many changes and improvements
This commit is contained in:
parent
0c6ba1fd58
commit
d8486967aa
21 changed files with 356 additions and 254 deletions
22
lang/cem/libcc.ansi/headers/.distr
Normal file
22
lang/cem/libcc.ansi/headers/.distr
Normal file
|
@ -0,0 +1,22 @@
|
|||
LIST
|
||||
Makefile
|
||||
assert.h
|
||||
ctype.h
|
||||
dirent.h
|
||||
errno.h
|
||||
float.h
|
||||
grp.h
|
||||
limits.h
|
||||
locale.h
|
||||
math.h
|
||||
mathconst.h
|
||||
setjmp.h
|
||||
sgtty.h
|
||||
signal.h
|
||||
stdarg.h
|
||||
stddef.h
|
||||
stdio.h
|
||||
stdlib.h
|
||||
string.h
|
||||
time.h
|
||||
sys
|
23
lang/cem/libcc.ansi/headers/LIST
Normal file
23
lang/cem/libcc.ansi/headers/LIST
Normal file
|
@ -0,0 +1,23 @@
|
|||
assert.h
|
||||
ctype.h
|
||||
dirent.h
|
||||
errno.h
|
||||
float.h
|
||||
grp.h
|
||||
limits.h
|
||||
locale.h
|
||||
math.h
|
||||
mathconst.h
|
||||
setjmp.h
|
||||
sgtty.h
|
||||
signal.h
|
||||
stdarg.h
|
||||
stddef.h
|
||||
stdio.h
|
||||
stdlib.h
|
||||
string.h
|
||||
time.h
|
||||
sys/dirent.h
|
||||
sys/errno.h
|
||||
sys/stat.h
|
||||
sys/types.h
|
9
lang/cem/libcc.ansi/headers/Makefile
Normal file
9
lang/cem/libcc.ansi/headers/Makefile
Normal file
|
@ -0,0 +1,9 @@
|
|||
CFLAGS=-L -LIB
|
||||
|
||||
.SUFFIXES: .o .e .c
|
||||
|
||||
.e.o:
|
||||
$(CC) $(CFLAGS) -c -o $@ $*.e
|
||||
|
||||
clean:
|
||||
rm -rf OLIST
|
|
@ -3,28 +3,49 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__CTYPE_HEADER__)
|
||||
#define __CTYPE_HEADER__
|
||||
#if !defined(_CTYPE_H)
|
||||
#define _CTYPE_H
|
||||
|
||||
int isalnum(int __c); /* alpha numeric character */
|
||||
int isalpha(int __c); /* alpha character */
|
||||
int iscntrl(int __c); /* control character */
|
||||
int isdigit(int __c); /* digit character */
|
||||
int isgraph(int __c); /* graphical character */
|
||||
int islower(int __c); /* lower case character */
|
||||
int isprint(int __c); /* printable character */
|
||||
int ispunct(int __c); /* punctuaction character */
|
||||
int isspace(int __c); /* space character */
|
||||
int isupper(int __c); /* upper case character */
|
||||
int isxdigit(int __c); /* hexdecimal digit character */
|
||||
extern char __ctype[]; /* located in chartab.c */
|
||||
extern int __x; /* scratch variable */
|
||||
|
||||
int tolower(int __c); /* convert to lower case character */
|
||||
int toupper(int __c); /* convert to upper case character */
|
||||
#define _U 0x01 /* this bit is for upper-case letters [A-Z] */
|
||||
#define _L 0x02 /* this bit is for lower-case letters [a-z] */
|
||||
#define _N 0x04 /* this bit is for numbers [0-9] */
|
||||
#define _S 0x08 /* this bit is for white space \t \n \f etc */
|
||||
#define _P 0x10 /* this bit is for punctuation characters */
|
||||
#define _C 0x20 /* this bit is for control characters */
|
||||
#define _X 0x40 /* this bit is for hex digits [a-f] and [A-F]*/
|
||||
|
||||
#define isdigit(c) ((unsigned)((c)-'0') < 10)
|
||||
#define islower(c) ((unsigned)((c)-'a') < 26)
|
||||
#define isupper(c) ((unsigned)((c)-'A') < 26)
|
||||
#define isprint(c) ((unsigned)((c)-' ') < 95)
|
||||
#define isascii(c) ((unsigned)(c) < 128)
|
||||
int isalnum(int __c); /* alphanumeric [a-z], [A-Z], [0-9] */
|
||||
int isalpha(int __c); /* alphabetic */
|
||||
int iscntrl(int __c); /* control characters */
|
||||
int isdigit(int __c); /* digit [0-9] */
|
||||
int isgraph(int __c); /* graphic character */
|
||||
int islower(int __c); /* lower-case letter [a-z] */
|
||||
int isprint(int __c); /* printable character */
|
||||
int ispunct(int __c); /* punctuation mark */
|
||||
int isspace(int __c); /* white space sp, \f, \n, \r, \t, \v */
|
||||
int isupper(int __c); /* upper-case letter [A-Z] */
|
||||
int isxdigit(int __c); /* hex digit [0-9], [a-f], [A-F] */
|
||||
int tolower(int __c); /* convert to lower case character */
|
||||
int toupper(int __c); /* convert to upper case character */
|
||||
|
||||
#endif /* __CTYPE_HEADER__ */
|
||||
#define isalpha(c) ((__ctype+1)[c]&(_U|_L))
|
||||
#define isspace(c) ((__ctype+1)[c]&_S)
|
||||
#define iscntrl(c) ((__ctype+1)[c]&_C)
|
||||
#define isxdigit(c) ((__ctype+1)[c]&(_N|_X))
|
||||
#define isalnum(c) ((__ctype+1)[c]&(_U|_L|_N))
|
||||
#define isgraph(c) ((__ctype+1)[c]&(_P|_U|_L|_N))
|
||||
#define ispunct(c) ((__ctype+1)[c]&_P)
|
||||
|
||||
#define isdigit(c) ((unsigned) ((c)-'0') < 10)
|
||||
#define islower(c) ((unsigned) ((c)-'a') < 26)
|
||||
#define isupper(c) ((unsigned) ((c)-'A') < 26)
|
||||
#define isprint(c) ((unsigned) ((c)-' ') < 95)
|
||||
#define isascii(c) ((unsigned) (c) < 128)
|
||||
|
||||
#define toupper(c) (__x = (c), islower( __x) ? __x - 'a' + 'A' : __x)
|
||||
#define tolower(c) (__x = (c), isupper( __x) ? __x - 'A' + 'a' : __x)
|
||||
|
||||
#endif /* _CTYPE_H */
|
||||
|
|
34
lang/cem/libcc.ansi/headers/dirent.h
Normal file
34
lang/cem/libcc.ansi/headers/dirent.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
<dirent.h> -- definitions for SVR3 directory access routines
|
||||
|
||||
last edit: 25-Apr-1987 D A Gwyn
|
||||
|
||||
Prerequisite: <sys/types.h>
|
||||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(_DIRENT_H)
|
||||
#define _DIRENT_H
|
||||
#include <sys/dirent.h>
|
||||
|
||||
#define DIRBUF 8192 /* buffer size for fs-indep. dirs */
|
||||
/* must in general be larger than the filesystem buffer size */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int dd_fd; /* file descriptor */
|
||||
int dd_loc; /* offset in block */
|
||||
int dd_size; /* amount of valid data */
|
||||
char *dd_buf; /* -> directory block */
|
||||
} DIR; /* stream data from opendir() */
|
||||
|
||||
DIR *opendir(const char *__dirname);
|
||||
struct dirent *readdir(DIR *__dirp);
|
||||
void rewinddir(DIR *__dirp);
|
||||
int closedir(DIR *__dirp);
|
||||
off_t telldir(DIR *__dirp);
|
||||
void seekdir(DIR *__dirp, off_t __loc);
|
||||
|
||||
#define NULL ((void *)0) /* DAG -- added for convenience */
|
||||
|
||||
#endif /* _DIRENT_H */
|
|
@ -3,133 +3,18 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__ERRNO_HEADER__)
|
||||
#define __ERRNO_HEADER__
|
||||
#if !defined(_ERRNO_H)
|
||||
#define _ERRNO_H
|
||||
|
||||
#define EPERM 1 /* Not owner */
|
||||
#define ENOENT 2 /* No such file or directory */
|
||||
#define ESRCH 3 /* No such process */
|
||||
#define EINTR 4 /* Interrupted system call */
|
||||
#define EIO 5 /* I/O error */
|
||||
#define ENXIO 6 /* No such device or address */
|
||||
#define E2BIG 7 /* Arg list too long */
|
||||
#define ENOEXEC 8 /* Exec format error */
|
||||
#define EBADF 9 /* Bad file number */
|
||||
#define ECHILD 10 /* No children */
|
||||
#define EAGAIN 11 /* No more processes */
|
||||
#define ENOMEM 12 /* Not enough core */
|
||||
#define EACCES 13 /* Permission denied */
|
||||
#define EFAULT 14 /* Bad address */
|
||||
#define ENOTBLK 15 /* Block device required */
|
||||
#define EBUSY 16 /* Mount device busy */
|
||||
#define EEXIST 17 /* File exists */
|
||||
#define EXDEV 18 /* Cross-device link */
|
||||
#define ENODEV 19 /* No such device */
|
||||
#define ENOTDIR 20 /* Not a directory*/
|
||||
#define EISDIR 21 /* Is a directory */
|
||||
#define EINVAL 22 /* Invalid argument */
|
||||
#define ENFILE 23 /* File table overflow */
|
||||
#define EMFILE 24 /* Too many open files */
|
||||
#define ENOTTY 25 /* Not a typewriter */
|
||||
#define ETXTBSY 26 /* Text file busy */
|
||||
#define EFBIG 27 /* File too large */
|
||||
#define ENOSPC 28 /* No space left on device */
|
||||
#define ESPIPE 29 /* Illegal seek */
|
||||
#define EROFS 30 /* Read-only file system */
|
||||
#define EMLINK 31 /* Too many links */
|
||||
#define EPIPE 32 /* Broken pipe */
|
||||
#include <sys/errno.h>
|
||||
|
||||
/* The standard requires the next two definitions */
|
||||
/* The standard requires the next two definitions. If they are also in
|
||||
* <sys/errno.h>, their values should be equal. The <sys/errno.h> supplied
|
||||
* with the compiler doesn't contain them.
|
||||
*/
|
||||
#define EDOM 33 /* math arg out of domain of func */
|
||||
#define ERANGE 34 /* math result not representable */
|
||||
|
||||
#if defined(__USG)
|
||||
/* Only ENOMSG, EIDRM and EDEADLK are documented */
|
||||
#define ENOMSG 35 /* No message of desired type */
|
||||
#define EIDRM 36 /* Identifier Removed */
|
||||
#define ECHRNG 37 /* Channel number out of range */
|
||||
#define EL2NSYNC 38 /* Level 2 not synchronized */
|
||||
#define EL3HLT 39 /* Level 3 halted */
|
||||
#define EL3RST 40 /* Level 3 reset */
|
||||
#define ELNRNG 41 /* Link number out of range */
|
||||
#define EUNATCH 42 /* Protocol driver not attached */
|
||||
#define ENOCSI 43 /* No CSI structure available */
|
||||
#define EL2HLT 44 /* Level 2 halted */
|
||||
#define EDEADLK 45 /* DeadLock */
|
||||
#endif /* __USG */
|
||||
extern int errno; /* error number */
|
||||
|
||||
#if defined(__BDS4_2)
|
||||
/* non-blocking and interrupt i/o */
|
||||
#define EWOULDBLOCK 35 /* Operation would block */
|
||||
#define EINPROGRESS 36 /* Operation now in progress */
|
||||
#define EALREADY 37 /* Operation already in progress */
|
||||
/* ipc/network software */
|
||||
|
||||
/* argument errors */
|
||||
#define ENOTSOCK 38 /* Socket operation on non-socket */
|
||||
#define EDESTADDRREQ 39 /* Destination address required */
|
||||
#define EMSGSIZE 40 /* Message too long */
|
||||
#define EPROTOTYPE 41 /* Protocol wrong type for socket */
|
||||
#define ENOPROTOOPT 42 /* Protocol not available */
|
||||
#define EPROTONOSUPPORT 43 /* Protocol not supported */
|
||||
#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
|
||||
#define EOPNOTSUPP 45 /* Operation not supported on socket */
|
||||
#define EPFNOSUPPORT 46 /* Protocol family not supported */
|
||||
#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
|
||||
#define EADDRINUSE 48 /* Address already in use */
|
||||
#define EADDRNOTAVAIL 49 /* Can't assign requested address */
|
||||
|
||||
/* operational errors */
|
||||
#define ENETDOWN 50 /* Network is down */
|
||||
#define ENETUNREACH 51 /* Network is unreachable */
|
||||
#define ENETRESET 52 /* Network dropped connection on reset */
|
||||
#define ECONNABORTED 53 /* Software caused connection abort */
|
||||
#define ECONNRESET 54 /* Connection reset by peer */
|
||||
#define ENOBUFS 55 /* No buffer space available */
|
||||
#define EISCONN 56 /* Socket is already connected */
|
||||
#define ENOTCONN 57 /* Socket is not connected */
|
||||
#define ESHUTDOWN 58 /* Can't send after socket shutdown */
|
||||
/* ETOOMANYREFS is not documented */
|
||||
#define ETOOMANYREFS 59 /* Too many references: can't splice */
|
||||
#define ETIMEDOUT 60 /* Connection timed out */
|
||||
#define ECONNREFUSED 61 /* Connection refused */
|
||||
|
||||
/* */
|
||||
#define ELOOP 62 /* Too many levels of symbolic links */
|
||||
#define ENAMETOOLONG 63 /* File name too long */
|
||||
|
||||
/* In BSD4.2, ENOTEMPTY is defined as 64. */
|
||||
/* Just use BSD4.3 & Sun UNIX 4.2 definitions */
|
||||
#define EHOSTDOWN 64 /* Host is down */
|
||||
#define EHOSTUNREACH 65 /* No route to host */
|
||||
#define ENOTEMPTY 66 /* Directory not empty */
|
||||
|
||||
/* quotas & mush */
|
||||
/* EPROCLIM and EUSERS are not documented */
|
||||
#define EPROCLIM 67 /* Too many processes */
|
||||
#define EUSERS 68 /* Too many users */
|
||||
#define EDQUOT 69 /* Disc quota exceeded */
|
||||
|
||||
/* Network File System */
|
||||
#define ESTALE 70 /* Stale NFS file handle */
|
||||
#define EREMOTE 71 /* Too many levels of remote in path */
|
||||
|
||||
/* streams */
|
||||
/* only ENOMSG is documented */
|
||||
#define ENOSTR 72 /* Device is not a stream */
|
||||
#define ETIME 73 /* Timer expired */
|
||||
#define ENOSR 74 /* Out of streams resources */
|
||||
#define ENOMSG 75 /* No message of desired type */
|
||||
#define EBADMSG 76 /* Trying to read unreadable message */
|
||||
|
||||
#define EIDRM 77 /* Identifier removed */
|
||||
|
||||
/* SystemV Record Locking */
|
||||
#define EDEADLK 78 /* Deadlock condition. */
|
||||
#define ENOLCK 79 /* No record locks available. */
|
||||
|
||||
#endif /* __BSD4_2 */
|
||||
|
||||
extern int errno; /* error number */
|
||||
|
||||
#endif /* __ERRNO_HEADER__ */
|
||||
#endif /* _ERRNO_H */
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__FLOAT_HEADER__)
|
||||
#define __FLOAT_HEADER__
|
||||
#if !defined(_FLOAT_H)
|
||||
#define _FLOAT_H
|
||||
|
||||
#if defined(vax)
|
||||
#define FLT_DIG 6
|
||||
|
@ -113,4 +113,4 @@
|
|||
|
||||
#endif /* vax, pdp or ieee */
|
||||
|
||||
#endif /* __FLOAT_HEADER__ */
|
||||
#endif /* _FLOAT_H */
|
||||
|
|
17
lang/cem/libcc.ansi/headers/grp.h
Normal file
17
lang/cem/libcc.ansi/headers/grp.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
/* $Header$ */
|
||||
|
||||
#if !defined(_GRP_H)
|
||||
#define _GRP_H
|
||||
|
||||
struct group { /* see getgrent(3) */
|
||||
char *gr_name;
|
||||
char *gr_passwd;
|
||||
int gr_gid;
|
||||
char **gr_mem;
|
||||
};
|
||||
|
||||
struct group *getgrent(void);
|
||||
struct group *getgrgid(int __gid);
|
||||
struct group *getgrnam(const char *__name);
|
||||
|
||||
#endif /* _GRP_H */
|
|
@ -3,35 +3,35 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__LIMITS_HEADER__)
|
||||
#define __LIMITS_HEADER__
|
||||
#if !defined(_LIMITS_H)
|
||||
#define _LIMITS_H
|
||||
|
||||
#define CHAR_BIT 8
|
||||
#define SCHAR_MIN (-128)
|
||||
#define SCHAR_MAX (+127)
|
||||
#define SCHAR_MIN -128
|
||||
#define SCHAR_MAX 127
|
||||
#define UCHAR_MAX 255
|
||||
#define MB_LEN_MAX 1
|
||||
|
||||
#define SHRT_MIN (-32767 - 1)
|
||||
#define SHRT_MAX (+32767)
|
||||
#define SHRT_MAX 32767
|
||||
#define USHRT_MAX 65535U
|
||||
|
||||
#define LONG_MIN (-2147483647L - 1L)
|
||||
#define LONG_MAX (+2147483647L)
|
||||
#define ULONG_MAX 4294967295U
|
||||
#define LONG_MAX 2147483647L
|
||||
#define ULONG_MAX 4294967295UL
|
||||
|
||||
/* Assume signed characters (yegh) */
|
||||
#define CHAR_MAX SCHAR_MAX
|
||||
#define CHAR_MIN SCHAR_MIN
|
||||
|
||||
#if _EM_WSIZE == 4
|
||||
#define INT_MIN LONG_MIN
|
||||
#define INT_MAX LONG_MAX
|
||||
#define UINT_MAX ULONG_MAX
|
||||
#else /* _EM_WSIZE == 2 */
|
||||
#if _EM_WSIZE == 2
|
||||
#define INT_MIN SHRT_MIN
|
||||
#define INT_MAX SHRT_MAX
|
||||
#define UINT_MAX USHRT_MAX
|
||||
#define UINT_MAX 65535U
|
||||
#else /* _EM_WSIZE == 4 */
|
||||
#define INT_MIN (-2147483647 - 1)
|
||||
#define INT_MAX 2147483647
|
||||
#define UINT_MAX 4294967295U
|
||||
#endif
|
||||
|
||||
#endif /* __LIMITS_HEADER__ */
|
||||
#endif /* _LIMITS_H */
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__LOCALE_HEADER__)
|
||||
#define __LOCALE_HEADER__
|
||||
#if !defined(_LOCALE_H)
|
||||
#define _LOCALE_H
|
||||
|
||||
struct lconv {
|
||||
char *decimal_point; /* "." */
|
||||
|
@ -17,6 +17,7 @@ struct lconv {
|
|||
char *mon_grouping; /* "" */
|
||||
char *positive_sign; /* "" */
|
||||
char *negative_sign; /* "" */
|
||||
char int_frac_digits; /* CHAR_MAX */
|
||||
char frac_digits; /* CHAR_MAX */
|
||||
char p_cs_precedes; /* CHAR_MAX */
|
||||
char p_sep_by_space; /* CHAR_MAX */
|
||||
|
@ -26,9 +27,7 @@ struct lconv {
|
|||
char n_sign_posn; /* CHAR_MAX */
|
||||
};
|
||||
|
||||
#if defined(NULL)
|
||||
#define NULL 0
|
||||
#endif /* NULL */
|
||||
#define NULL ((void *)0)
|
||||
|
||||
#define LC_ALL 1
|
||||
#define LC_COLLATE 2
|
||||
|
@ -41,4 +40,4 @@ struct lconv {
|
|||
char *setlocale(int __category, const char *__locale);
|
||||
struct lconv *localeconv(void);
|
||||
|
||||
#endif /* __LOCALE_HEADER__ */
|
||||
#endif /* _LOCALE_H */
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__MATH_HEADER__)
|
||||
#define __MATH_HEADER__
|
||||
#if !defined(_MATH_H)
|
||||
#define _MATH_H
|
||||
|
||||
#define HUGE_VAL 9.9e+999 /* though it will generate a warning */
|
||||
|
||||
|
@ -37,4 +37,4 @@ double ldexp(double __x, int __exp);
|
|||
double modf(double __x, double *__iptr);
|
||||
double fmod(double __x, double __y);
|
||||
|
||||
#endif /* __MATH_HEADER__ */
|
||||
#endif /* _MATH_H */
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__MATHCONST_HEADER__)
|
||||
#define __MATHCONST_HEADER__
|
||||
#if !defined(_MATHCONST_H)
|
||||
#define _MATHCONST_H
|
||||
|
||||
/* some constants (Hart & Cheney) */
|
||||
#define M_PI 3.14159265358979323846264338327950288
|
||||
|
@ -26,4 +26,4 @@
|
|||
#define M_1_SQRT2 0.70710678118654752440084436210484904
|
||||
#define M_EULER 0.57721566490153286060651209008240243
|
||||
|
||||
#endif /* __MATHCONST_HEADER__ */
|
||||
#endif /* _MATHCONST_H */
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__SETJMP_HEADER__)
|
||||
#define __SETJMP_HEADER__
|
||||
#if !defined(_SETJMP_H)
|
||||
#define _SETJMP_H
|
||||
|
||||
typedef char jmp_buf[256];
|
||||
|
||||
int setjmp(jmp_buf __env);
|
||||
void longjmp(jmp_buf __env, int __val);
|
||||
|
||||
#endif /* __SETJMP_HEADER__ */
|
||||
#endif /* _SETJMP_H */
|
||||
|
|
72
lang/cem/libcc.ansi/headers/sgtty.h
Normal file
72
lang/cem/libcc.ansi/headers/sgtty.h
Normal file
|
@ -0,0 +1,72 @@
|
|||
/* $Header$ */
|
||||
|
||||
#if !defined(_SGTTY_H)
|
||||
#define _SGTTY_H
|
||||
/* Data structures for IOCTL. */
|
||||
|
||||
struct sgttyb {
|
||||
char sg_ispeed; /* input speed */
|
||||
char sg_ospeed; /* output speed */
|
||||
char sg_erase; /* erase character */
|
||||
char sg_kill; /* kill character */
|
||||
#if defined(__USG) && !defined(_XENIX)
|
||||
int sg_flags; /* mode flags */
|
||||
#else
|
||||
short sg_flags; /* mode flags */
|
||||
#endif
|
||||
};
|
||||
|
||||
struct tchars {
|
||||
char t_intrc; /* SIGINT char */
|
||||
char t_quitc; /* SIGQUIT char */
|
||||
char t_startc; /* start output (initially CTRL-Q) */
|
||||
char t_stopc; /* stop output (initially CTRL-S) */
|
||||
char t_eofc; /* EOF (initially CTRL-D) */
|
||||
char t_brkc; /* input delimiter (like nl) */
|
||||
};
|
||||
|
||||
/* Field names */
|
||||
#if defined(__USG) && !defined(_XENIX)
|
||||
#define XTABS 0000002 /* do tab expansion */
|
||||
#else
|
||||
#define XTABS 0006000 /* do tab expansion */
|
||||
#endif
|
||||
#define EVENP 0000200 /* even parity */
|
||||
#define ODDP 0000100 /* odd parity */
|
||||
#define RAW 0000040 /* enable raw mode */
|
||||
#define CRMOD 0000020 /* map lf to cr + lf */
|
||||
#define ECHO 0000010 /* echo input */
|
||||
#define LCASE 0000004 /* map upper case to lower on input */
|
||||
#define CBREAK 0000002 /* enable cbreak mode */
|
||||
#if defined(__BSD4_2) || defined(_XENIX)
|
||||
#define TANDEM 0000001 /* automatic flow control */
|
||||
#else
|
||||
#define HUPCL 0000001 /* unused ??? */
|
||||
#endif
|
||||
#define COOKED 0000000 /* neither CBREAK nor RAW */
|
||||
|
||||
#define B0 0
|
||||
#define B50 1
|
||||
#define B75 2
|
||||
#define B110 3
|
||||
#define B134 4
|
||||
#define B150 5
|
||||
#define B200 6
|
||||
#define B300 7
|
||||
#define B600 8
|
||||
#define B1200 9
|
||||
#define B1800 10
|
||||
#define B2400 11
|
||||
#define B4800 12
|
||||
#define B9600 13
|
||||
#define B19200 14
|
||||
#define B38400 15
|
||||
#define EXTA 14
|
||||
#define EXTB 15
|
||||
|
||||
#define TIOCGETP (('t'<<8) | 8)
|
||||
#define TIOCSETP (('t'<<8) | 9)
|
||||
#define TIOCGETC (('t'<<8) | 18)
|
||||
#define TIOCSETC (('t'<<8) | 17)
|
||||
|
||||
#endif /* _SGTTY_H */
|
|
@ -6,8 +6,8 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__SIGNAL_HEADER__)
|
||||
#define __SIGNAL_HEADER__
|
||||
#if !defined(_SIGNAL_H)
|
||||
#define _SIGNAL_H
|
||||
|
||||
typedef int sig_atomic_t;
|
||||
|
||||
|
@ -69,4 +69,4 @@ typedef int sig_atomic_t;
|
|||
void (*signal(int __sig, void (*__func)(int)))(int);
|
||||
int raise(int __sig);
|
||||
|
||||
#endif /* __SIGNAL_HEADER__ */
|
||||
#endif /* _SIGNAL_H */
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__STDARG_HEADER__)
|
||||
#define __STDARG_HEADER__
|
||||
#if !defined(_STDARG_H)
|
||||
#define _STDARG_H
|
||||
|
||||
typedef void *va_list;
|
||||
typedef char *va_list;
|
||||
|
||||
#define _vasz(x) ((sizeof(x)+sizeof(int)-1) & ~(sizeof(int) -1))
|
||||
#define __vasz(x) ((sizeof(x)+sizeof(int)-1) & ~(sizeof(int) -1))
|
||||
|
||||
#define va_start(ap, parmN) (ap = (va_list)&parmN + _vasz(parmN))
|
||||
#define va_arg(ap, type) (*((type *)((ap += _vasz(type)) - _vasz(type))))
|
||||
#define va_start(ap, parmN) (ap = (va_list)&parmN + __vasz(parmN))
|
||||
#define va_arg(ap, type) (*((type *)((ap += __vasz(type)) - __vasz(type))))
|
||||
#define va_end(ap)
|
||||
|
||||
#endif /* __STDARG_HEADER__ */
|
||||
#endif /* _STDARG_H */
|
||||
|
|
|
@ -6,28 +6,33 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__STDDEF_HEADER__)
|
||||
#define __STDDEF_HEADER__
|
||||
#if !defined(_STDDEF_H)
|
||||
#define _STDDEF_H
|
||||
|
||||
#if !defined(NULL)
|
||||
#define NULL 0
|
||||
#endif /* NULL */
|
||||
#define NULL ((void *)0)
|
||||
|
||||
#define offsetof(type, ident) (((size_t) &(((type *)0)->ident))
|
||||
#define offsetof(type, ident) (((size_t) &(((type *)0)->ident)))
|
||||
|
||||
#if !defined(__TYPE_PTRDIFF__)
|
||||
#define __TYPE_PTRDIFF__
|
||||
#if _EM_PSIZE == 2
|
||||
typedef int ptrdiff_t; /* result of substracting two pointers */
|
||||
#endif /* __TYPE_PTRDIFF__ */
|
||||
#elif _EM_PSIZE == 4
|
||||
typedef long ptrdiff_t; /* result of substracting two pointers */
|
||||
#else
|
||||
#error garbage pointer size
|
||||
#endif /* _EM_PSIZE */
|
||||
|
||||
#if !defined(__TYPE_SIZE__)
|
||||
#define __TYPE_SIZE__
|
||||
#if !defined(_SIZE_T)
|
||||
#define _SIZE_T
|
||||
#if _EM_WSIZE == _EM_PSIZE
|
||||
typedef unsigned int size_t; /* type returned by sizeof */
|
||||
#endif /* __TYPE_SIZE__ */
|
||||
#else
|
||||
typedef unsigned long size_t; /* type returned by sizeof */
|
||||
#endif
|
||||
#endif /* _SIZE_T */
|
||||
|
||||
#if !defined(__TYPE_WCHAR__)
|
||||
#define __TYPE_WCHAR__
|
||||
#if !defined(_WCHAR_T)
|
||||
#define _WCHAR_T
|
||||
typedef char wchar_t; /* type expanded character set */
|
||||
#endif /* __TYPE_WCHAR__ */
|
||||
#endif /* _WCHAR_T */
|
||||
|
||||
#endif /* __STDDEF_HEADER__ */
|
||||
#endif /* _STDDEF_H */
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__STDIO_HEADER__)
|
||||
#define __STDIO_HEADER__
|
||||
#if !defined(_STDIO_H)
|
||||
#define _STDIO_H
|
||||
|
||||
/*
|
||||
* Focus point of all stdio activity.
|
||||
|
@ -32,6 +32,7 @@ typedef struct __iobuf {
|
|||
#define _IOLBF 0x040
|
||||
#define _IOREADING 0x080
|
||||
#define _IOWRITING 0x100
|
||||
#define _IOAPPEND 0x200
|
||||
|
||||
/* The following definitions are also in <unistd.h>. They should not
|
||||
* conflict.
|
||||
|
@ -45,12 +46,8 @@ typedef struct __iobuf {
|
|||
#define stderr (&__stderr)
|
||||
|
||||
#define BUFSIZ 1024
|
||||
#if !defined(NULL)
|
||||
#define NULL 0
|
||||
#endif /* NULL */
|
||||
#if !defined(EOF)
|
||||
#define NULL ((void *)0)
|
||||
#define EOF (-1)
|
||||
#endif /* EOF */
|
||||
|
||||
#define FOPEN_MAX 20
|
||||
|
||||
|
@ -62,15 +59,16 @@ typedef struct __iobuf {
|
|||
#define TMP_MAX 999
|
||||
#define L_tmpnam (sizeof("/tmp/") + 15)
|
||||
|
||||
#if !defined(__TYPE_FPOS__)
|
||||
#define __TYPE_FPOS__
|
||||
typedef long int fpos_t;
|
||||
#endif /* __TYPE_FPOS__ */
|
||||
|
||||
#if !defined(__TYPE_SIZE__)
|
||||
#define __TYPE_SIZE__
|
||||
typedef unsigned int size_t;
|
||||
#endif /* __TYPE_SIZE__ */
|
||||
#if !defined(_SIZE_T)
|
||||
#define _SIZE_T
|
||||
#if _EM_WSIZE == _EM_PSIZE
|
||||
typedef unsigned int size_t; /* type returned by sizeof */
|
||||
#else
|
||||
typedef unsigned long size_t; /* type returned by sizeof */
|
||||
#endif
|
||||
#endif /* _SIZE_T */
|
||||
|
||||
extern FILE *__iotab[FOPEN_MAX];
|
||||
extern FILE __stdin, __stdout, __stderr;
|
||||
|
@ -91,9 +89,9 @@ int printf(const char *__format, ...);
|
|||
int scanf(const char *__format, ...);
|
||||
int sprintf(char *__s, const char *__format, ...);
|
||||
int sscanf(char *__s, const char *__format, ...);
|
||||
int vfprintf(FILE *__stream, const char *__format, void *__arg);
|
||||
int vprintf(const char *__format, void *__arg);
|
||||
int vsprintf(char *__s, const char *__format, void *__arg);
|
||||
int vfprintf(FILE *__stream, const char *__format, char *__arg);
|
||||
int vprintf(const char *__format, char *__arg);
|
||||
int vsprintf(char *__s, const char *__format, char *__arg);
|
||||
int fgetc(FILE *__stream);
|
||||
char *fgets(char *__s, int __n, FILE *__stream);
|
||||
int fputc(int __c, FILE *__stream);
|
||||
|
@ -132,9 +130,9 @@ int __flushbuf(int __c, FILE *__stream);
|
|||
#define feof(p) (((p)->_flags & _IOEOF) != 0)
|
||||
#define ferror(p) (((p)->_flags & _IOERR) != 0)
|
||||
|
||||
#if defined(_POSIX_SOURCE)
|
||||
#if defined(__BSD4_2) || defined(__USG) || defined(_POSIX_SOURCE)
|
||||
int fileno(FILE *__stream);
|
||||
#define fileno(stream) ((stream)->_fd)
|
||||
#endif /* _POSIX_SOURCE */
|
||||
#endif /* __BSD4_2 || __USG || _POSIX_SOURCE */
|
||||
|
||||
#endif /* __STDIO_HEADER__ */
|
||||
#endif /* _STDIO_H */
|
||||
|
|
|
@ -6,12 +6,10 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__STDLIB_HEADER__)
|
||||
#define __STDLIB_HEADER__
|
||||
#if !defined(_STDLIB_H)
|
||||
#define _STDLIB_H
|
||||
|
||||
#if !defined(NULL)
|
||||
#define NULL 0
|
||||
#endif /* NULL */
|
||||
#define NULL ((void *)0)
|
||||
|
||||
#define EXIT_FAILURE 1
|
||||
#define EXIT_SUCCESS 0
|
||||
|
@ -21,15 +19,19 @@
|
|||
typedef struct { int quot, rem; } div_t;
|
||||
typedef struct { long quot, rem; } ldiv_t;
|
||||
|
||||
#if !defined(__TYPE_SIZE__)
|
||||
#define __TYPE_SIZE__
|
||||
typedef unsigned int size_t;
|
||||
#endif /* __TYPE_SIZE__ */
|
||||
#if !defined(_SIZE_T)
|
||||
#define _SIZE_T
|
||||
#if _EM_WSIZE == _EM_PSIZE
|
||||
typedef unsigned int size_t; /* type returned by sizeof */
|
||||
#else
|
||||
typedef unsigned long size_t; /* type returned by sizeof */
|
||||
#endif
|
||||
#endif /* _SIZE_T */
|
||||
|
||||
#if !defined(__TYPE_WCHAR__)
|
||||
#define __TYPE_WCHAR__
|
||||
#if !defined(_WCHAR_T)
|
||||
#define _WCHAR_T
|
||||
typedef char wchar_t;
|
||||
#endif /* __TYPE_WCHAR__ */
|
||||
#endif /* _WCHAR_T */
|
||||
|
||||
double atof(const char *__nptr);
|
||||
int atoi(const char *__nptr);
|
||||
|
@ -63,4 +65,4 @@ int wctomb(char *__s, wchar_t __wchar);
|
|||
size_t mbstowcs(wchar_t *__pwcs, const char *__s, size_t __n);
|
||||
size_t wcstombs(char *__s, const wchar_t *__pwcs, size_t __n);
|
||||
|
||||
#endif /* __STDLIB_HEADER__ */
|
||||
#endif /* _STDLIB_H */
|
||||
|
|
|
@ -6,17 +6,19 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__STRING_HEADER__)
|
||||
#define __STRING_HEADER__
|
||||
#if !defined(_STRING_H)
|
||||
#define _STRING_H
|
||||
|
||||
#if !defined(NULL)
|
||||
#define NULL 0
|
||||
#endif /* NULL */
|
||||
#define NULL ((void *)0)
|
||||
|
||||
#if !defined(__TYPE_SIZE__)
|
||||
#define __TYPE_SIZE__
|
||||
#if !defined(_SIZE_T)
|
||||
#define _SIZE_T
|
||||
#if _EM_WSIZE == _EM_PSIZE
|
||||
typedef unsigned int size_t; /* type returned by sizeof */
|
||||
#endif /* __TYPE_SIZE__ */
|
||||
#else
|
||||
typedef unsigned long size_t; /* type returned by sizeof */
|
||||
#endif
|
||||
#endif /* _SIZE_T */
|
||||
|
||||
void *memcpy(void *__s1, const void *__s2, size_t __n);
|
||||
void *memmove(void *__s1, const void *__s2, size_t __n);
|
||||
|
@ -41,4 +43,4 @@ void *memset(void *__s, int __c, size_t __n);
|
|||
char *strerror(int __errnum);
|
||||
size_t strlen(const char *__s);
|
||||
|
||||
#endif /* __STRING_HEADER__ */
|
||||
#endif /* _STRING_H */
|
||||
|
|
|
@ -3,12 +3,10 @@
|
|||
*/
|
||||
/* $Header$ */
|
||||
|
||||
#if !defined(__TIME_HEADER__)
|
||||
#define __TIME_HEADER__
|
||||
#if !defined(_TIME_H)
|
||||
#define _TIME_H
|
||||
|
||||
#if !defined(NULL)
|
||||
#define NULL 0
|
||||
#endif /* NULL */
|
||||
#define NULL ((void *)0)
|
||||
|
||||
#if defined(__BSD4_2)
|
||||
#define CLOCKS_PER_SEC 1000000 /* ticks per second */
|
||||
|
@ -16,12 +14,20 @@
|
|||
#define CLOCKS_PER_SEC 60
|
||||
#endif /* __BSD4_2 */
|
||||
|
||||
#if !defined(__TYPE_SIZE__)
|
||||
#define __TYPE_SIZE__
|
||||
#if !defined(_SIZE_T)
|
||||
#define _SIZE_T
|
||||
#if _EM_WSIZE == _EM_PSIZE
|
||||
typedef unsigned int size_t; /* type returned by sizeof */
|
||||
#endif /* __TYPE_SIZE__ */
|
||||
#else
|
||||
typedef unsigned long size_t; /* type returned by sizeof */
|
||||
#endif
|
||||
#endif /* _SIZE_T */
|
||||
|
||||
#if !defined(_TIME_T)
|
||||
#define _TIME_T
|
||||
typedef unsigned long time_t; /* type returned by TOD clock */
|
||||
#endif /* _TIME_T */
|
||||
|
||||
typedef unsigned long clock_t; /* type returned by real time clock */
|
||||
|
||||
struct tm {
|
||||
|
@ -49,7 +55,14 @@ size_t strftime(char *__s, size_t __maxsize,
|
|||
const struct tm *__timeptr);
|
||||
|
||||
#if defined(__USG) || defined(_POSIX_SOURCE)
|
||||
|
||||
void tzset(void);
|
||||
|
||||
#if defined(__USG)
|
||||
extern long timezone;
|
||||
extern int daylight;
|
||||
extern char *tzname[2];
|
||||
#endif
|
||||
#endif /* __USG || _POSIX_SOURCE */
|
||||
|
||||
#endif /* __TIME_HEADER__ */
|
||||
#endif /* _TIME_H */
|
||||
|
|
Loading…
Reference in a new issue