home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / FLEX / FLEX-2.4 / FLEX-2 / flex-2.4.7 / MISC / VMS / VMS.more-stuff / main.dif < prev    next >
Encoding:
Text File  |  1990-11-26  |  3.0 KB  |  150 lines

  1. *** flex/main.c    Fri Oct 12 10:56:35 1990
  2. --- main.c    Fri Nov 23 13:39:07 1990
  3. ***************
  4. *** 104,109 ****
  5. --- 104,110 ----
  6.   static int outfile_created = 0;
  7.   static int use_stdout;
  8.   static char *skelname = NULL;
  9. + static int initialized = 0;
  10.   
  11.   
  12.   int main( argc, argv )
  13. ***************
  14. *** 243,249 ****
  15.           flexfatal( "error occurred when closing backtracking file" );
  16.       }
  17.   
  18. !     if ( printstats )
  19.       {
  20.       endtime = flex_gettime();
  21.   
  22. --- 244,250 ----
  23.           flexfatal( "error occurred when closing backtracking file" );
  24.       }
  25.   
  26. !     if ( printstats && initialized )
  27.       {
  28.       endtime = flex_gettime();
  29.   
  30. ***************
  31. *** 372,382 ****
  32.       fprintf( stderr, "  %d total table entries needed\n", tblsiz );
  33.       }
  34.   
  35. - #ifndef VMS
  36.       exit( status );
  37. - #else
  38. -     exit( status + 1 );
  39. - #endif
  40.       }
  41.   
  42.   
  43. --- 373,379 ----
  44. ***************
  45. *** 395,400 ****
  46. --- 392,402 ----
  47.       {
  48.       int i, sawcmpflag;
  49.       char *arg, *flex_gettime(), *mktemp();
  50. + #ifndef SHORT_FILE_NAMES
  51. +     char *backtrack_fn = "lex.backtrack";
  52. + #else
  53. +     char *backtrack_fn = "lex.bck";
  54. + #endif
  55.   
  56.       printstats = syntaxerror = trace = spprdflt = interactive = caseins = fa
  57. lse;
  58.       backtrack_report = performance_report = ddebug = fulltbl = fullspd = fal
  59. se;
  60. ***************
  61. *** 407,414 ****
  62. --- 409,428 ----
  63.   
  64.       csize = DEFAULT_CSIZE;
  65.   
  66. + #ifndef VMSCMDLN
  67.       program_name = argv[0];
  68.   
  69. + /* If GCC doesn't use the VAXCRTL cmdline parsing this should be #ifdef VAXC
  70.  */
  71. + #ifdef VMS
  72. +     {        /* Fixup the grotesque argv[0] */
  73. +     char *p;
  74. +     if (NULL != (p = strrchr (argv[0], '.'))) *p = '\0';
  75. +     if (NULL != (p = strrchr (argv[0], ']'))) program_name = p + 1;
  76. +     }
  77. + #endif
  78. +     
  79.       /* read flags */
  80.       for ( --argc, ++argv; argc ; --argc, ++argv )
  81.       {
  82. ***************
  83. *** 540,545 ****
  84. --- 554,568 ----
  85.       ;
  86.       }
  87.   
  88. +     num_input_files = argc;
  89. +     input_files = argv;
  90. + #else /* VMSCMDLN */
  91. + #include "vmscmdln.c"
  92. + #endif /* VMSCMDLN */
  93.       if ( (fulltbl || fullspd) && usemecs )
  94.       flexerror( "full table and -Cm don't make sense together" );
  95.   
  96. ***************
  97. *** 567,586 ****
  98.       outfile_created = 1;
  99.       }
  100.   
  101. -     num_input_files = argc;
  102. -     input_files = argv;
  103.       set_input_file( num_input_files > 0 ? input_files[0] : NULL );
  104.   
  105.       if ( backtrack_report )
  106.       {
  107. ! #ifndef SHORT_FILE_NAMES
  108. !     backtrack_file = fopen( "lex.backtrack", "w" );
  109. ! #else
  110. !     backtrack_file = fopen( "lex.bck", "w" );
  111. ! #endif
  112.   
  113.       if ( backtrack_file == NULL )
  114. !         flexerror( "could not create lex.backtrack" );
  115.       }
  116.   
  117.       else
  118. --- 590,603 ----
  119.       outfile_created = 1;
  120.       }
  121.   
  122.       set_input_file( num_input_files > 0 ? input_files[0] : NULL );
  123.   
  124.       if ( backtrack_report )
  125.       {
  126. !     backtrack_file = fopen( backtrack_fn, "w" );
  127.   
  128.       if ( backtrack_file == NULL )
  129. !         lerrsf( "could not create backtrack file %s", backtrack_fn );
  130.       }
  131.   
  132.       else
  133. ***************
  134. *** 657,662 ****
  135. --- 674,681 ----
  136.       }
  137.   
  138.       set_up_initial_allocations();
  139. +     initialized = TRUE;
  140.       }
  141.   
  142.   
  143.