ast@cs.vu.nl (Andy Tanenbaum) (01/23/89)
: This is a shar archive. Extract with sh, not csh. : This archive ends with exit, so do not worry about trailing junk. : --------------------------- cut here -------------------------- PATH=/bin:/usr/bin:/usr/ucb echo Extracting 'ctype.h' sed 's/^X//' > 'ctype.h' << '+ END-OF-FILE ''ctype.h' X/* ctype.h */ X X/* Added isgraph(3) and toascii(3); renamed _toupper(3) */ X/* and _tolower(3) Terrence W. Holm Oct. 1988 */ X Xextern char _ctype_[]; X X#define _U 0001 X#define _L 0002 X#define _N 0004 X#define _S 0010 X#define _P 0020 X#define _C 0040 X#define _X 0100 X#define _SP 0200 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]&(_SP|_P|_U|_L|_N)) 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 X#define _toupper(c) ((c) - 'a' + 'A') X#define _tolower(c) ((c) - 'A' + 'a') X#define toascii(c) ((c) & 0177) + END-OF-FILE ctype.h chmod 'u=rw,g=r,o=r' 'ctype.h' set `wc -c 'ctype.h'` count=$1 case $count in 919) :;; *) echo 'Bad character count in ''ctype.h' >&2 echo 'Count should be 919' >&2 esac echo Extracting 'dir.h' sed 's/^X//' > 'dir.h' << '+ END-OF-FILE ''dir.h' X#define DIRBLKSIZ 512 /* size of directory block */ X X#ifndef DIRSIZ X#define DIRSIZ 14 X#endif X Xstruct direct { X ino_t d_ino; X char d_name[DIRSIZ]; X}; + END-OF-FILE dir.h chmod 'u=rw,g=r,o=r' 'dir.h' set `wc -c 'dir.h'` count=$1 case $count in 150) :;; *) echo 'Bad character count in ''dir.h' >&2 echo 'Count should be 150' >&2 esac echo Extracting 'dirent.h' sed 's/^X//' > 'dirent.h' << '+ END-OF-FILE ''dirent.h' X/* X <dirent.h> -- definitions for SVR3 directory access routines X X last edit: 25-Apr-1987 D A Gwyn X X Prerequisite: <sys/types.h> X*/ X X#include <sys/dirent.h> X X#define DIRBUF 1024 /* buffer size for fs-indep. dirs */ X /* must in general be larger than the filesystem buffer size */ X Xtypedef struct X { X int dd_fd; /* file descriptor */ X int dd_loc; /* offset in block */ X int dd_size; /* amount of valid data */ X char *dd_buf; /* -> directory block */ X } DIR; /* stream data from opendir() */ X Xextern DIR *opendir(); Xextern struct dirent *readdir(); Xextern off_t telldir(); Xextern void seekdir(); Xextern void rewinddir(); Xextern int closedir(); X X#ifndef NULL X#define NULL 0 /* DAG -- added for convenience */ X#endif + END-OF-FILE dirent.h chmod 'u=rw,g=r,o=r' 'dirent.h' set `wc -c 'dirent.h'` count=$1 case $count in 730) :;; *) echo 'Bad character count in ''dirent.h' >&2 echo 'Count should be 730' >&2 esac echo Extracting 'string.h.proto' sed 's/^X//' > 'string.h.proto' << '+ END-OF-FILE ''string.h.proto' X/* X# String library. Author: Henry Spencer X X# Configuration settings: how should "size_t", "void *", "const" be written? X# "size_t" is what's needed to hold the result of sizeof; beware of problems X# with compatibility here, because X3J11 uses this for e.g. the third X# argument of strncpy() as well. You may need to make it "int" even if X# this is a lie. "void *" is the generic pointer type, "char *" in most X# existing implementations. "const" is the keyword marking read-only X# variables and parameters, unimplemented in most existing implementations. X# These things need to be defined this way because they must be fitted into X# both the .h files and the .c files; see the make instructions for string.h X# in the Makefile. X XSIZET = int XVOIDSTAR = char * XLVOIDSTAR = char* # Lint shell file has problems with * alone. Barf. XCONST = X*/ X X/* X * String functions. X */ X XVOIDSTAR memcpy(/*VOIDSTAR dst, const VOIDSTAR src, SIZET size*/); XVOIDSTAR memccpy(/*VOIDSTAR dst, const VOIDSTAR src, int ucharstop, SIZET size*/); Xchar *strcpy(/*char *dst, const char *src*/); Xchar *strncpy(/*char *dst, const char *src, SIZET size*/); Xchar *strcat(/*char *dst, const char *src*/); Xchar *strncat(/*char *dst, const char *src, SIZET size*/); Xint memcmp(/*const VOIDSTAR s1, const VOIDSTAR s2, SIZET size*/); Xint strcmp(/*const char *s1, const char *s2*/); Xint strncmp(/*const char *s1, const char *s2, SIZET size*/); XVOIDSTAR memchr(/*const VOIDSTAR s, int ucharwanted, SIZET size*/); Xchar *strchr(/*const char *s, int charwanted*/); XSIZET strcspn(/*const char *s, const char *reject*/); Xchar *strpbrk(/*const char *s, const char *breakat*/); Xchar *strrchr(/*const char *s, int charwanted*/); XSIZET strspn(/*const char *s, const char *accept*/); Xchar *strstr(/*const char *s, const char *wanted*/); Xchar *strtok(/*char *s, const char *delim*/); XVOIDSTAR memset(/*VOIDSTAR s, int ucharfill, SIZET size*/); XSIZET strlen(/*const char *s*/); X X/* X * V7 and Berklix compatibility. X */ Xchar *index(/*const char *s, int charwanted*/); Xchar *rindex(/*const char *s, int charwanted*/); Xint bcopy(/*const char *src, char *dst, int length*/); Xint bcmp(/*const char *s1, const char *s2, int length*/); Xint bzero(/*char *dst, int length*/); X X/* X * Putting this in here is really silly, but who am I to argue with X3J11? X */ Xchar *strerror(/*int errnum*/); + END-OF-FILE string.h.proto chmod 'u=rw,g=r,o=r' 'string.h.proto' set `wc -c 'string.h.proto'` count=$1 case $count in 2336) :;; *) echo 'Bad character count in ''string.h.proto' >&2 echo 'Count should be 2336' >&2 esac echo Extracting 'sys_dirent.h' sed 's/^X//' > 'sys_dirent.h' << '+ END-OF-FILE ''sys_dirent.h' X/* X <sys/dirent.h> -- file system independent directory entry (SVR3) X X last edit: 27-Oct-1988 D A Gwyn X X prerequisite: <sys/types.h> X*/ X Xstruct dirent /* data from getdents()/readdir() */ X { X long d_ino; /* inode number of entry */ X off_t d_off; /* offset of disk directory entry */ X unsigned short d_reclen; /* length of this record */ X char d_name[1]; /* name of file */ /* non-ANSI */ X }; X X#ifdef BSD_SYSV /* (e.g., when compiling getdents.c) */ Xextern struct dirent __dirent; /* (not actually used) */ X/* The following is portable, although rather silly. */ X#define DIRENTBASESIZ (__dirent.d_name - (char *)&__dirent.d_ino) X X#else X/* The following nonportable ugliness could have been avoided by defining X DIRENTSIZ and DIRENTBASESIZ to also have (struct dirent *) arguments. X There shouldn't be any problem if you avoid using the DIRENTSIZ() macro. */ X X#define DIRENTBASESIZ (((struct dirent *)0)->d_name \ X - (char *)&((struct dirent *)0)->d_ino) X#endif X X#define DIRENTSIZ( namlen ) ((DIRENTBASESIZ + sizeof(long) + (namlen)) \ X / sizeof(long) * sizeof(long)) X X/* DAG -- the following was moved from <dirent.h>, which was the wrong place */ X#define MAXNAMLEN 512 /* maximum filename length */ X X#ifndef NAME_MAX X#define NAME_MAX (MAXNAMLEN - 1) /* DAG -- added for POSIX */ X#endif + END-OF-FILE sys_dirent.h chmod 'u=rw,g=r,o=r' 'sys_dirent.h' set `wc -c 'sys_dirent.h'` count=$1 case $count in 1310) :;; *) echo 'Bad character count in ''sys_dirent.h' >&2 echo 'Count should be 1310' >&2 esac echo Extracting 'varargs.h' sed 's/^X//' > 'varargs.h' << '+ END-OF-FILE ''varargs.h' X/* varargs.h */ X Xtypedef char *va_list; X X#define va_dcl int va_alist; X#define va_start(p) (p) = (va_list) &va_alist; X#define va_arg(p,type) ( (type *) ((p)+=sizeof(type)) )[-1] X#define va_end(p) X X#define vfprintf _doprintf X#define vprintf(fmt,args) vfprintf(stdout,fmt,args) + END-OF-FILE varargs.h chmod 'u=rw,g=r,o=r' 'varargs.h' set `wc -c 'varargs.h'` count=$1 case $count in 283) :;; *) echo 'Bad character count in ''varargs.h' >&2 echo 'Count should be 283' >&2 esac exit 0