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