This commit is contained in:
seta75D
2021-10-11 18:37:13 -03:00
commit ff309bfe1c
14130 changed files with 3180272 additions and 0 deletions

48
5include/Makefile Normal file
View File

@@ -0,0 +1,48 @@
#
# @(#)Makefile 1.1 94/10/31 SMI; from UCB 4.3 83/07/10
#
# Doing a make install builds /usr/5include
#
# The ``rm -rf''s used below are safe because rm doesn't
# follow symbolic links.
#
DESTDIR=
SUBDIRS=sys
STD= assert.h \
ctype.h \
grp.h \
malloc.h \
pwd.h \
stdio.h \
stdlib.h \
time.h
LINKS= fcntl.h
CHOWN= /etc/chown
all: $(SUBDIRS) ${STD} $(LINKS)
$(SUBDIRS): FRC
@set -x;for i in $(SUBDIRS); do ( cd $$i; $(MAKE) ); done
$(LINKS): $(SUBDIRS)
rm -f $@;
ln -s sys/$@ $@
FRC:
install: all
install -d -o bin -m 755 ${DESTDIR}/usr/5include
install -d -o bin -m 755 ${DESTDIR}/usr/5include/sys
@set -x;(cd sys; for j in *.h; do \
install -c -m 444 $$j ${DESTDIR}/usr/5include/sys/$$j; \
done)
-for i in ${STD}; do \
install -c -m 444 $$i ${DESTDIR}/usr/5include/$$i; \
done
(cd ../usr.lib/libcurses; ${MAKE} DESTDIR=${DESTDIR} install_h)
-for i in ${LINKS}; do \
rm -f ${DESTDIR}/usr/5include/$$i; \
ln -s sys/$$i ${DESTDIR}/usr/5include/$$i; \
done
clean:

13
5include/assert.h Normal file
View File

@@ -0,0 +1,13 @@
/* @(#)assert.h 1.1 94/10/31 SMI; from S5R2 1.4 */
#ifndef _assert_h
#define _assert_h
#ifdef NDEBUG
#define assert(EX)
#else
extern void _assert();
#define assert(EX) if (EX) ; else _assert("EX", __FILE__, __LINE__)
#endif
#endif /*!_assert_h*/

74
5include/ctype.h Normal file
View File

@@ -0,0 +1,74 @@
/* @(#)ctype.h 1.1 94/10/31 SMI; from S5R3.1 1.9 */
/* Copyright (c) 1984 AT&T */
/* All Rights Reserved */
/* Portions Copyright (c) 1989 Sun Microsystems, Inc. */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
#ifndef __ctype_h
#define __ctype_h
#define _U 01 /* Upper case */
#define _L 02 /* Lower case */
#define _N 04 /* Numeral (digit) */
#define _S 010 /* Spacing character */
#define _P 020 /* Punctuation */
#define _C 040 /* Control character */
#define _X 0100 /* heXadecimal digit */
#define _B 0200 /* Blank */
extern int isalnum(/* int c */);
extern int isalpha(/* int c */);
#ifndef _POSIX_SOURCE
extern int isascii(/* int c */);
#endif
extern int iscntrl(/* int c */);
extern int isdigit(/* int c */);
extern int isgraph(/* int c */);
extern int islower(/* int c */);
extern int isprint(/* int c */);
extern int ispunct(/* int c */);
extern int isspace(/* int c */);
extern int isupper(/* int c */);
extern int isxdigit(/* int c */);
#ifndef _POSIX_SOURCE
extern int toascii(/* int c */);
#endif
extern int tolower(/* int c */);
extern int toupper(/* int c */);
#ifndef lint
#define isalnum(c) ((_ctype_ + 1)[c] & (_U | _L | _N))
#define isalpha(c) ((_ctype_ + 1)[c] & (_U | _L))
#ifndef _POSIX_SOURCE
#define isascii(c) (!((c) & ~0177))
#endif
#define iscntrl(c) ((_ctype_ + 1)[c] & _C)
#define isdigit(c) ((_ctype_ + 1)[c] & _N)
#define isgraph(c) ((_ctype_ + 1)[c] & (_P | _U | _L | _N))
#define islower(c) ((_ctype_ + 1)[c] & _L)
#define isprint(c) ((_ctype_ + 1)[c] & (_P | _U | _L | _N | _B))
#define ispunct(c) ((_ctype_ + 1)[c] & _P)
#define isspace(c) ((_ctype_ + 1)[c] & _S)
#define isupper(c) ((_ctype_ + 1)[c] & _U)
#define isxdigit(c) ((_ctype_ + 1)[c] & _X)
#ifndef _POSIX_SOURCE
#define toascii(c) ((c) & 0177)
/*
* These upper/lower macros are not codeset independent
*/
#define _toupper(c) ((c) - 'a' + 'A')
#define _tolower(c) ((c) - 'A' + 'a')
#endif
extern char _ctype_[];
#endif /* lint */
#endif /* !__ctype_h */

