451 lines
13 KiB
Plaintext
451 lines
13 KiB
Plaintext
*** stdio.g Thu Jul 26 22:15:17 1990
|
|
--- stdio.h Sun Nov 4 08:51:48 1990
|
|
***************
|
|
*** 21,36 ****
|
|
*/
|
|
|
|
/* Site specific definitions */
|
|
! /*+*/
|
|
! /*efine _STDIO_P_(x)*/
|
|
! /*efine _STDIO_VA_*/
|
|
! /*efine _STDIO_UCHAR_*/
|
|
! /*efine _STDIO_VA_LIST_*/
|
|
! /*efine _STDIO_SIZE_T_*/
|
|
! /*efine _STDIO_USIZE_T_*/
|
|
! /*efine _STDIO_NULL*/
|
|
! /*efine NULL*/
|
|
! /*-*/
|
|
|
|
/* Definitions based on ANSI compiler */
|
|
#ifdef __STDC__
|
|
--- 21,36 ----
|
|
*/
|
|
|
|
/* Site specific definitions */
|
|
! /*@*/
|
|
! #undef NULL
|
|
! #ifndef NULL
|
|
! # define NULL 0
|
|
! #endif
|
|
! #define _STDIO_UCHAR_ 0xFF
|
|
! #define _STDIO_VA_LIST_ char *
|
|
! #define _STDIO_SIZE_T_ unsigned int /* type returned by sizeof */
|
|
! #define _STDIO_USIZE_T_ unsigned int
|
|
! /*=*/
|
|
|
|
/* Definitions based on ANSI compiler */
|
|
#ifdef __STDC__
|
|
*** site.h Sun Nov 4 08:53:53 1990
|
|
--- site.h Sun Nov 4 08:53:53 1990
|
|
***************
|
|
*** 0 ****
|
|
--- 1,30 ----
|
|
+ /*efine NDEBUG*/
|
|
+ /*efine HIDDEN*/
|
|
+ #define NOFLOAT
|
|
+ #define ERRLIST
|
|
+ #define STDARG
|
|
+ #define LIMITS
|
|
+ /*efine CHAR_BIT*/
|
|
+ /*efine UINT_MAX*/
|
|
+ /*efine ULONG_MAX*/
|
|
+ /*efine INT_MAX*/
|
|
+ /*efine LONG_MAX*/
|
|
+ /*efine HUGE_VAL*/
|
|
+ /*efine UNSIGNEDCHAR*/
|
|
+ #define MEMORY
|
|
+ /*efine MYMEMCPY*/
|
|
+ /*efine MYMEMCHR*/
|
|
+ /*efine MYMEMSET*/
|
|
+ #define STRING
|
|
+ #define TOLOWER(c) tolower(c)
|
|
+ #define OPEN3
|
|
+ #define RENAME
|
|
+ #define UNISTD
|
|
+ /*efine MODE_T mode_t*/
|
|
+ /*efine UID_T uid_t*/
|
|
+ #define VOIDSIGNAL
|
|
+ #define SYSTYPES
|
|
+ /*efine DENORMAL*/
|
|
+ /*efine TRUNCATE*/
|
|
+ /*efine LMR*/
|
|
+ /*efine POWERS*/
|
|
*** Makefile Sun Nov 4 08:53:55 1990
|
|
--- Makefile Sun Nov 4 08:53:55 1990
|
|
***************
|
|
*** 0 ****
|
|
--- 1,328 ----
|
|
+
|
|
+ #min _MINIX
|
|
+ CPP =/usr/lib/cpp -P -D_MINIX
|
|
+ FPCC =$(CC) -f
|
|
+ CC =cc
|
|
+ FPLD =$(LD)
|
|
+ LD =$(CC) -i
|
|
+ RANLIB =echo
|
|
+ LORDER =lorder
|
|
+ TSORT =tsort
|
|
+
|
|
+
|
|
+
|
|
+ Installdir =INSTALL/
|
|
+ Testdir =TEST/
|
|
+ Fptestdir =FPTEST/
|
|
+ Define =-D_MINIX -D_POSIX_SOURCE
|
|
+ Include =-I.
|
|
+ Libraries =stdio.a
|
|
+ MathLibraries =-f
|
|
+ FPLib =stdiofp.a
|
|
+ StdioLib =stdio.a
|
|
+
|
|
+ All =README *.x *.c *.g *.h \
|
|
+ makefile.cpp makefile.nix makefile.min \
|
|
+ $(Testdir)*.c $(Testdir)*.sh \
|
|
+ $(Fptestdir)*.c \
|
|
+ $(Installdir)*.c $(Installdir)*.sh \
|
|
+ $(Installdir)*.txt $(Installdir)*.sit \
|
|
+ $(Installdir)*.ans
|
|
+
|
|
+ Everyone =nix min dos
|
|
+
|
|
+ CFLAGS= $(Define) $(Include) -LIB -c
|
|
+
|
|
+ FPOBJ= \
|
|
+ _f_cvt.s _f_fprintf.s _f_fscanf.s \
|
|
+ _f_guard.s _f_pow10.s _f_printf.s \
|
|
+ _f_scanf.s _f_sprintf.s _f_sscanf.s \
|
|
+ _f_tvc.s _f_vfprintf.s _f_vprintf.s \
|
|
+ _f_vsprintf.s
|
|
+
|
|
+ LIBOBJ= \
|
|
+ _allocbuf.s _bfs.s _bread.s \
|
|
+ _bwrite.s _err.s _errlist.s \
|
|
+ _fgetlx.s _file.s _fopen.s \
|
|
+ _freebuf.s _in.s _ioread.s \
|
|
+ _iowrite.s _ipow10.s _open3.s \
|
|
+ _os.s _out.s _rename.s \
|
|
+ _rlbf.s _stdio.s _update.s \
|
|
+ _utoa.s _vfprintf.s _vfscanf.s \
|
|
+ _vscanf.s _vsscanf.s _xassert.s \
|
|
+ _z_cvt.s _z_tvc.s _zatexit.s \
|
|
+ _zerr.s _zout.s _zrlbf.s \
|
|
+ _zwrapup.s atexit.s clearerr.s \
|
|
+ ctermid.s cuserid.s exit.s \
|
|
+ fclose.s fdopen.s feof.s \
|
|
+ ferror.s fflush.s fgetc.s \
|
|
+ fgetpos.s fgets.s fileno.s \
|
|
+ fopen.s fprintf.s fputc.s \
|
|
+ fputs.s fread.s freopen.s \
|
|
+ fscanf.s fseek.s fsetpos.s \
|
|
+ ftell.s fwrite.s getc.s \
|
|
+ getchar.s gets.s getw.s \
|
|
+ perror.s printf.s putc.s \
|
|
+ putchar.s puts.s putw.s \
|
|
+ remove.s rewind.s scanf.s \
|
|
+ setbuf.s setvbuf.s sprintf.s \
|
|
+ sscanf.s tmpfile.s tmpnam.s \
|
|
+ ungetc.s vfprintf.s vprintf.s \
|
|
+ vsprintf.s
|
|
+
|
|
+ .SUFFIXES: .s .c
|
|
+ .c.s:
|
|
+ $(CC) $(CFLAGS) $<
|
|
+
|
|
+ test:
|
|
+ -cd $(Testdir) ; \
|
|
+ for f in *.c ; do \
|
|
+ n=`basename $$f .c` ; \
|
|
+ $(CC) $(CFLAGS) -I.. $$n.c ; \
|
|
+ $(LD) -o $$n $$n.s ../stdio.a ; \
|
|
+ done
|
|
+
|
|
+ fptest:
|
|
+ -cd $(Fptestdir) ; \
|
|
+ for f in *.c ; do \
|
|
+ n=`basename $$f .c` ; \
|
|
+ $(FPCC) $(CFLAGS) -I.. $$n.c ; \
|
|
+ $(FPLD) -o $$n $$n.s ../stdiofp.a ../stdio.a $(MathLibraries) ; \
|
|
+ done
|
|
+
|
|
+ update:
|
|
+ -if test -z "$(LIBC)" ; then \
|
|
+ echo Usage: make update LIBC=library ; \
|
|
+ else \
|
|
+ ar t $(LIBC) | sed -e 's/ //g' | sort > libc.files ; \
|
|
+ ar rv $(LIBC) `ls *.o | comm -12 - libc.files` ; \
|
|
+ rm -f libc.files ; \
|
|
+ $(RANLIB) $(LIBC); \
|
|
+ fi
|
|
+
|
|
+ # Library dependencies
|
|
+
|
|
+ $(FPOBJ) $(LIBOBJ): stdiolib.h stdio.h
|
|
+
|
|
+ Hide: site.h
|
|
+ rm -f Hidden
|
|
+ -if grep -s "define HIDDEN" site.h ; then \
|
|
+ $(CPP) stub.x >Hidden ; \
|
|
+ for f in `grep '^.define [a-z]' hidden.h | \
|
|
+ sed 's/^.define \([a-z]*\).*/\1/'` ; do \
|
|
+ echo $${f} ; \
|
|
+ sed -e "s/XYZ/$${f}/g" < Hidden > _u_$${f}.x ; \
|
|
+ libpack < _u_$${f}.x > _u_$${f}.s ; \
|
|
+ done ; \
|
|
+ fi
|
|
+ echo -n >Hide
|
|
+
|
|
+ # Put together a library
|
|
+
|
|
+ FPobjects: $(FPOBJ)
|
|
+
|
|
+ FPorder: $(FPOBJ) Hide
|
|
+ echo -n >FPorder
|
|
+ -if test -f Hidden ; then \
|
|
+ ls _u_*print*.s _u_*scan*.s >> FPorder ; \
|
|
+ fi
|
|
+ ls $(FPOBJ) > FPorder.tmp
|
|
+ $(LORDER) `cat FPorder.tmp` | $(TSORT) >> FPorder; \
|
|
+ rm -f FPorder.tmp FPsort.tmp
|
|
+
|
|
+ FParchive: FPorder
|
|
+ rm -f $(FPLib)
|
|
+ ar cr $(FPLib) `cat FPorder`
|
|
+ $(RANLIB) stdiofp.a
|
|
+
|
|
+ Liborder: $(LIBOBJ) Hide
|
|
+ echo -n >Liborder
|
|
+ -if test -f Hidden ; then \
|
|
+ ls _u_*.s >> Liborder ; \
|
|
+ fi
|
|
+ ls $(LIBOBJ) > Liborder.tmp
|
|
+ $(LORDER) `cat Liborder.tmp` | $(TSORT) >> Liborder; \
|
|
+ rm -f Liborder.tmp
|
|
+
|
|
+ stdio $(StdioLib): Liborder
|
|
+ rm -f $(StdioLib)
|
|
+ ar cr $(StdioLib) `cat Liborder`
|
|
+ $(RANLIB) stdio.a
|
|
+
|
|
+ stdiofp $(FPLib):
|
|
+ $(MAKE) FPobjects "CC=$(FPCC)" "LD=$(FPLD)"
|
|
+ $(MAKE) FParchive
|
|
+
|
|
+ # Pretty list of objects
|
|
+
|
|
+ fpfiles:
|
|
+ ls _f_*.c | sed -e 's/\.c/.O/g' | \
|
|
+ pr -3 -l1 -t -w60 > FPfiles
|
|
+ sed -e 's/O *$$/O \\/' -e '$$s/ \\$$//' < FPfiles > FPfiles.new
|
|
+ mv FPfiles.new FPfiles
|
|
+
|
|
+ libfiles:
|
|
+ ls [_a-wz]*.c | sed -e '/^_f_/d' -e 's/\.c/.O/g' | \
|
|
+ pr -3 -l1 -t -w60 > Libfiles
|
|
+ sed -e 's/O *$$/O \\/' -e '$$s/ \\$$//' < Libfiles > Libfiles.new
|
|
+ mv Libfiles.new Libfiles
|
|
+
|
|
+ # Clean
|
|
+
|
|
+ clean:
|
|
+ rm -f $(LIBOBJ)
|
|
+ rm -f $(FPOBJ)
|
|
+ rm -f _u_*
|
|
+ rm -f $(StdioLib) $(FPLib)
|
|
+ rm -f $(Testdir)*.s $(Fptestdir)*.s $(Installdir)*.s
|
|
+ for d in $(Testdir) $(Fptestdir) $(Installdir) ; do \
|
|
+ cd $$d ; \
|
|
+ rm -f core *.out ; \
|
|
+ for f in *.c ; do \
|
|
+ e=`basename $$f .c` ; \
|
|
+ rm -f -o $$e ; \
|
|
+ done ; \
|
|
+ cd .. ; \
|
|
+ done
|
|
+ rm -f *~ core *.out *order Hid* test.dat
|
|
+ rm -f *files *.tmp
|
|
+ rm -f estdio.u* estdio.[01]?
|
|
+
|
|
+ # Site
|
|
+
|
|
+ site:
|
|
+ -cdiff stdio.g stdio.h > $(Installdir)ack.sit
|
|
+ -if test ! -f site.h ; then \
|
|
+ echo site.h not installed ; \
|
|
+ else \
|
|
+ LINES=`wc -l < site.h | sed 's/ //g'` ; \
|
|
+ DATE=`date` ; \
|
|
+ echo "*** site.h $${DATE}" >> $(Installdir)ack.sit ; \
|
|
+ echo "--- site.h $${DATE}" >> $(Installdir)ack.sit ; \
|
|
+ echo "***************" >> $(Installdir)ack.sit ; \
|
|
+ echo "*** 0 ****" >> $(Installdir)ack.sit ; \
|
|
+ echo "--- 1,$${LINES} ----" >> $(Installdir)ack.sit ; \
|
|
+ sed -e 's/^/+ /' < site.h >> $(Installdir)ack.sit ; \
|
|
+ fi
|
|
+ -if test ! -f Makefile ; then \
|
|
+ echo Makefile not installed ; \
|
|
+ else \
|
|
+ LINES=`wc -l < Makefile | sed 's/ //g'` ; \
|
|
+ DATE=`date` ; \
|
|
+ echo "*** Makefile $${DATE}" >> $(Installdir)ack.sit ; \
|
|
+ echo "--- Makefile $${DATE}" >> $(Installdir)ack.sit ; \
|
|
+ echo "***************" >> $(Installdir)ack.sit ; \
|
|
+ echo "*** 0 ****" >> $(Installdir)ack.sit ; \
|
|
+ echo "--- 1,$${LINES} ----" >> $(Installdir)ack.sit ; \
|
|
+ sed -e 's/^/+ /' < Makefile >> $(Installdir)ack.sit ; \
|
|
+ fi
|
|
+ -if test -s errlist.h ; then \
|
|
+ LINES=`wc -l < errlist.h | sed 's/ //g'` ; \
|
|
+ DATE=`date` ; \
|
|
+ echo "*** errlist.h $${DATE}" >> $(Installdir)ack.sit ; \
|
|
+ echo "--- errlist.h $${DATE}" >> $(Installdir)ack.sit ; \
|
|
+ echo "***************" >> $(Installdir)ack.sit ; \
|
|
+ echo "*** 0 ****" >> $(Installdir)ack.sit ; \
|
|
+ echo "--- 1,$${LINES} ----" >> $(Installdir)ack.sit ; \
|
|
+ sed -e 's/^/+ /' < errlist.h >> $(Installdir)ack.sit ; \
|
|
+ fi
|
|
+ -if test -s powers.h ; then \
|
|
+ LINES=`wc -l < powers.h | sed 's/ //g'` ; \
|
|
+ DATE=`date` ; \
|
|
+ echo "*** powers.h $${DATE}" >> $(Installdir)ack.sit ; \
|
|
+ echo "--- powers.h $${DATE}" >> $(Installdir)ack.sit ; \
|
|
+ echo "***************" >> $(Installdir)ack.sit ; \
|
|
+ echo "*** 0 ****" >> $(Installdir)ack.sit ; \
|
|
+ echo "--- 1,$${LINES} ----" >> $(Installdir)ack.sit ; \
|
|
+ sed -e 's/^/+ /' < powers.h >> $(Installdir)ack.sit ; \
|
|
+ fi
|
|
+ -if test -s lmr.h ; then \
|
|
+ LINES=`wc -l < lmr.h | sed 's/ //g'` ; \
|
|
+ DATE=`date` ; \
|
|
+ echo "*** lmr.h $${DATE}" >> $(Installdir)ack.sit ; \
|
|
+ echo "--- lmr.h $${DATE}" >> $(Installdir)ack.sit ; \
|
|
+ echo "***************" >> $(Installdir)ack.sit ; \
|
|
+ echo "*** 0 ****" >> $(Installdir)ack.sit ; \
|
|
+ echo "--- 1,$${LINES} ----" >> $(Installdir)ack.sit ; \
|
|
+ sed -e 's/^/+ /' < lmr.h >> $(Installdir)ack.sit ; \
|
|
+ fi
|
|
+
|
|
+ # Distribution
|
|
+
|
|
+ distribution:
|
|
+ ls $(All) | \
|
|
+ sed -e '/^stdio\.h/d' \
|
|
+ -e '/^site\.h/d' \
|
|
+ -e '/^errlist\.h/d' \
|
|
+ -e '/^powers\.h/d' \
|
|
+ -e '/^lmr\.h/d' \
|
|
+ -e '/^_u_/d' > files
|
|
+
|
|
+ # Arc
|
|
+
|
|
+ arc: distribution
|
|
+ rm -f estdio.arc
|
|
+ arc a estdio.arc @files
|
|
+
|
|
+ # Tar
|
|
+
|
|
+ tar estdio.taz: distribution
|
|
+ rm -f estdio.taz
|
|
+ tar cvf - `cat files` | compress -b13 > estdio.taz
|
|
+
|
|
+ # Distribution by tar parts
|
|
+
|
|
+ uu: distribution
|
|
+ rm -f estdio.u*
|
|
+ tar cvf - `cat files` | \
|
|
+ compress -b13 | \
|
|
+ uuencode estdio.taz | \
|
|
+ split -300 - estdio.u
|
|
+ for f in estdio.u* ; do \
|
|
+ echo '------ Cut Here ------' > uu.tmp ; \
|
|
+ cat $$f >> uu.tmp ; \
|
|
+ echo '------ Cut Here ------' >> uu.tmp ; \
|
|
+ mv uu.tmp $$f ; \
|
|
+ done
|
|
+
|
|
+ # Shell archive
|
|
+
|
|
+ shar: distribution
|
|
+ rm -f estdio.[0-9][0-9]*
|
|
+ sed -e '/^site\.h/d' \
|
|
+ -e '/^stdio\.h/d' \
|
|
+ -e 's%.*\.x%& Assembler stub%' \
|
|
+ -e 's%^TEST/.*%& Exercise file%' \
|
|
+ -e 's%^FPTEST/.*%& Exercise file%' \
|
|
+ -e 's%^INSTALL/.*\.c%& Installation file%' \
|
|
+ -e 's%^INSTALL/.*\.sh%& Installation script%' \
|
|
+ -e 's%^INSTALL/.*\.txt%& Documentation%' \
|
|
+ -e 's%^INSTALL/.*\.sit%& Differences for preconfigured sites%' \
|
|
+ -e 's%^INSTALL/.*\.ans%& Answer file for generating sites%' \
|
|
+ -e 's%^makefile.cpp$$%& Cppmake file%' \
|
|
+ -e 's%^makefile.[a-z]*$$%& Makefile%' \
|
|
+ -e 's%^[0-9a-z_]*\.g$$%& Header file source%' \
|
|
+ -e 's%^[0-9a-z_]*\.h$$%& Header file%' \
|
|
+ -e 's%^_z.*\.c$$%& Stdio fake source code%' \
|
|
+ -e 's%^[0-9a-z_]*\.c$$%& Stdio source code%' < files > MANIFEST
|
|
+ shar -a -n estdio -C -b13 -c -o estdio -l 40 MANIFEST `cat files`
|
|
+
|
|
+ # Dust and dirt
|
|
+
|
|
+ lint:
|
|
+ lint -n $(Include) $(Define) `echo $(LIBOBJ) | sed 's/\.o/.c/g'`
|
|
+
|
|
+ # Makefiles
|
|
+
|
|
+ makefiles:
|
|
+ -for w in $(Everyone) ; do \
|
|
+ n=`grep "^.$$w " <makefile.cpp | sed 's/^.[^ ]* //'` ; \
|
|
+ echo $$n ; \
|
|
+ if test _MINIX = $$n ; then \
|
|
+ cppmake -o makefile.$$w ; \
|
|
+ rm -f Makefile ; \
|
|
+ cp makefile.$$w Makefile ; \
|
|
+ else \
|
|
+ cppmake -U_MINIX -D$$n -o makefile.$$w ; \
|
|
+ fi ; \
|
|
+ done
|
|
*** errlist.h Sun Nov 4 08:53:58 1990
|
|
--- errlist.h Sun Nov 4 08:53:58 1990
|
|
***************
|
|
*** 0 ****
|
|
--- 1,40 ----
|
|
+ /* EUNKNOWN 0 */ "Unknown error",
|
|
+ /* EPERM 1 */ "Not owner",
|
|
+ /* ENOENT 2 */ "No such file or directory",
|
|
+ /* ESRCH 3 */ "No such process",
|
|
+ /* EINTR 4 */ "Interrupted system call",
|
|
+ /* EIO 5 */ "I/O error",
|
|
+ /* ENXIO 6 */ "No such device or address",
|
|
+ /* E2BIG 7 */ "Arg list too long",
|
|
+ /* ENOEXEC 8 */ "Exec format error",
|
|
+ /* EBADF 9 */ "Bad file number",
|
|
+ /* ECHILD 10 */ "No children",
|
|
+ /* EAGAIN 11 */ "No more processes",
|
|
+ /* ENOMEM 12 */ "Not enough core",
|
|
+ /* EACCES 13 */ "Permission denied",
|
|
+ /* EFAULT 14 */ "Bad address",
|
|
+ /* ENOTBLK 15 */ "Block device required",
|
|
+ /* EBUSY 16 */ "Mount device busy",
|
|
+ /* EEXIST 17 */ "File exists",
|
|
+ /* EXDEV 18 */ "Cross-device link",
|
|
+ /* ENODEV 19 */ "No such device",
|
|
+ /* ENOTDIR 20 */ "Not a directory",
|
|
+ /* EISDIR 21 */ "Is a directory",
|
|
+ /* EINVAL 22 */ "Invalid argument",
|
|
+ /* ENFILE 23 */ "File table overflow",
|
|
+ /* EMFILE 24 */ "Too many open files",
|
|
+ /* ENOTTY 25 */ "Not a typewriter",
|
|
+ /* ETXTBSY 26 */ "Text file busy",
|
|
+ /* EFBIG 27 */ "File too large",
|
|
+ /* ENOSPC 28 */ "No space left on device",
|
|
+ /* ESPIPE 29 */ "Illegal seek",
|
|
+ /* EROFS 30 */ "Read-only file system",
|
|
+ /* EMLINK 31 */ "Too many links",
|
|
+ /* EPIPE 32 */ "Broken pipe",
|
|
+ /* EDOM 33 */ "Math argument",
|
|
+ /* ERANGE 34 */ "Result too large",
|
|
+ /* EDEADLK 35 */ "Resource deadlock avoided",
|
|
+ /* ENAMETOOLONG 36 */ "Filename too long",
|
|
+ /* ENOLCK 37 */ "No locks available",
|
|
+ /* ENOSYS 38 */ "Function not implemented",
|
|
+ /* ENOTEMPTY 39 */ "Directory not empty"
|