148123Sbostic /*-
248123Sbostic * %sccs.include.proprietary.c%
348123Sbostic */
448123Sbostic
510949Srrh #ifndef lint
6*62266Sbostic static char sccsid[] = "@(#)1.finish.c 8.1 (Berkeley) 06/06/93";
748123Sbostic #endif /* not lint */
810949Srrh
910949Srrh #include <stdio.h>
1010949Srrh #include "def.h"
1110949Srrh #include "1.incl.h"
1210949Srrh
fingraph()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
addum(v,lst)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