36
5include/grp.h Normal file
View File

@@ -0,0 +1,36 @@
/* @(#)grp.h 1.1 94/10/31 SMI */
#ifndef __grp_h
#define __grp_h
#include <sys/types.h>
/*
* We have to make this POSIX.1 compatible header compatible with SunOS
* Release 4.0.x and the BSD interface provided by /usr/include/grp.h
* so we have a filler to make the gid_t gr_gid field here match the
* int gr_gid field there.
* This will all go away in a later release when gid_t is enlarged.
* Until then watch out for big- vs. little-endian problems in the filler.
*/
struct group { /* see getgrent(3) */
char *gr_name;
char *gr_passwd;
#if defined(mc68000) || defined(sparc)
short gr_gid_filler;
#endif
gid_t gr_gid;
#if defined(i386)
short gr_gid_filler;
#endif
char **gr_mem;
};
#ifndef _POSIX_SOURCE
struct group *getgrent();
#endif
struct group *getgrgid(/* gid_t gid */);
struct group *getgrnam(/* char *name */);
#endif /* !__grp_h */

47
5include/malloc.h Normal file
View File

@@ -0,0 +1,47 @@
/* @(#)malloc.h 1.1 94/10/31 SMI; from include/malloc.h 1.5 */
#ifndef __malloc_h
#define __malloc_h
/*
* Constants defining mallopt operations
*/
#define M_MXFAST 1 /* set size of 'small blocks' */
#define M_NLBLKS 2 /* set num of small blocks in holding block */
#define M_GRAIN 3 /* set rounding factor for small blocks */
#define M_KEEP 4 /* (nop) retain contents of freed blocks */
/*
* malloc information structure
*/
struct mallinfo {
int arena; /* total space in arena */
int ordblks; /* number of ordinary blocks */
int smblks; /* number of small blocks */
int hblks; /* number of holding blocks */
int hblkhd; /* space in holding block headers */
int usmblks; /* space in small blocks in use */
int fsmblks; /* space in free small blocks */
int uordblks; /* space in ordinary blocks in use */
int fordblks; /* space in free ordinary blocks */
int keepcost; /* cost of enabling keep option */
int mxfast; /* max size of small blocks */
int nlblks; /* number of small blocks in a holding block */
int grain; /* small block rounding factor */
int uordbytes; /* space (including overhead) allocated in ord. blks */
int allocated; /* number of ordinary blocks allocated */
int treeoverhead; /* bytes used in maintaining the free tree */
};
typedef void * malloc_t;
extern malloc_t calloc(/* size_t nmemb, size_t size */);
extern void free(/* malloc_t ptr */);
extern malloc_t malloc(/* size_t size */);
extern malloc_t realloc(/* malloc_t ptr, size_t size */);
extern int mallopt();
extern struct mallinfo mallinfo();
#endif /* !__malloc_h */

57
5include/pwd.h Normal file
View File

