Done a major overhaul of the way target include files are installed and
how platform libraries are built. The ARCH pm variable has now been renamed PLATFORM (which is more accurate) and a different ARCH variable added, which represents the CPU family rather than the hardware platform.
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
ctype.h
|
||||
setjmp.h
|
||||
stdio.h
|
||||
assert.h
|
||||
varargs.h
|
||||
math.h
|
||||
time.h
|
||||
pwd.h
|
||||
grp.h
|
||||
sgtty.h
|
||||
signal.h
|
||||
fcntl.h
|
||||
errno.h
|
||||
sys
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
/* $Id$ */
|
||||
/* A S S E R T I O N M A C R O D E F I N I T I O N */
|
||||
|
||||
#ifndef _ASSERT_H
|
||||
#define _ASSERT_H
|
||||
|
||||
#ifndef NDEBUG
|
||||
/* Note: this macro uses parameter substitution inside strings */
|
||||
#define assert(exp) (exp || (fprintf(stderr,"Assertion \"%s\" failed: file %s, line %d\n", "exp", __FILE__, __LINE__), exit(1)))
|
||||
#define _assert(exp) (exp || (fprintf(stderr,"Assertion \"%s\" failed: file %s, line %d\n", "exp", __FILE__, __LINE__), exit(1)))
|
||||
#else
|
||||
#define assert(exp) (1)
|
||||
#define _assert(exp) (1)
|
||||
#endif /* NDEBUG */
|
||||
#endif /* _ASSERT_H */
|
||||
@@ -1,55 +0,0 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
|
||||
#ifndef _CTYPE_H
|
||||
#define _CTYPE_H
|
||||
|
||||
/* File : ctypes.h
|
||||
Author : Richard A. O'Keefe.
|
||||
Updated: 26 April 1984
|
||||
Purpose: Reimplement the UNIX ctype(3) library.
|
||||
|
||||
isaneol(c) means that c is a line terminating character.
|
||||
isalnum, ispunct, isspace, and isaneol are defined on the
|
||||
range -1..127, i.e. on ASCII U {EOF}, while all the other
|
||||
macros are defined for any integer.
|
||||
|
||||
isodigit(c) checks for Octal digits.
|
||||
isxdigit(c) checkx for heXadecimal digits.
|
||||
*/
|
||||
|
||||
#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 iscntrl(c) ((unsigned)((c)-' ') >= 95)
|
||||
#define isascii(c) ((unsigned)(c) < 128)
|
||||
#define isalpha(c) ((unsigned)(((c)|32)-'a') < 26)
|
||||
|
||||
extern char _c2type[];
|
||||
|
||||
#define isalnum(c) (_c2type[(c)+1] < 36)
|
||||
#define ispunct(c) (_c2type[(c)+1] == 36)
|
||||
#define isspace(c) (_c2type[(c)+1] > 37)
|
||||
#define isaneol(c) (_c2type[(c)+1] > 38)
|
||||
|
||||
#define isxdigit(c) (_c2type[(c)+1] < 16)
|
||||
#define isodigit(c) ((unsigned)((c)-'0') < 8)
|
||||
|
||||
/* The following "conversion" macros have been in some versions of UNIX
|
||||
but are not in all. tocntrl is new. The original motivation for ^?
|
||||
being a name for DEL was that (x)^64 mapped A..Z to ^A..^Z and also
|
||||
? to DEL. The trouble is that this trick doesn't work for lower case
|
||||
letters. The version given here is not mine. I wish it was. It has
|
||||
the nice property that DEL is mapped to itself (so does EOF).
|
||||
tolower(c) and toupper(c) are only defined when isalpha(c).
|
||||
*/
|
||||
#define tolower(c) ((c)|32)
|
||||
#define toupper(c) ((c)&~32)
|
||||
#define tocntrl(c) (((((c)+1)&~96)-1)&127)
|
||||
#define toascii(c) ((c)&127)
|
||||
|
||||
#endif /* _CTYPE_H */
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* errno.h - errors
|
||||
*/
|
||||
/* $Id$ */
|
||||
|
||||
#if !defined(_ERRNO_H)
|
||||
#define _ERRNO_H
|
||||
|
||||
#include <sys/errno.h>
|
||||
|
||||
/* 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 */
|
||||
|
||||
extern int errno; /* error number */
|
||||
|
||||
#endif /* _ERRNO_H */
|
||||
@@ -1,55 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copied from Minix, with some changes */
|
||||
/* The <fcntl.h> header is needed by the open() and fcntl() system calls,
|
||||
* which have a variety of parameters and flags. They are described here.
|
||||
* The formats of the calls to each of these are:
|
||||
*
|
||||
* open(path, oflag [,mode]) open a file
|
||||
* fcntl(fd, cmd [,arg]) get or set file attributes
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __BSD4_2
|
||||
#ifndef _FCNTL_H
|
||||
#define _FCNTL_H
|
||||
|
||||
/* These values are used for cmd in fcntl(). POSIX Table 6-1. */
|
||||
#define F_DUPFD 0 /* duplicate file descriptor */
|
||||
#define F_GETFD 1 /* get file descriptor flags */
|
||||
#define F_SETFD 2 /* set file descriptor flags */
|
||||
#define F_GETFL 3 /* get file status flags */
|
||||
#define F_SETFL 4 /* set file status flags */
|
||||
#define F_GETLK 7 /* get record locking information */
|
||||
#define F_SETLK 8 /* set record locking information */
|
||||
#define F_SETLKW 9 /* set record locking info; wait if blocked */
|
||||
|
||||
/* File descriptor flags used for fcntl(). POSIX Table 6-2. */
|
||||
#define FD_CLOEXEC 1 /* close on exec flag for third arg of fcntl */
|
||||
|
||||
/* L_type values for record locking with fcntl(). POSIX Table 6-3. */
|
||||
#define F_RDLCK 1 /* shared or read lock */
|
||||
#define F_WRLCK 2 /* exclusive or write lock */
|
||||
#define F_UNLCK 3 /* unlock */
|
||||
|
||||
/* Oflag values for open(). POSIX Table 6-4. */
|
||||
#define O_CREAT 0001000 /* creat file if it doesn't exist */
|
||||
#define O_EXCL 0004000 /* exclusive use flag */
|
||||
#define O_NOCTTY 0100000 /* do not assign a controlling terminal */
|
||||
#define O_TRUNC 0002000 /* truncate flag */
|
||||
|
||||
/* File status flags for open() and fcntl(). POSIX Table 6-5. */
|
||||
#define O_APPEND 0000010 /* set append mode */
|
||||
#define O_NONBLOCK 0040000 /* no delay */
|
||||
#define O_NDELAY 0000004 /* no delay (BSD) */
|
||||
|
||||
/* File access modes for open() and fcntl(). POSIX Table 6-6. */
|
||||
#define O_RDONLY 0 /* open(name, O_RDONLY) opens read only */
|
||||
#define O_WRONLY 1 /* open(name, O_WRONLY) opens write only */
|
||||
#define O_RDWR 2 /* open(name, O_RDWR) opens read/write */
|
||||
|
||||
/* Mask for use with file access modes. POSIX Table 6-7. */
|
||||
#define O_ACCMODE 03 /* mask for file access modes */
|
||||
|
||||
#endif /* _FCNTL_H */
|
||||
#endif /* __BSD4_2 */
|
||||
@@ -1,21 +0,0 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
|
||||
#ifndef _GRP_H
|
||||
#define _GRP_H
|
||||
|
||||
struct group {
|
||||
char *gr_name; /* the name of the group */
|
||||
char *gr_passwd; /* the group passwd */
|
||||
int gr_gid; /* the numerical group ID */
|
||||
char **gr_mem; /* a vector of pointers to the members */
|
||||
};
|
||||
|
||||
extern struct group *getgrgid();
|
||||
extern struct group *getgrnam();
|
||||
extern struct group *getgrent();
|
||||
|
||||
#endif /* _GRP_H */
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef _MATH_H
|
||||
#define _MATH_H
|
||||
|
||||
/* some constants (Hart & Cheney) */
|
||||
|
||||
#define M_PI 3.14159265358979323846264338327950288
|
||||
#define M_2PI 6.28318530717958647692528676655900576
|
||||
#define M_3PI_4 2.35619449019234492884698253745962716
|
||||
#define M_PI_2 1.57079632679489661923132169163975144
|
||||
#define M_3PI_8 1.17809724509617246442349126872981358
|
||||
#define M_PI_4 0.78539816339744830961566084581987572
|
||||
#define M_PI_8 0.39269908169872415480783042290993786
|
||||
#define M_1_PI 0.31830988618379067153776752674502872
|
||||
#define M_2_PI 0.63661977236758134307553505349005744
|
||||
#define M_4_PI 1.27323954473516268615107010698011488
|
||||
#define M_E 2.71828182845904523536028747135266250
|
||||
#define M_LOG2E 1.44269504088896340735992468100189213
|
||||
#define M_LOG10E 0.43429448190325182765112891891660508
|
||||
#define M_LN2 0.69314718055994530941723212145817657
|
||||
#define M_LN10 2.30258509299404568401799145468436421
|
||||
#define M_SQRT2 1.41421356237309504880168872420969808
|
||||
#define M_1_SQRT2 0.70710678118654752440084436210484904
|
||||
#define M_EULER 0.57721566490153286060651209008240243
|
||||
|
||||
#ifndef __NO_DEFS
|
||||
extern double exp(), log(), log10(), pow(), sqrt();
|
||||
extern double fabs(), ceil(), floor();
|
||||
extern double gamma();
|
||||
extern double hypot(), cabs();
|
||||
extern double j0(), y0(), j1(), y1(), jn(), yn();
|
||||
extern double sin(), asin(), tan(), atan(), atan2(), cos(), acos();
|
||||
extern double sinh(), tanh(), cosh();
|
||||
#endif
|
||||
|
||||
#define POLYNOM1(x, a) ((a)[1]*(x)+(a)[0])
|
||||
#define POLYNOM2(x, a) (POLYNOM1((x),(a)+1)*(x)+(a)[0])
|
||||
#define POLYNOM3(x, a) (POLYNOM2((x),(a)+1)*(x)+(a)[0])
|
||||
#define POLYNOM4(x, a) (POLYNOM3((x),(a)+1)*(x)+(a)[0])
|
||||
#define POLYNOM5(x, a) (POLYNOM4((x),(a)+1)*(x)+(a)[0])
|
||||
#define POLYNOM6(x, a) (POLYNOM5((x),(a)+1)*(x)+(a)[0])
|
||||
#define POLYNOM7(x, a) (POLYNOM6((x),(a)+1)*(x)+(a)[0])
|
||||
#define POLYNOM8(x, a) (POLYNOM7((x),(a)+1)*(x)+(a)[0])
|
||||
#define POLYNOM9(x, a) (POLYNOM8((x),(a)+1)*(x)+(a)[0])
|
||||
#define POLYNOM10(x, a) (POLYNOM9((x),(a)+1)*(x)+(a)[0])
|
||||
#define POLYNOM11(x, a) (POLYNOM10((x),(a)+1)*(x)+(a)[0])
|
||||
#define POLYNOM12(x, a) (POLYNOM11((x),(a)+1)*(x)+(a)[0])
|
||||
#define POLYNOM13(x, a) (POLYNOM12((x),(a)+1)*(x)+(a)[0])
|
||||
|
||||
#ifdef __vax
|
||||
#define M_MAX_D 1.701411834604692293e+38
|
||||
#define M_MIN_D 2.938735877055718770e-39
|
||||
#define M_DEXPLEN 8
|
||||
#endif
|
||||
|
||||
#ifdef __pdp
|
||||
#define M_MAX_D 1.701411834604692293e+38
|
||||
#define M_MIN_D 2.938735877055718770e-39
|
||||
#define M_DEXPLEN 8
|
||||
#endif
|
||||
|
||||
#ifndef M_MAX_D
|
||||
#define M_MAX_D 1.7976931348623157e+308
|
||||
#define M_MIN_D 2.2250738585072014e-308
|
||||
#define M_DEXPLEN 11
|
||||
#endif
|
||||
#define M_DMAXEXP ((1 << (M_DEXPLEN - 1)) - 1)
|
||||
#define M_DMINEXP (-M_DMAXEXP)
|
||||
#define M_LN_MAX_D (M_LN2 * M_DMAXEXP)
|
||||
#define M_LN_MIN_D (M_LN2 * (M_DMINEXP - 1))
|
||||
|
||||
#define HUGE M_MAX_D
|
||||
#define MAXDOUBLE M_MAX_D
|
||||
|
||||
#endif /* _MATH_H */
|
||||
@@ -1,26 +0,0 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
|
||||
#ifndef _PWD_H
|
||||
#define _PWD_H
|
||||
|
||||
struct passwd {
|
||||
char *pw_name; /* login name */
|
||||
int pw_uid; /* uid corresponding to the name */
|
||||
int pw_gid; /* gid corresponding to the name */
|
||||
char *pw_dir; /* user's home directory */
|
||||
char *pw_shell; /* name of the user's shell */
|
||||
|
||||
/* The following members are not defined by POSIX. */
|
||||
char *pw_passwd; /* password information */
|
||||
char *pw_gecos; /* just in case you have a GE 645 around */
|
||||
};
|
||||
|
||||
extern struct passwd *getpwnam();
|
||||
extern struct passwd *getpwuid();
|
||||
extern struct passwd *getpwent();
|
||||
|
||||
#endif /* _PWD_H */
|
||||
@@ -1,12 +0,0 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
|
||||
#ifndef _SETJMP_H
|
||||
#define _SETJMP_H
|
||||
|
||||
typedef char jmp_buf[256];
|
||||
|
||||
#endif /* _SETJMP_H */
|
||||
@@ -1,119 +0,0 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
/* Data structures for ioctl/stty/gtty, sufficient for ACK libraries */
|
||||
|
||||
#ifndef _SGTTY_H
|
||||
#define _SGTTY_H
|
||||
|
||||
struct sgttyb {
|
||||
char sg_ispeed; /* input speed (not used) */
|
||||
char sg_ospeed; /* output speed (not used) */
|
||||
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) */
|
||||
};
|
||||
|
||||
/* Fields in t_flags. */
|
||||
#define ALLDELAY 0177400
|
||||
|
||||
#define BSDELAY 0100000
|
||||
# define BS0 0000000
|
||||
# define BS1 0100000
|
||||
|
||||
#define VTDELAY 0040000
|
||||
# define FF0 0000000
|
||||
# define FF1 0040000
|
||||
|
||||
#define CRDELAY 0030000
|
||||
# define CR0 0000000
|
||||
# define CR1 0010000
|
||||
# define CR2 0020000
|
||||
# define CR3 0030000
|
||||
|
||||
#if defined(__USG) && !defined(_XENIX)
|
||||
#define XTABS 0000002 /* do tab expansion */
|
||||
#else
|
||||
#define XTABS 0006000 /* do tab expansion */
|
||||
#endif
|
||||
|
||||
#define TBDELAY 0006000
|
||||
# define TAB0 0000000
|
||||
# define TAB1 0002000
|
||||
# define TAB2 0004000
|
||||
|
||||
#define NLDELAY 0001400
|
||||
# define NL0 0000000
|
||||
# define NL1 0000400
|
||||
# define NL2 0001000
|
||||
# define NL3 0001400
|
||||
|
||||
#define ANYP 0000300
|
||||
#define EVENP 0000200
|
||||
#define ODDP 0000100
|
||||
|
||||
#define RAW 0000040 /* enable raw mode */
|
||||
#define CRMOD 0000020 /* map lf to cr + lf */
|
||||
#define ECHO 0000010 /* echo input */
|
||||
#define LCASE 0000004
|
||||
#define CBREAK 0000002 /* enable cbreak mode */
|
||||
#if defined(__BSD4_2) || defined(_XENIX)
|
||||
#define TANDEM 0000001
|
||||
#else
|
||||
#define HUPCL 0000001 /* unused ??? */
|
||||
#endif
|
||||
/*#define COOKED 0000000 /* neither CBREAK nor RAW */
|
||||
|
||||
#ifdef __BDS4_2
|
||||
#define TIOCGETP (('t'<<8) | 8 | (6 << 16) | 0x40000000)
|
||||
#define TIOCSETP (('t'<<8) | 9 | (6 << 16) | 0x80000000)
|
||||
#define TIOCSETN (('t'<<8) | 10 | (6 << 16) | 0x80000000)
|
||||
#define TIOCEXCL (('t'<<8) | 13 | 0x20000000)
|
||||
#define TIOCNXCL (('t'<<8) | 14 | 0x20000000)
|
||||
#define TIOCHPCL (('t'<<8) | 2 | 0x20000000)
|
||||
#define TIOCGETC (('t'<<8) | 18 | (6 << 16) | 0x40000000)
|
||||
#define TIOCSETC (('t'<<8) | 17 | (6 << 16) | 0x80000000)
|
||||
#else
|
||||
#define TIOCGETP (('t'<<8) | 8)
|
||||
#define TIOCSETP (('t'<<8) | 9)
|
||||
#define TIOCSETN (('t'<<8) | 10)
|
||||
#define TIOCEXCL (('t'<<8) | 13)
|
||||
#define TIOCNXCL (('t'<<8) | 14)
|
||||
#define TIOCHPCL (('t'<<8) | 2)
|
||||
#define TIOCGETC (('t'<<8) | 18)
|
||||
#define TIOCSETC (('t'<<8) | 17)
|
||||
#endif
|
||||
|
||||
#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 EXTA 14
|
||||
#define EXTB 15
|
||||
|
||||
#endif /* _SGTTY_H */
|
||||
@@ -1,60 +0,0 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#ifndef _SIGNAL_H
|
||||
#define _SIGNAL_H
|
||||
|
||||
#ifdef __BSD4_2
|
||||
#define _NSIG 32 /* number of signals used */
|
||||
#else
|
||||
#define _NSIG 16 /* number of signals used */
|
||||
#endif
|
||||
#define NSIG _NSIG
|
||||
|
||||
#define SIGHUP 1 /* hangup */
|
||||
#define SIGINT 2 /* interrupt (DEL) */
|
||||
#define SIGQUIT 3 /* quit (ASCII FS) */
|
||||
#define SIGILL 4 /* illegal instruction */
|
||||
#define SIGTRAP 5 /* trace trap (not reset when caught) */
|
||||
#define SIGABRT 6 /* IOT instruction */
|
||||
#define SIGIOT 6 /* SIGABRT for people who speak PDP-11 */
|
||||
#define SIGEMT 7 /* EMT instruction */
|
||||
#define SIGFPE 8 /* floating point exception */
|
||||
#define SIGKILL 9 /* kill (cannot be caught or ignored) */
|
||||
#define SIGBUS 10 /* bus error */
|
||||
#define SIGSEGV 11 /* segmentation violation */
|
||||
#define SIGSYS 12 /* bad argument to system call */
|
||||
#define SIGPIPE 13 /* write on a pipe with no one to read it */
|
||||
#define SIGALRM 14 /* alarm clock */
|
||||
#define SIGTERM 15 /* software termination signal from kill */
|
||||
|
||||
#ifdef __BSD4_2
|
||||
#define SIGURG 16 /* urgent condition on IO channel */
|
||||
#define SIGCHLD 20 /* child process terminated or stopped */
|
||||
#define SIGCONT 19 /* continue if stopped */
|
||||
#define SIGSTOP 17 /* stop signal */
|
||||
#define SIGTSTP 18 /* interactive stop signal */
|
||||
#define SIGTTIN 21 /* background process wants to read */
|
||||
#define SIGTTOU 22 /* background process wants to write */
|
||||
#define SIGIO 23 /* input/output possible signal */
|
||||
#define SIGPOLL SIGIO /* System V name for SIGIO */
|
||||
#define SIGXCPU 24 /* exceeded CPU time limit */
|
||||
#define SIGXFSZ 25 /* exceeded file size limit */
|
||||
#define SIGVTALRM 26 /* virtual time alarm */
|
||||
#define SIGPROF 27 /* profiling time alarm */
|
||||
#define SIGWINCH 28 /* window changed */
|
||||
#define SIGLOST 29 /* resource lost (eg, record-lock lost) */
|
||||
#define SIGUSR1 30 /* user defined signal 1 */
|
||||
#define SIGUSR2 31 /* user defined signal 2 */
|
||||
#endif
|
||||
|
||||
|
||||
#define SIG_DFL ((void (*)())0) /* default signal handling */
|
||||
#define SIG_IGN ((void (*)())1) /* ignore signal */
|
||||
#define SIG_ERR ((void (*)())-1)
|
||||
|
||||
void (*signal()) ();
|
||||
|
||||
#endif /* _SIGNAL_H */
|
||||
@@ -1,83 +0,0 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
|
||||
#ifndef _STDIO_H
|
||||
#define _STDIO_H
|
||||
|
||||
#define BUFSIZ 1024
|
||||
#ifdef __vax
|
||||
#define _NBF 8
|
||||
#endif
|
||||
#ifdef __mc68020
|
||||
#define _NBF 8
|
||||
#endif
|
||||
#ifndef _NBF
|
||||
#define _NBF 1
|
||||
#endif
|
||||
#define _BUFSIZ (_NBF * BUFSIZ)
|
||||
#define _NFILES 20
|
||||
#define NULL 0
|
||||
#define EOF (-1)
|
||||
|
||||
#define IO_READMODE 1
|
||||
#define IO_WRITEMODE 2
|
||||
#define IO_UNBUFF 4
|
||||
#define IO_EOF 8
|
||||
#define IO_ERR 16
|
||||
#define IO_MYBUF 32
|
||||
#define IO_PERPRINTF 64
|
||||
|
||||
#ifndef FILE
|
||||
|
||||
extern struct _io_buf {
|
||||
int _count;
|
||||
int _flags;
|
||||
unsigned char *_buf;
|
||||
unsigned char *_ptr;
|
||||
int _bufsiz;
|
||||
int _fd;
|
||||
} *_io_table[_NFILES], _stdin, _stdout, _stderr;
|
||||
|
||||
|
||||
#endif /* FILE */
|
||||
|
||||
#define FILE struct _io_buf
|
||||
|
||||
|
||||
#define stdin (&_stdin)
|
||||
#define stdout (&_stdout)
|
||||
#define stderr (&_stderr)
|
||||
|
||||
#define getchar() getc(stdin)
|
||||
#define putchar(c) putc(c,stdout)
|
||||
#define getc(p) (--(p)->_count >= 0 ? (int) (*(p)->_ptr++) : \
|
||||
_fillbuf(p))
|
||||
#define putc(c, p) (--(p)->_count >= 0 ? \
|
||||
(int) (*(p)->_ptr++ = (c)) : \
|
||||
_flushbuf((c),(p)))
|
||||
#define feof(p) (((p)->_flags & IO_EOF) != 0)
|
||||
#define ferror(p) (((p)->_flags & IO_ERR) != 0)
|
||||
#define fileno(p) ((p)->_fd)
|
||||
#define io_testflag(p,x) ((p)->_flags & (x))
|
||||
|
||||
/* If you want a stream to be flushed after each printf use:
|
||||
*
|
||||
* io_perprintf(stream);
|
||||
*
|
||||
* If you want to stop with this kind of buffering use:
|
||||
*
|
||||
* io_noperprintf(stream);
|
||||
*/
|
||||
|
||||
#define io_noperprintf(p) ((p)->_flags &= ~IO_PERPRINTF)
|
||||
#define io_perprintf(p) ((p)->_flags |= IO_PERPRINTF)
|
||||
|
||||
extern FILE *fopen(), *fdopen(), *freopen(), *popen();
|
||||
extern long ftell();
|
||||
extern setbuf(), rewind();
|
||||
extern char *fgets(), *gets();
|
||||
|
||||
#endif /* _STDIO_H */
|
||||
@@ -1,5 +0,0 @@
|
||||
dir.h
|
||||
stat.h
|
||||
types.h
|
||||
stdtypes.h
|
||||
errno.h
|
||||
@@ -1,45 +0,0 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
#ifndef _DIR_H
|
||||
#define _DIR_H
|
||||
|
||||
#ifdef __BSD4_2
|
||||
#define MAXNAMLEN 255
|
||||
#else
|
||||
#define MAXNAMLEN 14
|
||||
#endif
|
||||
#define DIRBLKSIZ 512
|
||||
#undef DIRSIZ
|
||||
#define DIRSIZ(dp) \
|
||||
((sizeof(struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1+3)&~3))
|
||||
struct direct {
|
||||
long d_ino;
|
||||
short d_reclen;
|
||||
short d_namlen;
|
||||
char d_name[MAXNAMLEN+1];
|
||||
};
|
||||
|
||||
struct _dirdesc {
|
||||
int dd_fd;
|
||||
long dd_loc;
|
||||
long dd_size;
|
||||
char *dd_buf;
|
||||
int dd_bsize;
|
||||
};
|
||||
|
||||
typedef struct _dirdesc DIR;
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
extern DIR *opendir();
|
||||
extern struct direct *readdir();
|
||||
extern long telldir();
|
||||
extern seekdir();
|
||||
#define rewinddir(dirp) seekdir((dirp), 0L)
|
||||
extern closedir();
|
||||
|
||||
#endif /* _DIR_H */
|
||||
@@ -1,144 +0,0 @@
|
||||
/*
|
||||
* sys/errno.h - error numbers
|
||||
*/
|
||||
/* $Id$ */
|
||||
|
||||
#if !defined(_SYS_ERRNO_H)
|
||||
#define _SYS_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 */
|
||||
|
||||
#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 */
|
||||
|
||||
#if defined(__BSD4_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 */
|
||||
|
||||
#if defined(_POSIX_SOURCE)
|
||||
#if defined(_MINIX)
|
||||
#define EDEADLK 35 /* resource deadlock avoided */
|
||||
#define ENAMETOOLONG 36 /* file name too long */
|
||||
#define ENOLCK 37 /* no locks available */
|
||||
#define ENOSYS 38 /* function not implemented */
|
||||
#define ENOTEMPTY 39 /* directory not empty */
|
||||
|
||||
#define ELOCKED 101 /* can't send message */
|
||||
#define EBADCALL 102 /* error on send/recieve */
|
||||
#define ELONGSTRING 103 /* string too long */
|
||||
#endif
|
||||
/* Room for other POSIX implementations */
|
||||
#endif
|
||||
|
||||
#endif /* _SYS_ERRNO_H */
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
/* $Id$ */
|
||||
|
||||
#if !defined(_SYS_STAT_H)
|
||||
#define _SYS_STAT_H
|
||||
|
||||
struct stat {
|
||||
dev_t st_dev;
|
||||
ino_t st_ino;
|
||||
u_short st_mode;
|
||||
short st_nlink;
|
||||
short st_uid;
|
||||
short st_gid;
|
||||
dev_t st_rdev;
|
||||
off_t st_size;
|
||||
time_t st_atime;
|
||||
#if defined(__BSD4_2)
|
||||
long st_spare1;
|
||||
#endif
|
||||
time_t st_mtime;
|
||||
#if defined(__BSD4_2)
|
||||
long st_spare2;
|
||||
#endif
|
||||
time_t st_ctime;
|
||||
#if defined(__BSD4_2)
|
||||
long st_spare3;
|
||||
long st_blksize;
|
||||
long st_blocks;
|
||||
long st_spare4[2];
|
||||
#endif
|
||||
};
|
||||
|
||||
#define S_IFMT 0170000
|
||||
#define S_IFDIR 0040000
|
||||
#define S_IFCHR 0020000
|
||||
#define S_IFBLK 0060000
|
||||
#define S_IFREG 0100000
|
||||
#if !defined(__BSD4_2)
|
||||
#if !defined(__USG) && !defined(_POSIX_SOURCE)
|
||||
#define S_IFMPC 0030000
|
||||
#define S_IFMPB 0070000
|
||||
#else
|
||||
#define S_IFIFO 0010000
|
||||
#endif
|
||||
#else
|
||||
#define S_IFLNK 0120000
|
||||
#define S_IFSOCK 0140000
|
||||
#endif
|
||||
#define S_ISUID 0004000
|
||||
#define S_ISGID 0002000
|
||||
#define S_ISVTX 0001000
|
||||
#define S_IREAD 0000400
|
||||
#define S_IWRITE 0000200
|
||||
#define S_IEXEC 0000100
|
||||
|
||||
#if defined(__BSD4_2) || defined(_POSIX_SOURCE)
|
||||
#define S_IRWXU 00700 /* owner: rwx------ */
|
||||
#define S_IRUSR 00400 /* owner: r-------- */
|
||||
#define S_IWUSR 00200 /* owner: -w------- */
|
||||
#define S_IXUSR 00100 /* owner: --x------ */
|
||||
|
||||
#define S_IRWXG 00070 /* group: ---rwx--- */
|
||||
#define S_IRGRP 00040 /* group: ---r----- */
|
||||
#define S_IWGRP 00020 /* group: ----w---- */
|
||||
#define S_IXGRP 00010 /* group: -----x--- */
|
||||
|
||||
#define S_IRWXO 00007 /* others: ------rwx */
|
||||
#define S_IROTH 00004 /* others: ------r-- */
|
||||
#define S_IWOTH 00002 /* others: -------w- */
|
||||
#define S_IXOTH 00001 /* others: --------x */
|
||||
|
||||
#if defined(_POSIX_SOURCE)
|
||||
/* The following macros test st_mode (from POSIX Sec. 5.6.1.1.) */
|
||||
#define S_ISREG(m) ((m & S_IFMT) == S_IFREG) /* is a reg file */
|
||||
#define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR) /* is a directory */
|
||||
#define S_ISCHR(m) ((m & S_IFMT) == S_IFCHR) /* is a char spec */
|
||||
#define S_ISBLK(m) ((m & S_IFMT) == S_IFBLK) /* is a block spec */
|
||||
#define S_ISFIFO(m) ((m & S_IFMT) == S_IFIFO) /* is a pipe/FIFO */
|
||||
#endif /* _POSIX_SOURCE */
|
||||
#endif /* BSD4_2 || _POSIX_SOURCE */
|
||||
|
||||
#endif /* _SYS_STAT_H */
|
||||
@@ -1,25 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* This include file exists so that <sys/types.h> can still safely be
|
||||
included. On a SUN, this would cause problems because sometimes time_t
|
||||
and/or size_t were defined twice.
|
||||
*/
|
||||
|
||||
#ifndef __STDTYPES_H__
|
||||
#define __STDTYPES_H__
|
||||
|
||||
typedef long sigset_t; /* for <signal.h> on SUN's */
|
||||
#ifndef __STDC__
|
||||
typedef long time_t;
|
||||
typedef long size_t;
|
||||
typedef long clock_t;
|
||||
#endif
|
||||
typedef int pid_t;
|
||||
typedef unsigned short gid_t;
|
||||
typedef unsigned short uid_t;
|
||||
typedef unsigned int speed_t;
|
||||
typedef unsigned long tcflag_t;
|
||||
typedef unsigned char cc_t;
|
||||
|
||||
|
||||
#endif /* __STDTYPES_H__ */
|
||||
@@ -1,79 +0,0 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
|
||||
/*
|
||||
* Basic system types and major/minor device constructing/busting macros.
|
||||
*/
|
||||
|
||||
#if !defined(_SYS_TYPES_H)
|
||||
#define _SYS_TYPES_H
|
||||
|
||||
#ifdef __STDC__
|
||||
#if !defined(_SIZE_T)
|
||||
#define _SIZE_T
|
||||
typedef unsigned int size_t; /* type returned by sizeof */
|
||||
#endif /* _SIZE_T */
|
||||
|
||||
#if !defined(_TIME_T)
|
||||
#define _TIME_T
|
||||
typedef unsigned long time_t;
|
||||
#endif /* TIME_T */
|
||||
#endif
|
||||
|
||||
#if !defined(_POSIX_SOURCE)
|
||||
|
||||
/* major part of a device */
|
||||
#define major(x) ((int)(((unsigned)(x)>>8)&0377))
|
||||
|
||||
/* minor part of a device */
|
||||
#define minor(x) ((int)((x)&0377))
|
||||
|
||||
/* make a device number */
|
||||
#define makedev(x,y) ((dev_t)(((x)<<8) | (y)))
|
||||
|
||||
typedef unsigned char u_char;
|
||||
typedef unsigned short u_short;
|
||||
typedef unsigned int u_int;
|
||||
typedef unsigned long u_long;
|
||||
|
||||
typedef struct _physadr { int r[1]; } *physadr;
|
||||
typedef long daddr_t;
|
||||
typedef char * caddr_t;
|
||||
#if defined(__BSD4_2)
|
||||
typedef u_long ino_t;
|
||||
#else
|
||||
typedef u_short ino_t;
|
||||
#endif
|
||||
typedef long swblk_t;
|
||||
|
||||
#include <sys/stdtypes.h>
|
||||
|
||||
typedef long label_t[14];
|
||||
typedef short dev_t;
|
||||
typedef long off_t;
|
||||
|
||||
/* system V compatibility: */
|
||||
typedef unsigned int uint;
|
||||
typedef unsigned short ushort;
|
||||
typedef unsigned char uchar_t;
|
||||
typedef short cnt_t;
|
||||
typedef long paddr_t;
|
||||
typedef long key_t;
|
||||
|
||||
#else /* _POSIX_SOURCE */
|
||||
#if defined(_MINIX)
|
||||
typedef unsigned short dev_t; /* hold (major|minor) device pair */
|
||||
typedef unsigned char gid_t; /* group id */
|
||||
typedef unsigned short ino_t; /* i-node number */
|
||||
typedef unsigned short mode_t; /* mode number within an i-node */
|
||||
typedef unsigned char nlink_t; /* number-of-links field within an i-node */
|
||||
typedef long off_t; /* offsets within a file */
|
||||
typedef int pid_t; /* type for pids (must be signed) */
|
||||
typedef unsigned short uid_t; /* user id */
|
||||
#endif /* _MINIX */
|
||||
#endif /* _POSIX_SOURCE */
|
||||
|
||||
#endif /* _SYS_TYPES_H */
|
||||
@@ -1,27 +0,0 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
|
||||
#ifndef _TIME_H
|
||||
#define _TIME_H
|
||||
|
||||
struct tm {
|
||||
int tm_sec; /* seconds after the minute [0, 59] */
|
||||
int tm_min; /* minutes after the hour [0, 59] */
|
||||
int tm_hour; /* hours since midnight [0, 23] */
|
||||
int tm_mday; /* day of the month [1, 31] */
|
||||
int tm_mon; /* months since January [0, 11] */
|
||||
int tm_year; /* years since 1900 */
|
||||
int tm_wday; /* days since Sunday [0, 6] */
|
||||
int tm_yday; /* days since January 1 [0, 365] */
|
||||
int tm_isdst; /* Daylight Saving Time flag */
|
||||
};
|
||||
|
||||
extern struct tm *gmtime();
|
||||
extern struct tm *localtime();
|
||||
extern char *asctime();
|
||||
extern char *ctime();
|
||||
|
||||
#endif /* _TIME_H */
|
||||
@@ -1,16 +0,0 @@
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef _VARARGS_H
|
||||
#define _VARARGS_H
|
||||
|
||||
typedef char *va_list;
|
||||
# define __va_sz(mode) (((sizeof(mode) + sizeof(int) - 1) / sizeof(int)) * sizeof(int))
|
||||
# define va_dcl int va_alist;
|
||||
# define va_start(list) (list = (char *) &va_alist)
|
||||
# define va_end(list)
|
||||
# define va_arg(list,mode) (*((mode *)((list += __va_sz(mode)) - __va_sz(mode))))
|
||||
#endif /* _VARARGS_H */
|
||||
@@ -1,79 +0,0 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||
*/
|
||||
|
||||
/*
|
||||
* Basic system types and major/minor device constructing/busting macros.
|
||||
*/
|
||||
|
||||
#if !defined(_SYS_TYPES_H)
|
||||
#define _SYS_TYPES_H
|
||||
|
||||
#ifdef __STDC__
|
||||
#if !defined(_SIZE_T)
|
||||
#define _SIZE_T
|
||||
typedef unsigned int size_t; /* type returned by sizeof */
|
||||
#endif /* _SIZE_T */
|
||||
|
||||
#if !defined(_TIME_T)
|
||||
#define _TIME_T
|
||||
typedef unsigned long time_t;
|
||||
#endif /* TIME_T */
|
||||
#endif
|
||||
|
||||
#if !defined(_POSIX_SOURCE)
|
||||
|
||||
/* major part of a device */
|
||||
#define major(x) ((int)(((unsigned)(x)>>8)&0377))
|
||||
|
||||
/* minor part of a device */
|
||||
#define minor(x) ((int)((x)&0377))
|
||||
|
||||
/* make a device number */
|
||||
#define makedev(x,y) ((dev_t)(((x)<<8) | (y)))
|
||||
|
||||
typedef unsigned char u_char;
|
||||
typedef unsigned short u_short;
|
||||
typedef unsigned int u_int;
|
||||
typedef unsigned long u_long;
|
||||
|
||||
typedef struct _physadr { int r[1]; } *physadr;
|
||||
typedef long daddr_t;
|
||||
typedef char * caddr_t;
|
||||
#if defined(__BSD4_2)
|
||||
typedef u_long ino_t;
|
||||
#else
|
||||
typedef u_short ino_t;
|
||||
#endif
|
||||
typedef long swblk_t;
|
||||
|
||||
#include <sys/stdtypes.h>
|
||||
|
||||
typedef long label_t[14];
|
||||
typedef short dev_t;
|
||||
typedef long off_t;
|
||||
|
||||
/* system V compatibility: */
|
||||
typedef unsigned int uint;
|
||||
typedef unsigned short ushort;
|
||||
typedef unsigned char uchar_t;
|
||||
typedef short cnt_t;
|
||||
typedef long paddr_t;
|
||||
typedef long key_t;
|
||||
|
||||
#else /* _POSIX_SOURCE */
|
||||
#if defined(_MINIX)
|
||||
typedef unsigned short dev_t; /* hold (major|minor) device pair */
|
||||
typedef unsigned char gid_t; /* group id */
|
||||
typedef unsigned short ino_t; /* i-node number */
|
||||
typedef unsigned short mode_t; /* mode number within an i-node */
|
||||
typedef unsigned char nlink_t; /* number-of-links field within an i-node */
|
||||
typedef long off_t; /* offsets within a file */
|
||||
typedef int pid_t; /* type for pids (must be signed) */
|
||||
typedef unsigned short uid_t; /* user id */
|
||||
#endif /* _MINIX */
|
||||
#endif /* _POSIX_SOURCE */
|
||||
|
||||
#endif /* _SYS_TYPES_H */
|
||||
@@ -1,3 +0,0 @@
|
||||
dec.ocm
|
||||
printd.ocm
|
||||
prints.ocm
|
||||
@@ -1,62 +0,0 @@
|
||||
-- decin/decout - Decimal i/o
|
||||
|
||||
proc decin(chan in, var d, c)=
|
||||
-- Reads a decimal number from input into d. c is used as the first input
|
||||
-- character, and it contains the character just after the decimal number
|
||||
-- when decin exits.
|
||||
|
||||
var neg:
|
||||
seq
|
||||
while (c='*s') or (c='*t') or (c='*n')
|
||||
in ? c
|
||||
if
|
||||
(c='-') or (c='+')
|
||||
seq
|
||||
neg:=(c='-')
|
||||
in ? c
|
||||
true
|
||||
neg:=false
|
||||
d:=0
|
||||
while ('0'<=c) and (c<='9')
|
||||
seq
|
||||
d:=(d*10)+(c-'0')
|
||||
in ? c
|
||||
if
|
||||
neg
|
||||
d:= -d
|
||||
:
|
||||
proc decout(chan out, value d, w)=
|
||||
-- Sends d to channel out in decimal on a field of w spaces. It is just like
|
||||
-- fprintf(out, "%*d", w, d);
|
||||
|
||||
var dec[BYTE 12], di, dd, d0, neg:
|
||||
seq
|
||||
di:=0
|
||||
if
|
||||
d<0
|
||||
seq
|
||||
neg:=true
|
||||
dd:= -d
|
||||
d>=0
|
||||
seq
|
||||
neg:=false
|
||||
dd:=d
|
||||
d0:=1
|
||||
while d0<>0
|
||||
seq
|
||||
dec[BYTE di]:=(dd\10)+'0'
|
||||
di:=di+1
|
||||
dd:=dd/10
|
||||
d0:=dd
|
||||
if
|
||||
neg
|
||||
seq
|
||||
dec[BYTE di]:='-'
|
||||
di:=di+1
|
||||
seq i=[0 for w-di]
|
||||
out ! '*s'
|
||||
while di<>0
|
||||
seq
|
||||
di:=di-1
|
||||
out ! dec[BYTE di]
|
||||
:
|
||||
@@ -1,36 +0,0 @@
|
||||
proc printd(chan out, value fmt[], d)=
|
||||
-- Like fprintf(out, fmt, d), with only %d or %<width>d in fmt[]
|
||||
|
||||
def otherwise=true:
|
||||
var i, len:
|
||||
seq
|
||||
len:=fmt[byte 0]
|
||||
i:=1
|
||||
|
||||
while i<=len
|
||||
if
|
||||
fmt[byte i] = '%'
|
||||
var w:
|
||||
seq
|
||||
i:=i+1
|
||||
w:=0
|
||||
while (i<=len) and ('0'<=fmt[byte i]) and (fmt[byte i]<='9')
|
||||
seq
|
||||
w:=(w*10)+(fmt[byte i]-'0')
|
||||
i:=i+1
|
||||
if
|
||||
i<=len
|
||||
var key:
|
||||
seq
|
||||
key:=fmt[byte i]
|
||||
if
|
||||
key='d'
|
||||
decout(out, d, w)
|
||||
otherwise
|
||||
out ! key
|
||||
i:=i+1
|
||||
otherwise
|
||||
seq
|
||||
out ! fmt[byte i]
|
||||
i:=i+1
|
||||
:
|
||||
@@ -1,40 +0,0 @@
|
||||
proc prints(chan out, value fmt[], str[]) =
|
||||
-- Like fprintf(out, fmt, str), with only %s or %<width>s in fmt[]
|
||||
|
||||
def otherwise=true:
|
||||
var i, len:
|
||||
seq
|
||||
len:=fmt[byte 0]
|
||||
i:=1
|
||||
|
||||
while i<=len
|
||||
if
|
||||
fmt[byte i] = '%'
|
||||
var w:
|
||||
seq
|
||||
i:=i+1
|
||||
w:=0
|
||||
while (i<=len) and ('0'<=fmt[byte i]) and (fmt[byte i]<='9')
|
||||
seq
|
||||
w:=(w*10)+(fmt[byte i]-'0')
|
||||
i:=i+1
|
||||
if
|
||||
i<=len
|
||||
var key:
|
||||
seq
|
||||
key:=fmt[byte i]
|
||||
if
|
||||
key='s'
|
||||
seq
|
||||
seq i=[0 for w-str[byte 0]]
|
||||
out ! ' '
|
||||
seq i=[0 for str[byte 0]]
|
||||
out ! str[byte i]
|
||||
otherwise
|
||||
out ! key
|
||||
i:=i+1
|
||||
otherwise
|
||||
seq
|
||||
out ! fmt[byte i]
|
||||
i:=i+1
|
||||
:
|
||||
Reference in New Issue
Block a user