Change parse to parseaddr for BB&N TCP/IP implementation; clean up
[unix-history] / usr / src / old / berknet / mach.h
CommitLineData
cd64e4fd 1/* @(#)mach.h 4.5 (Berkeley) %G% */
93d5777b
KM
2
3/* sccs id variable */
4static char *mach_h_sid = "@(#)mach.h 1.11";
5
6/*
7
8 mach.h -- define machine-dependent things
9
10*** Pre-processor Flags ***
11
12This set of code is controlled by this set of conditional
13compilation flags:
14
15TESTING if defined, do not generate tests, etc. which require
16 super-user status.
17
18OLDTTY if defined, compile for old 1 character TTY names
19CCTTY if defined, compile for CC tty name format
20 if neither is defined, use v7 ttyname format
21
22PASSWDF compile in code to handle /etc/passwdf - split passwd files
23
24V6 Assume the v6 features instead of the v7 ones.
25
26FUID use the funny uid's present on CC V6
27
28DELIVERM Uses the delivermail program
29
30HPASSWD The local machine has the hashed password stuff
31
32OLDMAIL mail is in home-directory/.mail
33USRMAIL mail is in /usr/mail/name
34 (mail is in /usr/spool/mail/name)
35
36CC Machine is a Computer Center machine
37NUID userid (as returned by getuid()) on this machine
38UID1CHAR Uses vanila Version6 userid's (only 1 byte for uid)
39NOEUID Does not have the geteuid() system call
40NFREECMD doesn't allow any "network" free commands
41NOFP floating point just doesn't work on this machine
42NOREMACCT allows netlpr's on remote machines without an account
43CSH use the /bin/csh shell (Paths.h sets BINSH to this path ).
44CRN CC crn's are passed
45DONTHOLDBIG large (size > MAXDAYFILE ) jobs wont be held until night for
46 transmission
47
48SWAB this machine has byte-ordering reversed from the DEC VAX
49 and PDP-11 standard (the only current example is Onyx)
50The conditonal flags are first defined
c2ee80d2 51in "local.h" in this directory.
93d5777b
KM
52
53For "normal" version 6 machines, there is a dummy machine
54definition for "VANILLA6" which indicates the v6 UNIX options.
55
56For "normal" version 7 machines, there is a dummy machine
57definition for "VANILLA7" which indicates the v7 UNIX options.
58(VM/UNIX and Berkeley VM/VAX/UNIX can use this)
59*/
60/* be sure to include <stdio.h> before these defns */
61
c2ee80d2 62# include "local.h"
93d5777b
KM
63# include <sysexits.h>
64
65/* note NUID is only used in mmail.c */
66
67# ifdef RAND
68/* definitions for Rand-Unix */
69# ifdef VAX
70# define LOCAL 'v'
71# define NUID (-1)
72# endif VAX
73
74# ifdef GRAPHICS
75# define V6
76# define OLDTTY
77# define UID1CHAR
78# define OLDMAIL
79# define LOCAL 'g'
80# define NUID (-1)
81# endif GRAPHICS
82
83# ifdef TP
84# define LOCAL 't'
85# define V6
86# define OLDTTY
87# define UID1CHAR
88# define OLDMAIL
89# define NUID (-1)
90# endif TP
91
92/* end of definitions for Rand */
93# endif RAND
94
95
96# ifdef NOSC
97/* definitions for Naval Ocean Systems Center NOSC */
98# ifdef ATTS
99# define LOCAL 'a'
100# define V6
101# define OLDTTY
102# define UID1CHAR
103# define OLDMAIL
104# define NUID (-1)
105# endif ATTS
106
107# ifdef CCMM
108# define LOCAL 'c'
109# define V6
110# define OLDTTY
111# define UID1CHAR
112# define OLDMAIL
113# define NUID (-1)
114# endif CCMM
115
116# ifdef MSSF
117# define V6
118# define OLDTTY
119# define UID1CHAR
120# define OLDMAIL
121# define LOCAL 'm'
122# define NUID (-1)
123# endif MSSF
124
125/* end of definitions for NOSC */
126
127# endif NOSC
128
129# ifdef BERKELEY
c2ee80d2 130/* CFO - A */
93d5777b
KM
131# ifdef A
132# define CCV7
133# define LOCAL 'a'
134# endif A
135
c2ee80d2 136/* CFO - B */
93d5777b
KM
137# ifdef B
138# define CCV7
139# define LOCAL 'b'
140# endif B
141
c2ee80d2 142/* CFO - C */
93d5777b
KM
143# ifdef C
144# define CCV7
145# define LOCAL 'c'
146# endif C
147
c2ee80d2 148/* CFO - D */
93d5777b
KM
149# ifdef D
150# define CCV7
151# define LOCAL 'd'
152# endif D
153
c2ee80d2 154/* CFO - E */
93d5777b
KM
155# ifdef E
156# define CCV7
157# define LOCAL 'e'
158# endif E
159
c2ee80d2 160/* CFO - F */
93d5777b
KM
161# ifdef F
162# define CCV7
163# define LOCAL 'f'
164# endif F
165
c2ee80d2 166/* CFO - G */
93d5777b
KM
167# ifdef G
168# define LOCAL 'g'
169# define NUID (501)
170# endif G
171
c2ee80d2
KM
172/* CFO - Jade */
173# ifdef H
174# define LOCAL 'h'
175# define NUID (501)
176# endif H
177
0e9fba27
DC
178/* CSSG - ucberl70 */
179# ifdef ERL70
93d5777b
KM
180# define LOCAL 'i'
181# define NUID (174)
0e9fba27 182# endif ERL70
93d5777b 183
c2ee80d2 184/* Ingres Group - ucbingres */
93d5777b
KM
185# ifdef INGVAX
186# define LOCAL 'j'
187# define NUID (37)
188# define FREELPR
189# define DELIVERM
190# endif INGVAX
191
c2ee80d2
KM
192/* CS network hub - ucbvax */
193# ifdef UCBVAX
93d5777b 194# define LOCAL 'k'
c2ee80d2
KM
195# define NUID (35)
196# define DELIVERM
197# define MAXSENDQ 35
198# endif UCBVAX
199
200/* Brodersen - ucboz */
201# ifdef OZ
202# define LOCAL 'l'
203# define NUID (501)
204# endif OZ
93d5777b 205
c2ee80d2
KM
206/* EE-Signal Proccessing - ucbmedea */
207# ifdef MEDEA
93d5777b 208# define LOCAL 'm'
c2ee80d2
KM
209# define NUID (501)
210# endif MEDEA
93d5777b 211
c2ee80d2 212/* Fateman - ucbkim */
93d5777b
KM
213# ifdef KIM
214# define LOCAL 'n'
c2ee80d2
KM
215# define DELIVERM
216# define NUID (501)
93d5777b
KM
217# endif KIM
218
c2ee80d2 219/* EECS-Research - ucbesvax */
93d5777b
KM
220# ifdef ESVAX
221# define LOCAL 'o'
222# define NUID (67)
223# endif ESVAX
224
c2ee80d2 225/* Newton CAD - ucbcad */
93d5777b
KM
226# ifdef CAD
227# define LOCAL 'p'
228# define NUID (67)
229# endif CAD
230
c2ee80d2 231/* currently unused */
93d5777b 232# ifdef Q
93d5777b 233# define LOCAL 'q'
93d5777b
KM
234# endif Q
235
c2ee80d2 236/* Fabry CSRG - ucbarpa */
93d5777b
KM
237# ifdef ARPAVAX
238# define LOCAL 'r'
239# define NUID (501)
240# define DELIVERM
241# define MAXSENDQ 35
242# endif ARPAVAX
243
c2ee80d2 244/* CFO & SRC - SRC */
93d5777b 245# ifdef SRC
93d5777b
KM
246# define LOCAL 's'
247# define NUID 38
93d5777b
KM
248# endif SRC
249
c2ee80d2 250/* Math/Stat Dept - MathStat */
93d5777b
KM
251# ifdef MATHSTAT
252# define LOCAL 't'
c2ee80d2 253# define NUID (-1)
93d5777b
KM
254# endif MATHSTAT
255
c2ee80d2
KM
256/* Fabry CSRG - c70 */
257# ifdef C70
258# define LOCAL 'u'
259# define NUID (501)
260# define DELIVERM
261# define MAXSENDQ 35
262# endif C70
263
264/* CS Research - ucbernie */
93d5777b
KM
265# ifdef CSVAX
266# define LOCAL 'v'
267# define NUID (501)
268# define DELIVERM
269# define MAXSENDQ 35
270# endif CSVAX
271
c2ee80d2
KM
272/* Stat Dept - statvax */
273# ifdef STATVAX
274# define LOCAL 'w'
275# define NUID
276# endif STATVAX
277
278/* CS Research - Onyx */
93d5777b
KM
279# ifdef ONYX
280# define LOCAL 'x'
281# define NUID (10)
282# define NOFP
283# define SWAB
93d5777b
KM
284# undef PARMLIST
285# define PARMLIST 20
c2ee80d2 286# define DELIVERM
93d5777b
KM
287# endif ONYX
288
c2ee80d2 289/* EECS Dept - Cory */
93d5777b
KM
290# ifdef CORY
291# define LOCAL 'y'
292# define NUID (10)
293# define MAXSENDQ 35
294# include <signal.h>
93d5777b
KM
295# undef NETLDISC
296# define DELIVERM
297# endif CORY
298
c2ee80d2
KM
299/* EECS Dept Administrative - ucbear */
300# ifdef EARVAX
93d5777b
KM
301# define LOCAL 'z'
302# define NUID ((1 << 8) | 104)
c2ee80d2
KM
303# define DELIVERM
304# endif EARVAX
93d5777b
KM
305
306/* end of Berkeley definitions */
307# endif BERKELEY
308
309/*
310 the CC V6 machines are all the same.
311 splitting their type into a separate group will
312 allow the binary patching program "patchd" to be
313 used to patch the binaries so the sources can be compiled
314 on one CC machine and the binaries shipped around
315 to the other CC machines.
316*/
317# ifdef CCV7
318# undef CC
319# define NOREMACCT
320# define NUID (10)
321# define MAXSENDQ 35
322# define CSH
323# define CRN
324# define MAGICCRN "3700" /* default CC crn */
325# endif CCV7
326
327# ifdef CC
328# define V6
329# define CCV6
330# define CCTTY
331# define PASSWDF
332# define FUID
333# define USRMAIL
334# define NUID (115)
335# define MAXSENDQ 35
336# define NOREMACCT
337# define CSH
338# define CRN
339# define MAGICCRN "3700" /* default CC crn */
340# endif CC
341
342/* default version 6 options */
343# ifdef VANILLA6
344# define V6
345# define UID1CHAR
346# define OLDTTY
347# define OLDMAIL
348# endif VANILLA6
349
350/* default version 7 options */
351# ifdef VANILLA7
352# endif VANILLA7
353
354# ifndef V6
355# include <sys/param.h>
356# include <sys/stat.h>
cd64e4fd 357# include <dir.h>
93d5777b
KM
358# include <sys/times.h>
359# include <ctype.h>
360# include <sgtty.h>
361# include <errno.h>
362# include <pwd.h>
363# include <assert.h>
364# include <setjmp.h>
365# define getsize(S) ((S)->st_size)
366# define gettime() (time(0))
367int (*signal())();
368/*
369#define SIG_DFL (int (*)())0
370#define SIG_IGN (int (*)())1
371*/
372
373# else V6
374
375# define ETXTBSY 26
376# define S_IREAD 0400
377# define S_IFMT 060000
378# define S_IFDIR 0040000
379# define ANYP 0300
380# define ECHO 010
381# define ROOTINO 1
93d5777b
KM
382# define TIOCEXCL 0
383# define SIGHUP 1
384# define SIGINT 2
385# define SIGQUIT 3
386# define SIGKILL 9
387# define SIGALRM 14
388# define SIGTERM 15
389# define SIG_IGN 1
390# define ASSERT "Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}}
391# define assert(ex) {if (!(ex)){fprintf(stderr,ASSERT
392# define isprint(c) (040 <= c && c <= 0176)
393# define longjmp(a,b) reset()
394# define setjmp(a) setexit()
395
396
93d5777b
KM
397struct tms { /* see times - sect 2 */
398 int tms_utime; /* user time */
399 int tms_stime; /* system time */
400 long tms_cutime; /* user time, children */
401 long tms_cstime; /* system time, children */
402 };
403struct sgttyb {
404 char sg_ispeed;
405 char sg_ospeed;
406 char sg_erase;
407 char sg_kill;
408 int sg_flags;
409 };
410struct passwd { /* see getpwent(3) */
411 char *pw_name;
412 char *pw_passwd;
413 int pw_uid;
414 int pw_gid;
415 int pw_quota;
416 char *pw_comment;
417 char *pw_gecos;
418 char *pw_dir;
419 char *pw_shell;
420 };
421/* /usr/include/varargs.h */
422typedef char *va_list;
423# define va_dcl int va_alist;
424# define va_start(list) list = (char *) &va_alist
425# define va_end(list)
426# define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1]
427
428typedef int jmp_buf[10];
429long gettime(), getsize();
430# endif V6
431/* end of non-v7 defns */
432
433# ifdef FUID
434# define getgid(s) (0)
435# endif FUID
436
437# ifdef UID1CHAR
438# define uidmask(S) (S & 0377)
439# define geteuid() ((getuid()>>8)&0377)
440# else UID1CHAR
441# define uidmask(S) (S)
442# endif UID1CHAR
443
444# ifdef NOEUID
445# define geteuid(S) (-1)
446# endif NOEUID
447
448# ifdef CCTTY
449# define ttyname(S) myttyname(S)
450# endif CCTTY
451
452#ifdef CRN
453#include <gecos.h>
454#endif CRN
455
456# ifdef OLDTTY
457/* this is the version 7 utmp structure. the getutmp() procedure
458 converts the v6 structure into this format
459*/
460struct utmp {
461 char ut_line[8]; /* tty name */
462 char ut_name[8]; /* user id */
463 long ut_time; /* time on */
464};
465# else OLDTTY
466# include <utmp.h>
467# endif OLDTTY
468
469# define chfromf(S) (S ? 'T' : 'F')
470
471/* functions */
472
473char *hgethome(), *calloc(), *ctime(), *getenv();
474char *getname(), *getun(), *getlogin();
475char *SnFromUid(), *ttyname();
476struct passwd *getpwnam(), *getpwuid();
477long atol(),time();
478struct utmp *getutmp();