date and time created 83/02/11 15:44:02 by rrh
authorRobert R. Henry <rrh@ucbvax.Berkeley.EDU>
Sat, 12 Feb 1983 07:44:02 +0000 (23:44 -0800)
committerRobert R. Henry <rrh@ucbvax.Berkeley.EDU>
Sat, 12 Feb 1983 07:44:02 +0000 (23:44 -0800)
SCCS-vsn: usr.bin/struct/struct/1.finish.c 4.1

usr/src/usr.bin/struct/struct/1.finish.c [new file with mode: 0644]

diff --git a/usr/src/usr.bin/struct/struct/1.finish.c b/usr/src/usr.bin/struct/struct/1.finish.c
new file mode 100644 (file)
index 0000000..ca78419
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef lint
+static char sccsid[] = "@(#)1.finish.c 4.1     (Berkeley)      %G%";
+#endif not lint
+
+#include <stdio.h>
+#include "def.h"
+#include "1.incl.h"
+
+fingraph()
+       {
+       /* if any entry statements, add a DUMVX with arcs to all entry statements */
+       if (ENTLST)
+               {
+               ARC(START,0) = addum(ARC(START,0),ENTLST);
+               freelst(ENTLST);
+               }
+       /* if any FMTVX, add a DUMVX with arcs to all FMTVX's */
+       if (FMTLST)
+               {
+               ARC(START,0) = addum(ARC(START,0),FMTLST);
+               freelst(FMTLST);
+               }
+       }
+
+addum(v,lst)
+VERT v;
+struct list *lst;
+       {
+       VERT new;
+       int count,i;
+       struct list *ls;
+       count = lslen(lst);             /* length of lst */
+       new = create(DUMVX,1+count);
+       ARC(new,0) = v;
+       for (i = count, ls = lst; i >= 1; --i, ls = ls->nxtlist)
+               {
+               ASSERT(ls,addum);
+               ARC(new,i) = ls->elt;
+               }
+       ASSERT(!ls, addum);
+       return(new);
+       }