home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-08-03 | 39.1 KB | 1,283 lines |
- Newsgroups: comp.sources.misc
- subject: v14i046: dmake version 3.5 patch 1 part 01/04
- From: dvadura@watdragon.waterloo.edu (Dennis Vadura)
- Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
-
- Posting-number: Volume 14, Issue 46
- Submitted-by: dvadura@watdragon.waterloo.edu (Dennis Vadura)
- Archive-name: dmake/patch01
-
- #!/bin/sh
- # shar: Shell Archiver (v1.22)
- #
- # This is a patch for dmake version 3.5 patchlevel 1.
- # No further patches are forthcomming at this time.
- #
- # See below for a description of the patch, and what it fixes. The four files
- # that make up the patch distribution are really another shell archive that
- # applies the patch when unpacked.
- #
- # To apply the patch, unpack the four files that make up the patch to get the
- # file dmake-3.5-patch1, and run that through the shell in the root directory
- # of the dmake source distribution to apply the patch.
- #
- # This patch file is also available on watmsg.uwaterloo.ca (129.97.129.9)
- # via anonymous ftp from pub/src/dmake-3.5-patch1.
- #
- # Many thanks to all those out in net-land who have mailed me code and diffs
- # to fix the problems they encountered installing dmake. This patch is a
- # result of your efforts.
- #
- # -dennis
- # ---------------------------------------------------------------------------
- # This is part 1 of a multipart archive
- # do not concatenate these parts, unpack them in order with /bin/sh
- #
- # Run the following text with /bin/sh to create:
- # dmake-3.5-patch1
- #
- if test -r s2_seq_.tmp
- then echo "Must unpack archives in sequence!"
- next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
- exit 1; fi
- sed 's/^X//' << 'SHAR_EOF' > dmake-3.5-patch1 &&
- X#!/bin/sh
- X# dodiff: Directory tree maintainer (v1.1)
- X#
- X# dmake version 3.5, patch #1
- X# ---------------------------
- X#
- X# Severity: Medium
- X#
- X# Nature: Minor teething problems with Sequent Dynix, and MSC 6.0,
- X# Fix for BSD 4.3 version of putenv.c, numerous other file
- X# reorganization changes to better compile on a wider variety of
- X# architectures.
- X#
- X# Format: Shar containing new versions of affected files. With appropriate
- X# patches. (run through sh, and it will do the rest)
- X#
- X# Also available as pub/src/dmake-3.5-patch1 on watmsg.uwaterloo.edu
- X# (129.97.129.9)
- X#
- X# Prerequisites: dmake version 3.5, patchlevel 1 source distribution
- X#
- X# Description of Fixes:
- X# ---------------------
- X# - modified _readme.dos
- X# - added sysvr1 initial target (SysV 5.0 Relese 1)
- X# - renamed macros.h stdmacs.h (some compilers had trouble with this)
- X# - renamed dynix subtree to vf subtree and added a bunch of new
- X# targets to bootstrap makefile.
- X#
- X# UNIX:
- X# -----
- X# - Fix to improve compiles on sequent machines. Added source for
- X# memcpy.c and vfprinft.c which are missing from the dynix C
- X# libraries. This also comes with a new make.sh and config.mk file
- X# in the appropriate directories.
- X#
- X# - Fix to bsd43 version of putenv.c, If you had an environment macro
- X# defined (say ENV=fred), and you exported a macro whose name began
- X# with ENV, say ENVTEST then it would replace the value of ENV,
- X# defined previously.
- X#
- X#
- X# MSDOS:
- X# ------
- X# MSC 6.0: - A couple of nasty quirks with MSC compiles have been fixed up.
- X# - size_t redefinition is taken care of, by now defining _TYPES_ in
- X# msdos/mscdos/config.h
- X# - SIGQUIT is not defined in MSDOS, redefined it to some other signal
- X# SIGFPE (which wont ever happen since no floating point is used for
- X# dmake).
- X# - Provide a new response file msdods/mscdos/mscovl.rsp which defines
- X# the link modules as two overlays. This reduces the overall
- X# memory requirements of dmake at runtime by about 14k.
- X# (looking into exeswapping code for dos, have some but not
- X# implemented yet)
- X#
- X# TCC 2.0: - duplicate definition of -I$(osrdir) in CFLAGS macro if uncommented
- X# line in msdos/tccdos/config.mk
- X# - wrong definition for LDOBJS in msdos/config.mk
- X# (my fault, didn't test after small change to source organization)
- X#
- X# Remove Obsolete files from distribution
- Xrm -f unix/runargv.c
- Xrm -f unix/bsd43/dynix/startup.mk
- Xrm -f unix/bsd43/dynix/make.sh
- Xrm -f unix/bsd43/dynix/ctype.h
- Xrm -f unix/bsd43/dynix/config.mk
- Xrm -f msdos/tccdos/tcc.rsp
- Xrm -f common/macros.h
- Xrm -fr unix/bsd43/dynix
- X
- X# Now use a shar archive to add any new files to the distribution
- X# shar: Shell Archiver (v1.22)
- X#
- X# Run the following text with /bin/sh to create:
- X# _readme.p1
- X# common/stdmacs.h
- X# msdos/mscdos/mscovl.rsp
- X# unix/386ix/runargv.c
- X# unix/bsd43/runargv.c
- X# unix/bsd43/vf
- X# unix/bsd43/vf/config.mk
- X# unix/bsd43/vf/ctype.h
- X# unix/bsd43/vf/make.sh
- X# unix/bsd43/vf/memcpy.c
- X# unix/bsd43/vf/startup.mk
- X# unix/bsd43/vf/vfprintf.c
- X# unix/sysvr1
- X# unix/sysvr1/config.h
- X# unix/sysvr1/config.mk
- X# unix/sysvr1/make.sh
- X# unix/sysvr1/putenv.c
- X# unix/sysvr1/runargv.c
- X# unix/sysvr1/startup.mk
- X# unix/sysvr1/stdarg.h
- X# unix/sysvr1/stdlib.h
- X# unix/sysvr1/time.h
- X# unix/sysvr1/vfprintf.c
- X# unix/sysvr3/runargv.c
- X#
- Xsed 's/^X//' << 'SHAR_EOF' > _readme.p1 &&
- XXdmake version 3.5, patch #1
- XX---------------------------
- XX
- XXSeverity: Medium
- XX
- XXNature: Minor teething problems with Sequent Dynix, and MSC 6.0,
- XX Fix for BSD 4.3 version of putenv.c, numerous other file
- XX reorganization changes to better compile on a wider variety of
- XX architectures.
- XX
- XXFormat: Shar containing new versions of affected files. With appropriate
- XX patches. (run through sh, and it will do the rest)
- XX
- XX Also available as pub/src/dmake-3.5-patch1 on watmsg.uwaterloo.edu
- XX (129.97.129.9)
- XX
- XXPrerequisites: dmake version 3.5, patchlevel 1 source distribution
- XX
- XXDescription of Fixes:
- XX---------------------
- XX - modified _readme.dos
- XX - added sysvr1 initial target (SysV 5.0 Relese 1)
- XX - renamed macros.h stdmacs.h (some compilers had trouble with this)
- XX - renamed dynix subtree to vf subtree and added a bunch of new
- XX targets to bootstrap makefile.
- XX
- XXUNIX:
- XX-----
- XX - Fix to improve compiles on sequent machines. Added source for
- XX memcpy.c and vfprinft.c which are missing from the dynix C
- XX libraries. This also comes with a new make.sh and config.mk file
- XX in the appropriate directories.
- XX
- XX - Fix to bsd43 version of putenv.c, If you had an environment macro
- XX defined (say ENV=fred), and you exported a macro whose name began
- XX with ENV, say ENVTEST then it would replace the value of ENV,
- XX defined previously.
- XX
- XX
- XXMSDOS:
- XX------
- XXMSC 6.0: - A couple of nasty quirks with MSC compiles have been fixed up.
- XX - size_t redefinition is taken care of, by now defining _TYPES_ in
- XX msdos/mscdos/config.h
- XX - SIGQUIT is not defined in MSDOS, redefined it to some other signal
- XX SIGFPE (which wont ever happen since no floating point is used for
- XX dmake).
- XX - Provide a new response file msdods/mscdos/mscovl.rsp which defines
- XX the link modules as two overlays. This reduces the overall
- XX memory requirements of dmake at runtime by about 14k.
- XX (looking into exeswapping code for dos, have some but not
- XX implemented yet)
- XX
- XXTCC 2.0: - duplicate definition of -I$(osrdir) in CFLAGS macro if uncommented
- XX line in msdos/tccdos/config.mk
- XX - wrong definition for LDOBJS in msdos/config.mk
- XX (my fault, didn't test after small change to source organization)
- XSHAR_EOF
- Xchmod 0640 _readme.p1 || echo "restore of _readme.p1 fails"
- Xset `wc -c _readme.p1`;Sum=$1
- Xif test "$Sum" != "2435"
- Xthen echo original size 2435, current size $Sum;fi
- Xsed 's/^X//' << 'SHAR_EOF' > common/stdmacs.h &&
- XX/* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/common/RCS/stdmacs.h,v 1.1 90/07/31 11:09:19 dvadura Exp $
- XX-- SYNOPSIS -- general use macros.
- XX--
- XX-- DESCRIPTION
- XX-- ANSI macro relies on the fact that it can be replaced by (), or by
- XX-- its value, where the value is one value due to the preprocessors
- XX-- handling of arguments that are surrounded by ()'s as a single
- XX-- argument.
- XX--
- XX-- AUTHOR
- XX-- Dennis Vadura, dvadura@watdragon.uwaterloo.ca
- XX-- CS DEPT, University of Waterloo, Waterloo, Ont., Canada
- XX--
- XX-- COPYRIGHT
- XX-- Copyright (c) 1990 by Dennis Vadura. All rights reserved.
- XX--
- XX-- This program is free software; you can redistribute it and/or
- XX-- modify it under the terms of the GNU General Public License
- XX-- (version 1), as published by the Free Software Foundation, and
- XX-- found in the file 'LICENSE' included with this distribution.
- XX--
- XX-- This program is distributed in the hope that it will be useful,
- XX-- but WITHOUT ANY WARRANTY; without even the implied warrant of
- XX-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- XX-- GNU General Public License for more details.
- XX--
- XX-- You should have received a copy of the GNU General Public License
- XX-- along with this program; if not, write to the Free Software
- XX-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- XX--
- XX-- LOG
- XX-- $Log: stdmacs.h,v $
- XX * Revision 1.1 90/07/31 11:09:19 dvadura
- XX * Initial Revison Dmake 3.5
- XX *
- XX*/
- XX
- XX#ifndef MACROS_h
- XX#define MACROS_h
- XX
- XX#if defined(__STDC__) || defined(__TURBOC__)
- XX#define ANSI(x) x
- XX#else
- XX#define ANSI(x) ()
- XX#endif
- XX
- XX#define NIL(p) ((p*)NULL)
- XX#define offsetof(type,id) ((size_t)&((type*)NULL)->id)
- XX
- XX#define FALSE 0
- XX#define TRUE 1
- XX
- XX#endif
- XX
- XSHAR_EOF
- Xchmod 0440 common/stdmacs.h || echo "restore of common/stdmacs.h fails"
- Xset `wc -c common/stdmacs.h`;Sum=$1
- Xif test "$Sum" != "1738"
- Xthen echo original size 1738, current size $Sum;fi
- Xsed 's/^X//' << 'SHAR_EOF' > msdos/mscdos/mscovl.rsp &&
- XX( objects\infer.obj+ objects\make.obj+ objects\stat.obj+ objects\path.obj+
- XX objects\basename.obj+ objects\runargv.obj+ objects\arlib.obj+
- XX objects\rmprq.obj+ objects\tempnam.obj )+
- XX( objects\imacs.obj+ objects\parse.obj+ objects\dump.obj+ objects\macparse.obj+
- XX objects\rulparse.obj+ objects\ruletab.obj+ objects\switchar.obj )+
- XXobjects\expand.obj+
- XXobjects\string.obj+
- XXobjects\hash.obj+
- XXobjects\dag.obj+
- XXobjects\dmake.obj+
- XXobjects\sysintf.obj+
- XXobjects\getinp.obj+
- XXobjects\quit.obj+
- XXobjects\percent.obj+
- XXobjects\dirbrk.obj+
- XXobjects\_chdir.obj
- XSHAR_EOF
- Xchmod 0640 msdos/mscdos/mscovl.rsp || echo "restore of msdos/mscdos/mscovl.rsp fails"
- Xset `wc -c msdos/mscdos/mscovl.rsp`;Sum=$1
- Xif test "$Sum" != "545"
- Xthen echo original size 545, current size $Sum;fi
- Xsed 's/^X//' << 'SHAR_EOF' > unix/386ix/runargv.c &&
- XX/* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/unix/386ix/RCS/runargv.c,v 1.1 90/07/31 10:49:16 dvadura Exp $
- XX-- SYNOPSIS -- invoke a sub process.
- XX--
- XX-- DESCRIPTION
- XX-- Use the standard methods of executing a sub process.
- XX--
- XX-- AUTHOR
- XX-- Dennis Vadura, dvadura@watdragon.uwaterloo.ca
- XX-- CS DEPT, University of Waterloo, Waterloo, Ont., Canada
- XX--
- XX-- COPYRIGHT
- XX-- Copyright (c) 1990 by Dennis Vadura. All rights reserved.
- XX--
- XX-- This program is free software; you can redistribute it and/or
- XX-- modify it under the terms of the GNU General Public License
- XX-- (version 1), as published by the Free Software Foundation, and
- XX-- found in the file 'LICENSE' included with this distribution.
- XX--
- XX-- This program is distributed in the hope that it will be useful,
- XX-- but WITHOUT ANY WARRANTY; without even the implied warrant of
- XX-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- XX-- GNU General Public License for more details.
- XX--
- XX-- You should have received a copy of the GNU General Public License
- XX-- along with this program; if not, write to the Free Software
- XX-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- XX--
- XX-- LOG
- XX-- $Log: runargv.c,v $
- XX * Revision 1.1 90/07/31 10:49:16 dvadura
- XX * Initial Revision Dmake 3.5
- XX *
- XX * Revision 1.1 90/07/20 16:54:53 dvadura
- XX * Initial Revision of Version 3.5
- XX *
- XX*/
- XX
- XX#include <signal.h>
- XX#include "extern.h"
- XX#include "sysintf.h"
- XX#include "alloc.h"
- XX
- XXtypedef struct prp {
- XX char *prp_cmd;
- XX int prp_group;
- XX int prp_ignore;
- XX int prp_last;
- XX struct prp *prp_next;
- XX char *prp_dir;
- XX} RCP, *RCPPTR;
- XX
- XXtypedef struct pr {
- XX int pr_valid;
- XX int pr_pid;
- XX CELLPTR pr_target;
- XX HOWPTR pr_how;
- XX int pr_ignore;
- XX int pr_last;
- XX RCPPTR pr_recipe;
- XX RCPPTR pr_recipe_end;
- XX} PR;
- XX
- XXstatic PR *_procs = NIL(PR);
- XXstatic int _proc_cnt = 0;
- XXstatic int _abort_flg= FALSE;
- XXstatic int _use_i = -1;
- XXstatic int _do_upd = 0;
- XX
- XXstatic void _add_child ANSI((int, CELLPTR, HOWPTR, int, int));
- XXstatic void _attach_cmd ANSI((char *, int, int, CELLPTR, HOWPTR, int));
- XXstatic void _finished_child ANSI((int, int));
- XXstatic int _running ANSI((CELLPTR, HOWPTR));
- XX
- XXint
- XXrunargv(target, how, ignore, group, last, cmd)
- XXCELLPTR target;
- XXHOWPTR how;
- XXint ignore;
- XXint group;
- XXint last;
- XXchar *cmd;
- XX{
- XX extern int errno;
- XX extern char *sys_errlist[];
- XX int pid;
- XX char *argv[MAXARGV];
- XX
- XX if( _running(target, how) /*&& Max_proc != 1*/ ) {
- XX /* The command will be executed when the previous recipe
- XX * line completes. */
- XX _attach_cmd( cmd, group, ignore, target, how, last );
- XX return(1);
- XX }
- XX
- XX Pack_argv( argv, MAXARGV, group, cmd );
- XX
- XX while( _proc_cnt == Max_proc )
- XX if( Wait_for_child(FALSE, -1) == -1 ) Fatal( "Lost a child" );
- XX
- XX switch( pid=fork() ){
- XX int wid;
- XX int status;
- XX
- XX case -1: /* fork failed */
- XX Error("%s: %s", argv[0], sys_errlist[errno]);
- XX Handle_result(-1, ignore, _abort_flg, target);
- XX return(-1);
- XX
- XX case 0: /* child */
- XX execvp(argv[0], argv);
- XX Continue = TRUE; /* survive error message */
- XX Error("%s: %s", argv[0], sys_errlist[errno]);
- XX kill(getpid(), SIGTERM);
- XX /*NOTREACHED*/
- XX
- XX default: /* parent */
- XX _add_child(pid, target, how, ignore, last);
- XX }
- XX
- XX return(1);
- XX}
- XX
- XX
- XXint
- XXWait_for_child( abort_flg, pid )
- XXint abort_flg;
- XXint pid;
- XX{
- XX int wid;
- XX int status;
- XX int waitchild;
- XX
- XX waitchild = (pid == -1)? FALSE : Wait_for_completion;
- XX
- XX do {
- XX if( (wid = wait(&status)) == -1 ) return(-1);
- XX
- XX _abort_flg = abort_flg;
- XX _finished_child(wid, status);
- XX _abort_flg = FALSE;
- XX }
- XX while( waitchild && pid != wid );
- XX
- XX return(0);
- XX}
- XX
- XX
- XXvoid
- XXClean_up_processes()
- XX{
- XX register int i;
- XX
- XX if( _procs != NIL(PR) ) {
- XX for( i=0; i<Max_proc; i++ )
- XX if( _procs[i].pr_valid )
- XX kill(_procs[i].pr_pid, SIGTERM);
- XX
- XX while( Wait_for_child(TRUE, -1) != -1 );
- XX }
- XX}
- XX
- XX
- XXstatic void
- XX_add_child( pid, target, how, ignore, last )
- XXint pid;
- XXCELLPTR target;
- XXHOWPTR how;
- XXint ignore;
- XXint last;
- XX{
- XX register int i;
- XX register PR *pp;
- XX
- XX if( _procs == NIL(PR) ) {
- XX TALLOC( _procs, Max_proc, PR );
- XX }
- XX
- XX if( (i = _use_i) == -1 )
- XX for( i=0; i<Max_proc; i++ )
- XX if( !_procs[i].pr_valid )
- XX break;
- XX
- XX pp = _procs+i;
- XX
- XX pp->pr_valid = 1;
- XX pp->pr_pid = pid;
- XX pp->pr_target = target;
- XX pp->pr_how = how;
- XX pp->pr_ignore = ignore;
- XX pp->pr_last = last;
- XX
- XX Current_target = NIL(HOW);
- XX
- XX _proc_cnt++;
- XX
- XX if( Wait_for_completion ) Wait_for_child( FALSE, pid );
- XX}
- XX
- XX
- XXstatic void
- XX_finished_child(pid, status)
- XXint pid;
- XXint status;
- XX{
- XX register int i;
- XX register PR *pp;
- XX
- XX for( i=0; i<Max_proc; i++ )
- XX if( _procs[i].pr_valid && _procs[i].pr_pid == pid )
- XX break;
- XX
- XX _procs[i].pr_valid = 0;
- XX _proc_cnt--;
- XX
- XX if( _procs[i].pr_recipe != NIL(RCP) && !_abort_flg ) {
- XX RCPPTR rp = _procs[i].pr_recipe;
- XX char *dir;
- XX
- XX Current_target = _procs[i].pr_how;
- XX Handle_result( status, _procs[i].pr_ignore, FALSE, _procs[i].pr_target );
- XX Current_target = NIL(HOW);
- XX
- XX _procs[i].pr_recipe = rp->prp_next;
- XX
- XX _use_i = i;
- XX dir = _strdup(Get_current_dir());
- XX Set_dir( rp->prp_dir );
- XX runargv( _procs[i].pr_target, _procs[i].pr_how, rp->prp_ignore,
- XX rp->prp_group, rp->prp_last, rp->prp_cmd );
- XX Set_dir(dir);
- XX FREE(dir);
- XX FREE(rp->prp_dir);
- XX _use_i = -1;
- XX
- XX FREE( rp->prp_cmd );
- XX FREE( rp );
- XX
- XX if( _proc_cnt == Max_proc ) Wait_for_child( FALSE, -1 );
- XX }
- XX else {
- XX Unlink_temp_files( _procs[i].pr_how );
- XX Handle_result(status,_procs[i].pr_ignore,_abort_flg,_procs[i].pr_target);
- XX
- XX if( _procs[i].pr_last && !Doing_bang )
- XX Update_time_stamp( _procs[i].pr_target, _procs[i].pr_how );
- XX }
- XX}
- XX
- XX
- XXstatic int
- XX_running( cp, how )
- XXCELLPTR cp;
- XXHOWPTR how;
- XX{
- XX register int i;
- XX
- XX if( !_procs ) return(FALSE);
- XX
- XX for( i=0; i<Max_proc; i++ )
- XX if( _procs[i].pr_valid &&
- XX _procs[i].pr_how == how &&
- XX _procs[i].pr_target == cp )
- XX break;
- XX
- XX return( i != Max_proc );
- XX}
- XX
- XX
- XXstatic void
- XX_attach_cmd( cmd, group, ignore, cp, how, last )
- XXchar *cmd;
- XXint group;
- XXint ignore;
- XXCELLPTR cp;
- XXHOWPTR how;
- XXint last;
- XX{
- XX register int i;
- XX RCPPTR rp;
- XX
- XX for( i=0; i<Max_proc; i++ )
- XX if( _procs[i].pr_valid &&
- XX _procs[i].pr_how == how &&
- XX _procs[i].pr_target == cp )
- XX break;
- XX
- XX TALLOC( rp, 1, RCP );
- XX rp->prp_cmd = _strdup(cmd);
- XX rp->prp_group = group;
- XX rp->prp_ignore= ignore;
- XX rp->prp_last = last;
- XX rp->prp_dir = _strdup(Get_current_dir());
- XX
- XX if( _procs[i].pr_recipe == NIL(RCP) )
- XX _procs[i].pr_recipe = _procs[i].pr_recipe_end = rp;
- XX else {
- XX _procs[i].pr_recipe_end->prp_next = rp;
- XX _procs[i].pr_recipe_end = rp;
- XX }
- XX}
- XSHAR_EOF
- Xchmod 0440 unix/386ix/runargv.c || echo "restore of unix/386ix/runargv.c fails"
- Xset `wc -c unix/386ix/runargv.c`;Sum=$1
- Xif test "$Sum" != "6805"
- Xthen echo original size 6805, current size $Sum;fi
- Xsed 's/^X//' << 'SHAR_EOF' > unix/bsd43/runargv.c &&
- XX/* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/unix/bsd43/RCS/runargv.c,v 1.1 90/07/31 10:48:36 dvadura Exp $
- XX-- SYNOPSIS -- invoke a sub process.
- XX--
- XX-- DESCRIPTION
- XX-- Use the standard methods of executing a sub process.
- XX--
- XX-- AUTHOR
- XX-- Dennis Vadura, dvadura@watdragon.uwaterloo.ca
- XX-- CS DEPT, University of Waterloo, Waterloo, Ont., Canada
- XX--
- XX-- COPYRIGHT
- XX-- Copyright (c) 1990 by Dennis Vadura. All rights reserved.
- XX--
- XX-- This program is free software; you can redistribute it and/or
- XX-- modify it under the terms of the GNU General Public License
- XX-- (version 1), as published by the Free Software Foundation, and
- XX-- found in the file 'LICENSE' included with this distribution.
- XX--
- XX-- This program is distributed in the hope that it will be useful,
- XX-- but WITHOUT ANY WARRANTY; without even the implied warrant of
- XX-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- XX-- GNU General Public License for more details.
- XX--
- XX-- You should have received a copy of the GNU General Public License
- XX-- along with this program; if not, write to the Free Software
- XX-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- XX--
- XX-- LOG
- XX-- $Log: runargv.c,v $
- XX * Revision 1.1 90/07/31 10:48:36 dvadura
- XX * Initial Revision Dmake 3.5
- XX *
- XX*/
- XX
- XX#include <signal.h>
- XX#include "extern.h"
- XX#include "sysintf.h"
- XX#include "alloc.h"
- XX
- XXtypedef struct prp {
- XX char *prp_cmd;
- XX int prp_group;
- XX int prp_ignore;
- XX int prp_last;
- XX struct prp *prp_next;
- XX char *prp_dir;
- XX} RCP, *RCPPTR;
- XX
- XXtypedef struct pr {
- XX int pr_valid;
- XX int pr_pid;
- XX CELLPTR pr_target;
- XX HOWPTR pr_how;
- XX int pr_ignore;
- XX int pr_last;
- XX RCPPTR pr_recipe;
- XX RCPPTR pr_recipe_end;
- XX} PR;
- XX
- XXstatic PR *_procs = NIL(PR);
- XXstatic int _proc_cnt = 0;
- XXstatic int _abort_flg= FALSE;
- XXstatic int _use_i = -1;
- XXstatic int _do_upd = 0;
- XX
- XXstatic void _add_child ANSI((int, CELLPTR, HOWPTR, int, int));
- XXstatic void _attach_cmd ANSI((char *, int, int, CELLPTR, HOWPTR, int));
- XXstatic void _finished_child ANSI((int, int));
- XXstatic int _running ANSI((CELLPTR, HOWPTR));
- XX
- XXint
- XXrunargv(target, how, ignore, group, last, cmd)
- XXCELLPTR target;
- XXHOWPTR how;
- XXint ignore;
- XXint group;
- XXint last;
- XXchar *cmd;
- XX{
- XX extern int errno;
- XX extern char *sys_errlist[];
- XX int pid;
- XX char *argv[MAXARGV];
- XX
- XX if( _running(target, how) /*&& Max_proc != 1*/ ) {
- XX /* The command will be executed when the previous recipe
- XX * line completes. */
- XX _attach_cmd( cmd, group, ignore, target, how, last );
- XX return(1);
- XX }
- XX
- XX Pack_argv( argv, MAXARGV, group, cmd );
- XX
- XX while( _proc_cnt == Max_proc )
- XX if( Wait_for_child(FALSE, -1) == -1 ) Fatal( "Lost a child" );
- XX
- XX switch( pid=fork() ){
- XX int wid;
- XX int status;
- XX
- XX case -1: /* fork failed */
- XX Error("%s: %s", argv[0], sys_errlist[errno]);
- XX Handle_result(-1, ignore, _abort_flg, target);
- XX return(-1);
- XX
- XX case 0: /* child */
- XX execvp(argv[0], argv);
- XX Continue = TRUE; /* survive error message */
- XX Error("%s: %s", argv[0], sys_errlist[errno]);
- XX kill(getpid(), SIGTERM);
- XX /*NOTREACHED*/
- XX
- XX default: /* parent */
- XX _add_child(pid, target, how, ignore, last);
- XX }
- XX
- XX return(1);
- XX}
- XX
- XX
- XXint
- XXWait_for_child( abort_flg, pid )
- XXint abort_flg;
- XXint pid;
- XX{
- XX int wid;
- XX int status;
- XX int waitchild;
- XX
- XX waitchild = (pid == -1)? FALSE : Wait_for_completion;
- XX
- XX do {
- XX if( (wid = wait(&status)) == -1 ) return(-1);
- XX
- XX _abort_flg = abort_flg;
- XX _finished_child(wid, status);
- XX _abort_flg = FALSE;
- XX }
- XX while( waitchild && pid != wid );
- XX
- XX return(0);
- XX}
- XX
- XX
- XXvoid
- XXClean_up_processes()
- XX{
- XX register int i;
- XX
- XX if( _procs != NIL(PR) ) {
- XX for( i=0; i<Max_proc; i++ )
- XX if( _procs[i].pr_valid )
- XX kill(_procs[i].pr_pid, SIGTERM);
- XX
- XX while( Wait_for_child(TRUE, -1) != -1 );
- XX }
- XX}
- XX
- XX
- XXstatic void
- XX_add_child( pid, target, how, ignore, last )
- XXint pid;
- XXCELLPTR target;
- XXHOWPTR how;
- XXint ignore;
- XXint last;
- XX{
- XX register int i;
- XX register PR *pp;
- XX
- XX if( _procs == NIL(PR) ) {
- XX TALLOC( _procs, Max_proc, PR );
- XX }
- XX
- XX if( (i = _use_i) == -1 )
- XX for( i=0; i<Max_proc; i++ )
- XX if( !_procs[i].pr_valid )
- XX break;
- XX
- XX pp = _procs+i;
- XX
- XX pp->pr_valid = 1;
- XX pp->pr_pid = pid;
- XX pp->pr_target = target;
- XX pp->pr_how = how;
- XX pp->pr_ignore = ignore;
- XX pp->pr_last = last;
- XX
- XX Current_target = NIL(HOW);
- XX
- XX _proc_cnt++;
- XX
- XX if( Wait_for_completion ) Wait_for_child( FALSE, pid );
- XX}
- XX
- XX
- XXstatic void
- XX_finished_child(pid, status)
- XXint pid;
- XXint status;
- XX{
- XX register int i;
- XX register PR *pp;
- XX
- XX for( i=0; i<Max_proc; i++ )
- XX if( _procs[i].pr_valid && _procs[i].pr_pid == pid )
- XX break;
- XX
- XX _procs[i].pr_valid = 0;
- XX _proc_cnt--;
- XX
- XX if( _procs[i].pr_recipe != NIL(RCP) && !_abort_flg ) {
- XX RCPPTR rp = _procs[i].pr_recipe;
- XX char *dir;
- XX
- XX Current_target = _procs[i].pr_how;
- XX Handle_result( status, _procs[i].pr_ignore, FALSE, _procs[i].pr_target );
- XX Current_target = NIL(HOW);
- XX
- XX _procs[i].pr_recipe = rp->prp_next;
- XX
- XX _use_i = i;
- XX dir = _strdup(Get_current_dir());
- XX Set_dir( rp->prp_dir );
- XX runargv( _procs[i].pr_target, _procs[i].pr_how, rp->prp_ignore,
- XX rp->prp_group, rp->prp_last, rp->prp_cmd );
- XX Set_dir(dir);
- XX FREE(dir);
- XX FREE(rp->prp_dir);
- XX _use_i = -1;
- XX
- XX FREE( rp->prp_cmd );
- XX FREE( rp );
- XX
- XX if( _proc_cnt == Max_proc ) Wait_for_child( FALSE, -1 );
- XX }
- XX else {
- XX Unlink_temp_files( _procs[i].pr_how );
- XX Handle_result(status,_procs[i].pr_ignore,_abort_flg,_procs[i].pr_target);
- XX
- XX if( _procs[i].pr_last && !Doing_bang )
- XX Update_time_stamp( _procs[i].pr_target, _procs[i].pr_how );
- XX }
- XX}
- XX
- XX
- XXstatic int
- XX_running( cp, how )
- XXCELLPTR cp;
- XXHOWPTR how;
- XX{
- XX register int i;
- XX
- XX if( !_procs ) return(FALSE);
- XX
- XX for( i=0; i<Max_proc; i++ )
- XX if( _procs[i].pr_valid &&
- XX _procs[i].pr_how == how &&
- XX _procs[i].pr_target == cp )
- XX break;
- XX
- XX return( i != Max_proc );
- XX}
- XX
- XX
- XXstatic void
- XX_attach_cmd( cmd, group, ignore, cp, how, last )
- XXchar *cmd;
- XXint group;
- XXint ignore;
- XXCELLPTR cp;
- XXHOWPTR how;
- XXint last;
- XX{
- XX register int i;
- XX RCPPTR rp;
- XX
- XX for( i=0; i<Max_proc; i++ )
- XX if( _procs[i].pr_valid &&
- XX _procs[i].pr_how == how &&
- XX _procs[i].pr_target == cp )
- XX break;
- XX
- XX TALLOC( rp, 1, RCP );
- XX rp->prp_cmd = _strdup(cmd);
- XX rp->prp_group = group;
- XX rp->prp_ignore= ignore;
- XX rp->prp_last = last;
- XX rp->prp_dir = _strdup(Get_current_dir());
- XX
- XX if( _procs[i].pr_recipe == NIL(RCP) )
- XX _procs[i].pr_recipe = _procs[i].pr_recipe_end = rp;
- XX else {
- XX _procs[i].pr_recipe_end->prp_next = rp;
- XX _procs[i].pr_recipe_end = rp;
- XX }
- XX}
- XSHAR_EOF
- Xchmod 0440 unix/bsd43/runargv.c || echo "restore of unix/bsd43/runargv.c fails"
- Xset `wc -c unix/bsd43/runargv.c`;Sum=$1
- Xif test "$Sum" != "6721"
- Xthen echo original size 6721, current size $Sum;fi
- Xecho mkdir - unix/bsd43/vf
- Xmkdir unix/bsd43/vf
- Xsed 's/^X//' << 'SHAR_EOF' > unix/bsd43/vf/config.mk &&
- XX# This config file adds vfprintf.c and memcpy.c for those systems that
- XX# do not have it.
- XX#
- XX
- XXosredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT)
- XX
- XX# The following sources are required for BSD4.3
- XXOSDESRC := memcpy.c vfprintf.c
- XXSRC += $(OSDESRC)
- XX.SETDIR=$(osredir) : $(OSDESRC)
- XX
- XXCFLAGS += -I$(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
- XSHAR_EOF
- Xchmod 0640 unix/bsd43/vf/config.mk || echo "restore of unix/bsd43/vf/config.mk fails"
- Xset `wc -c unix/bsd43/vf/config.mk`;Sum=$1
- Xif test "$Sum" != "345"
- Xthen echo original size 345, current size $Sum;fi
- Xsed 's/^X//' << 'SHAR_EOF' > unix/bsd43/vf/ctype.h &&
- XX/* ctype.h 4.2 85/09/04 */
- XX
- XX#define _U 01
- XX#define _L 02
- XX#define _N 04
- XX#define _S 010
- XX#define _P 020
- XX#define _C 040
- XX#define _X 0100
- XX#define _B 0200
- XX
- XXextern char _ctype_[];
- XX
- XX#define isalpha(c) ((_ctype_+1)[c]&(_U|_L))
- XX#define isupper(c) ((_ctype_+1)[c]&_U)
- XX#define islower(c) ((_ctype_+1)[c]&_L)
- XX#define isdigit(c) ((_ctype_+1)[c]&_N)
- XX#define isxdigit(c) ((_ctype_+1)[c]&(_N|_X))
- XX#define isspace(c) ((_ctype_+1)[c]&_S)
- XX#define ispunct(c) ((_ctype_+1)[c]&_P)
- XX#define isalnum(c) ((_ctype_+1)[c]&(_U|_L|_N))
- XX#define isprint(c) ((_ctype_+1)[c]&(_P|_U|_L|_N|_B))
- XX#define isgraph(c) ((_ctype_+1)[c]&(_P|_U|_L|_N))
- XX#define iscntrl(c) ((_ctype_+1)[c]&_C)
- XX#define isascii(c) ((unsigned)(c)<=0177)
- XX#define toupper(c) ((c)-'a'+'A')
- XX#define tolower(c) ((c)-'A'+'a')
- XX#define toascii(c) ((c)&0177)
- XSHAR_EOF
- Xchmod 0440 unix/bsd43/vf/ctype.h || echo "restore of unix/bsd43/vf/ctype.h fails"
- Xset `wc -c unix/bsd43/vf/ctype.h`;Sum=$1
- Xif test "$Sum" != "782"
- Xthen echo original size 782, current size $Sum;fi
- Xsed 's/^X//' << 'SHAR_EOF' > unix/bsd43/vf/make.sh &&
- XXmkdir objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O infer.c
- XXmv infer.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O make.c
- XXmv make.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O stat.c
- XXmv stat.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O expand.c
- XXmv expand.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O string.c
- XXmv string.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O hash.c
- XXmv hash.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dag.c
- XXmv dag.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmake.c
- XXmv dmake.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O path.c
- XXmv path.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O imacs.c
- XXmv imacs.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O sysintf.c
- XXmv sysintf.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O parse.c
- XXmv parse.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O getinp.c
- XXmv getinp.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O quit.c
- XXmv quit.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O basename.c
- XXmv basename.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dump.c
- XXmv dump.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O macparse.c
- XXmv macparse.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O rulparse.c
- XXmv rulparse.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O percent.c
- XXmv percent.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/arlib.c
- XXmv arlib.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/dirbrk.c
- XXmv dirbrk.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/explode.c
- XXmv explode.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/rmprq.c
- XXmv rmprq.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/ruletab.c
- XXmv ruletab.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/putenv.c
- XXmv putenv.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/tempnam.c
- XXmv tempnam.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/utime.c
- XXmv utime.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/setvbuf.c
- XXmv setvbuf.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/runargv.c
- XXmv runargv.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/vf/memcpy.c
- XXmv memcpy.o objects
- XXcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/vf/vfprintf.c
- XXmv vfprintf.o objects
- XXcc -o dmake objects/infer.o objects/make.o objects/stat.o objects/expand.o objects/string.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o objects/quit.o objects/basename.o objects/dump.o objects/macparse.o objects/rulparse.o objects/percent.o objects/arlib.o objects/dirbrk.o objects/explode.o objects/rmprq.o objects/ruletab.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o objects/runargv.o objects/memcpy.o objects/vfprintf.o
- XSHAR_EOF
- Xchmod 0640 unix/bsd43/vf/make.sh || echo "restore of unix/bsd43/vf/make.sh fails"
- Xset `wc -c unix/bsd43/vf/make.sh`;Sum=$1
- Xif test "$Sum" != "3588"
- Xthen echo original size 3588, current size $Sum;fi
- Xsed 's/^X//' << 'SHAR_EOF' > unix/bsd43/vf/memcpy.c &&
- XXchar *
- XXmemcpy(t, f, n)
- XXregister char *t, *f;
- XXregister n;
- XX{
- XX register char *p = t;
- XX
- XX while( --n >= 0 ) *t++ = *f++;
- XX
- XX return (p);
- XX}
- XSHAR_EOF
- Xchmod 0440 unix/bsd43/vf/memcpy.c || echo "restore of unix/bsd43/vf/memcpy.c fails"
- Xset `wc -c unix/bsd43/vf/memcpy.c`;Sum=$1
- Xif test "$Sum" != "137"
- Xthen echo original size 137, current size $Sum;fi
- Xsed 's/^X//' << 'SHAR_EOF' > unix/bsd43/vf/startup.mk &&
- XX# Generic UNIX DMAKE startup file. Customize to suit your needs.
- XX# Should work for both SYSV, and BSD 4.3
- XX# See the documentation for a description of internally defined macros.
- XX#
- XX# Disable warnings for macros redefined here that were given
- XX# on the command line.
- XX__.SILENT := $(.SILENT)
- XX.SILENT := yes
- XX
- XX# Configuration parameters for DMAKE startup.mk file
- XX# Set these to NON-NULL if you wish to turn the parameter on.
- XX_HAVE_RCS := yes # yes => RCS is installed.
- XX_HAVE_SCCS := yes # yes => SCCS is installed.
- XX
- XX# Applicable suffix definitions
- XXA := .a # Libraries
- XXE := # Executables
- XXF := .f # Fortran
- XXO := .o # Objects
- XXP := .p # Pascal
- XXS := .s # Assembler sources
- XXV := ,v # RCS suffix
- XX
- XX# Recipe execution configurations
- XXSHELL := /bin/sh
- XXSHELLFLAGS := -ce
- XXGROUPSHELL := $(SHELL)
- XXGROUPFLAGS :=
- XXSHELLMETAS := |();&<>?*][$$:\\#`'"
- XXGROUPSUFFIX :=
- XX
- XX# Standard C-language command names and flags
- XX CPP := /lib/cpp # C-preprocessor
- XX CC := cc # C-compiler and flags
- XX CFLAGS =
- XX
- XX AS := as # Assembler and flags
- XX ASFLAGS =
- XX
- XX LD = $(CC) # Loader and flags
- XX LDFLAGS =
- XX LDLIBS =
- XX
- XX# Definition of $(MAKE) macro for recursive makes.
- XX MAKE = $(MAKECMD) $(MFLAGS)
- XX
- XX# Definition of Print command for this system.
- XX PRINT = lpr
- XX
- XX# Language and Parser generation Tools and their flags
- XX YACC := yacc # standard yacc
- XX YFLAGS =
- XX YTAB := y.tab # yacc output files name stem.
- XX
- XX LEX := lex # standard lex
- XX LFLAGS =
- XX LEXYY := lex.yy # lex output file
- XX
- XX# Other Compilers, Tools and their flags
- XX PC := pc # pascal compiler
- XX RC := f77 # ratfor compiler
- XX FC := f77 # fortran compiler
- XX
- XX CO := co # check out for RCS
- XX COFLAGS := -q
- XX
- XX AR := ar # archiver
- XX ARFLAGS = ruv
- XX
- XX RM := /bin/rm # remove a file command
- XX RMFLAGS =
- XX
- XX# Implicit generation rules for making inferences.
- XX# We don't provide .yr or .ye rules here. They're obsolete.
- XX# Rules for making *$O
- XX %$O : %.c ; $(CC) $(CFLAGS) -c $<
- XX %$O : %$P ; $(PC) $(PFLAGS) -c $<
- XX %$O : %$S ; $(AS) $<
- XX %$O : %.cl ; class -c $<
- XX %$O : %.e %.r %.F %$F
- XX $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
- XX
- XX# Executables
- XX %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
- XX
- XX# lex and yacc rules
- XX %.c : %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@
- XX %.c : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@
- XX
- XX# This rule tells how to make *.out from it's immediate list of prerequisites
- XX# UNIX only.
- XX %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
- XX
- XX# RCS support
- XX.IF $(_HAVE_RCS)
- XX % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
- XX .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
- XX.END
- XX
- XX# SCCS support
- XX.IF $(_HAVE_SCCS)
- XX % : s.% ; get $@
- XX .NOINFER : s.%
- XX.END
- XX
- XX# Recipe to make archive files.
- XX%$A :
- XX[
- XX $(AR) $(ARFLAGS) $@ $?
- XX $(RM) $(RMFLAGS) $?
- XX ranlib $@
- XX]
- XX
- XX# DMAKE uses this recipe to remove intermediate targets
- XX.REMOVE :; $(RM) -f $<
- XX
- XX# AUGMAKE extensions for SYSV compatibility
- XX@B = $(@:b)
- XX@D = $(@:d)
- XX@F = $(@:f)
- XX*B = $(*:b)
- XX*D = $(*:d)
- XX*F = $(*:f)
- XX<B = $(<:b)
- XX<D = $(<:d)
- XX<F = $(<:f)
- XX?B = $(?:b)
- XX?F = $(?:f)
- XX?D = $(?:d)
- XX
- XX# Turn warnings back to previous setting.
- XX.SILENT := $(__.SILENT)
- XX
- XX# Local startup file if any
- XX.INCLUDE .IGNORE: "_startup.mk"
- XSHAR_EOF
- Xchmod 0640 unix/bsd43/vf/startup.mk || echo "restore of unix/bsd43/vf/startup.mk fails"
- Xset `wc -c unix/bsd43/vf/startup.mk`;Sum=$1
- Xif test "$Sum" != "3187"
- Xthen echo original size 3187, current size $Sum;fi
- Xsed 's/^X//' << 'SHAR_EOF' > unix/bsd43/vf/vfprintf.c &&
- XX/*
- XX * Copyright (c) 1988 Regents of the University of California.
- XX * All rights reserved.
- XX *
- XX * Redistribution and use in source and binary forms are permitted
- XX * provided that the above copyright notice and this paragraph are
- XX * duplicated in all such forms and that any documentation,
- XX * advertising materials, and other materials related to such
- XX * distribution and use acknowledge that the software was developed
- XX * by the University of California, Berkeley. The name of the
- XX * University may not be used to endorse or promote products derived
- XX * from this software without specific prior written permission.
- XX * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- XX * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- XX * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- XX */
- XX
- XX#if defined(LIBC_SCCS) && !defined(lint)
- XXstatic char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88";
- XX#endif /* LIBC_SCCS and not lint */
- XX
- XX#include <stdio.h>
- XX#include <varargs.h>
- XX
- XXint
- XXvfprintf(iop, fmt, ap)
- XX FILE *iop;
- XX char *fmt;
- XX va_list ap;
- XX{
- XX int len;
- XX char localbuf[BUFSIZ];
- XX
- XX if (iop->_flag & _IONBF) {
- XX iop->_flag &= ~_IONBF;
- XX iop->_ptr = iop->_base = localbuf;
- XX len = _doprnt(fmt, ap, iop);
- XX (void) fflush(iop);
- XX iop->_flag |= _IONBF;
- XX iop->_base = NULL;
- XX iop->_bufsiz = 0;
- XX iop->_cnt = 0;
- XX } else
- XX len = _doprnt(fmt, ap, iop);
- XX
- XX return (ferror(iop) ? EOF : len);
- XX}
- XX
- XSHAR_EOF
- Xchmod 0440 unix/bsd43/vf/vfprintf.c || echo "restore of unix/bsd43/vf/vfprintf.c fails"
- Xset `wc -c unix/bsd43/vf/vfprintf.c`;Sum=$1
- Xif test "$Sum" != "1409"
- Xthen echo original size 1409, current size $Sum;fi
- Xecho mkdir - unix/sysvr1
- Xmkdir unix/sysvr1
- Xsed 's/^X//' << 'SHAR_EOF' > unix/sysvr1/config.h &&
- XX/* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/unix/sysvr1/RCS/config.h,v 1.1 90/07/31 11:00:15 dvadura Exp $
- XX-- SYNOPSIS -- Configurarion include file.
- XX--
- XX-- DESCRIPTION
- XX-- There is one of these for each specific machine configuration.
- XX-- It can be used to further tweek the machine specific sources
- XX-- so that they compile.
- XX--
- XX-- AUTHOR
- XX-- Dennis Vadura, dvadura@watdragon.uwaterloo.ca
- XX-- CS DEPT, University of Waterloo, Waterloo, Ont., Canada
- XX--
- XX-- COPYRIGHT
- XX-- Copyright (c) 1990 by Dennis Vadura. All rights reserved.
- XX--
- XX-- This program is free software; you can redistribute it and/or
- XX-- modify it under the terms of the GNU General Public License
- XX-- (version 1), as published by the Free Software Foundation, and
- XX-- found in the file 'LICENSE' included with this distribution.
- XX--
- XX-- This program is distributed in the hope that it will be useful,
- XX-- but WITHOUT ANY WARRANTY; without even the implied warrant of
- XX-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- XX-- GNU General Public License for more details.
- XX--
- XX-- You should have received a copy of the GNU General Public License
- XX-- along with this program; if not, write to the Free Software
- XX-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- XX--
- XX-- LOG
- XX-- $Log: config.h,v $
- XX * Revision 1.1 90/07/31 11:00:15 dvadura
- XX * Initial Revision Dmake 3.5
- XX *
- XX*/
- XX
- XX/* define this for configurations that don't have the coreleft function
- XX * so that the code compiles. To my knowledge coreleft exists only on
- XX * Turbo C, but it is needed here since the function is used in many debug
- XX * macros. */
- XX#define coreleft() 0L
- SHAR_EOF
- echo "End of part 1, continue with part 2"
- echo "2" > s2_seq_.tmp
- exit 0
-
-