xref: /original-bsd/usr.bin/struct/struct/1.init.c (revision c3e32dec)
1 /*-
2  * %sccs.include.proprietary.c%
3  */
4 
5 #ifndef lint
6 static char sccsid[] = "@(#)1.init.c	8.1 (Berkeley) 06/06/93";
7 #endif /* not lint */
8 
9 #include <stdio.h>
10 #include "1.defs.h"
11 #include  "1.incl.h"
12 #include "def.h"
13 
14 
15 prog_init()
16 	{
17 	endline = endcom = 0;	endchar = -1;
18 	comchar = -1;
19 	graph = challoc(sizeof(*graph) * maxnode);
20 	}
21 
22 routinit()
23 	{
24 	graf_init();
25 	progtype = !sub;
26 	routbeg = endline + 1;
27 	rtnbeg = endchar + 1;
28 	nameline = 0;
29 	stflag = UNDEFINED;
30 	}
31 line_init()
32 	{
33 	struct lablist *makelab();
34 	freelabs();
35 	newlab = linelabs = makelab(0L);
36 	flag = counter = nlabs = lswnum = swptr = p1 = 0;
37 	p3 = 5;
38 	endcom = endline;
39 	comchar = endchar;
40 	begline = endline + 1;	begchar = endchar + 1;
41 	reflab = endlab = errlab = 0;
42 	r1 = r2 = 0;
43 	}
44 graf_init()
45 	{
46 	int arctype[3];  long arclab[3];
47 	nodenum = 0;
48 	doptr = UNDEFINED;
49 	retvert = stopvert = UNDEFINED;
50 	ENTLST = FMTLST = 0;
51 
52 
53 	arctype[0] = -2;  arclab[0] = implicit;
54 	START = makenode(DUMVX,FALSE,FALSE,implicit,1,arctype,arclab);
55 	}
56 
57