1 /*-
2 * %sccs.include.proprietary.c%
3 */
4
5 #ifndef lint
6 static char sccsid[] = "@(#)1.finish.c 8.1 (Berkeley) 06/06/93";
7 #endif /* not lint */
8
9 #include <stdio.h>
10 #include "def.h"
11 #include "1.incl.h"
12
fingraph()13 fingraph()
14 {
15 /* if any entry statements, add a DUMVX with arcs to all entry statements */
16 if (ENTLST)
17 {
18 ARC(START,0) = addum(ARC(START,0),ENTLST);
19 freelst(ENTLST);
20 }
21 /* if any FMTVX, add a DUMVX with arcs to all FMTVX's */
22 if (FMTLST)
23 {
24 ARC(START,0) = addum(ARC(START,0),FMTLST);
25 freelst(FMTLST);
26 }
27 }
28
addum(v,lst)29 addum(v,lst)
30 VERT v;
31 struct list *lst;
32 {
33 VERT new;
34 int count,i;
35 struct list *ls;
36 count = lslen(lst); /* length of lst */
37 new = create(DUMVX,1+count);
38 ARC(new,0) = v;
39 for (i = count, ls = lst; i >= 1; --i, ls = ls->nxtlist)
40 {
41 ASSERT(ls,addum);
42 ARC(new,i) = ls->elt;
43 }
44 ASSERT(!ls, addum);
45 return(new);
46 }
47