/* * printfree.c * for Animal Pictures Archive * jskim@AnimalPicturesArchive.com * prints the body */ #include "version3/web.h" #include main() { FILE *fp; char line[1024]; int PrintThisLine = 0; getentry entries[5]; int i, x; /* general purposes */ printf("content-type: text/html\n\n"); /* HTML Header */ i = ProcessGetMethod(entries); for (x = 0; x <= i; x++) { if (!strcasecmp(entries[x].name, "file")) { fp = fopen(entries[x].val, "r"); if (fp == NULL) { printf("Can't open your request [%s]\n", entries[x].val); exit(0); } continue; } } while (fgets(line, 1024, fp)) { if( !strncasecmp(line, "", 6)) { PrintThisLine = 1; printf("%s", line); continue; } if( !strncasecmp(line, "", 7)) { PrintThisLine = 0; printf("%s
\n", line); continue; } if( !strncasecmp(line, "", 25)) { PrintThisLine = 1; continue; } if( !strncasecmp(line, "", 23)) { PrintThisLine = 0; continue; } if (PrintThisLine) printf("%s", line); } printf("

\n"); printf("© CopyLeft 1995-2000, AnimalPicturesArchive.com\n"); printf("\n"); fclose(fp); exit(0); }