@@ -0,0 +1,57 @@
/* @(#)pwd.h 1.1 94/10/31 SMI; from S5R2 1.1 */
#ifndef __pwd_h
#define __pwd_h
#include <sys/types.h>
/*
* We have to make this POSIX.1 compatible header compatible with SunOS
* Release 4.0.x and the BSD interface provided by /usr/include/pwd.h
* so we have fillers to make the gid_t pw_gid field here match the
* int pw_gid field there and the uid_t pw_uid field here match the
* int pw_uid field there.
* This will all go away in a later release when gid_t is enlarged.
* Until then watch out for big- vs. little-endian problems in the filler.
*/
struct passwd {
char *pw_name;
char *pw_passwd;
#if defined(mc68000) || defined(sparc)
short pw_uid_filler;
#endif
uid_t pw_uid;
#if defined(i386)
short pw_uid_filler;
#endif
#if defined(mc68000) || defined(sparc)
short pw_gid_filler;
#endif
gid_t pw_gid;
#if defined(i386)
short pw_gid_filler;
#endif
char *pw_age;
char *pw_comment;
char *pw_gecos;
char *pw_dir;
char *pw_shell;
};
#ifndef _POSIX_SOURCE
extern struct passwd *getpwent();
struct comment {
char *c_dept;
char *c_name;
char *c_acct;
char *c_bin;
};
#endif
struct passwd *getpwuid(/* uid_t uid */);
struct passwd *getpwnam(/* char *name */);
#endif /* !__pwd_h */

181
5include/stdio.h Normal file
View File

