/* All of the below was authored by me. By using any part of this source code, you agree to waive all liabilities from the author. Furthermore, you agree that you will not use this source code for personal (or corporate) gain. Finally, should you change any part of this source code, you agree to give credit to the author where such credit is due. This program prepares code for xhtml display (set your CSS to use font-family: monospace). Simply Compile, then drag and drop your files onto the .exe */ #include #include #include #include int main (int argc, char *argv[]) { char *fpath, c1; int h,i,j,k; FILE *in,*out; if(argc<2) { printf("ERROR! Requires at least one argument.\n"); system("pause"); return -1; } for(k=0,i=1; i') { fprintf(out,">"); } else if(c1=='&') { fprintf(out,"&"); } else if(c1=='\"') { fprintf(out,"""); } else if(c1=='\t') { for(;h%7;h++) fprintf(out," "); } else if(c1=='\n') { fprintf(out,"
\n"); h=0; } else fputc(c1,out); } } free(fpath); fclose(out); } else { printf("%s could not be opened.\n",argv[i]); k++; } fclose(in); } if(k!=0) system("pause"); return k; }