From 8b2e40fc8778bc5438fb65916a326c1a8e39c840 Mon Sep 17 00:00:00 2001 From: Bill Joy Date: Mon, 12 Feb 1979 05:31:57 -0800 Subject: [PATCH] BSD 3 development Work on file usr/include/ar.h Work on file usr/include/assert.h Work on file usr/include/execargs.h Work on file usr/include/pack.h Work on file usr/include/lastlog.h Work on file usr/include/pwd.h Work on file usr/include/mp.h Work on file usr/include/math.h Work on file usr/include/dir.h Work on file usr/include/olddump.h Work on file usr/include/dk.h Work on file usr/include/grp.h Work on file usr/include/core.h Work on file usr/include/errno.h Work on file usr/include/time.h Work on file usr/include/symbol.h Work on file usr/include/stat.h Work on file usr/include/varargs.h Work on file usr/include/setjmp.h Work on file usr/include/signal.h Work on file usr/include/sys.s Work on file usr/include/sccs.h Synthesized-from: 3bsd --- usr/include/ar.h | 9 +++ usr/include/assert.h | 7 +++ usr/include/core.h | 4 ++ usr/include/dir.h | 8 +++ usr/include/dk.h | 20 +++++++ usr/include/errno.h | 40 ++++++++++++++ usr/include/execargs.h | 1 + usr/include/grp.h | 6 ++ usr/include/lastlog.h | 4 ++ usr/include/math.h | 9 +++ usr/include/mp.h | 33 +++++++++++ usr/include/olddump.h | 92 +++++++++++++++++++++++++++++++ usr/include/pack.h | 121 +++++++++++++++++++++++++++++++++++++++++ usr/include/pwd.h | 11 ++++ usr/include/sccs.h | 1 + usr/include/setjmp.h | 1 + usr/include/signal.h | 21 +++++++ usr/include/stat.h | 28 ++++++++++ usr/include/symbol.h | 9 +++ usr/include/sys.s | 59 ++++++++++++++++++++ usr/include/time.h | 11 ++++ usr/include/varargs.h | 5 ++ 22 files changed, 500 insertions(+) create mode 100644 usr/include/ar.h create mode 100644 usr/include/assert.h create mode 100644 usr/include/core.h create mode 100644 usr/include/dir.h create mode 100644 usr/include/dk.h create mode 100644 usr/include/errno.h create mode 100644 usr/include/execargs.h create mode 100644 usr/include/grp.h create mode 100644 usr/include/lastlog.h create mode 100644 usr/include/math.h create mode 100644 usr/include/mp.h create mode 100644 usr/include/olddump.h create mode 100644 usr/include/pack.h create mode 100644 usr/include/pwd.h create mode 100644 usr/include/sccs.h create mode 100644 usr/include/setjmp.h create mode 100644 usr/include/signal.h create mode 100644 usr/include/stat.h create mode 100644 usr/include/symbol.h create mode 100644 usr/include/sys.s create mode 100644 usr/include/time.h create mode 100644 usr/include/varargs.h diff --git a/usr/include/ar.h b/usr/include/ar.h new file mode 100644 index 0000000000..88708076e0 --- /dev/null +++ b/usr/include/ar.h @@ -0,0 +1,9 @@ +#define ARMAG 0177545 +struct ar_hdr { + char ar_name[14]; + long ar_date; + char ar_uid; + char ar_gid; + int ar_mode; + long ar_size; +}; diff --git a/usr/include/assert.h b/usr/include/assert.h new file mode 100644 index 0000000000..6c51adc8b8 --- /dev/null +++ b/usr/include/assert.h @@ -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 index 0000000000..ed3ef1c0cc --- /dev/null +++ b/usr/include/core.h @@ -0,0 +1,4 @@ +/* machine dependent stuff for core files */ +#define TXTRNDSIZ 512L +#define stacktop(siz) (0x80000000L) +#define stackbas(siz) (0x80000000L-siz) diff --git a/usr/include/dir.h b/usr/include/dir.h new file mode 100644 index 0000000000..f714208b20 --- /dev/null +++ b/usr/include/dir.h @@ -0,0 +1,8 @@ +#ifndef DIRSIZ +#define DIRSIZ 14 +#endif +struct dir +{ + ino_t d_ino; + char d_name[DIRSIZ]; +}; diff --git a/usr/include/dk.h b/usr/include/dk.h new file mode 100644 index 0000000000..d12c906ef1 --- /dev/null +++ b/usr/include/dk.h @@ -0,0 +1,20 @@ +/* + * switch commands + */ +#define RAM_ON 0226 +#define ROM_ON 0322 +#define R_CNTL 0264 +#define W_CNTL 0170 + +/* + * dk command channel mode + */ +#define DKCMD 04000 + +/* + * library routine declarations + */ +extern long cmread(); +extern long ocmread(); + + diff --git a/usr/include/errno.h b/usr/include/errno.h new file mode 100644 index 0000000000..3ff9fde529 --- /dev/null +++ b/usr/include/errno.h @@ -0,0 +1,40 @@ +/* + * Error codes + */ + +#define EPERM 1 +#define ENOENT 2 +#define ESRCH 3 +#define EINTR 4 +#define EIO 5 +#define ENXIO 6 +#define E2BIG 7 +#define ENOEXEC 8 +#define EBADF 9 +#define ECHILD 10 +#define EAGAIN 11 +#define ENOMEM 12 +#define EACCES 13 +#define EFAULT 14 +#define ENOTBLK 15 +#define EBUSY 16 +#define EEXIST 17 +#define EXDEV 18 +#define ENODEV 19 +#define ENOTDIR 20 +#define EISDIR 21 +#define EINVAL 22 +#define ENFILE 23 +#define EMFILE 24 +#define ENOTTY 25 +#define ETXTBSY 26 +#define EFBIG 27 +#define ENOSPC 28 +#define ESPIPE 29 +#define EROFS 30 +#define EMLINK 31 +#define EPIPE 32 + +/* math software */ +#define EDOM 33 +#define ERANGE 34 diff --git a/usr/include/execargs.h b/usr/include/execargs.h new file mode 100644 index 0000000000..6c21e0abe8 --- /dev/null +++ b/usr/include/execargs.h @@ -0,0 +1 @@ +char **execargs = (char**)(0x7ffffffc); diff --git a/usr/include/grp.h b/usr/include/grp.h new file mode 100644 index 0000000000..59ad28cc88 --- /dev/null +++ b/usr/include/grp.h @@ -0,0 +1,6 @@ +struct group { /* see getgrent(3) */ + char *gr_name; + char *gr_passwd; + int gr_gid; + char **gr_mem; +}; diff --git a/usr/include/lastlog.h b/usr/include/lastlog.h new file mode 100644 index 0000000000..c7dbc575a0 --- /dev/null +++ b/usr/include/lastlog.h @@ -0,0 +1,4 @@ +struct lastlog { + time_t ll_time; + char ll_line[8]; +}; diff --git a/usr/include/math.h b/usr/include/math.h new file mode 100644 index 0000000000..1bd661ca59 --- /dev/null +++ b/usr/include/math.h @@ -0,0 +1,9 @@ +extern double fabs(), floor(), ceil(), fmod(), ldexp(); +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 index 0000000000..5fa2116757 --- /dev/null +++ b/usr/include/mp.h @@ -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/olddump.h b/usr/include/olddump.h new file mode 100644 index 0000000000..7ebb959e8e --- /dev/null +++ b/usr/include/olddump.h @@ -0,0 +1,92 @@ +#define MAXSIZE 500 /* max size in blocks of dumped files */ +#define NILIST 100 /* max files extracted at once */ +#define BFACT 20 /* tape blocking factor */ + +int tden 1600; /* tape density */ +int tlen 2200; /* tape length (feet) */ + +char *dump_cmd[] = { /* default args for dump */ + "dump", + "i", + "/dev/rp0", + 0 +}; + +char *rest_cmd[] = { /* defaults for restor */ + "restor", + "t", + 0 +}; + +char *tape "/dev/rmt1"; +char dfile[] "/dev/dtab"; +char tfile[] "/tmp/dtmp"; +char name[100]; + +#define NDTAB 10 +struct { + char dt_name[16]; + time_t dt_date; +} dtab[NDTAB]; + +struct thdr { + ino_t isize; + ino_t maxi; + daddr_t fsize; + time_t cdate; + time_t ddate; + long tsize; + int nflg; +}; + +struct fhdr { + short xmagic; + ino_t xino; + short xmode; + short xnlink; + short xuid; + short xgid; + daddr_t xaddr; + off_t xsize; + time_t xatime; + time_t xmtime; + time_t xctime; +}; +#define FMAGIC 012345 +#define SMAGIC 031415 + +#define DAPTB 127 /* (BSIZE-2*sizeof(short))/sizeof(daddr_t)) */ + +FILE *tmpf; + +long +getsize() +{ + register c; + long j; + + c = getc(tmpf); + if(c == EOF) + return((long)-1); + if(c <= 253) + return((long)c); + if(c == 255) + return((long)-1); + j = 0; + for(c=0;c<3;c++) + j = (j<<8) + (getc(tmpf)&0377); + return(j); +} + +putsize(s) +long s; +{ + if(s <= 253) { + putc((char)s, tmpf); + return; + } + putc(254, tmpf); + putc((char)(s>>16), tmpf); + putc((char)(s>>8), tmpf); + putc((char)s, tmpf); +} diff --git a/usr/include/pack.h b/usr/include/pack.h new file mode 100644 index 0000000000..9b67aac7b2 --- /dev/null +++ b/usr/include/pack.h @@ -0,0 +1,121 @@ +struct header { + char sync; + char ksize; + unsigned short sum; + char cntl; + char ccntl; +}; +#define HDRSIZ 6 + +struct pack { + short p_state; /* line state */ + short p_bits; /* mask for getepack */ + short p_rsize; /* input packet size */ + short p_xsize; /* output packet size */ + struct header p_ihbuf; /* input header */ + struct header p_ohbuf; /* output header */ + char *p_rptr; + char p_mode; + char **p_ipool; + char p_xcount; /* # active output buffers */ + char p_rcount; + char p_nout,p_tout; + char p_lpsize; /* log(psize/32) */ + char p_timer; + char p_obusy; + char p_srxmit; + char p_rwindow; /* window size */ + char p_swindow; + char p_msg; /* control msg */ + char p_rmsg; /* repeated control msg */ + char p_ps,p_pr; /* last packet sent, recv'd */ + char p_rpr; + char p_nxtps; /* next output seq number */ + char p_imap; /* bit map of input buffers */ + char p_pscopy; /* newest output packet */ + char *p_ob[8]; /* output buffers */ + char *p_ib[8]; /* input buffers */ + char p_os[8]; /* output buffer status */ + char p_is[8]; /* input buffer status */ + short p_osum[8]; /* output checksums */ + short p_isum[8]; /* input checksums */ + DSYSTEM; +}; +#define CHECK 0125252 +#define SYN 020 +#define MOD8 7 +#define ISCNTL(a) ((a & 0300)==0) +#define MIN(a,b) ((a