[BACK]Return to ole.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Doc

Annotation of OpenXM/src/kan96xx/Doc/ole.c, Revision 1.1

1.1     ! maekawa     1: #include <stdio.h>
        !             2:
        !             3: main() {
        !             4:   FILE *fp;
        !             5:   int c;
        !             6:   char fname[1024];
        !             7:   int i;
        !             8:   printf("\\def\\at{\\catcode`@=11{@}\\catcode`@=12 } \n");
        !             9:   while ((c=getchar()) != EOF) {
        !            10:     if (c != '@') {
        !            11:        putchar(c);
        !            12:     }else{
        !            13:        i = 0;
        !            14:        while (1) {
        !            15:          c = getchar();
        !            16:         if (c <= ' ') {
        !            17:            fname[i]='\0';
        !            18:            break;
        !            19:         }
        !            20:         fname[i++] = c;
        !            21:        }
        !            22:        fp = fopen(fname,"r");
        !            23:        if (fp == (FILE *)NULL) {
        !            24:           fprintf(stderr,"I cannot find the file %s.\n",fname);
        !            25:        }else{
        !            26:           printf("\\begin{verbatim}\n");
        !            27:           while ((c =fgetc(fp)) != EOF) putchar(c);
        !            28:           printf("\n\\end{verbatim}\n");
        !            29:        }
        !            30:     }
        !            31:   }
        !            32:   exit(0);
        !            33: }

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