@@ -0,0 +1,181 @@
/* @(#)stdio.h 1.1 94/10/31 SMI; from S5R2 2.7 */
#ifdef comment /* ======================================================= */
"Standard" header file definition. See the C style paper for
full explanations. Note that this reorganization has been
forced upon us by ANSI C; please abide by it. This file, aside
from this comment, is supposed to be a good example.
/* sccs id stuff */
#ifndef __[dir_]_filename_h
#define __[dir_]_filename_h
#include /* all includes come first */
#define /* all defines other than function like macros */
structs
unions
enums
function prototypes
/*
* macros that are supplied as C functions have to be defined after
* the C prototype.
*/
#define /* all function like macros */
extern variables
#endif __[dir_]_filename_h
#endif /* comment ======================================================= */
#ifndef __stdio_h
#define __stdio_h
#include <sys/stdtypes.h> /* for size_t */
#if pdp11
#define BUFSIZ 512
#elif u370
#define BUFSIZ 4096
#else /* just about every other UNIX system in existence */
#define BUFSIZ 1024
#endif
#ifndef EOF
#define EOF (-1)
#endif
#define L_ctermid 9
#define L_cuserid 9
#define L_tmpnam 25 /* (sizeof (_tmpdir) + 15) */
#define _tmpdir "/usr/tmp/"
#define FILENAME_MAX 1025
#define TMP_MAX 17576
/*
* ANSI C requires definitions of SEEK_CUR, SEEK_END, and SEEK_SET here.
* They must be kept in sync with SEEK_* in <sys/unistd.h> (as required
* by POSIX.1) and L_* in <sys/file.h>.
* FOPEN_MAX should follow definition of _POSIX_OPEN_MAX in <sys/unistd.h>.
*/
#ifndef SEEK_SET
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif
#define FOPEN_MAX 16
#ifndef _POSIX_SOURCE
#define P_tmpdir _tmpdir
#endif
#ifndef NULL
#define NULL 0
#endif
#define stdin (&_iob[0])
#define stdout (&_iob[1])
#define stderr (&_iob[2])
/*
* _IOLBF means that a file's output will be buffered line by line
* In addition to being flags, _IONBF, _IOLBF and _IOFBF are possible
* values for "type" in setvbuf.
*/
#define _IOFBF 0000
#define _IOREAD 0001
#define _IOWRT 0002
#define _IONBF 0004
#define _IOMYBUF 0010
#define _IOEOF 0020
#define _IOERR 0040
#define _IOSTRG 0100
#define _IOLBF 0200
#define _IORW 0400
/*
* buffer size for multi-character output to unbuffered files
*/
#define _SBFSIZ 8
typedef struct {
#if pdp11 || u370
unsigned char *_ptr;
int _cnt;
#else /* just about every other UNIX system in existence */
int _cnt;
unsigned char *_ptr;
#endif
unsigned char *_base;
int _bufsiz;
short _flag;
unsigned char _file; /* should be short */
} FILE;
#ifndef _POSIX_SOURCE
extern char *ctermid(/* char *s */); /* unistd.h */
extern char *cuserid(/* char *s */); /* unistd.h */
extern FILE *popen(/* char *prog, char *mode */);
extern char *tempnam(/* char *d, char *s */);
#endif
extern void clearerr(/* FILE *stream */);
extern int fclose(/* FILE *f */);
extern FILE *fdopen(/* int fd, char *type */);
extern int feof(/* FILE *f */);
extern int ferror(/* FILE *f */);
extern int fflush(/* FILE *f */);
extern int fgetc(/* FILE *f */);
extern int fileno(/* FILE *f */);
extern FILE *fopen(/* const char *path, const char *mode */);
extern char *fgets(/* char *s, int n, FILE *f */);
extern int fprintf(/* FILE *f, const char *fmt, ... */);
extern int fputc(/* int c, FILE *f */);
extern int fputs(/* const char *s, FILE *f */);
extern size_t fread(/* void *ptr, size_t size, size_t nmemb, FILE *f */);
extern FILE *freopen(/* const char *filename, const char *mode, FILE *f */);
extern int fscanf(/* FILE *f, const char *format, ... */);
extern int fseek(/* FILE *f, long int offset, int whence */);
extern long ftell(/* FILE *f */);
extern size_t fwrite(/* const void *p, size_t size, size_t nmemb, FILE *f */);
extern int getc(/* FILE *f */);
extern int getchar(/* void */);
extern char *gets(/* char *s */);
extern void perror(/* const char *s */);
extern int printf(/* const char *fmt, ... */);
extern int putc(/* int c, FILE *f */);
extern int putchar(/* int c */);
extern int puts(/* const char *s */);
extern int remove(/* const char *filename */);
extern int rename(/* char *old, char *new */);
extern void rewind(/* FILE *f */);
extern int scanf(/* const char *format, ... */);
extern void setbuf(/* FILE *f, char *b */);
extern int sprintf(/* char *s, const char *fmt, ... */);
extern int sscanf(/* const char *s, const char *format, ... */);
extern FILE *tmpfile(/* void */);
extern char *tmpnam(/* char *s */);
extern int ungetc(/* int c, FILE *f */);
#ifndef lint
#define getc(p) (--(p)->_cnt >= 0 ? ((int) *(p)->_ptr++) : _filbuf(p))
#define putc(x, p) (--(p)->_cnt >= 0 ?\
(int)(*(p)->_ptr++ = (unsigned char)(x)) :\
(((p)->_flag & _IOLBF) && -(p)->_cnt < (p)->_bufsiz ?\
((*(p)->_ptr = (unsigned char)(x)) != '\n' ?\
(int)(*(p)->_ptr++) :\
_flsbuf(*(unsigned char *)(p)->_ptr, p)) :\
_flsbuf((unsigned char)(x), p)))
#define getchar() getc(stdin)
#define putchar(x) putc((x), stdout)
#define clearerr(p) ((void) ((p)->_flag &= ~(_IOERR | _IOEOF)))
#define feof(p) (((p)->_flag & _IOEOF) != 0)
#define ferror(p) (((p)->_flag & _IOERR) != 0)
#define fileno(p) (p)->_file
#endif
extern FILE _iob[];
#endif /* !__stdio_h */

49
5include/stdlib.h Normal file
View File

