# 2.11BSD#431 - /usr/src/usr.bin/struct/2.main.c

##### Functions

    build             X

##### Variables

    ntoaft            X
    ntobef            X

       1: #ifndef lint
       2: static char sccsid[] = "@(#)2.main.c	4.1	(Berkeley)	2/11/83";
       3: #endif not lint
       4:
       5: #include <stdio.h>
       6: #include "def.h"
       7: #include "2.def.h"
       8:
       9: VERT *after;
      10: int *ntobef, *ntoaft;
      11: build()
      12:     {
      13:     VERT v, *dom, *head;
      14:     int type;
      15:     struct list **inarc;
      16:     dfs(START);
      17:     if (routerr) return;
      18:     for (v = 0; v < nodenum; ++v)
      19:         {
      20:         type = NTYPE(v);
      21:         if (type == LOOPVX || type == DOVX)
      22:             FATH(ARC(v,0)) = v;
      23:         }
      24:
      25:     head = (VERT *)challoc(sizeof(*head) * nodenum);
      26:     if (progress) fprintf(stderr,"	gethead:\n");
      27:     gethead(head);  /* sets head[v] to ITERVX heading smallest loop containing v or UNDEFINED */
      28:
      29:     if (routerr) return;
      30:     inarc = (struct list **)challoc(nodenum * sizeof(*inarc));
      31:     if (progress) fprintf(stderr,"	getinarc:\n");
      32:     getinarc(inarc,head);       /* sets inarc[v] to list of forward arcs entering v */
      33:
      34:     dom = (VERT *)challoc(nodenum * sizeof(*dom));
      35:     if (progress) fprintf(stderr,"	getdom:\n");
      36:     getdom(inarc,dom);  /* sets dom[v] to immediate dominator of v or UNDEFINED */
      37:     if (routerr) return;
      38:     if (progress) fprintf(stderr,"	gettree:\n");
      39:     gettree(inarc, dom, head);
      40:     if (routerr) return;
      41:
      42:     chfree(head, nodenum * sizeof(*head)); head = 0;
      43:     chfree(dom,nodenum * sizeof(*dom)); dom = 0;
      44:     for (v = 0; v < nodenum; ++v)
      45:         {
      46:         freelst(inarc[v]);
      47:         inarc[v] = 0;
      48:         }
      49:     chfree(inarc,sizeof(*inarc) * nodenum); inarc = 0;
      50:     chfree(ntoaft,sizeof(*ntoaft) * nodenum); ntoaft = 0;
      51:     chfree(ntobef,sizeof(*ntobef) * nodenum); ntobef = 0;
      52:     chfree(after, sizeof(*after) * accessnum); after = 0;
      53:     }

#### Defined functions

build defined in line 11; used 1 times

- in /usr/src/usr.bin/struct/main.c line 46

#### Defined variables

ntoaft defined in line 10; used 18 times

- in line 50(3)
- in /usr/src/usr.bin/struct/2.dfs.c line 57-60(3), 176
- in /usr/src/usr.bin/struct/2.dom.c line 32, 48(2)
- in /usr/src/usr.bin/struct/2.head.c line 14(2), 42
- in /usr/src/usr.bin/struct/2.inarc.c line 32(2)
- in /usr/src/usr.bin/struct/2.main.c line 50(3)

ntobef defined in line 10; used 13 times

- in line 51(3)
- in /usr/src/usr.bin/struct/2.dfs.c line 58-60(3), 165-170(2)
- in /usr/src/usr.bin/struct/2.head.c line 14(2)
- in /usr/src/usr.bin/struct/2.main.c line 51(3)

sccsid defined in line 2; never used

Last modified: 1993-01-18 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 518 |