[BACK]Return to genusage.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / hgm / mh / src

Annotation of OpenXM/src/hgm/mh/src/genusage.c, Revision 1.2

1.1       takayama    1: #include <stdio.h>
                      2: #include <string.h>
                      3: #define SIZE 4098
                      4: main() {
                      5:   char s[SIZE];
                      6:   int i;
                      7:   printf("/* This is automatically generated. Do not edit it.*/\n");
                      8:   while (fgets(s,SIZE-1,stdin)!=NULL) {
                      9:        if (s[0] == '!') {
                     10:          printf("%s",&(s[1]));
                     11:          continue;
                     12:        }
1.2     ! takayama   13:        if (s[0] == '$') {
        !            14:          if (strncmp(&(s[1]),"Open",4)==0) {
        !            15:            continue;
        !            16:          }
        !            17:        }
1.1       takayama   18:        printf("oxprintfe(\"");
                     19:        for (i=0; i<strlen(s); i++) {
                     20:          if (s[i] == '\\') printf("\\\\");
                     21:          else if (s[i] == 0xa) printf("\\n");
                     22:          else if (s[i] == '%') printf("%%%%");
                     23:          else if (s[i] == '"') printf("\\\"");
                     24:          else putchar(s[i]);
                     25:        }
                     26:        printf("\");\n");
                     27:   }
                     28: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>