% c2html -tTitle infile1.c infile2.c infile3.c > outfile.htmlwill create a file called outfile.html which is an html document with title "Title" and containing the list of the code for the input files infile1.c, infile2.c, and infile3.c. An executable version of c2html is available in /u/cs217/2/c2html. A sample output is available in /u/cs217/2/unique.html.
WWW documents are written in `HTML' - the HyperText Markup Language. You do not need to know much about HTML; simply mimic the output of the program /u/cs217/2/c2html. The source code for program is 106 lines long.
A HTML document contains text and embedded formatting commands. Most formatting commands have the form <X>text</X> where X is the formatting command that applies to text. Commands that do not apply to specific pieces of text have only the leading <X>.
The command like the one shown above generates an HTML file that has the following general structure.
Fri Sep 9 16:21:35 EDT 1994
Each file is listed verbatim, except for some include directives. If an include directive refers to one of the ANSI Standard include files in brackets, a hypertext link to the include file itself is planted in the output. For example, if one of the input files contains the line
#include <stdlib.h>
c2html prints this line as
#include <<a href="http://www.princeton.edu/~cs217/include/stdlib.h">stdlib.h</a>>
Note the use of `<' and `>' for the literal occurrences of < and >; c2html must replace all left and right brackets with < and > to avoid confusing WWW clients that interpret HTML formatting codes. It must also replace occurrences of `&' with &.
Similarly, if an include directive refers to one of the file arguments, a self-referential hypertext link to that file is emitted. For example, if one input files contains something like the line
#include "somefile.h"
c2html prints this line as
#include "<a href="#3">somefile.h</a>"
The "#3" is the same string that appears just after the <h2> code at the beginning of the listing for somefile.h.
If an include directive refers to file that is neither one of the ANSI Standard include files nor one of the ones listed in the call to c2html, then it is printed verbatim, it means, without a hypertext link.
/u/cs217/bin/submit 2 readme makefile ...You may use other computing facilities to develop your program, but the submitted version must compile with lcc and execute correctly on Arizona.
Due: submitted by 11:59pm, Monday, February 15, 1999.