Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
993 B

  1. // Copyright (c) 1993-1999 Microsoft Corporation
  2. #include <string.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <ctype.h>
  6. extern int yyparse();
  7. extern FILE *yyin, *yyout;
  8. char * name_prefix;
  9. void
  10. main(
  11. int argc,
  12. char *argv[] )
  13. {
  14. int ExitCode;
  15. char * cur;
  16. yyin = stdin;
  17. yyout = stdout;
  18. fprintf(stderr, "Grammar (.cxx) munge utility\n");
  19. if( argc < 2 )
  20. {
  21. printf("Usage : pg <filename>\n");
  22. exit(1);
  23. }
  24. else
  25. {
  26. if( (yyin = fopen( argv[1], "rt" )) == (FILE *)NULL )
  27. {
  28. printf("Error opening file %s\n", argv[1] );
  29. exit(1);
  30. }
  31. }
  32. name_prefix = _strdup( argv[1] );
  33. if ( NULL == name_prefix )
  34. {
  35. fprintf( stderr, "Out of memory" );
  36. exit(1);
  37. }
  38. name_prefix = _strlwr( name_prefix );
  39. for ( cur = name_prefix; islower( *cur ); cur++ );
  40. *cur = '\0';
  41. ExitCode = yyparse();
  42. fprintf(stderr, "Exit Code (%d) \n", ExitCode );
  43. exit( ExitCode );
  44. }