@@ -0,0 +1,49 @@
/* @(#)stdlib.h 1.1 94/10/31 SMI */
/*
* stdlib.h
*/
#ifndef __stdlib_h
#define __stdlib_h
#include <sys/stdtypes.h> /* to get size_t */
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
#define RAND_MAX 0x7fff
#ifndef NULL
#define NULL 0
#endif
extern unsigned int _mb_cur_max;
#define MB_CUR_MAX _mb_cur_max
/* declaration of various libc functions */
extern void abort(/* void */);
extern int abs(/* int j */);
extern double atof(/* const char *nptr */);
extern int atoi(/* const char *nptr */);
extern long int atol(/* const char *nptr */);
extern void * bsearch(/* const void *key, const void *base, size_t nmemb,
size_t size, int (*compar)(const void *, const void *) */);
extern void * calloc(/* size_t nmemb, size_t size */);
extern void exit(/* int status */);
extern void free(/* void *ptr */);
extern char * getenv(/* const char *name */);
extern void * malloc(/* size_t size */);
extern void qsort(/* void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *) */);
extern int rand(/* void */);
extern void * realloc(/* void *ptr, size_t size */);
extern void srand(/* unsigned int seed */);
extern int mbtowc(/* wchar_t *pwc, const char *s, size_t n */);
extern int wctomb(/* char *s, wchar_t wchar */);
extern size_t mbstowcs(/* wchar_t *pwcs, const char *s, size_t n */);
extern size_t wcstombs(/* char *s, const wchar_t *pwcs, size_t n */);
#define mblen(s, n) mbtowc((wchar_t *)0, s, n)
#endif

10
5include/sys/Makefile Normal file
View File

@@ -0,0 +1,10 @@
# @(#)Makefile 1.1 94/10/31 SMI
#
H = fcntl.h
all: $H
clean:
# Install is done by parent makefile
install:

12
5include/sys/fcntl.h Normal file
View File

@@ -0,0 +1,12 @@
/* @(#)fcntl.h 1.1 94/10/31 SMI */
#ifndef __sys_fcntl_h
#define __sys_fcntl_h
#include <sys/fcntlcom.h>
#ifndef _POSIX_SOURCE
#define O_NDELAY _FNBIO /* Non-blocking I/O (S5 style) */
#endif
#endif /* !__sys_fcntl_h */

58
5include/time.h Normal file
View File

@@ -0,0 +1,58 @@
/* @(#)time.h 1.1 94/10/31 SMI; from S5R2 1.1 */
#ifndef __time_h
#define __time_h
#include <sys/stdtypes.h>
#ifndef NULL
#define NULL 0
#endif
struct tm { /* see ctime(3) */
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
char *tm_zone;
long tm_gmtoff;
};
/*
* Following 2 lines are required to make CLK_TCK work.
* If they change here they have to change in <sys/unistd.h> as well.
*/
extern long sysconf(/* int name */);
#define _SC_CLK_TCK 3 /* clock ticks/sec */
/*
* POSIX.1 uses CLK_TCK to specify units used by times(3).
* POSIX.1a doesn't use a name for this and says CLK_TCK is obsolescent, but
* we'll probably have to support it for a long time.
*/
#define CLK_TCK (sysconf(_SC_CLK_TCK))
/* 881207 ANSI C draft uses CLOCKS_PER_SEC to specify units used by clock(3). */
#define CLOCKS_PER_SEC 1000000L
extern char * asctime(/* const struct tm *t */);
extern char * ctime(/* const time_t *t */);
extern struct tm * gmtime(/* const time_t *t */);
extern struct tm * localtime(/* const time_t *t */);
extern time_t mktime(/* struct tm *timeptr */);
extern size_t strftime(/* char *s, size_t maxsize, const char *format,
const struct tm *timeptr */);
extern time_t time(/* time_t *t */);
extern void tzset(/* void */);
extern char *tzname[];
#ifndef _POSIX_SOURCE
extern int daylight;
extern long timezone;
extern void tzsetwall(/* void */);
#endif !_POSIX_SOURCE
#endif !__time_h