aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorsvn2git <svn2git@FreeBSD.org>1994-05-01 08:00:00 +0000
committersvn2git <svn2git@FreeBSD.org>1994-05-01 08:00:00 +0000
commita16f65c7d117419bd266c28a1901ef129a337569 (patch)
tree2626602f66dc3551e7a7c7bc9ad763c3bc7ab40a /include
parent8503f4f13f77abf7adc8f7e329c6f9c1d52b6a20 (diff)
Diffstat (limited to 'include')
-rw-r--r--include/Makefile17
-rw-r--r--include/a.out.h55
-rw-r--r--include/ar.h9
-rw-r--r--include/assert.h9
-rw-r--r--include/bitstring.h59
-rw-r--r--include/ctype.h9
-rw-r--r--include/db.h96
-rw-r--r--include/f2c.h214
-rw-r--r--include/grp.h11
-rw-r--r--include/link.h289
-rw-r--r--include/math.h1
-rw-r--r--include/mpool.h4
-rw-r--r--include/nlist.h15
-rw-r--r--include/protocols/dumprestore.h9
-rw-r--r--include/pwd.h11
-rw-r--r--include/queue.h245
-rw-r--r--include/regex.h108
-rw-r--r--include/regexp.h69
-rw-r--r--include/rpcsvc/rstat.x18
-rw-r--r--include/setjmp.h9
-rw-r--r--include/time.h9
-rw-r--r--include/tzfile.h4
-rw-r--r--include/utmp.h9
-rw-r--r--include/varargs.h9
24 files changed, 1114 insertions, 174 deletions
diff --git a/include/Makefile b/include/Makefile
index eb10d2f3c19b..a00e9575c3b0 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -10,17 +10,18 @@ SUBDIR= rpcsvc
# Missing: mp.h
FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
- err.h fnmatch.h fstab.h fts.h glob.h grp.h kvm.h limits.h locale.h \
- math.h memory.h mpool.h ndbm.h netdb.h nlist.h paths.h pwd.h \
- ranlib.h regexp.h resolv.h setjmp.h sgtty.h stab.h stdarg.h \
- stddef.h stdio.h stdlib.h string.h strings.h struct.h sysexits.h \
- time.h ttyent.h tzfile.h unistd.h utime.h utmp.h varargs.h vis.h
+ err.h f2c.h fnmatch.h fstab.h fts.h glob.h grp.h kvm.h limits.h \
+ link.h locale.h math.h memory.h mpool.h ndbm.h netdb.h nlist.h \
+ paths.h pwd.h queue.h ranlib.h regex.h resolv.h setjmp.h \
+ sgtty.h stab.h stdarg.h stddef.h stdio.h stdlib.h string.h strings.h \
+ struct.h sysexits.h time.h ttyent.h tzfile.h unistd.h utime.h utmp.h \
+ varargs.h vis.h
MFILES= float.h floatingpoint.h frame.h
LFILES= errno.h fcntl.h signal.h syslog.h syscall.h termios.h
DIRS=arpa protocols
-LDIRS= net netccitt netinet netiso netns nfs sys ufs vm
+LDIRS= net netccitt netinet netiso netns nfs scsi sys ufs vm
# removed netimp depricated?
NOOBJ= noobj
@@ -69,7 +70,7 @@ copies:
@echo copies: ${LDIRS}
@-for i in ${LDIRS}; do \
rm -rf ${DESTDIR}/usr/include/$$i; \
- cd /sys; \
+ cd ../sys; \
tar cf - $$i/*.h | (cd ${DESTDIR}/usr/include; tar xpfB -); \
chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/$$i; \
chmod -R 444 ${DESTDIR}/usr/include/$$i; \
@@ -77,7 +78,7 @@ copies:
done
rm -rf ${DESTDIR}/usr/include/machine
mkdir ${DESTDIR}/usr/include/machine
- cd /sys/${MACHINE}/include; \
+ cd ../sys/${MACHINE}/include; \
tar cf - *.h | (cd ${DESTDIR}/usr/include/machine; tar xpfB -);
chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/machine;
chmod -R 444 ${DESTDIR}/usr/include/machine;
diff --git a/include/a.out.h b/include/a.out.h
index 9133f81bc3e6..39726e00b963 100644
--- a/include/a.out.h
+++ b/include/a.out.h
@@ -45,17 +45,45 @@
#define __LDPGSZ 1024
#endif
+#define N_GETMAGIC(ex) \
+ ( (ex).a_midmag & 0xffff )
+#define N_GETMID(ex) \
+ ( (N_GETMAGIC_NET(ex) == ZMAGIC) ? N_GETMID_NET(ex) : \
+ ((ex).a_midmag >> 16) & 0x03ff )
+#define N_GETFLAG(ex) \
+ ( (N_GETMAGIC_NET(ex) == ZMAGIC) ? N_GETFLAG_NET(ex) : \
+ ((ex).a_midmag >> 26) & 0x3f )
+#define N_SETMAGIC(ex,mag,mid,flag) \
+ ( (ex).a_midmag = (((flag) & 0x3f) <<26) | (((mid) & 0x03ff) << 16) | \
+ ((mag) & 0xffff) )
+
+#define N_GETMAGIC_NET(ex) \
+ (ntohl((ex).a_midmag) & 0xffff)
+#define N_GETMID_NET(ex) \
+ ((ntohl((ex).a_midmag) >> 16) & 0x03ff)
+#define N_GETFLAG_NET(ex) \
+ ((ntohl((ex).a_midmag) >> 26) & 0x3f)
+#define N_SETMAGIC_NET(ex,mag,mid,flag) \
+ ( (ex).a_midmag = htonl( (((flag)&0x3f)<<26) | (((mid)&0x03ff)<<16) | \
+ (((mag)&0xffff)) ) )
+
#define N_ALIGN(ex,x) \
- ((ex).a_magic == ZMAGIC || (ex).a_magic == QMAGIC ? \
+ (N_GETMAGIC(ex) == ZMAGIC || N_GETMAGIC(ex) == QMAGIC || \
+ N_GETMAGIC_NET(ex) == ZMAGIC || N_GETMAGIC_NET(ex) == QMAGIC ? \
((x) + __LDPGSZ - 1) & ~(__LDPGSZ - 1) : (x))
/* Valid magic number check. */
#define N_BADMAG(ex) \
- ((ex).a_magic != NMAGIC && (ex).a_magic != OMAGIC && \
- (ex).a_magic != ZMAGIC && (ex).a_magic != QMAGIC)
+ (N_GETMAGIC(ex) != OMAGIC && N_GETMAGIC(ex) != NMAGIC && \
+ N_GETMAGIC(ex) != ZMAGIC && N_GETMAGIC(ex) != QMAGIC && \
+ N_GETMAGIC_NET(ex) != OMAGIC && N_GETMAGIC_NET(ex) != NMAGIC && \
+ N_GETMAGIC_NET(ex) != ZMAGIC && N_GETMAGIC_NET(ex) != QMAGIC)
+
/* Address of the bottom of the text segment. */
-#define N_TXTADDR(ex) ((ex).a_magic == QMAGIC ? __LDPGSZ : 0)
+#define N_TXTADDR(ex) \
+ ((N_GETMAGIC(ex) == OMAGIC || N_GETMAGIC(ex) == NMAGIC || \
+ N_GETMAGIC(ex) == ZMAGIC) ? 0 : __LDPGSZ)
/* Address of the bottom of the data segment. */
#define N_DATADDR(ex) \
@@ -63,8 +91,8 @@
/* Text segment offset. */
#define N_TXTOFF(ex) \
- ((ex).a_magic == ZMAGIC ? __LDPGSZ \
- : ((ex).a_magic == QMAGIC ? 0 : sizeof(struct exec)))
+ (N_GETMAGIC(ex) == ZMAGIC ? __LDPGSZ : (N_GETMAGIC(ex) == QMAGIC || \
+ N_GETMAGIC_NET(ex) == ZMAGIC) ? 0 : sizeof(struct exec))
/* Data segment offset. */
#define N_DATOFF(ex) \
@@ -83,12 +111,15 @@
/* Relocation format. */
struct relocation_info {
- int r_address; /* offset in text or data segment */
- unsigned int r_symbolnum : 24, /* ordinal number of add symbol */
- r_pcrel : 1, /* 1 if value should be pc-relative */
- r_length : 2, /* log base 2 of value's width */
- r_extern : 1, /* 1 if need to add symbol to value */
- : 4; /* reserved */
+ int r_address; /* offset in text or data segment */
+ unsigned int r_symbolnum : 24, /* ordinal number of add symbol */
+ r_pcrel : 1, /* 1 if value should be pc-relative */
+ r_length : 2, /* log base 2 of value's width */
+ r_extern : 1, /* 1 if need to add symbol to value */
+ r_baserel : 1, /* linkage table relative */
+ r_jmptable : 1, /* relocate to jump table */
+ r_relative : 1, /* load address relative */
+ r_copy : 1; /* run time copy */
};
#define _AOUT_INCLUDE_
diff --git a/include/ar.h b/include/ar.h
index b0bd443fd0e5..7aacb441cfd3 100644
--- a/include/ar.h
+++ b/include/ar.h
@@ -1,3 +1,12 @@
+/*
+ * Copyright (c) UNIX System Laboratories, Inc. All or some portions
+ * of this file are derived from material licensed to the
+ * University of California by American Telephone and Telegraph Co.
+ * or UNIX System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * $Id: ar.h,v 1.1.1.1.2.1 1994/05/04 07:37:40 rgrimes Exp $
+ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
* All rights reserved.
diff --git a/include/assert.h b/include/assert.h
index 91bed604f41c..99b1d8320282 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -1,3 +1,12 @@
+/*
+ * Copyright (c) UNIX System Laboratories, Inc. All or some portions
+ * of this file are derived from material licensed to the
+ * University of California by American Telephone and Telegraph Co.
+ * or UNIX System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * $Id: assert.h,v 1.2.2.1 1994/05/04 07:37:42 rgrimes Exp $
+ */
/*-
* Copyright (c) 1992 The Regents of the University of California.
* All rights reserved.
diff --git a/include/bitstring.h b/include/bitstring.h
index 21f10f697a15..2ed0e65e8ca2 100644
--- a/include/bitstring.h
+++ b/include/bitstring.h
@@ -33,12 +33,20 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)bitstring.h 5.5 (Berkeley) 4/3/91
+ * from: @(#)bitstring.h 5.5 (Berkeley) 4/3/91
+ * $Id: bitstring.h,v 1.2 1994/02/17 08:54:00 rgrimes Exp $
*/
#ifndef _BITSTRING_H_
-#define _BITSTRING_H_
+#define _BITSTRING_H_
+/* modified for SV/AT and bitstring bugfix by M.R.Murphy, 11oct91
+ * bitstr_size changed gratuitously, but shorter
+ * bit_alloc spelling error fixed
+ * the following were efficient, but didn't work, they've been made to
+ * work, but are no longer as efficient :-)
+ * bit_nclear, bit_nset, bit_ffc, bit_ffs
+ */
typedef unsigned char bitstr_t;
/* internal macros */
@@ -53,12 +61,11 @@ typedef unsigned char bitstr_t;
/* external macros */
/* bytes in a bitstring of nbits bits */
#define bitstr_size(nbits) \
- ((((nbits) - 1) >> 3) + 1)
+ (((nbits) + 7) >> 3)
/* allocate a bitstring */
#define bit_alloc(nbits) \
- (bitstr_t *)calloc(1, \
- (unsigned int)_bitstr_size(nbits) * sizeof(bitstr_t))
+ (bitstr_t *)calloc((size_t)bitstr_size(nbits), sizeof(bitstr_t))
/* allocate a bitstring on the stack */
#define bit_decl(name, nbits) \
@@ -80,36 +87,29 @@ typedef unsigned char bitstr_t;
#define bit_nclear(name, start, stop) { \
register bitstr_t *_name = name; \
register int _start = start, _stop = stop; \
- register int _startbyte = _bit_byte(_start); \
- register int _stopbyte = _bit_byte(_stop); \
- _name[_startbyte] &= 0xff >> (8 - (_start&0x7)); \
- while (++_startbyte < _stopbyte) \
- _name[_startbyte] = 0; \
- _name[_stopbyte] &= 0xff << ((_stop&0x7) + 1); \
+ while (_start <= _stop) { \
+ bit_clear(_name, _start); \
+ _start++; \
+ } \
}
/* set bits start ... stop in bitstring */
#define bit_nset(name, start, stop) { \
register bitstr_t *_name = name; \
register int _start = start, _stop = stop; \
- register int _startbyte = _bit_byte(_start); \
- register int _stopbyte = _bit_byte(_stop); \
- _name[_startbyte] |= 0xff << ((start)&0x7); \
- while (++_startbyte < _stopbyte) \
- _name[_startbyte] = 0xff; \
- _name[_stopbyte] |= 0xff >> (7 - (_stop&0x7)); \
+ while (_start <= _stop) { \
+ bit_set(_name, _start); \
+ _start++; \
+ } \
}
/* find first bit clear in name */
#define bit_ffc(name, nbits, value) { \
register bitstr_t *_name = name; \
- register int _byte, _nbits = nbits; \
- register int _stopbyte = _bit_byte(_nbits), _value = -1; \
- for (_byte = 0; _byte <= _stopbyte; ++_byte) \
- if (_name[_byte] != 0xff) { \
- _value = _byte << 3; \
- for (_stopbyte = _name[_byte]; (_stopbyte&0x1); \
- ++_value, _stopbyte >>= 1); \
+ register int _bit, _nbits = nbits, _value = -1; \
+ for (_bit = 0; _bit < _nbits; ++_bit) \
+ if (!bit_test(_name, _bit)) { \
+ _value = _bit; \
break; \
} \
*(value) = _value; \
@@ -118,13 +118,10 @@ typedef unsigned char bitstr_t;
/* find first bit set in name */
#define bit_ffs(name, nbits, value) { \
register bitstr_t *_name = name; \
- register int _byte, _nbits = nbits; \
- register int _stopbyte = _bit_byte(_nbits), _value = -1; \
- for (_byte = 0; _byte <= _stopbyte; ++_byte) \
- if (_name[_byte]) { \
- _value = _byte << 3; \
- for (_stopbyte = _name[_byte]; !(_stopbyte&0x1); \
- ++_value, _stopbyte >>= 1); \
+ register int _bit, _nbits = nbits, _value = -1; \
+ for (_bit = 0; _bit < _nbits; ++_bit) \
+ if (bit_test(_name, _bit)) { \
+ _value = _bit; \
break; \
} \
*(value) = _value; \
diff --git a/include/ctype.h b/include/ctype.h
index b7d292c3e670..cdfddcbb81b2 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -1,4 +1,13 @@
/*
+ * Copyright (c) UNIX System Laboratories, Inc. All or some portions
+ * of this file are derived from material licensed to the
+ * University of California by American Telephone and Telegraph Co.
+ * or UNIX System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * $Id: ctype.h,v 1.2.2.1 1994/05/04 07:37:44 rgrimes Exp $
+ */
+/*
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
*
diff --git a/include/db.h b/include/db.h
index 2b7de273a517..f89cbbb7c5c7 100644
--- a/include/db.h
+++ b/include/db.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)db.h 8.1 (Berkeley) 6/2/93
+ * @(#)db.h 8.3 (Berkeley) 10/12/93
*/
#ifndef _DB_H_
@@ -40,6 +40,8 @@
#include <sys/cdefs.h>
#include <machine/endian.h>
+#include <limits.h>
+
#define RET_ERROR -1 /* Return values. */
#define RET_SUCCESS 0
#define RET_SPECIAL 1
@@ -72,20 +74,40 @@ typedef struct {
typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE;
-#define __USE_OPEN_FLAGS \
- (O_CREAT|O_EXCL|O_EXLOCK|O_RDONLY|O_RDWR|O_SHLOCK|O_TRUNC)
+/*
+ * !!!
+ * The following flags are included in the dbopen(3) call as part of the
+ * open(2) flags. In order to avoid conflicts with the open flags, start
+ * at the top of the 16 or 32-bit number space and work our way down. If
+ * the open flags were significantly expanded in the future, it could be
+ * a problem. Wish I'd left another flags word in the dbopen call.
+ *
+ * !!!
+ * None of this stuff is implemented yet. The only reason that it's here
+ * is so that the access methods can skip copying the key/data pair when
+ * the DB_LOCK flag isn't set.
+ */
+#if UINT_MAX > 65535
+#define DB_LOCK 0x20000000 /* Do locking. */
+#define DB_SHMEM 0x40000000 /* Use shared memory. */
+#define DB_TXN 0x80000000 /* Do transactions. */
+#else
+#define DB_LOCK 0x00002000 /* Do locking. */
+#define DB_SHMEM 0x00004000 /* Use shared memory. */
+#define DB_TXN 0x00008000 /* Do transactions. */
+#endif
/* Access method description structure. */
typedef struct __db {
- DBTYPE type; /* underlying db type */
+ DBTYPE type; /* Underlying db type. */
int (*close) __P((struct __db *));
int (*del) __P((const struct __db *, const DBT *, u_int));
- int (*fd) __P((const struct __db *));
int (*get) __P((const struct __db *, const DBT *, DBT *, u_int));
int (*put) __P((const struct __db *, DBT *, const DBT *, u_int));
int (*seq) __P((const struct __db *, DBT *, DBT *, u_int));
int (*sync) __P((const struct __db *, u_int));
- void *internal; /* access method private */
+ void *internal; /* Access method private. */
+ int (*fd) __P((const struct __db *));
} DB;
#define BTREEMAGIC 0x053162
@@ -139,25 +161,25 @@ typedef struct {
* BLPSWAP swap a referenced memory location
* BLSWAP_COPY swap from one location to another
*/
-#define BLSWAP(a) { \
- u_long _tmp = a; \
- ((char *)&a)[0] = ((char *)&_tmp)[3]; \
- ((char *)&a)[1] = ((char *)&_tmp)[2]; \
- ((char *)&a)[2] = ((char *)&_tmp)[1]; \
- ((char *)&a)[3] = ((char *)&_tmp)[0]; \
+#define BLSWAP(a) { \
+ u_long _tmp = a; \
+ ((char *)&a)[0] = ((char *)&_tmp)[3]; \
+ ((char *)&a)[1] = ((char *)&_tmp)[2]; \
+ ((char *)&a)[2] = ((char *)&_tmp)[1]; \
+ ((char *)&a)[3] = ((char *)&_tmp)[0]; \
}
-#define BLPSWAP(a) { \
- u_long _tmp = *(u_long *)a; \
- ((char *)a)[0] = ((char *)&_tmp)[3]; \
- ((char *)a)[1] = ((char *)&_tmp)[2]; \
- ((char *)a)[2] = ((char *)&_tmp)[1]; \
- ((char *)a)[3] = ((char *)&_tmp)[0]; \
+#define BLPSWAP(a) { \
+ u_long _tmp = *(u_long *)a; \
+ ((char *)a)[0] = ((char *)&_tmp)[3]; \
+ ((char *)a)[1] = ((char *)&_tmp)[2]; \
+ ((char *)a)[2] = ((char *)&_tmp)[1]; \
+ ((char *)a)[3] = ((char *)&_tmp)[0]; \
}
-#define BLSWAP_COPY(a, b) { \
- ((char *)&(b))[0] = ((char *)&(a))[3]; \
- ((char *)&(b))[1] = ((char *)&(a))[2]; \
- ((char *)&(b))[2] = ((char *)&(a))[1]; \
- ((char *)&(b))[3] = ((char *)&(a))[0]; \
+#define BLSWAP_COPY(a, b) { \
+ ((char *)&(b))[0] = ((char *)&(a))[3]; \
+ ((char *)&(b))[1] = ((char *)&(a))[2]; \
+ ((char *)&(b))[2] = ((char *)&(a))[1]; \
+ ((char *)&(b))[3] = ((char *)&(a))[0]; \
}
/*
@@ -166,28 +188,28 @@ typedef struct {
* BSPSWAP swap a referenced memory location
* BSSWAP_COPY swap from one location to another
*/
-#define BSSWAP(a) { \
- u_short _tmp = a; \
- ((char *)&a)[0] = ((char *)&_tmp)[1]; \
- ((char *)&a)[1] = ((char *)&_tmp)[0]; \
+#define BSSWAP(a) { \
+ u_short _tmp = a; \
+ ((char *)&a)[0] = ((char *)&_tmp)[1]; \
+ ((char *)&a)[1] = ((char *)&_tmp)[0]; \
}
-#define BSPSWAP(a) { \
- u_short _tmp = *(u_short *)a; \
- ((char *)a)[0] = ((char *)&_tmp)[1]; \
- ((char *)a)[1] = ((char *)&_tmp)[0]; \
+#define BSPSWAP(a) { \
+ u_short _tmp = *(u_short *)a; \
+ ((char *)a)[0] = ((char *)&_tmp)[1]; \
+ ((char *)a)[1] = ((char *)&_tmp)[0]; \
}
-#define BSSWAP_COPY(a, b) { \
- ((char *)&(b))[0] = ((char *)&(a))[1]; \
- ((char *)&(b))[1] = ((char *)&(a))[0]; \
+#define BSSWAP_COPY(a, b) { \
+ ((char *)&(b))[0] = ((char *)&(a))[1]; \
+ ((char *)&(b))[1] = ((char *)&(a))[0]; \
}
__BEGIN_DECLS
DB *dbopen __P((const char *, int, int, DBTYPE, const void *));
#ifdef __DBINTERFACE_PRIVATE
-DB *__bt_open __P((const char *, int, int, const BTREEINFO *));
-DB *__hash_open __P((const char *, int, int, const HASHINFO *));
-DB *__rec_open __P((const char *, int, int, const RECNOINFO *));
+DB *__bt_open __P((const char *, int, int, const BTREEINFO *, int));
+DB *__hash_open __P((const char *, int, int, const HASHINFO *, int));
+DB *__rec_open __P((const char *, int, int, const RECNOINFO *, int));
void __dbpanic __P((DB *dbp));
#endif
__END_DECLS
diff --git a/include/f2c.h b/include/f2c.h
new file mode 100644
index 000000000000..fc1e9791fbc7
--- /dev/null
+++ b/include/f2c.h
@@ -0,0 +1,214 @@
+/* f2c.h -- Standard Fortran to C header file */
+
+/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
+
+ - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
+
+#ifndef F2C_INCLUDE
+#define F2C_INCLUDE
+
+typedef long int integer;
+typedef char *address;
+typedef short int shortint;
+typedef float real;
+typedef double doublereal;
+typedef struct { real r, i; } complex;
+typedef struct { doublereal r, i; } doublecomplex;
+typedef long int logical;
+typedef short int shortlogical;
+typedef char logical1;
+typedef char integer1;
+/* typedef long long longint; */ /* system-dependent */
+
+#define TRUE_ (1)
+#define FALSE_ (0)
+
+/* Extern is for use with -E */
+#ifndef Extern
+#define Extern extern
+#endif
+
+/* I/O stuff */
+
+#ifdef f2c_i2
+/* for -i2 */
+typedef short flag;
+typedef short ftnlen;
+typedef short ftnint;
+#else
+typedef long flag;
+typedef long ftnlen;
+typedef long ftnint;
+#endif
+
+/*external read, write*/
+typedef struct
+{ flag cierr;
+ ftnint ciunit;
+ flag ciend;
+ char *cifmt;
+ ftnint cirec;
+} cilist;
+
+/*internal read, write*/
+typedef struct
+{ flag icierr;
+ char *iciunit;
+ flag iciend;
+ char *icifmt;
+ ftnint icirlen;
+ ftnint icirnum;
+} icilist;
+
+/*open*/
+typedef struct
+{ flag oerr;
+ ftnint ounit;
+ char *ofnm;
+ ftnlen ofnmlen;
+ char *osta;
+ char *oacc;
+ char *ofm;
+ ftnint orl;
+ char *oblnk;
+} olist;
+
+/*close*/
+typedef struct
+{ flag cerr;
+ ftnint cunit;
+ char *csta;
+} cllist;
+
+/*rewind, backspace, endfile*/
+typedef struct
+{ flag aerr;
+ ftnint aunit;
+} alist;
+
+/* inquire */
+typedef struct
+{ flag inerr;
+ ftnint inunit;
+ char *infile;
+ ftnlen infilen;
+ ftnint *inex; /*parameters in standard's order*/
+ ftnint *inopen;
+ ftnint *innum;
+ ftnint *innamed;
+ char *inname;
+ ftnlen innamlen;
+ char *inacc;
+ ftnlen inacclen;
+ char *inseq;
+ ftnlen inseqlen;
+ char *indir;
+ ftnlen indirlen;
+ char *infmt;
+ ftnlen infmtlen;
+ char *inform;
+ ftnint informlen;
+ char *inunf;
+ ftnlen inunflen;
+ ftnint *inrecl;
+ ftnint *innrec;
+ char *inblank;
+ ftnlen inblanklen;
+} inlist;
+
+#define VOID void
+
+union Multitype { /* for multiple entry points */
+ integer1 g;
+ shortint h;
+ integer i;
+ /* longint j; */
+ real r;
+ doublereal d;
+ complex c;
+ doublecomplex z;
+ };
+
+typedef union Multitype Multitype;
+
+typedef long Long; /* No longer used; formerly in Namelist */
+
+struct Vardesc { /* for Namelist */
+ char *name;
+ char *addr;
+ ftnlen *dims;
+ int type;
+ };
+typedef struct Vardesc Vardesc;
+
+struct Namelist {
+ char *name;
+ Vardesc **vars;
+ int nvars;
+ };
+typedef struct Namelist Namelist;
+
+#define abs(x) ((x) >= 0 ? (x) : -(x))
+#define dabs(x) (doublereal)abs(x)
+#define min(a,b) ((a) <= (b) ? (a) : (b))
+#define max(a,b) ((a) >= (b) ? (a) : (b))
+#define dmin(a,b) (doublereal)min(a,b)
+#define dmax(a,b) (doublereal)max(a,b)
+
+/* procedure parameter types for -A and -C++ */
+
+#define F2C_proc_par_types 1
+#ifdef __cplusplus
+typedef int /* Unknown procedure type */ (*U_fp)(...);
+typedef shortint (*J_fp)(...);
+typedef integer (*I_fp)(...);
+typedef real (*R_fp)(...);
+typedef doublereal (*D_fp)(...), (*E_fp)(...);
+typedef /* Complex */ VOID (*C_fp)(...);
+typedef /* Double Complex */ VOID (*Z_fp)(...);
+typedef logical (*L_fp)(...);
+typedef shortlogical (*K_fp)(...);
+typedef /* Character */ VOID (*H_fp)(...);
+typedef /* Subroutine */ int (*S_fp)(...);
+#else
+typedef int /* Unknown procedure type */ (*U_fp)();
+typedef shortint (*J_fp)();
+typedef integer (*I_fp)();
+typedef real (*R_fp)();
+typedef doublereal (*D_fp)(), (*E_fp)();
+typedef /* Complex */ VOID (*C_fp)();
+typedef /* Double Complex */ VOID (*Z_fp)();
+typedef logical (*L_fp)();
+typedef shortlogical (*K_fp)();
+typedef /* Character */ VOID (*H_fp)();
+typedef /* Subroutine */ int (*S_fp)();
+#endif
+/* E_fp is for real functions when -R is not specified */
+typedef VOID C_f; /* complex function */
+typedef VOID H_f; /* character function */
+typedef VOID Z_f; /* double complex function */
+typedef doublereal E_f; /* real function with -R not specified */
+
+/* undef any lower-case symbols that your C compiler predefines, e.g.: */
+
+#ifndef Skip_f2c_Undefs
+#undef cray
+#undef gcos
+#undef mc68010
+#undef mc68020
+#undef mips
+#undef pdp11
+#undef sgi
+#undef sparc
+#undef sun
+#undef sun2
+#undef sun3
+#undef sun4
+#undef u370
+#undef u3b
+#undef u3b2
+#undef u3b5
+#undef unix
+#undef vax
+#endif
+#endif
diff --git a/include/grp.h b/include/grp.h
index 0e699afe48c6..1a9afba0a521 100644
--- a/include/grp.h
+++ b/include/grp.h
@@ -1,3 +1,12 @@
+/*
+ * Copyright (c) UNIX System Laboratories, Inc. All or some portions
+ * of this file are derived from material licensed to the
+ * University of California by American Telephone and Telegraph Co.
+ * or UNIX System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * $Id: grp.h,v 1.2.2.1 1994/05/04 07:37:45 rgrimes Exp $
+ */
/*-
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
@@ -54,7 +63,7 @@ struct group *getgrgid __P((gid_t));
struct group *getgrnam __P((const char *));
#ifndef _POSIX_SOURCE
struct group *getgrent __P((void));
-int setgrent __P((void));
+void setgrent __P((void));
void endgrent __P((void));
void setgrfile __P((const char *));
int setgroupent __P((int));
diff --git a/include/link.h b/include/link.h
new file mode 100644
index 000000000000..2a77b243a8dc
--- /dev/null
+++ b/include/link.h
@@ -0,0 +1,289 @@
+/*
+ * Copyright (c) 1993 Paul Kranenburg
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Paul Kranenburg.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software withough specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $Id: link.h,v 1.2 1994/02/13 20:47:18 jkh Exp $
+ */
+
+/*
+ * RRS section definitions.
+ *
+ * The layout of some data structures defined in this header file is
+ * such that we can provide compatibility with the SunOS 4.x shared
+ * library scheme.
+ */
+
+#ifndef _LINK_H_
+#define _LINK_H_
+
+/*
+ * A `Shared Object Descriptor' descibes a shared object that is needed
+ * to complete the link edit process of the object containing it.
+ * A list of such objects (chained through `sod_next') is pointed at
+ * by `sdt_sods' in the section_dispatch_table structure.
+ */
+
+struct sod { /* Shared Object Descriptor */
+ long sod_name; /* name (relative to load address) */
+ u_int sod_library : 1, /* Searched for by library rules */
+ sod_reserved : 31;
+ short sod_major; /* major version number */
+ short sod_minor; /* minor version number */
+ long sod_next; /* next sod */
+};
+
+/*
+ * `Shared Object Map's are used by the run-time link editor (ld.so) to
+ * keep track of all shared objects loaded into a process' address space.
+ * These structures are only used at run-time and do not occur within
+ * the text or data segment of an executable or shared library.
+ */
+struct so_map { /* Shared Object Map */
+ caddr_t som_addr; /* Address at which object mapped */
+ char *som_path; /* Path to mmap'ed file */
+ struct so_map *som_next; /* Next map in chain */
+ struct sod *som_sod; /* Sod responsible for this map */
+ caddr_t som_sodbase; /* Base address of this sod */
+ u_int som_write : 1; /* Text is currently writable */
+ struct _dynamic *som_dynamic; /* _dynamic structure */
+ caddr_t som_spd; /* Private data */
+};
+
+/*
+ * Symbol description with size. This is simply an `nlist' with
+ * one field (nz_size) added.
+ * Used to convey size information on items in the data segment
+ * of shared objects. An array of these live in the shared object's
+ * text segment and is addressed by the `sdt_nzlist' field.
+ */
+struct nzlist {
+ struct nlist nlist;
+ u_long nz_size;
+#define nz_un nlist.n_un
+#define nz_strx nlist.n_un.n_strx
+#define nz_name nlist.n_un.n_name
+#define nz_type nlist.n_type
+#define nz_value nlist.n_value
+#define nz_desc nlist.n_desc
+#define nz_other nlist.n_other
+};
+
+#define N_AUX(p) ((p)->n_other & 0xf)
+#define N_RESERVED(p) (((unsigned int)(p)->n_other >> 4) & 0xf)
+#define N_OTHER(r, v) (((unsigned int)(r) << 4) | ((v) & 0xf))
+
+#define AUX_OBJECT 1
+#define AUX_FUNC 2
+
+
+/*
+ * The `section_dispatch_table' structure contains offsets to various data
+ * structures needed to do run-time relocation.
+ */
+struct section_dispatch_table {
+ struct so_map *sdt_loaded; /* List of loaded objects */
+ long sdt_sods; /* List of shared objects descriptors */
+ long sdt_filler1; /* Unused (was: search rules) */
+ long sdt_got; /* Global offset table */
+ long sdt_plt; /* Procedure linkage table */
+ long sdt_rel; /* Relocation table */
+ long sdt_hash; /* Symbol hash table */
+ long sdt_nzlist; /* Symbol table itself */
+ long sdt_filler2; /* Unused (was: stab_hash) */
+ long sdt_buckets; /* Number of hash buckets */
+ long sdt_strings; /* Symbol strings */
+ long sdt_str_sz; /* Size of symbol strings */
+ long sdt_text_sz; /* Size of text area */
+ long sdt_plt_sz; /* Size of procedure linkage table */
+};
+
+/*
+ * RRS symbol hash table, addressed by `sdt_hash' in section_dispatch_table.
+ * Used to quickly lookup symbols of the shared object by hashing
+ * on the symbol's name. `rh_symbolnum' is the index of the symbol
+ * in the shared object's symbol list (`sdt_nzlist'), `rh_next' is
+ * the next symbol in the hash bucket (in case of collisions).
+ */
+struct rrs_hash {
+ int rh_symbolnum; /* Symbol number */
+ int rh_next; /* Next hash entry */
+};
+
+/*
+ * `rt_symbols' is used to keep track of run-time allocated commons
+ * and data items copied from shared objects.
+ */
+struct rt_symbol {
+ struct nzlist *rt_sp; /* The symbol */
+ struct rt_symbol *rt_next; /* Next in linear list */
+ struct rt_symbol *rt_link; /* Next in bucket */
+ caddr_t rt_srcaddr; /* Address of "master" copy */
+ struct so_map *rt_smp; /* Originating map */
+};
+
+/*
+ * Debugger interface structure.
+ */
+struct so_debug {
+ int dd_version; /* Version # of interface */
+ int dd_in_debugger; /* Set when run by debugger */
+ int dd_sym_loaded; /* Run-time linking brought more
+ symbols into scope */
+ char *dd_bpt_addr; /* Address of rtld-generated bpt */
+ int dd_bpt_shadow; /* Original contents of bpt */
+ struct rt_symbol *dd_cc; /* Allocated commons/copied data */
+};
+
+/*
+ * Entry points into ld.so - user interface to the run-time linker.
+ */
+struct ld_entry {
+ void *(*dlopen) __P((char *, int));
+ int (*dlclose) __P((void *));
+ void *(*dlsym) __P((void *, char *));
+ int (*dlctl) __P((void *, int, void *));
+};
+
+/*
+ * dlctl() commands
+ */
+#define DL_GETERRNO 1
+
+/*
+ * dl*() prototypes.
+ */
+extern void *dlopen __P((char *, int));
+extern int dlclose __P((void *));
+extern void *dlsym __P((void *, char *));
+extern int dlctl __P((void *, int, void *));
+
+
+/*
+ * This is the structure pointed at by the __DYNAMIC symbol if an
+ * executable requires the attention of the run-time link editor.
+ * __DYNAMIC is given the value zero if no run-time linking needs to
+ * be done (it is always present in shared objects).
+ * The union `d_un' provides for different versions of the dynamic
+ * linking mechanism (switched on by `d_version'). The last version
+ * used by Sun is 3. We leave some room here and go to version number
+ * 8 for NetBSD, the main difference lying in the support for the
+ * `nz_list' type of symbols.
+ */
+
+struct _dynamic {
+ int d_version; /* version # of this interface */
+ struct so_debug *d_debug;
+ union {
+ struct section_dispatch_table *d_sdt;
+ } d_un;
+ struct ld_entry *d_entry;
+};
+
+#define LD_VERSION_SUN (3)
+#define LD_VERSION_BSD (8)
+#define LD_VERSION_NZLIST_P(v) ((v) >= 8)
+
+#define LD_GOT(x) ((x)->d_un.d_sdt->sdt_got)
+#define LD_PLT(x) ((x)->d_un.d_sdt->sdt_plt)
+#define LD_REL(x) ((x)->d_un.d_sdt->sdt_rel)
+#define LD_SYMBOL(x) ((x)->d_un.d_sdt->sdt_nzlist)
+#define LD_HASH(x) ((x)->d_un.d_sdt->sdt_hash)
+#define LD_STRINGS(x) ((x)->d_un.d_sdt->sdt_strings)
+#define LD_NEED(x) ((x)->d_un.d_sdt->sdt_sods)
+#define LD_BUCKETS(x) ((x)->d_un.d_sdt->sdt_buckets)
+
+#define LD_GOTSZ(x) ((x)->d_un.d_sdt->sdt_plt - (x)->d_un.d_sdt->sdt_got)
+#define LD_RELSZ(x) ((x)->d_un.d_sdt->sdt_hash - (x)->d_un.d_sdt->sdt_rel)
+#define LD_HASHSZ(x) ((x)->d_un.d_sdt->sdt_nzlist - (x)->d_un.d_sdt->sdt_hash)
+#define LD_STABSZ(x) ((x)->d_un.d_sdt->sdt_strings - (x)->d_un.d_sdt->sdt_nzlist)
+#define LD_PLTSZ(x) ((x)->d_un.d_sdt->sdt_plt_sz)
+#define LD_STRSZ(x) ((x)->d_un.d_sdt->sdt_str_sz)
+#define LD_TEXTSZ(x) ((x)->d_un.d_sdt->sdt_text_sz)
+
+/*
+ * Interface to ld.so
+ */
+struct crt_ldso {
+ int crt_ba; /* Base address of ld.so */
+ int crt_dzfd; /* "/dev/zero" file decriptor (SunOS) */
+ int crt_ldfd; /* ld.so file descriptor */
+ struct _dynamic *crt_dp; /* Main's __DYNAMIC */
+ char **crt_ep; /* environment strings */
+ caddr_t crt_bp; /* Breakpoint if run from debugger */
+ char *crt_prog; /* Program name */
+};
+
+/*
+ * Version passed from crt0 to ld.so (1st argument to _rtld()).
+ */
+#define CRT_VERSION_SUN 1
+#define CRT_VERSION_BSD 2
+#define CRT_VERSION_BSD_2 2
+#define CRT_VERSION_BSD_3 3
+
+
+/*
+ * Maximum number of recognized shared object version numbers.
+ */
+#define MAXDEWEY 8
+
+/*
+ * Header of the hints file.
+ */
+struct hints_header {
+ long hh_magic;
+#define HH_MAGIC 011421044151
+ long hh_version; /* Interface version number */
+#define LD_HINTS_VERSION_1 1
+ long hh_hashtab; /* Location of hash table */
+ long hh_nbucket; /* Number of buckets in hashtab */
+ long hh_strtab; /* Location of strings */
+ long hh_strtab_sz; /* Size of strings */
+ long hh_ehints; /* End of hints (max offset in file) */
+};
+
+#define HH_BADMAG(hdr) ((hdr).hh_magic != HH_MAGIC)
+
+/*
+ * Hash table element in hints file.
+ */
+struct hints_bucket {
+ /* namex and pathx are indices into the string table */
+ int hi_namex; /* Library name */
+ int hi_pathx; /* Full path */
+ int hi_dewey[MAXDEWEY]; /* The versions */
+ int hi_ndewey; /* Number of version numbers */
+#define hi_major hi_dewey[0]
+#define hi_minor hi_dewey[1]
+ int hi_next; /* Next in this bucket */
+};
+
+#define _PATH_LD_HINTS "/var/run/ld.so.hints"
+
+#endif /* _LINK_H_ */
+
diff --git a/include/math.h b/include/math.h
index 036e6e454091..99d14ab04771 100644
--- a/include/math.h
+++ b/include/math.h
@@ -119,6 +119,7 @@ double j0 __P((double));
double j1 __P((double));
double jn __P((int, double));
double lgamma __P((double));
+double gamma __P((double));
double log1p __P((double));
double logb __P((double));
double rint __P((double));
diff --git a/include/mpool.h b/include/mpool.h
index 0cbdd39d26f9..910e0782aa9d 100644
--- a/include/mpool.h
+++ b/include/mpool.h
@@ -33,8 +33,6 @@
* @(#)mpool.h 8.1 (Berkeley) 6/2/93
*/
-#ifndef _MPOOL_H_
-#define _MPOOL_H
/*
* The memory pool scheme is a simple one. Each in memory page is referenced
* by a bucket which is threaded in three ways. All active pages are threaded
@@ -135,5 +133,3 @@ int mpool_close __P((MPOOL *));
void mpool_stat __P((MPOOL *));
#endif
__END_DECLS
-
-#endif /* _MPOOL_H_ */
diff --git a/include/nlist.h b/include/nlist.h
index e397b746a959..1191e7a9d7f1 100644
--- a/include/nlist.h
+++ b/include/nlist.h
@@ -1,3 +1,12 @@
+/*
+ * Copyright (c) UNIX System Laboratories, Inc. All or some portions
+ * of this file are derived from material licensed to the
+ * University of California by American Telephone and Telegraph Co.
+ * or UNIX System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * $Id: nlist.h,v 1.2.2.1 1994/05/04 07:37:49 rgrimes Exp $
+ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
* All rights reserved.
@@ -55,7 +64,13 @@ struct nlist {
#define N_TEXT 0x04 /* text segment */
#define N_DATA 0x06 /* data segment */
#define N_BSS 0x08 /* bss segment */
+#define N_INDR 0x0a /* indirect reference */
#define N_COMM 0x12 /* common reference */
+#define N_SETA 0x14 /* absolute set element symbol */
+#define N_SETT 0x16 /* text set element symbol */
+#define N_SETD 0x18 /* data set element symbol */
+#define N_SETB 0x1a /* bss set element symbol */
+#define N_SETV 0x1c /* pointer to set vector in data area */
#define N_FN 0x1e /* file name */
#define N_EXT 0x01 /* external (global) bit, OR'ed in */
diff --git a/include/protocols/dumprestore.h b/include/protocols/dumprestore.h
index 3b7b8c36f3f9..ff6d868be4d6 100644
--- a/include/protocols/dumprestore.h
+++ b/include/protocols/dumprestore.h
@@ -1,4 +1,13 @@
/*
+ * Copyright (c) UNIX System Laboratories, Inc. All or some portions
+ * of this file are derived from material licensed to the
+ * University of California by American Telephone and Telegraph Co.
+ * or UNIX System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * $Id: dumprestore.h,v 1.1.1.1.2.1 1994/05/04 07:38:27 rgrimes Exp $
+ */
+/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved.
*
diff --git a/include/pwd.h b/include/pwd.h
index 8b25a47875b2..7775f58ab0ee 100644
--- a/include/pwd.h
+++ b/include/pwd.h
@@ -1,3 +1,12 @@
+/*
+ * Copyright (c) UNIX System Laboratories, Inc. All or some portions
+ * of this file are derived from material licensed to the
+ * University of California by American Telephone and Telegraph Co.
+ * or UNIX System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * $Id: pwd.h,v 1.3.2.1 1994/05/04 07:37:52 rgrimes Exp $
+ */
/*-
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
@@ -82,7 +91,7 @@ struct passwd *getpwnam __P((const char *));
#ifndef _POSIX_SOURCE
struct passwd *getpwent __P((void));
int setpassent __P((int));
-int setpwent __P((void));
+void setpwent __P((void));
void endpwent __P((void));
#endif
__END_DECLS
diff --git a/include/queue.h b/include/queue.h
new file mode 100644
index 000000000000..40d32ccb6e29
--- /dev/null
+++ b/include/queue.h
@@ -0,0 +1,245 @@
+/*
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)queue.h 8.3 (Berkeley) 12/13/93
+ */
+
+#ifndef _QUEUE_H_
+#define _QUEUE_H_
+
+/*
+ * This file defines three types of data structures: lists, tail queues,
+ * and circular queues.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list after
+ * an existing element or at the head of the list. A list may only be
+ * traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list after
+ * an existing element, at the head of the list, or at the end of the
+ * list. A tail queue may only be traversed in the forward direction.
+ *
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * List definitions.
+ */
+#define LIST_HEAD(name, type) \
+struct name { \
+ struct type *lh_first; /* first element */ \
+}
+
+#define LIST_ENTRY(type) \
+struct { \
+ struct type *le_next; /* next element */ \
+ struct type **le_prev; /* address of previous next element */ \
+}
+
+/*
+ * List functions.
+ */
+#define LIST_INIT(head) { \
+ (head)->lh_first = NULL; \
+}
+
+#define LIST_INSERT_AFTER(listelm, elm, field) { \
+ if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
+ (listelm)->field.le_next->field.le_prev = \
+ &(elm)->field.le_next; \
+ (listelm)->field.le_next = (elm); \
+ (elm)->field.le_prev = &(listelm)->field.le_next; \
+}
+
+#define LIST_INSERT_HEAD(head, elm, field) { \
+ if (((elm)->field.le_next = (head)->lh_first) != NULL) \
+ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+ (head)->lh_first = (elm); \
+ (elm)->field.le_prev = &(head)->lh_first; \
+}
+
+#define LIST_REMOVE(elm, field) { \
+ if ((elm)->field.le_next != NULL) \
+ (elm)->field.le_next->field.le_prev = \
+ (elm)->field.le_prev; \
+ *(elm)->field.le_prev = (elm)->field.le_next; \
+}
+
+/*
+ * Tail queue definitions.
+ */
+#define TAILQ_HEAD(name, type) \
+struct name { \
+ struct type *tqh_first; /* first element */ \
+ struct type **tqh_last; /* addr of last next element */ \
+}
+
+#define TAILQ_ENTRY(type) \
+struct { \
+ struct type *tqe_next; /* next element */ \
+ struct type **tqe_prev; /* address of previous next element */ \
+}
+
+/*
+ * Tail queue functions.
+ */
+#define TAILQ_INIT(head) { \
+ (head)->tqh_first = NULL; \
+ (head)->tqh_last = &(head)->tqh_first; \
+}
+
+#define TAILQ_INSERT_HEAD(head, elm, field) { \
+ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
+ (elm)->field.tqe_next->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (head)->tqh_first = (elm); \
+ (elm)->field.tqe_prev = &(head)->tqh_first; \
+}
+
+#define TAILQ_INSERT_TAIL(head, elm, field) { \
+ (elm)->field.tqe_next = NULL; \
+ (elm)->field.tqe_prev = (head)->tqh_last; \
+ *(head)->tqh_last = (elm); \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+}
+
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field) { \
+ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
+ (elm)->field.tqe_next->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (listelm)->field.tqe_next = (elm); \
+ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
+}
+
+#define TAILQ_REMOVE(head, elm, field) { \
+ if (((elm)->field.tqe_next) != NULL) \
+ (elm)->field.tqe_next->field.tqe_prev = \
+ (elm)->field.tqe_prev; \
+ else \
+ (head)->tqh_last = (elm)->field.tqe_prev; \
+ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
+}
+
+/*
+ * Circular queue definitions.
+ */
+#define CIRCLEQ_HEAD(name, type) \
+struct name { \
+ struct type *cqh_first; /* first element */ \
+ struct type *cqh_last; /* last element */ \
+}
+
+#define CIRCLEQ_ENTRY(type) \
+struct { \
+ struct type *cqe_next; /* next element */ \
+ struct type *cqe_prev; /* previous element */ \
+}
+
+/*
+ * Circular queue functions.
+ */
+#define CIRCLEQ_INIT(head) { \
+ (head)->cqh_first = (void *)(head); \
+ (head)->cqh_last = (void *)(head); \
+}
+
+#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) { \
+ (elm)->field.cqe_next = (listelm)->field.cqe_next; \
+ (elm)->field.cqe_prev = (listelm); \
+ if ((listelm)->field.cqe_next == (void *)(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (listelm)->field.cqe_next->field.cqe_prev = (elm); \
+ (listelm)->field.cqe_next = (elm); \
+}
+
+#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) { \
+ (elm)->field.cqe_next = (listelm); \
+ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
+ if ((listelm)->field.cqe_prev == (void *)(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (listelm)->field.cqe_prev->field.cqe_next = (elm); \
+ (listelm)->field.cqe_prev = (elm); \
+}
+
+#define CIRCLEQ_INSERT_HEAD(head, elm, field) { \
+ (elm)->field.cqe_next = (head)->cqh_first; \
+ (elm)->field.cqe_prev = (void *)(head); \
+ if ((head)->cqh_last == (void *)(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (head)->cqh_first->field.cqe_prev = (elm); \
+ (head)->cqh_first = (elm); \
+}
+
+#define CIRCLEQ_INSERT_TAIL(head, elm, field) { \
+ (elm)->field.cqe_next = (void *)(head); \
+ (elm)->field.cqe_prev = (head)->cqh_last; \
+ if ((head)->cqh_first == (void *)(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (head)->cqh_last->field.cqe_next = (elm); \
+ (head)->cqh_last = (elm); \
+}
+
+#define CIRCLEQ_REMOVE(head, elm, field) { \
+ if ((elm)->field.cqe_next == (void *)(head)) \
+ (head)->cqh_last = (elm)->field.cqe_prev; \
+ else \
+ (elm)->field.cqe_next->field.cqe_prev = \
+ (elm)->field.cqe_prev; \
+ if ((elm)->field.cqe_prev == (void *)(head)) \
+ (head)->cqh_first = (elm)->field.cqe_next; \
+ else \
+ (elm)->field.cqe_prev->field.cqe_next = \
+ (elm)->field.cqe_next; \
+}
+#endif /* !_QUEUE_H_ */
diff --git a/include/regex.h b/include/regex.h
new file mode 100644
index 000000000000..81cf1700f7e4
--- /dev/null
+++ b/include/regex.h
@@ -0,0 +1,108 @@
+/*-
+ * Copyright (c) 1992 Henry Spencer.
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Henry Spencer of the University of Toronto.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)regex.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _REGEX_H_
+#define _REGEX_H_
+
+#include <sys/cdefs.h>
+
+#include <machine/endian.h>
+
+/* types */
+typedef off_t regoff_t;
+
+typedef struct {
+ int re_magic;
+ size_t re_nsub; /* number of parenthesized subexpressions */
+ const char *re_endp; /* end pointer for REG_PEND */
+ struct re_guts *re_g; /* none of your business :-) */
+} regex_t;
+
+typedef struct {
+ regoff_t rm_so; /* start of match */
+ regoff_t rm_eo; /* end of match */
+} regmatch_t;
+
+/* regcomp() flags */
+#define REG_BASIC 0000
+#define REG_EXTENDED 0001
+#define REG_ICASE 0002
+#define REG_NOSUB 0004
+#define REG_NEWLINE 0010
+#define REG_NOSPEC 0020
+#define REG_PEND 0040
+#define REG_DUMP 0200
+
+/* regerror() flags */
+#define REG_NOMATCH 1
+#define REG_BADPAT 2
+#define REG_ECOLLATE 3
+#define REG_ECTYPE 4
+#define REG_EESCAPE 5
+#define REG_ESUBREG 6
+#define REG_EBRACK 7
+#define REG_EPAREN 8
+#define REG_EBRACE 9
+#define REG_BADBR 10
+#define REG_ERANGE 11
+#define REG_ESPACE 12
+#define REG_BADRPT 13
+#define REG_EMPTY 14
+#define REG_ASSERT 15
+#define REG_INVARG 16
+#define REG_ATOI 255 /* convert name to number (!) */
+#define REG_ITOA 0400 /* convert number to name (!) */
+
+/* regexec() flags */
+#define REG_NOTBOL 00001
+#define REG_NOTEOL 00002
+#define REG_STARTEND 00004
+#define REG_TRACE 00400 /* tracing of execution */
+#define REG_LARGE 01000 /* force large representation */
+#define REG_BACKR 02000 /* force use of backref code */
+
+__BEGIN_DECLS
+int regcomp __P((regex_t *, const char *, int));
+size_t regerror __P((int, const regex_t *, char *, size_t));
+int regexec __P((const regex_t *,
+ const char *, size_t, regmatch_t [], int));
+void regfree __P((regex_t *));
+__END_DECLS
+
+#endif /* !_REGEX_H_ */
diff --git a/include/regexp.h b/include/regexp.h
deleted file mode 100644
index 086f990f71f7..000000000000
--- a/include/regexp.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1986 by University of Toronto.
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley
- * by Henry Spencer.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)regexp.h 5.2 (Berkeley) 4/3/91
- */
-
-#ifndef _REGEXP_H_
-#define _REGEXP_H_
-
-/*
- * Definitions etc. for regexp(3) routines.
- *
- * Caveat: this is V8 regexp(3) [actually, a reimplementation thereof],
- * not the System V one.
- */
-#define NSUBEXP 10
-typedef struct regexp {
- char *startp[NSUBEXP];
- char *endp[NSUBEXP];
- char regstart; /* Internal use only. */
- char reganch; /* Internal use only. */
- char *regmust; /* Internal use only. */
- int regmlen; /* Internal use only. */
- char program[1]; /* Unwarranted chumminess with compiler. */
-} regexp;
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-regexp *regcomp __P((const char *));
-int regexec __P((const regexp *, const char *));
-void regsub __P((const regexp *, const char *, char *));
-void regerror __P((const char *));
-__END_DECLS
-
-#endif /* !_REGEXP_H_ */
diff --git a/include/rpcsvc/rstat.x b/include/rpcsvc/rstat.x
index 51839658fa15..2099b4f4994d 100644
--- a/include/rpcsvc/rstat.x
+++ b/include/rpcsvc/rstat.x
@@ -47,13 +47,13 @@
%#ifndef lint
%/*static char sccsid[] = "from: @(#)rstat.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
%/*static char sccsid[] = "from: @(#)rstat.x 2.2 88/08/01 4.0 RPCSRC";*/
-%static char rcsid[] = "$Id: rstat.x,v 1.1 1993/09/14 17:42:50 jtc Exp $";
+%static char rcsid[] = "$Id: rstat.x,v 1.3 1993/11/30 20:31:41 ats Exp $";
%#endif /* not lint */
#endif /* def RPC_HDR */
-const CPUSTATES = 4;
-const DK_NDRIVE = 4;
+const RSTAT_CPUSTATES = 4;
+const RSTAT_DK_NDRIVE = 4;
/*
* GMT since 0:00, January 1, 1970
@@ -64,8 +64,8 @@ struct rstat_timeval {
};
struct statstime { /* RSTATVERS_TIME */
- int cp_time[CPUSTATES];
- int dk_xfer[DK_NDRIVE];
+ int cp_time[RSTAT_CPUSTATES];
+ int dk_xfer[RSTAT_DK_NDRIVE];
unsigned int v_pgpgin; /* these are cumulative sum */
unsigned int v_pgpgout;
unsigned int v_pswpin;
@@ -83,8 +83,8 @@ struct statstime { /* RSTATVERS_TIME */
};
struct statsswtch { /* RSTATVERS_SWTCH */
- int cp_time[CPUSTATES];
- int dk_xfer[DK_NDRIVE];
+ int cp_time[RSTAT_CPUSTATES];
+ int dk_xfer[RSTAT_DK_NDRIVE];
unsigned int v_pgpgin; /* these are cumulative sum */
unsigned int v_pgpgout;
unsigned int v_pswpin;
@@ -101,8 +101,8 @@ struct statsswtch { /* RSTATVERS_SWTCH */
};
struct stats { /* RSTATVERS_ORIG */
- int cp_time[CPUSTATES];
- int dk_xfer[DK_NDRIVE];
+ int cp_time[RSTAT_CPUSTATES];
+ int dk_xfer[RSTAT_DK_NDRIVE];
unsigned int v_pgpgin; /* these are cumulative sum */
unsigned int v_pgpgout;
unsigned int v_pswpin;
diff --git a/include/setjmp.h b/include/setjmp.h
index 99b9790dc5f9..7bf4e85693ee 100644
--- a/include/setjmp.h
+++ b/include/setjmp.h
@@ -1,3 +1,12 @@
+/*
+ * Copyright (c) UNIX System Laboratories, Inc. All or some portions
+ * of this file are derived from material licensed to the
+ * University of California by American Telephone and Telegraph Co.
+ * or UNIX System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * $Id: setjmp.h,v 1.2.2.1 1994/05/04 07:37:56 rgrimes Exp $
+ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
diff --git a/include/time.h b/include/time.h
index 8b40b8c632d1..4057efcb4dae 100644
--- a/include/time.h
+++ b/include/time.h
@@ -1,4 +1,13 @@
/*
+ * Copyright (c) UNIX System Laboratories, Inc. All or some portions
+ * of this file are derived from material licensed to the
+ * University of California by American Telephone and Telegraph Co.
+ * or UNIX System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * $Id: time.h,v 1.1.1.1.2.1 1994/05/04 07:37:59 rgrimes Exp $
+ */
+/*
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
*
diff --git a/include/tzfile.h b/include/tzfile.h
index 43f5642acf3b..30113efc6305 100644
--- a/include/tzfile.h
+++ b/include/tzfile.h
@@ -85,6 +85,7 @@ struct tzhead {
** exceed any of the limits below.
*/
+#ifndef TZ_MAX_TIMES
/*
** The TZ_MAX_TIMES value below is enough to handle a bit more than a
** year's worth of solar time (corrected daily to the nearest second) or
@@ -92,8 +93,7 @@ struct tzhead {
** (where there are three time zone transitions every fourth year).
*/
#define TZ_MAX_TIMES 370
-
-#define NOSOLAR /* 4BSD doesn't currently handle solar time */
+#endif /* TZ_MAX_TIMES */
#ifndef NOSOLAR
#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
diff --git a/include/utmp.h b/include/utmp.h
index 8dc3c6daf881..6976acd3c64a 100644
--- a/include/utmp.h
+++ b/include/utmp.h
@@ -1,4 +1,13 @@
/*
+ * Copyright (c) UNIX System Laboratories, Inc. All or some portions
+ * of this file are derived from material licensed to the
+ * University of California by American Telephone and Telegraph Co.
+ * or UNIX System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * $Id: utmp.h,v 1.1.1.1.2.1 1994/05/04 07:38:03 rgrimes Exp $
+ */
+/*
* Copyright (c) 1988 The Regents of the University of California.
* All rights reserved.
*
diff --git a/include/varargs.h b/include/varargs.h
index 49742103784b..ba91e22c73a9 100644
--- a/include/varargs.h
+++ b/include/varargs.h
@@ -1,3 +1,12 @@
+/*
+ * Copyright (c) UNIX System Laboratories, Inc. All or some portions
+ * of this file are derived from material licensed to the
+ * University of California by American Telephone and Telegraph Co.
+ * or UNIX System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * $Id: varargs.h,v 1.1.1.1.2.1 1994/05/04 07:38:07 rgrimes Exp $
+ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.