home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V7 / usr / src / cmd / struct / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1979-01-10  |  1.0 KB  |  70 lines

  1. #include <signal.h>
  2. #include <stdio.h>
  3. #include "1.defs.h"
  4. #include "def.h"
  5.  
  6.  
  7. char (*input)(), (*unput)();
  8. FILE *outfd    = stdout;
  9.  
  10.  
  11.  
  12. main(argc,argv)
  13. int argc;
  14. char *argv[];
  15.     {
  16.     int anyoutput;
  17.     int dexit();
  18.     char *getargs();
  19.     char input1(), unput1(), input2(), unput2();
  20.     anyoutput = FALSE;
  21.     getargs(argc,argv);
  22.     if (debug == 2) debfd = stderr;
  23.     else if (debug)
  24.         debfd = fopen("debug1","w");
  25.  
  26.     if (signal(SIGINT, SIG_IGN) !=SIG_IGN)
  27.         signal(SIGINT,dexit);
  28.     prog_init();
  29.  
  30.     for (;;)
  31.         {
  32.         ++routnum;
  33.         routerr = 0;
  34.  
  35.         input = input1;
  36.         unput = unput1;
  37.         if (!mkgraph()) break;
  38.         if (debug) prgraph();
  39.         if (routerr) continue;
  40.  
  41.         if (progress)fprintf(stderr,"build:\n");
  42.         build();
  43.         if (debug) prtree();
  44.         if (routerr) continue;
  45.  
  46.         if (progress)fprintf(stderr,"structure:\n");
  47.         structure();
  48.         if (debug) prtree();
  49.         if (routerr) continue;
  50.         input = input2;
  51.         unput = unput2;
  52.  
  53.         if (progress)fprintf(stderr,"output:\n");
  54.         output();
  55.         if (routerr) continue;
  56.         anyoutput = TRUE;
  57.         freegraf();
  58.         }
  59.     if (anyoutput)
  60.         exit(0);
  61.     else
  62.         exit(1);
  63.     }
  64.  
  65.  
  66. dexit()
  67.     {
  68.     exit(1);
  69.     }
  70.