v14i012: dmake version 3.5 part 2/21
Dennis Vadura
dvadura at watdragon.waterloo.edu
Fri Jul 27 09:43:08 AEST 1990
Posting-number: Volume 14, Issue 12
Submitted-by: dvadura at watdragon.waterloo.edu (Dennis Vadura)
Archive-name: dmake/part02
#!/bin/sh
# this is part 2 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file unix/config.mk continued
#
CurArch=2
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
exit 1; fi
( read Scheck
if test "$Scheck" != $CurArch
then echo "Please unpack part $Scheck next!"
exit 1;
else exit 0; fi
) < s2_seq_.tmp || exit 1
echo "x - Continuing file unix/config.mk"
sed 's/^X//' << 'SHAR_EOF' >> unix/config.mk
X.END
X
X# Set the proper macros based on whether we are making the debugging version
X# or not.
X.IF $(DEBUG)
X CFLAGS += $(DB_CFLAGS)
X LDFLAGS += $(DB_LDFLAGS)
X LDLIBS += $(DB_LDLIBS)
X
X SILENT := $(.SILENT)
X .SILENT := yes
X TARGET := db$(TARGET)
X OBJDIR := $(OBJDIR).dbg
X .SILENT := $(SILENT)
X
X SRC += dbug.c malloc.c
X HDR += db.h
X .SETDIR=common : dbug.c malloc.c
X.ELSE
X CFLAGS += $(NDB_CFLAGS)
X LDFLAGS += $(NDB_LDFLAGS)
X LDLIBS += $(NDB_LDLIBS)
X.END
SHAR_EOF
echo "File unix/config.mk is complete"
chmod 0640 unix/config.mk || echo "restore of unix/config.mk fails"
echo mkdir - unix/bsd43
mkdir unix/bsd43
echo mkdir - unix/bsd43/uw
mkdir unix/bsd43/uw
echo "x - extracting unix/bsd43/uw/startup.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/uw/startup.mk &&
X# Generic UNIX DMAKE startup file. Customize to suit your needs.
X# Should work for both SYSV, and BSD 4.3
X# See the documentation for a description of internally defined macros.
X#
X# Disable warnings for macros redefined here that were given
X# on the command line.
X__.SILENT := $(.SILENT)
X.SILENT := yes
X
X# Configuration parameters for DMAKE startup.mk file
X# Set these to NON-NULL if you wish to turn the parameter on.
X_HAVE_RCS := yes # yes => RCS is installed.
X_HAVE_SCCS := yes # yes => SCCS is installed.
X
X# Applicable suffix definitions
XA := .a # Libraries
XE := # Executables
XF := .f # Fortran
XO := .o # Objects
XP := .p # Pascal
XS := .s # Assembler sources
XV := ,v # RCS suffix
X
X# Recipe execution configurations
XSHELL := /bin/sh
XSHELLFLAGS := -ce
XGROUPSHELL := $(SHELL)
XGROUPFLAGS :=
XSHELLMETAS := |();&<>?*][$$:\\#`'"
XGROUPSUFFIX :=
X
X# Standard C-language command names and flags
X CPP := /lib/cpp # C-preprocessor
X CC := cc # C-compiler and flags
X CFLAGS =
X
X AS := as # Assembler and flags
X ASFLAGS =
X
X LD = $(CC) # Loader and flags
X LDFLAGS =
X LDLIBS =
X
X# Definition of $(MAKE) macro for recursive makes.
X MAKE = $(MAKECMD) $(MFLAGS)
X
X# Definition of Print command for this system.
X PRINT = lpr
X
X# Language and Parser generation Tools and their flags
X YACC := yacc # standard yacc
X YFLAGS =
X YTAB := y.tab # yacc output files name stem.
X
X LEX := lex # standard lex
X LFLAGS =
X LEXYY := lex.yy # lex output file
X
X# Other Compilers, Tools and their flags
X PC := pc # pascal compiler
X RC := f77 # ratfor compiler
X FC := f77 # fortran compiler
X
X CO := co # check out for RCS
X COFLAGS := -q
X
X AR := ar # archiver
X ARFLAGS = ruv
X
X RM := /bin/rm # remove a file command
X RMFLAGS =
X
X# Implicit generation rules for making inferences.
X# We don't provide .yr or .ye rules here. They're obsolete.
X# Rules for making *$O
X %$O : %.c ; $(CC) -o $@ $(CFLAGS) -c $<
X %$O : %$P ; $(PC) -o $@ $(PFLAGS) -c $<
X %$O : %$S ; $(AS) -o $@ $<
X %$O : %.cl ; class -c $<
X %$O : %.e %.r %.F %$F
X $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
X
X# Executables
X %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
X
X# lex and yacc rules
X %.c : %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@
X %.c : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@
X
X# This rule tells how to make *.out from it's immediate list of prerequisites
X# UNIX only.
X %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
X
X# RCS support
X.IF $(_HAVE_RCS)
X % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
X .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
X.END
X
X# SCCS support
X.IF $(_HAVE_SCCS)
X % : s.% ; get $@
X .NOINFER : s.%
X.END
X
X# Recipe to make archive files.
X%$A :
X[
X $(AR) $(ARFLAGS) $@ $?
X $(RM) $(RMFLAGS) $?
X ranlib $@
X]
X
X# DMAKE uses this recipe to remove intermediate targets
X.REMOVE :; $(RM) -f $<
X
X# AUGMAKE extensions for SYSV compatibility
X at B = $(@:b)
X at D = $(@:d)
X at F = $(@:f)
X*B = $(*:b)
X*D = $(*:d)
X*F = $(*:f)
X<B = $(<:b)
X<D = $(<:d)
X<F = $(<:f)
X?B = $(?:b)
X?F = $(?:f)
X?D = $(?:d)
X
X# Turn warnings back to previous setting.
X.SILENT := $(__.SILENT)
X
X# Local startup file if any
X.INCLUDE .IGNORE: "_startup.mk"
SHAR_EOF
chmod 0640 unix/bsd43/uw/startup.mk || echo "restore of unix/bsd43/uw/startup.mk fails"
echo "x - extracting unix/bsd43/uw/make.sh (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/uw/make.sh &&
Xmkdir objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O infer.c
Xmv infer.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O make.c
Xmv make.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O stat.c
Xmv stat.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O expand.c
Xmv expand.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O string.c
Xmv string.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O hash.c
Xmv hash.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O dag.c
Xmv dag.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O dmake.c
Xmv dmake.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O path.c
Xmv path.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O imacs.c
Xmv imacs.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O sysintf.c
Xmv sysintf.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O parse.c
Xmv parse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O getinp.c
Xmv getinp.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O quit.c
Xmv quit.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O basename.c
Xmv basename.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O dump.c
Xmv dump.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O macparse.c
Xmv macparse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O rulparse.c
Xmv rulparse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O percent.c
Xmv percent.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/arlib.c
Xmv arlib.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/dirbrk.c
Xmv dirbrk.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/explode.c
Xmv explode.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/rmprq.c
Xmv rmprq.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/ruletab.c
Xmv ruletab.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/runargv.c
Xmv runargv.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/putenv.c
Xmv putenv.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/tempnam.c
Xmv tempnam.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/utime.c
Xmv utime.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/setvbuf.c
Xmv setvbuf.o objects
Xcc -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/runargv.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o -luw
SHAR_EOF
chmod 0640 unix/bsd43/uw/make.sh || echo "restore of unix/bsd43/uw/make.sh fails"
echo "x - extracting unix/bsd43/uw/config.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/uw/config.mk &&
X# This is the BSD 4.3 University of Waterloo (uw) UNIX configuration file
X# for DMAKE
X# It simply modifies the values of LDLIBS to include libuw.a
X# so that vfprintf can be found.
X#
X
XLDLIBS += -luw
X
X# install script for UW's /usr/software hierarchy...
Xinstall:
X mkdir ../bin; strip ./dmake; mv ./dmake ../bin
X chmod a+rx ../bin/dmake ../bin
X mkdir ../lib; chmod a+rx ../lib
X cp $(STARTUPFILE) ../lib
X chmod a+r ../lib/startup.mk
SHAR_EOF
chmod 0640 unix/bsd43/uw/config.mk || echo "restore of unix/bsd43/uw/config.mk fails"
echo "x - extracting unix/bsd43/utime.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/utime.c &&
X/*
X** change access and modify times of file
X*/
X#include <sys/types.h>
X#include <sys/time.h>
X#include <sys/stat.h>
X#include <sys/file.h>
X
Xint
Xutime(name, timep)
Xchar* name;
Xtime_t timep[2];
X{
X struct timeval tv[2], *tvp;
X struct stat buf;
X int fil;
X char data;
X
X if (timep!=0)
X {
X tvp = tv, tv[0].tv_sec = timep[0], tv[1].tv_sec = timep[1];
X if (utimes(name, tvp)==0)
X return (0);
X }
X
X if (stat(name, &buf) != 0)
X return (-1);
X if (buf.st_size != 0) {
X if ((fil = open(name, O_RDWR, 0666)) < 0)
X return (-1);
X if (read(fil, &data, 1) < 1) {
X close(fil);
X return (-1);
X }
X lseek(fil, 0L, 0);
X if (write(fil, &data, 1) < 1) {
X close(fil);
X return (-1);
X }
X close(fil);
X return (0);
X } else if ((fil = creat(name, 0666)) < 0) {
X return (-1);
X } else {
X close(fil);
X return (0);
X }
X}
SHAR_EOF
chmod 0640 unix/bsd43/utime.c || echo "restore of unix/bsd43/utime.c fails"
echo "x - extracting unix/bsd43/tempnam.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/tempnam.c &&
X/*LINTLIBRARY*/
X#include <stdio.h>
X#include <string.h>
X#include <stdlib.h>
X
X#define max(A,B) (((A)<(B))?(B):(A))
X
Xextern char *mktemp();
Xextern int access();
X
Xstatic char *cpdir();
Xstatic char *seed="AAA";
X
X/* BSD stdio.h doesn't define P_tmpdir, so let's do it here */
X#ifndef P_tmpdir
Xstatic char *P_tmpdir = "/tmp";
X#endif
X
Xchar *
Xtempnam(dir, prefix)
Xchar *dir; /* use this directory please (if non-NULL) */
Xchar *prefix; /* use this (if non-NULL) as filename prefix */
X{
X register char *p, *q, *tmpdir;
X int tl=0, dl=0, pl;
X
X pl = strlen(P_tmpdir);
X
X if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
X if( dir != NULL ) dl = strlen(dir);
X
X if( (p = malloc((unsigned)(max(max(dl,tl),pl)+16))) == NULL )
X return(NULL);
X
X *p = '\0';
X
X if( (tl == 0) || (access( cpdir(p, tmpdir), 3) != 0) )
X if( (dl == 0) || (access( cpdir(p, dir), 3) != 0) )
X if( access( cpdir(p, P_tmpdir), 3) != 0 )
X if( access( cpdir(p, "/tmp"), 3) != 0 )
X return(NULL);
X
X (void) strcat(p, "/");
X if(prefix)
X {
X *(p+strlen(p)+5) = '\0';
X (void)strncat(p, prefix, 5);
X }
X
X (void)strcat(p, seed);
X (void)strcat(p, "XXXXXX");
X
X q = seed;
X while(*q == 'Z') *q++ = 'A';
X ++*q;
X
X if(*mktemp(p) == '\0') return(NULL);
X return(p);
X}
X
X
X
Xstatic char *
Xcpdir(buf, str)
Xchar *buf;
Xchar *str;
X{
X char *p;
X
X if(str != NULL)
X {
X (void) strcpy(buf, str);
X p = buf - 1 + strlen(buf);
X if(*p == '/') *p = '\0';
X }
X
X return(buf);
X}
SHAR_EOF
chmod 0640 unix/bsd43/tempnam.c || echo "restore of unix/bsd43/tempnam.c fails"
echo "x - extracting unix/bsd43/string.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/string.h &&
X/*
X** BSD does this wrong
X*/
X#include <strings.h>
X
X#define strchr(str,c) index(str,c)
X#define strrchr(str,c) rindex(str,c)
X
X#include "macros.h"
Xextern char* strpbrk ANSI((char* src, char* any));
X
SHAR_EOF
chmod 0640 unix/bsd43/string.h || echo "restore of unix/bsd43/string.h fails"
echo "x - extracting unix/bsd43/stdlib.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/stdlib.h &&
X#ifndef _STDLIB_INCLUDED_
X#define _STDLIB_INCLUDED_
X
Xextern /*GOTO*/ _exit();
Xextern /*GOTO*/ exit();
Xextern /*GOTO*/ abort();
Xextern int system();
Xextern char *getenv();
Xextern char *calloc();
Xextern char *malloc();
Xextern char *realloc();
Xextern free();
Xextern int errno;
X
X#ifndef EIO
X# include <errno.h>
X#endif
X
X#endif /* _STDLIB_INCLUDED_ */
SHAR_EOF
chmod 0640 unix/bsd43/stdlib.h || echo "restore of unix/bsd43/stdlib.h fails"
echo "x - extracting unix/bsd43/stdarg.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/stdarg.h &&
X/*
X * stdarg.h
X *
X * defines ANSI style macros for accessing arguments of a function which takes
X * a variable number of arguments
X *
X */
X
Xtypedef char *va_list;
X
X#if defined(sparc)
X# define va_alist __builtin_va_alist
X#endif
X# define va_dcl int va_alist
X# define va_start(list,v) list = (char *)&va_alist
X# define va_end(list) list = NULL
X# define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1]
X
SHAR_EOF
chmod 0640 unix/bsd43/stdarg.h || echo "restore of unix/bsd43/stdarg.h fails"
echo "x - extracting unix/bsd43/startup.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/startup.mk &&
X# Generic UNIX DMAKE startup file. Customize to suit your needs.
X# Should work for both SYSV, and BSD 4.3
X# See the documentation for a description of internally defined macros.
X#
X# Disable warnings for macros redefined here that were given
X# on the command line.
X__.SILENT := $(.SILENT)
X.SILENT := yes
X
X# Configuration parameters for DMAKE startup.mk file
X# Set these to NON-NULL if you wish to turn the parameter on.
X_HAVE_RCS := yes # yes => RCS is installed.
X_HAVE_SCCS := yes # yes => SCCS is installed.
X
X# Applicable suffix definitions
XA := .a # Libraries
XE := # Executables
XF := .f # Fortran
XO := .o # Objects
XP := .p # Pascal
XS := .s # Assembler sources
XV := ,v # RCS suffix
X
X# Recipe execution configurations
XSHELL := /bin/sh
XSHELLFLAGS := -ce
XGROUPSHELL := $(SHELL)
XGROUPFLAGS :=
XSHELLMETAS := |();&<>?*][$$:\\#`'"
XGROUPSUFFIX :=
X
X# Standard C-language command names and flags
X CPP := /lib/cpp # C-preprocessor
X CC := cc # C-compiler and flags
X CFLAGS =
X
X AS := as # Assembler and flags
X ASFLAGS =
X
X LD = $(CC) # Loader and flags
X LDFLAGS =
X LDLIBS =
X
X# Definition of $(MAKE) macro for recursive makes.
X MAKE = $(MAKECMD) $(MFLAGS)
X
X# Definition of Print command for this system.
X PRINT = lpr
X
X# Language and Parser generation Tools and their flags
X YACC := yacc # standard yacc
X YFLAGS =
X YTAB := y.tab # yacc output files name stem.
X
X LEX := lex # standard lex
X LFLAGS =
X LEXYY := lex.yy # lex output file
X
X# Other Compilers, Tools and their flags
X PC := pc # pascal compiler
X RC := f77 # ratfor compiler
X FC := f77 # fortran compiler
X
X CO := co # check out for RCS
X COFLAGS := -q
X
X AR := ar # archiver
X ARFLAGS = ruv
X
X RM := /bin/rm # remove a file command
X RMFLAGS =
X
X# Implicit generation rules for making inferences.
X# We don't provide .yr or .ye rules here. They're obsolete.
X# Rules for making *$O
X %$O : %.c ; $(CC) $(CFLAGS) -c $<
X %$O : %$P ; $(PC) $(PFLAGS) -c $<
X %$O : %$S ; $(AS) $<
X %$O : %.cl ; class -c $<
X %$O : %.e %.r %.F %$F
X $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
X
X# Executables
X %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
X
X# lex and yacc rules
X %.c : %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@
X %.c : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@
X
X# This rule tells how to make *.out from it's immediate list of prerequisites
X# UNIX only.
X %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
X
X# RCS support
X.IF $(_HAVE_RCS)
X % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
X .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
X.END
X
X# SCCS support
X.IF $(_HAVE_SCCS)
X % : s.% ; get $@
X .NOINFER : s.%
X.END
X
X# Recipe to make archive files.
X%$A :
X[
X $(AR) $(ARFLAGS) $@ $?
X $(RM) $(RMFLAGS) $?
X ranlib $@
X]
X
X# DMAKE uses this recipe to remove intermediate targets
X.REMOVE :; $(RM) -f $<
X
X# AUGMAKE extensions for SYSV compatibility
X at B = $(@:b)
X at D = $(@:d)
X at F = $(@:f)
X*B = $(*:b)
X*D = $(*:d)
X*F = $(*:f)
X<B = $(<:b)
X<D = $(<:d)
X<F = $(<:f)
X?B = $(?:b)
X?F = $(?:f)
X?D = $(?:d)
X
X# Turn warnings back to previous setting.
X.SILENT := $(__.SILENT)
X
X# Local startup file if any
X.INCLUDE .IGNORE: "_startup.mk"
SHAR_EOF
chmod 0640 unix/bsd43/startup.mk || echo "restore of unix/bsd43/startup.mk fails"
echo "x - extracting unix/bsd43/setvbuf.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/setvbuf.c &&
X/* RCS -- $Header$
X-- SYNOPSIS -- setvbuf for BSD
X--
X-- DESCRIPTION
X-- A sysv call, standard BSD doesn't have this.
X--
X-- AUTHOR
X-- Dennis Vadura, dvadura at watdragon.uwaterloo.ca
X-- CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X-- Copyright (c) 1990 by Dennis Vadura. All rights reserved.
X--
X-- This program is free software; you can redistribute it and/or
X-- modify it under the terms of the GNU General Public License
X-- (version 1), as published by the Free Software Foundation, and
X-- found in the file 'LICENSE' included with this distribution.
X--
X-- This program is distributed in the hope that it will be useful,
X-- but WITHOUT ANY WARRANTY; without even the implied warrant of
X-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
X-- GNU General Public License for more details.
X--
X-- You should have received a copy of the GNU General Public License
X-- along with this program; if not, write to the Free Software
X-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X-- $Log$
X*/
X
X#include <stdio.h>
X
Xsetvbuf(fp, bp, type, len_unused)
XFILE* fp;
Xchar* bp;
Xint type;
Xint len_unused;
X{
X switch (type) {
X case _IOLBF: setlinebuf(fp); return;
X case _IONBF: setbuf(fp, NULL); return;
X default: setbuf(fp, bp); return;
X }
X}
X
SHAR_EOF
chmod 0640 unix/bsd43/setvbuf.c || echo "restore of unix/bsd43/setvbuf.c fails"
echo "x - extracting unix/bsd43/putenv.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/putenv.c &&
X/* RCS -- $Header$
X-- SYNOPSIS -- our own putenv for BSD systems.
X--
X-- DESCRIPTION
X-- This originally came from MKS.
X--
X-- AUTHOR
X-- Dennis Vadura, dvadura at watdragon.uwaterloo.ca
X-- CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X-- Copyright (c) 1990 by Dennis Vadura. All rights reserved.
X--
X-- This program is free software; you can redistribute it and/or
X-- modify it under the terms of the GNU General Public License
X-- (version 1), as published by the Free Software Foundation, and
X-- found in the file 'LICENSE' included with this distribution.
X--
X-- This program is distributed in the hope that it will be useful,
X-- but WITHOUT ANY WARRANTY; without even the implied warrant of
X-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
X-- GNU General Public License for more details.
X--
X-- You should have received a copy of the GNU General Public License
X-- along with this program; if not, write to the Free Software
X-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X-- $Log$
X*/
X
X/*
X * System V.2 Emulation Library.
X * Copyright (c) 1985 by Mortice Kern Systems, Inc.
X *
X * putenv -- C library.
X */
X
X#include <string.h>
X
X#ifndef NULL
X#define NULL 0
X#endif NULL
X
X/*
X * Put a string containing "name=value" into the environment.
X * The space pointed to by the string is put into the environment
X * so it should be static or malloc'd.
X * Return 0 if OK, non-zero otherwise.
X */
Xint
Xputenv(string)
Xchar *string;
X{
X extern char **environ;
X static char **ourenv = NULL;
X register char *ep;
X register char **epp;
X
X for (epp = environ; (ep = *epp) != NULL; epp++) {
X register char *np;
X register int c;
X
X np = string;
X while ((c = *ep++) == *np++)
X if (c == '\0')
X break;
X if (c=='=' || c=='\0') {
X *epp = string;
X return (0);
X }
X }
X if (environ != ourenv) {
X int neb = (epp-environ+1) * sizeof(char*);
X
X ourenv = (char**) malloc(neb);
X if (ourenv == NULL)
X return 1;
X memcpy((char*)ourenv, (char*)environ, neb);
X epp = ourenv + (epp-environ);
X environ = ourenv;
X }
X ourenv = (char**) realloc(environ, (epp-environ+2) * sizeof(char*));
X if (ourenv == NULL)
X return 1;
X epp = ourenv + (epp-environ);
X *epp++ = string;
X *epp = NULL;
X environ = ourenv;
X return (0);
X}
X
SHAR_EOF
chmod 0640 unix/bsd43/putenv.c || echo "restore of unix/bsd43/putenv.c fails"
echo "x - extracting unix/bsd43/make.sh (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/make.sh &&
Xmkdir objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O infer.c
Xmv infer.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O make.c
Xmv make.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O stat.c
Xmv stat.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O expand.c
Xmv expand.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O string.c
Xmv string.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O hash.c
Xmv hash.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O dag.c
Xmv dag.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O dmake.c
Xmv dmake.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O path.c
Xmv path.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O imacs.c
Xmv imacs.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O sysintf.c
Xmv sysintf.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O parse.c
Xmv parse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O getinp.c
Xmv getinp.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O quit.c
Xmv quit.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O basename.c
Xmv basename.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O dump.c
Xmv dump.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O macparse.c
Xmv macparse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O rulparse.c
Xmv rulparse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O percent.c
Xmv percent.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/arlib.c
Xmv arlib.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/dirbrk.c
Xmv dirbrk.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/explode.c
Xmv explode.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/rmprq.c
Xmv rmprq.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/ruletab.c
Xmv ruletab.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/runargv.c
Xmv runargv.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/putenv.c
Xmv putenv.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/tempnam.c
Xmv tempnam.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/utime.c
Xmv utime.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/setvbuf.c
Xmv setvbuf.o objects
Xcc -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/runargv.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o
SHAR_EOF
chmod 0640 unix/bsd43/make.sh || echo "restore of unix/bsd43/make.sh fails"
echo mkdir - unix/bsd43/dynix
mkdir unix/bsd43/dynix
echo "x - extracting unix/bsd43/dynix/startup.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/dynix/startup.mk &&
X# Generic UNIX DMAKE startup file. Customize to suit your needs.
X# Should work for both SYSV, and BSD 4.3
X# See the documentation for a description of internally defined macros.
X#
X# Disable warnings for macros redefined here that were given
X# on the command line.
X__.SILENT := $(.SILENT)
X.SILENT := yes
X
X# Configuration parameters for DMAKE startup.mk file
X# Set these to NON-NULL if you wish to turn the parameter on.
X_HAVE_RCS := yes # yes => RCS is installed.
X_HAVE_SCCS := yes # yes => SCCS is installed.
X
X# Applicable suffix definitions
XA := .a # Libraries
XE := # Executables
XF := .f # Fortran
XO := .o # Objects
XP := .p # Pascal
XS := .s # Assembler sources
XV := ,v # RCS suffix
X
X# Recipe execution configurations
XSHELL := /bin/sh
XSHELLFLAGS := -ce
XGROUPSHELL := $(SHELL)
XGROUPFLAGS :=
XSHELLMETAS := |();&<>?*][$$:\\#`'"
XGROUPSUFFIX :=
X
X# Standard C-language command names and flags
X CPP := /lib/cpp # C-preprocessor
X CC := cc # C-compiler and flags
X CFLAGS =
X
X AS := as # Assembler and flags
X ASFLAGS =
X
X LD = $(CC) # Loader and flags
X LDFLAGS =
X LDLIBS =
X
X# Definition of $(MAKE) macro for recursive makes.
X MAKE = $(MAKECMD) $(MFLAGS)
X
X# Definition of Print command for this system.
X PRINT = lpr
X
X# Language and Parser generation Tools and their flags
X YACC := yacc # standard yacc
X YFLAGS =
X YTAB := y.tab # yacc output files name stem.
X
X LEX := lex # standard lex
X LFLAGS =
X LEXYY := lex.yy # lex output file
X
X# Other Compilers, Tools and their flags
X PC := pc # pascal compiler
X RC := f77 # ratfor compiler
X FC := f77 # fortran compiler
X
X CO := co # check out for RCS
X COFLAGS := -q
X
X AR := ar # archiver
X ARFLAGS = ruv
X
X RM := /bin/rm # remove a file command
X RMFLAGS =
X
X# Implicit generation rules for making inferences.
X# We don't provide .yr or .ye rules here. They're obsolete.
X# Rules for making *$O
X %$O : %.c ; $(CC) $(CFLAGS) -c $<
X %$O : %$P ; $(PC) $(PFLAGS) -c $<
X %$O : %$S ; $(AS) $<
X %$O : %.cl ; class -c $<
X %$O : %.e %.r %.F %$F
X $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
X
X# Executables
X %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
X
X# lex and yacc rules
X %.c : %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@
X %.c : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@
X
X# This rule tells how to make *.out from it's immediate list of prerequisites
X# UNIX only.
X %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
X
X# RCS support
X.IF $(_HAVE_RCS)
X % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
X .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
X.END
X
X# SCCS support
X.IF $(_HAVE_SCCS)
X % : s.% ; get $@
X .NOINFER : s.%
X.END
X
X# Recipe to make archive files.
X%$A :
X[
X $(AR) $(ARFLAGS) $@ $?
X $(RM) $(RMFLAGS) $?
X ranlib $@
X]
X
X# DMAKE uses this recipe to remove intermediate targets
X.REMOVE :; $(RM) -f $<
X
X# AUGMAKE extensions for SYSV compatibility
X at B = $(@:b)
X at D = $(@:d)
X at F = $(@:f)
X*B = $(*:b)
X*D = $(*:d)
X*F = $(*:f)
X<B = $(<:b)
X<D = $(<:d)
X<F = $(<:f)
X?B = $(?:b)
X?F = $(?:f)
X?D = $(?:d)
X
X# Turn warnings back to previous setting.
X.SILENT := $(__.SILENT)
X
X# Local startup file if any
X.INCLUDE .IGNORE: "_startup.mk"
SHAR_EOF
chmod 0640 unix/bsd43/dynix/startup.mk || echo "restore of unix/bsd43/dynix/startup.mk fails"
echo "x - extracting unix/bsd43/dynix/make.sh (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/dynix/make.sh &&
Xmkdir objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O infer.c
Xmv infer.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O make.c
Xmv make.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O stat.c
Xmv stat.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O expand.c
Xmv expand.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O string.c
Xmv string.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O hash.c
Xmv hash.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O dag.c
Xmv dag.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O dmake.c
Xmv dmake.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O path.c
Xmv path.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O imacs.c
Xmv imacs.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O sysintf.c
Xmv sysintf.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O parse.c
Xmv parse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O getinp.c
Xmv getinp.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O quit.c
Xmv quit.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O basename.c
Xmv basename.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O dump.c
Xmv dump.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O macparse.c
Xmv macparse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O rulparse.c
Xmv rulparse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O percent.c
Xmv percent.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/arlib.c
Xmv arlib.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/dirbrk.c
Xmv dirbrk.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/explode.c
Xmv explode.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/rmprq.c
Xmv rmprq.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/ruletab.c
Xmv ruletab.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/runargv.c
Xmv runargv.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/bsd43/putenv.c
Xmv putenv.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/bsd43/tempnam.c
Xmv tempnam.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/bsd43/utime.c
Xmv utime.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/bsd43/setvbuf.c
Xmv setvbuf.o objects
Xcc -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/runargv.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o -lcfix
SHAR_EOF
chmod 0640 unix/bsd43/dynix/make.sh || echo "restore of unix/bsd43/dynix/make.sh fails"
echo "x - extracting unix/bsd43/dynix/ctype.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/dynix/ctype.h &&
X/* ctype.h 4.2 85/09/04 */
X
X#define _U 01
X#define _L 02
X#define _N 04
X#define _S 010
X#define _P 020
X#define _C 040
X#define _X 0100
X#define _B 0200
X
Xextern char _ctype_[];
X
X#define isalpha(c) ((_ctype_+1)[c]&(_U|_L))
X#define isupper(c) ((_ctype_+1)[c]&_U)
X#define islower(c) ((_ctype_+1)[c]&_L)
X#define isdigit(c) ((_ctype_+1)[c]&_N)
X#define isxdigit(c) ((_ctype_+1)[c]&(_N|_X))
X#define isspace(c) ((_ctype_+1)[c]&_S)
X#define ispunct(c) ((_ctype_+1)[c]&_P)
X#define isalnum(c) ((_ctype_+1)[c]&(_U|_L|_N))
X#define isprint(c) ((_ctype_+1)[c]&(_P|_U|_L|_N|_B))
X#define isgraph(c) ((_ctype_+1)[c]&(_P|_U|_L|_N))
X#define iscntrl(c) ((_ctype_+1)[c]&_C)
X#define isascii(c) ((unsigned)(c)<=0177)
X#define toupper(c) ((c)-'a'+'A')
X#define tolower(c) ((c)-'A'+'a')
X#define toascii(c) ((c)&0177)
SHAR_EOF
chmod 0640 unix/bsd43/dynix/ctype.h || echo "restore of unix/bsd43/dynix/ctype.h fails"
echo "x - extracting unix/bsd43/dynix/config.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/dynix/config.mk &&
X# This is the SysV Dynix configuration file
X# for DMAKE
X# It simply adds this dir as the dir to search for include files.
X# so that this ctype.h file is found.
X#
X
XLDLIBS += -lcfix
XCFLAGS += -I$(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
SHAR_EOF
chmod 0640 unix/bsd43/dynix/config.mk || echo "restore of unix/bsd43/dynix/config.mk fails"
echo "x - extracting unix/bsd43/config.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/config.mk &&
X# This is the BSD 4.3 UNIX configuration file for DMAKE
X# It simply modifies the values of SRC, and checks to see if
X# OSENVIRONMENT is defined. If so it includes the appropriate
X# config.mk file.
X#
X# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
X# directory.
X#
Xosrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
X
X# The following sources are required for BSD4.3
XOSDSRC := putenv.c tempnam.c utime.c setvbuf.c
XSRC += $(OSDSRC)
X.SETDIR=$(osrdir) : $(OSDSRC)
X
X.SOURCE.h : $(osrdir)
X
X# Local configuration modifications for CFLAGS, there's local BSD includes
X# too.
XCFLAGS += -I$(osrdir)
X
X# See if we modify anything in the lower levels.
X.IF $(OSENVIRONMENT) != $(NULL)
X .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
X.END
SHAR_EOF
chmod 0640 unix/bsd43/config.mk || echo "restore of unix/bsd43/config.mk fails"
echo "x - extracting unix/bsd43/config.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/config.h &&
X/* RCS -- $Header$
X-- SYNOPSIS -- Configurarion include file.
X--
X-- DESCRIPTION
X-- There is one of these for each specific machine configuration.
X-- It can be used to further tweek the machine specific sources
X-- so that they compile.
X--
X-- AUTHOR
X-- Dennis Vadura, dvadura at watdragon.uwaterloo.ca
X-- CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X-- Copyright (c) 1990 by Dennis Vadura. All rights reserved.
X--
X-- This program is free software; you can redistribute it and/or
X-- modify it under the terms of the GNU General Public License
X-- (version 1), as published by the Free Software Foundation, and
X-- found in the file 'LICENSE' included with this distribution.
X--
X-- This program is distributed in the hope that it will be useful,
X-- but WITHOUT ANY WARRANTY; without even the implied warrant of
X-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
X-- GNU General Public License for more details.
X--
X-- You should have received a copy of the GNU General Public License
X-- along with this program; if not, write to the Free Software
X-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X-- $Log$
X*/
X
X/* define this for configurations that don't have the coreleft function
X * so that the code compiles. To my knowledge coreleft exists only on
X * Turbo C, but it is needed here since the function is used in many debug
X * macros. */
X#define coreleft() 0L
X
X/* Define the getcwd function that is used in the code, since BSD does
X * not have getcwd, but call it getwd instead. */
Xextern char* getwd ANSI((char*));
X#define getcwd(buf,siz) getwd(buf)
SHAR_EOF
chmod 0640 unix/bsd43/config.h || echo "restore of unix/bsd43/config.h fails"
echo "x - extracting unix/arlib.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/arlib.c &&
X/* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/arlib.c,v 1.1 90/07/19 14:04:36 dvadura Exp $
X-- SYNOPSIS -- Unix archive manipulation code.
X--
X-- DESCRIPTION
X-- Originally this code was provided by Eric Gisin of MKS. I took
X-- his code and completely rewrote it adding cacheing of lib members
X-- and other various optimizations. I kept the overal functional
X-- idea of the library routines as they are similar to those in GNU
X-- make and felt it advantageous to maintain a similar interface.
X--
X-- AUTHOR
X-- Dennis Vadura, dvadura at watdragon.uwaterloo.ca
X-- CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X-- Copyright (c) 1990 by Dennis Vadura. All rights reserved.
X--
X-- This program is free software; you can redistribute it and/or
X-- modify it under the terms of the GNU General Public License
X-- (version 1), as published by the Free Software Foundation, and
X-- found in the file 'LICENSE' included with this distribution.
X--
X-- This program is distributed in the hope that it will be useful,
X-- but WITHOUT ANY WARRANTY; without even the implied warrant of
X-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
X-- GNU General Public License for more details.
X--
X-- You should have received a copy of the GNU General Public License
X-- along with this program; if not, write to the Free Software
X-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- This program is free software; you can redistribute it
X-- and/or modify it under the terms of the GNU General
X-- Public License (version 1), as published by the Free
X-- Software Foundation, and found in the file 'license'
X-- included in this distribution.
X--
X-- This program is distributed in the hope that it will be
X-- useful, but WITHOUT ANY WARRANTY; without even the implied
X-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
X-- PURPOSE. See the GNU General Public License for more
X-- details.
X--
X-- You should have received a copy of the GNU General Public
X-- License along with this program; if not, write to the
X-- Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
X-- MA 02139, USA.
X--
X-- LOG
X-- $Log: arlib.c,v $
X * Revision 1.1 90/07/19 14:04:36 dvadura
X * Initial Revision of Version 3.5
X *
X*/
X
X#include "extern.h"
X#include "sysintf.h"
X#include <ar.h>
X#include <stdio.h>
X
X/* By defining the defines below it is possible to configure the library
X * code for library cacheing/non-cacheing, ASCII archive headers, and a full
X * decode of the ar_hdr fields in the scan_ar function. */
X
X#define ASCARCH 1 /* ASCII time stored in archive */
X#define LC 1 /* Turn on library cacheing */
X#define DECODE_ALL_AR_FIELDS 0 /* decode only fields make needs*/
X
X#if LC
X# define FOUND_MEMBER FALSE
X#else
X# define FOUND_MEMBER TRUE
X# define _cache_member(a, b, c)
X# define _check_cache(a, b, c, d) FALSE
X#endif
X
X#define MAXFNAME 32 /* Longest file name in archive */
X#define MAXMNAME 8 /* Max module name < MAXFNAME */
X
X
X/* This struct is used to pass the library and member information about the
X * routines that perform the library seeking/cacheing */
Xstruct ar_args {
X char *lib;
X char *member;
X time_t time;
X};
X
X
Xtypedef struct AR {
X char ar_name[MAXFNAME+1]; /* File name */
X long ar_size; /* Size in bytes */
X time_t ar_time; /* Modification time */
X
X#ifdef DOS
X char ar_modname[MAXMNAME+1]; /* DOS module name */
X#endif
X
X#if DECODE_ALL_AR_FIELDS
X uint16 ar_mode; /* File mode */
X uint16 ar_uid; /* File owner */
X uint16 ar_gid; /* File group owner */
X#endif
X} AR, *ARPTR;
X
X
Xstatic int ar_scan ANSI((FILE *,
X int (*) ANSI((FILE *, struct AR *, struct ar_args *)),
X struct ar_args *));
Xstatic int ar_touch ANSI(( FILE *, time_t ));
Xstatic int time_function ANSI(( FILE *, struct AR *, struct ar_args * ));
Xstatic int touch_function ANSI(( FILE *, struct AR *, struct ar_args * ));
X
X#if LC
Xstatic int _cache_member ANSI((char *, char *, time_t));
Xstatic int _check_cache ANSI((char *, char *, time_t *, int));
X#endif
X
X/* decoded archive header */
Xstatic AR _ar;
X
X
Xtime_t
Xseek_arch(name, lib)/*
X======================
X Look for module 'name' inside 'lib'. If compiled with cacheing then first
SHAR_EOF
echo "End of part 2"
echo "File unix/arlib.c is continued in part 3"
echo "3" > s2_seq_.tmp
exit 0
More information about the Comp.sources.misc
mailing list