1*48123Sbostic /*- 2*48123Sbostic * %sccs.include.proprietary.c% 3*48123Sbostic */ 4*48123Sbostic 510949Srrh #ifndef lint 6*48123Sbostic static char sccsid[] = "@(#)1.finish.c 4.2 (Berkeley) 04/16/91"; 7*48123Sbostic #endif /* not lint */ 810949Srrh 910949Srrh #include <stdio.h> 1010949Srrh #include "def.h" 1110949Srrh #include "1.incl.h" 1210949Srrh 1310949Srrh fingraph() 1410949Srrh { 1510949Srrh /* if any entry statements, add a DUMVX with arcs to all entry statements */ 1610949Srrh if (ENTLST) 1710949Srrh { 1810949Srrh ARC(START,0) = addum(ARC(START,0),ENTLST); 1910949Srrh freelst(ENTLST); 2010949Srrh } 2110949Srrh /* if any FMTVX, add a DUMVX with arcs to all FMTVX's */ 2210949Srrh if (FMTLST) 2310949Srrh { 2410949Srrh ARC(START,0) = addum(ARC(START,0),FMTLST); 2510949Srrh freelst(FMTLST); 2610949Srrh } 2710949Srrh } 2810949Srrh 2910949Srrh addum(v,lst) 3010949Srrh VERT v; 3110949Srrh struct list *lst; 3210949Srrh { 3310949Srrh VERT new; 3410949Srrh int count,i; 3510949Srrh struct list *ls; 3610949Srrh count = lslen(lst); /* length of lst */ 3710949Srrh new = create(DUMVX,1+count); 3810949Srrh ARC(new,0) = v; 3910949Srrh for (i = count, ls = lst; i >= 1; --i, ls = ls->nxtlist) 4010949Srrh { 4110949Srrh ASSERT(ls,addum); 4210949Srrh ARC(new,i) = ls->elt; 4310949Srrh } 4410949Srrh ASSERT(!ls, addum); 4510949Srrh return(new); 4610949Srrh } 47