1: #ifndef lint
   2: static char sccsid[] = "@(#)0.graph.c	4.1	(Berkeley)	2/11/83";
   3: #endif not lint
   4: 
   5: #include <stdio.h>
   6: #include "def.h"
   7: 
   8: #define TABOVER(n)  tabover(n,stderr)
   9: prgraph()
  10:     {
  11:     VERT v;
  12:     int i;
  13:     if (progress) fprintf(stderr,"prgraph():\n");
  14:     for (v = 0; v < nodenum; ++v)
  15:         {
  16:         fprintf(stderr,"%d %s:",v, typename[NTYPE(v)]);
  17:         for (i = 0; i < ARCNUM(v); ++i)
  18:             {
  19:             printf("%d ",ARC(v,i));
  20:             ASSERT(UNDEFINED <= ARC(v,i) && ARC(v,i) < nodenum, prgraph);
  21:             }
  22:         printf("\n");
  23:         }
  24:     printf("\n\n");
  25:     }
  26: 
  27: prtree()
  28:     {
  29:     prtr(START,1);
  30:     }
  31: 
  32: prtr(v,tab)     /* print tree in form of program indenting by tab */
  33: VERT v;
  34: int tab;
  35:     {
  36:     int i;
  37:     TABOVER(tab);
  38:     fprintf(stderr,"%d %s:",v,typename[NTYPE(v)]);
  39:     for (i = 0; i < ARCNUM(v); ++i)
  40:         fprintf(stderr," %d",ARC(v,i));
  41:     printf("\n");
  42:     for (i = 0; i < CHILDNUM(v); ++i)
  43:         {
  44:         TABOVER(tab+1);
  45:         fprintf(stderr,"{\n");
  46:         if (DEFINED(LCHILD(v,i)))
  47:             prtr(LCHILD(v,i),tab+1);
  48:         TABOVER(tab+1);
  49:         fprintf(stderr,"}\n");
  50:         }
  51:     if (DEFINED(RSIB(v)))
  52:         prtr(RSIB(v),tab);
  53:     }
  54: 
  55: 
  56: tabover(n,fd)       /* tab n times */
  57: int n;
  58: FILE *fd;
  59:     {
  60:     int i;
  61:     for (i = 0; i < n; ++i)
  62:         putc('\t',fd);
  63:     }

Defined functions

prgraph defined in line 9; used 2 times
prtr defined in line 32; used 3 times
prtree defined in line 27; used 2 times
tabover defined in line 56; used 2 times

Defined variables

sccsid defined in line 2; never used

Defined macros

TABOVER defined in line 8; used 3 times
Last modified: 1987-02-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1962
Valid CSS Valid XHTML 1.0 Strict