|
|
1.1 root 1: /*-
2: * Copyright (c) 1979 The Regents of the University of California.
3: * All rights reserved.
4: *
5: * Redistribution and use in source and binary forms are permitted
6: * provided that: (1) source distributions retain this entire copyright
7: * notice and comment, and (2) distributions including binaries display
8: * the following acknowledgement: ``This product includes software
9: * developed by the University of California, Berkeley and its contributors''
10: * in the documentation or other materials provided with the distribution
11: * and in all advertising materials mentioning features or use of this
12: * software. Neither the name of the University nor the names of its
13: * contributors may be used to endorse or promote products derived
14: * from this software without specific prior written permission.
15: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18: */
19:
20: #ifndef lint
21: static char sccsid[] = "@(#)PCSTART.c 1.10 (Berkeley) 5/29/90";
22: #endif /* not lint */
23:
24: #include <signal.h>
25: #include "h00vars.h"
26: #include "libpc.h"
27:
28: /*
29: * program variables
30: */
31: struct display _disply[MAXLVL];
32: int _argc;
33: char **_argv;
34: long _stlim = 500000;
35: long _stcnt = 0;
36: long _seed = 1;
37: #ifdef ADDR32
38: char *_minptr = (char *)0x7fffffff;
39: #endif ADDR32
40: #ifdef ADDR16
41: char *_minptr = (char *)0xffff;
42: #endif ADDR16
43: char *_maxptr = (char *)0;
44:
45: /*
46: * file record variables
47: */
48: long _filefre = PREDEF;
49: struct iorechd _fchain = {
50: 0, 0, 0, 0, /* only use fchain field */
51: INPUT /* fchain */
52: };
53: struct iorec *_actfile[MAXFILES] = {
54: INPUT,
55: OUTPUT,
56: ERR
57: };
58:
59: /*
60: * standard files
61: */
62: char _inwin, _outwin, _errwin;
63: struct iorechd input = {
64: &_inwin, /* fileptr */
65: 0, /* lcount */
66: 0x7fffffff, /* llimit */
67: stdin, /* fbuf */
68: OUTPUT, /* fchain */
69: STDLVL, /* flev */
70: "standard input", /* pfname */
71: FTEXT|FREAD|SYNC|EOLN, /* funit */
72: 0, /* fblk */
73: 1 /* fsize */
74: };
75: struct iorechd output = {
76: &_outwin, /* fileptr */
77: 0, /* lcount */
78: 0x7fffffff, /* llimit */
79: stdout, /* fbuf */
80: ERR, /* fchain */
81: STDLVL, /* flev */
82: "standard output", /* pfname */
83: FTEXT | FWRITE | EOFF, /* funit */
84: 1, /* fblk */
85: 1 /* fsize */
86: };
87: struct iorechd _err = {
88: &_errwin, /* fileptr */
89: 0, /* lcount */
90: 0x7fffffff, /* llimit */
91: stderr, /* fbuf */
92: FILNIL, /* fchain */
93: STDLVL, /* flev */
94: "Message file", /* pfname */
95: FTEXT | FWRITE | EOFF, /* funit */
96: 2, /* fblk */
97: 1 /* fsize */
98: };
99:
100: PCSTART(mode)
101: int mode;
102: {
103: /*
104: * necessary only on systems which do not initialize
105: * memory to zero
106: */
107:
108: struct iorec **ip;
109:
110: /*
111: * if running with runtime tests enabled, give more
112: * coherent error messages for FPEs
113: */
114: if (mode) {
115: signal(SIGFPE, EXCEPT);
116: }
117: for (ip = &_actfile[3]; ip < &_actfile[MAXFILES]; *ip++ = FILNIL);
118: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.