/*
* inc2shtml: Convert httpd <1.1 style includes to 1.2 style
*
* Rob McCool
*
* Usage: inc2shtml [filename]
*
* If filename is given, this program will open filename. If not, it will
* look on stdin. It will output the new shtml file on stdout.
*/
#include
#define MAX_STRING_LEN 256
void usage(char *argv0) {
fprintf(stderr,"Usage: %s [filename]\n",argv0);
fprintf(stderr,"If filename is given, this program will open filename.\n");
fprintf(stderr,"If not, it will look on stdin for the inc file.\n");
fprintf(stderr,
"In either case, it will write the new shtml file on stdout.\n");
exit(1);
}
void translate_tag(char *tag, FILE *fd) {
char *tp = tag, *tp2;
int url;
url = (*tp == 'U' || *tp == 'u' ? 1 : 0);
while(*tp++ != '\"');
tp2 = tp + 1;
while(*tp2 != '\"') ++tp2;
*tp2 = '\0';
if(*tp == '|') {
fprintf(fd,"",fd);
} else
fprintf(fd,"",tp);
}
main(int argc, char *argv[]) {
FILE *f;
int c,x,p;
char c2;
char *lookfor = "') {
tag[x++] = c;
c = fgetc(f);
if(c == -1) {
fputs("