BSD 4_1c_2 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Mon, 11 Oct 1982 04:59:09 +0000 (20:59 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Mon, 11 Oct 1982 04:59:09 +0000 (20:59 -0800)
Work on file usr/include/local/uparm.h
Work on file usr/include/a.out.h
Work on file usr/include/ar.h
Work on file usr/include/assert.h
Work on file usr/include/core.h
Work on file usr/include/ctype.h
Work on file usr/include/grp.h
Work on file usr/include/lastlog.h
Work on file usr/include/math.h
Work on file usr/include/mp.h
Work on file usr/include/nlist.h
Work on file usr/include/mtab.h
Work on file usr/include/pagsiz.h
Work on file usr/include/pwd.h
Work on file usr/include/ranlib.h
Work on file usr/include/sccs.h
Work on file usr/include/setjmp.h
Work on file usr/include/stab.h
Work on file usr/include/utmp.h
Work on file usr/include/valign.h
Work on file usr/include/varargs.h
Work on file usr/include/vfont.h
Work on file usr/include/netdb.h

Synthesized-from: CSRG/cd1/4.1c.2

23 files changed:
usr/include/a.out.h [new file with mode: 0644]
usr/include/ar.h [new file with mode: 0644]
usr/include/assert.h [new file with mode: 0644]
usr/include/core.h [new file with mode: 0644]
usr/include/ctype.h [new file with mode: 0644]
usr/include/grp.h [new file with mode: 0644]
usr/include/lastlog.h [new file with mode: 0644]
usr/include/local/uparm.h [new file with mode: 0644]
usr/include/math.h [new file with mode: 0644]
usr/include/mp.h [new file with mode: 0644]
usr/include/mtab.h [new file with mode: 0644]
usr/include/netdb.h [new file with mode: 0644]
usr/include/nlist.h [new file with mode: 0644]
usr/include/pagsiz.h [new file with mode: 0644]
usr/include/pwd.h [new file with mode: 0644]
usr/include/ranlib.h [new file with mode: 0644]
usr/include/sccs.h [new file with mode: 0644]
usr/include/setjmp.h [new file with mode: 0644]
usr/include/stab.h [new file with mode: 0644]
usr/include/utmp.h [new file with mode: 0644]
usr/include/valign.h [new file with mode: 0644]
usr/include/varargs.h [new file with mode: 0644]
usr/include/vfont.h [new file with mode: 0644]

diff --git a/usr/include/a.out.h b/usr/include/a.out.h
new file mode 100644 (file)
index 0000000..3ea301a
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Header prepended to each a.out file.
+ */
+struct exec {
+       long    a_magic;        /* magic number */
+unsigned long  a_text;         /* size of text segment */
+unsigned long  a_data;         /* size of initialized data */
+unsigned long  a_bss;          /* size of uninitialized data */
+unsigned long  a_syms;         /* size of symbol table */
+unsigned long  a_entry;        /* entry point */
+unsigned long  a_trsize;       /* size of text relocation */
+unsigned long  a_drsize;       /* size of data relocation */
+};
+
+#define        OMAGIC  0407            /* old impure format */
+#define        NMAGIC  0410            /* read-only text */
+#define        ZMAGIC  0413            /* demand load format */
+
+/*
+ * Macros which take exec structures as arguments and tell whether
+ * the file has a reasonable magic number or offsets to text|symbols|strings.
+ */
+#define        N_BADMAG(x) \
+    (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC)
+
+#define        N_TXTOFF(x) \
+       ((x).a_magic==ZMAGIC ? 1024 : sizeof (struct exec))
+#define N_SYMOFF(x) \
+       (N_TXTOFF(x) + (x).a_text+(x).a_data + (x).a_trsize+(x).a_drsize)
+#define        N_STROFF(x) \
+       (N_SYMOFF(x) + (x).a_syms)
+
+/*
+ * Format of a relocation datum.
+ */
+struct relocation_info {
+       int     r_address;      /* address which is relocated */
+unsigned int   r_symbolnum:24, /* local symbol ordinal */
+               r_pcrel:1,      /* was relocated pc relative already */
+               r_length:2,     /* 0=byte, 1=word, 2=long */
+               r_extern:1,     /* does not include value of sym referenced */
+               :4;             /* nothing, yet */
+};
+
+/*
+ * Format of a symbol table entry; this file is included by <a.out.h>
+ * and should be used if you aren't interested the a.out header
+ * or relocation information.
+ */
+struct nlist {
+       union {
+               char    *n_name;        /* for use when in-core */
+               long    n_strx;         /* index into file string table */
+       } n_un;
+unsigned char  n_type;         /* type flag, i.e. N_TEXT etc; see below */
+       char    n_other;        /* unused */
+       short   n_desc;         /* see <stab.h> */
+unsigned long  n_value;        /* value of this symbol (or sdb offset) */
+};
+#define        n_hash  n_desc          /* used internally by ld */
+
+/*
+ * Simple values for n_type.
+ */
+#define        N_UNDF  0x0             /* undefined */
+#define        N_ABS   0x2             /* absolute */
+#define        N_TEXT  0x4             /* text */
+#define        N_DATA  0x6             /* data */
+#define        N_BSS   0x8             /* bss */
+#define        N_COMM  0x12            /* common (internal to ld) */
+#define        N_FN    0x1f            /* file name symbol */
+
+#define        N_EXT   01              /* external bit, or'ed in */
+#define        N_TYPE  0x1e            /* mask for all the type bits */
+
+/*
+ * Sdb entries have some of the N_STAB bits set.
+ * These are given in <stab.h>
+ */
+#define        N_STAB  0xe0            /* if any of these bits set, a SDB entry */
+
+/*
+ * Format for namelist values.
+ */
+#define        N_FORMAT        "%08x"
diff --git a/usr/include/ar.h b/usr/include/ar.h
new file mode 100644 (file)
index 0000000..8927bf0
--- /dev/null
@@ -0,0 +1,14 @@
+#define        ARMAG   "!<arch>\n"
+#define        SARMAG  8
+
+#define        ARFMAG  "`\n"
+
+struct ar_hdr {
+       char    ar_name[16];
+       char    ar_date[12];
+       char    ar_uid[6];
+       char    ar_gid[6];
+       char    ar_mode[8];
+       char    ar_size[10];
+       char    ar_fmag[2];
+};
diff --git a/usr/include/assert.h b/usr/include/assert.h
new file mode 100644 (file)
index 0000000..6c51adc
--- /dev/null
@@ -0,0 +1,7 @@
+# ifndef NDEBUG
+# define _assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}}
+# define assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}}
+# else
+# define _assert(ex) ;
+# define assert(ex) ;
+# endif
diff --git a/usr/include/core.h b/usr/include/core.h
new file mode 100644 (file)
index 0000000..3d66409
--- /dev/null
@@ -0,0 +1,4 @@
+/* machine dependent stuff for core files */
+#define TXTRNDSIZ 1024L
+#define stacktop(siz) (0x80000000L-6*0x200)
+#define stackbas(siz) (0x80000000L-6*0x200-siz)
diff --git a/usr/include/ctype.h b/usr/include/ctype.h
new file mode 100644 (file)
index 0000000..d314c05
--- /dev/null
@@ -0,0 +1,24 @@
+#define        _U      01
+#define        _L      02
+#define        _N      04
+#define        _S      010
+#define _P     020
+#define _C     040
+#define _X     0100
+
+extern char    _ctype_[];
+
+#define        isalpha(c)      ((_ctype_+1)[c]&(_U|_L))
+#define        isupper(c)      ((_ctype_+1)[c]&_U)
+#define        islower(c)      ((_ctype_+1)[c]&_L)
+#define        isdigit(c)      ((_ctype_+1)[c]&_N)
+#define        isxdigit(c)     ((_ctype_+1)[c]&(_N|_X))
+#define        isspace(c)      ((_ctype_+1)[c]&_S)
+#define ispunct(c)     ((_ctype_+1)[c]&_P)
+#define isalnum(c)     ((_ctype_+1)[c]&(_U|_L|_N))
+#define isprint(c)     ((_ctype_+1)[c]&(_P|_U|_L|_N))
+#define iscntrl(c)     ((_ctype_+1)[c]&_C)
+#define isascii(c)     ((unsigned)(c)<=0177)
+#define toupper(c)     ((c)-'a'+'A')
+#define tolower(c)     ((c)-'A'+'a')
+#define toascii(c)     ((c)&0177)
diff --git a/usr/include/grp.h b/usr/include/grp.h
new file mode 100644 (file)
index 0000000..8874389
--- /dev/null
@@ -0,0 +1,8 @@
+struct group { /* see getgrent(3) */
+       char    *gr_name;
+       char    *gr_passwd;
+       int     gr_gid;
+       char    **gr_mem;
+};
+
+struct group *getgrent(), *getgrgid(), *getgrnam();
diff --git a/usr/include/lastlog.h b/usr/include/lastlog.h
new file mode 100644 (file)
index 0000000..c7dbc57
--- /dev/null
@@ -0,0 +1,4 @@
+struct lastlog {
+       time_t  ll_time;
+       char    ll_line[8];
+};
diff --git a/usr/include/local/uparm.h b/usr/include/local/uparm.h
new file mode 100644 (file)
index 0000000..26aed33
--- /dev/null
@@ -0,0 +1,6 @@
+#define libpath(file) "/usr/lib/file"
+#define loclibpath(file) "/usr/local/lib/file"
+#define binpath(file) "/usr/ucb/file"
+#define usrpath(file) "/usr/file"
+#define E_TERMCAP      "/etc/termcap"
+#define B_CSH          "/bin/csh"
diff --git a/usr/include/math.h b/usr/include/math.h
new file mode 100644 (file)
index 0000000..a152bc4
--- /dev/null
@@ -0,0 +1,9 @@
+extern double fabs(), floor(), ceil(), fmod(), ldexp(), frexp();
+extern double sqrt(), hypot(), atof();
+extern double sin(), cos(), tan(), asin(), acos(), atan(), atan2();
+extern double exp(), log(), log10(), pow();
+extern double sinh(), cosh(), tanh();
+extern double gamma();
+extern double j0(), j1(), jn(), y0(), y1(), yn();
+
+#define HUGE   1.701411733192644270e38
diff --git a/usr/include/mp.h b/usr/include/mp.h
new file mode 100644 (file)
index 0000000..5fa2116
--- /dev/null
@@ -0,0 +1,33 @@
+#define MINT struct mint
+MINT
+{      int len;
+       short *val;
+};
+#define FREE(x) {if(x.len!=0) {free((char *)x.val); x.len=0;}}
+#ifndef DBG
+#define shfree(u) free((char *)u)
+#else
+#include "stdio.h"
+#define shfree(u) { if(dbg) fprintf(stderr, "free %o\n", u); free((char *)u);}
+extern int dbg;
+#endif
+#ifndef vax
+struct half
+{      short high;
+       short low;
+};
+#else
+struct half
+{      short low;
+       short high;
+};
+#endif
+extern MINT *itom();
+extern short *xalloc();
+
+#ifdef lint
+extern xv_oid;
+#define VOID xv_oid =
+#else
+#define VOID
+#endif
diff --git a/usr/include/mtab.h b/usr/include/mtab.h
new file mode 100644 (file)
index 0000000..ab72873
--- /dev/null
@@ -0,0 +1,4 @@
+struct mtab {
+       char    m_path[32];             /* mounted on pathname */
+       char    m_dname[32];            /* block device pathname */
+};
diff --git a/usr/include/netdb.h b/usr/include/netdb.h
new file mode 100644 (file)
index 0000000..140da55
--- /dev/null
@@ -0,0 +1,44 @@
+/*     netdb.h 4.1     82/10/05        */
+/*
+ * Structures returned by network
+ * data base library.  All addresses
+ * are supplied in host order, and
+ * returned in network order (suitable
+ * for use in system calls).
+ */
+struct hostent {
+       char    *h_name;        /* official name of host */
+       char    **h_aliases;    /* alias list */
+       int     h_addrtype;     /* host address type */
+       int     h_length;       /* length of address */
+       char    *h_addr;        /* address */
+};
+
+/*
+ * Assumption here is that a network number
+ * fits in 32 bits -- probably a poor one.
+ */
+struct netent {
+       char    *n_name;        /* official name of net */
+       char    **n_aliases;    /* alias list */
+       int     n_addrtype;     /* net address type */
+       int     n_net;          /* network # */
+};
+
+struct servent {
+       char    *s_name;        /* official service name */
+       char    **s_aliases;    /* alias list */
+       int     s_port;         /* port # */
+       char    *s_proto;       /* protocol to use */
+};
+
+struct protoent {
+       char    *p_name;        /* official protocol name */
+       char    **p_aliases;    /* alias list */
+       int     p_proto;        /* protocol # */
+};
+
+struct hostent *gethostbyname(), *gethostbyaddr(), *gethostent();
+struct netent  *getnetbyname(), *getnetbyaddr(), *getnetent();
+struct servent *getservbyname(), *getservbyport(), *getservent();
+struct protoent        *getprotobyname(), *getprotobynumber(), *getprotoent();
diff --git a/usr/include/nlist.h b/usr/include/nlist.h
new file mode 100644 (file)
index 0000000..c6b7f97
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Format of a symbol table entry; this file is included by <a.out.h>
+ * and should be used if you aren't interested the a.out header
+ * or relocation information.
+ */
+struct nlist {
+       char    *n_name;        /* for use when in-core */
+       unsigned char n_type;   /* type flag, i.e. N_TEXT etc; see below */
+       char    n_other;        /* unused */
+       short   n_desc;         /* see <stab.h> */
+       unsigned long n_value;  /* value of this symbol (or sdb offset) */
+};
+#define        n_hash  n_desc          /* used internally by ld */
+
+/*
+ * Simple values for n_type.
+ */
+#define        N_UNDF  0x0             /* undefined */
+#define        N_ABS   0x2             /* absolute */
+#define        N_TEXT  0x4             /* text */
+#define        N_DATA  0x6             /* data */
+#define        N_BSS   0x8             /* bss */
+#define        N_COMM  0x12            /* common (internal to ld) */
+#define        N_FN    0x1f            /* file name symbol */
+
+#define        N_EXT   01              /* external bit, or'ed in */
+#define        N_TYPE  0x1e            /* mask for all the type bits */
+
+/*
+ * Sdb entries have some of the N_STAB bits set.
+ * These are given in <stab.h>
+ */
+#define        N_STAB  0xe0            /* if any of these bits set, a SDB entry */
+
+/*
+ * Format for namelist values.
+ */
+#define        N_FORMAT        "%08x"
diff --git a/usr/include/pagsiz.h b/usr/include/pagsiz.h
new file mode 100644 (file)
index 0000000..abd7989
--- /dev/null
@@ -0,0 +1,6 @@
+#define        NBPG    512
+#define        PGOFSET 511
+#define        CLSIZE  2
+#define        CLOFSET 1023
+#define        PAGSIZ  (NBPG*CLSIZE)
+#define        PAGRND  ((PAGSIZ)-1)
diff --git a/usr/include/pwd.h b/usr/include/pwd.h
new file mode 100644 (file)
index 0000000..a291680
--- /dev/null
@@ -0,0 +1,13 @@
+struct passwd { /* see getpwent(3) */
+       char    *pw_name;
+       char    *pw_passwd;
+       int     pw_uid;
+       int     pw_gid;
+       int     pw_quota;
+       char    *pw_comment;
+       char    *pw_gecos;
+       char    *pw_dir;
+       char    *pw_shell;
+};
+
+struct passwd *getpwent(), *getpwuid(), *getpwnam();
diff --git a/usr/include/ranlib.h b/usr/include/ranlib.h
new file mode 100644 (file)
index 0000000..13b3f2e
--- /dev/null
@@ -0,0 +1,16 @@
+
+/*
+ * Structure of the __.SYMDEF table of contents for an archive.
+ * __.SYMDEF begins with a word giving the number of ranlib structures
+ * which immediately follow, and then continues with a string
+ * table consisting of a word giving the number of bytes of strings
+ * which follow and then the strings themselves.
+ * The ran_strx fields index the string table whose first byte is numbered 0.
+ */
+struct ranlib {
+       union {
+               off_t   ran_strx;       /* string table index of */
+               char    *ran_name;      /* symbol defined by */
+       } ran_un;
+       off_t   ran_off;                /* library member at this offset */
+};
diff --git a/usr/include/sccs.h b/usr/include/sccs.h
new file mode 100644 (file)
index 0000000..16570db
--- /dev/null
@@ -0,0 +1 @@
+#define SCCSID(arg) static char Sccsid[] = "arg";
diff --git a/usr/include/setjmp.h b/usr/include/setjmp.h
new file mode 100644 (file)
index 0000000..e1cb175
--- /dev/null
@@ -0,0 +1 @@
+typedef int jmp_buf[10];
diff --git a/usr/include/stab.h b/usr/include/stab.h
new file mode 100644 (file)
index 0000000..3c5c31e
--- /dev/null
@@ -0,0 +1,34 @@
+/* IF YOU ADD DEFINITIONS, ADD THEM TO nm.c as well */
+/*
+ * This file gives definitions supplementing <a.out.h>
+ * for permanent symbol table entries.
+ * These must have one of the N_STAB bits on,
+ * and are subject to relocation according to the masks in <a.out.h>.
+ */
+/*
+ * for symbolic debugger, sdb(1):
+ */
+#define        N_GSYM  0x20            /* global symbol: name,,0,type,0 */
+#define        N_FNAME 0x22            /* procedure name (f77 kludge): name,,0 */
+#define        N_FUN   0x24            /* procedure: name,,0,linenumber,address */
+#define        N_STSYM 0x26            /* static symbol: name,,0,type,address */
+#define        N_LCSYM 0x28            /* .lcomm symbol: name,,0,type,address */
+#define        N_RSYM  0x40            /* register sym: name,,0,type,register */
+#define        N_SLINE 0x44            /* src line: 0,,0,linenumber,address */
+#define        N_SSYM  0x60            /* structure elt: name,,0,type,struct_offset */
+#define        N_SO    0x64            /* source file name: name,,0,0,address */
+#define        N_LSYM  0x80            /* local sym: name,,0,type,offset */
+#define        N_SOL   0x84            /* #included file name: name,,0,0,address */
+#define        N_PSYM  0xa0            /* parameter: name,,0,type,offset */
+#define        N_ENTRY 0xa4            /* alternate entry: name,linenumber,address */
+#define        N_LBRAC 0xc0            /* left bracket: 0,,0,nesting level,address */
+#define        N_RBRAC 0xe0            /* right bracket: 0,,0,nesting level,address */
+#define        N_BCOMM 0xe2            /* begin common: name,, */
+#define        N_ECOMM 0xe4            /* end common: name,, */
+#define        N_ECOML 0xe8            /* end common (local name): ,,address */
+#define        N_LENG  0xfe            /* second stab entry with length information */
+
+/*
+ * for the berkeley pascal compiler, pc(1):
+ */
+#define        N_PC    0x30            /* global pascal symbol: name,,0,subtype,line */
diff --git a/usr/include/utmp.h b/usr/include/utmp.h
new file mode 100644 (file)
index 0000000..25f22e3
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ * Structure of utmp and wtmp files.
+ *
+ * Assuming the number 8 is unwise.
+ */
+struct utmp {
+       char    ut_line[8];             /* tty name */
+       char    ut_name[8];             /* user id */
+       long    ut_time;                /* time on */
+};
diff --git a/usr/include/valign.h b/usr/include/valign.h
new file mode 100644 (file)
index 0000000..af5298c
--- /dev/null
@@ -0,0 +1 @@
+#define        VALSIZ  1024
diff --git a/usr/include/varargs.h b/usr/include/varargs.h
new file mode 100644 (file)
index 0000000..da1d099
--- /dev/null
@@ -0,0 +1,5 @@
+typedef char *va_list;
+# 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 += sizeof(mode)))[-1]
diff --git a/usr/include/vfont.h b/usr/include/vfont.h
new file mode 100644 (file)
index 0000000..f24f24c
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * The structures header and dispatch define the format of a font file.
+ *
+ * See vfont(5) for more details.
+ */
+struct header {
+       short magic;
+       unsigned short size;
+       short maxx;
+       short maxy;
+       short xtend;
+}; 
+
+struct dispatch {
+       unsigned short addr;
+       short nbytes;
+       char up,down,left,right;
+       short width;
+};