BSD 4_1c_2 release
[unix-history] / usr / src / usr.lib / libpc / PCSTART.c
CommitLineData
a002c9f4
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
e804469b 3static char sccsid[] = "@(#)PCSTART.c 1.8 1/10/83";
a002c9f4 4
597e0cdd 5#include <signal.h>
a002c9f4 6#include "h00vars.h"
597e0cdd 7#include "libpc.h"
a002c9f4
KM
8
9/*
10 * program variables
11 */
12struct display _disply[MAXLVL];
13int _argc;
14char **_argv;
15long _stlim = 500000;
16long _stcnt = 0;
ef5ad5b1 17long _seed = 1;
9b685633 18#ifdef ADDR32
a002c9f4 19char *_minptr = (char *)0x7fffffff;
9b685633
KM
20#endif ADDR32
21#ifdef ADDR16
492cc5d3 22char *_minptr = (char *)0xffff;
9b685633 23#endif ADDR16
a002c9f4
KM
24char *_maxptr = (char *)0;
25
26/*
27 * file record variables
28 */
29long _filefre = PREDEF;
30struct iorechd _fchain = {
31 0, 0, 0, 0, /* only use fchain field */
32 INPUT /* fchain */
33};
34struct iorec *_actfile[MAXFILES] = {
35 INPUT,
36 OUTPUT,
37 ERR
38};
39
40/*
41 * standard files
42 */
43char _inwin, _outwin, _errwin;
44struct iorechd input = {
45 &_inwin, /* fileptr */
46 0, /* lcount */
47 0x7fffffff, /* llimit */
48 &_iob[0], /* fbuf */
49 OUTPUT, /* fchain */
50 STDLVL, /* flev */
51 "standard input", /* pfname */
b56aaddc 52 FTEXT|FREAD|SYNC|EOLN, /* funit */
a002c9f4
KM
53 0, /* fblk */
54 1 /* fsize */
55};
56struct iorechd output = {
57 &_outwin, /* fileptr */
58 0, /* lcount */
59 0x7fffffff, /* llimit */
60 &_iob[1], /* fbuf */
61 ERR, /* fchain */
62 STDLVL, /* flev */
63 "standard output", /* pfname */
64 FTEXT | FWRITE | EOFF, /* funit */
65 1, /* fblk */
66 1 /* fsize */
67};
68struct iorechd _err = {
69 &_errwin, /* fileptr */
70 0, /* lcount */
71 0x7fffffff, /* llimit */
72 &_iob[2], /* fbuf */
73 FILNIL, /* fchain */
74 STDLVL, /* flev */
75 "Message file", /* pfname */
76 FTEXT | FWRITE | EOFF, /* funit */
77 2, /* fblk */
78 1 /* fsize */
79};
80
597e0cdd
KM
81PCSTART(mode)
82 int mode;
a002c9f4
KM
83{
84 /*
85 * necessary only on systems which do not initialize
86 * memory to zero
87 */
88
89 struct iorec **ip;
90
597e0cdd
KM
91 /*
92 * if running with runtime tests enabled, give more
93 * coherent error messages for FPEs
94 */
95 if (mode) {
96 signal(SIGFPE, EXCEPT);
97 }
a002c9f4
KM
98 for (ip = &_actfile[3]; ip < &_actfile[MAXFILES]; *ip++ = FILNIL);
99}