make-index/web/Parser.html

249 lines
5.1 KiB
HTML
Raw Permalink Normal View History

2018-03-18 22:57:28 -04:00
<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<!-- steal these colour values from JavaDocs; meh -->
<style type = "text/css">
a:link, a:visited { color: #4a6782; }
a:hover, a:focus { color: #bb7a2a; }
a:active { color: #4A6782; }
tr:nth-child(even) { background: #dee3e9; }
div {
margin: 4px 0;
padding: 0 4px 4px 4px;
}
table { width: 100%; }
td { padding: 4px; }
h3, h1 {
color: #2c4557;
background-color: #dee3e9;
padding: 4px;
}
h3 {
margin: 0 -4px;
padding: 4px;
}
</style>
<title>Parser</title>
</head>
<body>
<h1>Parser</h1>
<ul>
<li><a href = "#_declarations">Declarations</a></li>
<li><a href = "#_summary">Function Summary</a></li>
<li><a href = "#_detail">Function Detail</a></li>
</ul>
<p>
Copyright 2008, 2012 Neil Edelman, distributed under the terms of the
GNU General Public License, see copying.txt
</p>
<p>
Parsing of strings. '~' on a line by itself is recognised in ".newsfile.rss"
and ".sitemap.xml" as a &lt;head&gt;~&lt;body&gt;~&lt;tail&gt;; there should be two of them.
</p>
<p>
Parsed in ".index.html",
</p>
<ul>
<li>
@(content) prints <em>content.d</em>, or, if it is missing, <em>index.d</em>;
</li>
<li>
@(files){} repeats for all the files in the directory the contents of the
argument;
</li>
<li>
@(htmlcontent);
</li>
<li>
@(pwd){} prints the directory, the argument is the separator;
eg, @(pwd){/};
</li>
<li>
@(root){}, like @(pwd), except up instead of down;
</li>
<li>
@(now) prints the date and the time in UTC.
</li>
</ul>
<p>
Further parsed in @(files)<em></em> in ".index.html",
</p>
<ul>
<li>
@(filealt) prints Dir or File;
</li>
<li>
@(filedesc);
</li>
<li>
@(filehref) prints the filename or the <em>.link</em>;
</li>
<li>
@(fileicon) prints it's <em>.d.jpeg</em>, or if it is not there, <em>dir.jpeg</em> or
<em>file.jpeg</em>;
</li>
<li>
@(filename) prints the file name;
</li>
<li>
@(filesize) prints the file size, if it exits;
</li>
<li>
@(now) prints the date and the time in UTC.
</li>
</ul>
<p>
Parsed in ".newsfeed.rss",
</p>
<ul>
<li>
@(date) prints the date on the news file;
</li>
<li>
@(news) prints the contents of the file (as a text file);
</li>
<li>
@(newsname) prints the filename of the news story;
</li>
<li>
@(now) prints the date and the time in UTC;
</li>
<li>
@(title) prints the second line in the <em>.news</em>.
</li>
</ul>
<dl>
<dt>minimum standard</dt>
<dd>C89/90</dd>
<dt>author</dt>
<dd>Neil</dd>
<dt>version</dt>
<dd>1.1; 2017-03 fixed pedantic warnings; command-line improvements</dd>
<dt>since</dt>
<dd>0.6; 2008-03-21</dd>
</dl>
<a name = "_declarations"><!-- --></a><h2>Declarations</h2>
<div><a name = "struct Parser"><!-- --></a>
<h3>struct Parser</h3>
<pre><b>struct Parser</b></pre>
<p>
See <a href = "#Parser">Parser</a>.
</p>
<dl>
</dl>
</div>
<div><a name = "struct Files"><!-- --></a>
<h3>struct Files</h3>
<pre><b>struct Files</b></pre>
<p>
Dependancy on <em>Files</em>.
</p>
<dl>
</dl>
</div>
<div><a name = "typedef int (*ParserWidget)(struct Files *const files, FILE *const fp)"><!-- --></a>
<h3>typedef int (*ParserWidget)(struct Files *const files, FILE *const fp)</h3>
<pre><b>typedef int (*ParserWidget)(struct Files *const files, FILE *const fp)</b></pre>
<p>
All <em>ParserWidget</em>s are in <em>Widget.c</em>.
</p>
<dl>
</dl>
</div>
<a name = "_summary"><!-- --></a><h2>Function Summary</h2>
<table>
<tr><th>Return Type</th><th>Function Name</th><th>Argument List</th></tr>
<tr>
<td>struct Parser *</td>
<td><a href = "#Parser">Parser</a></td>
<td>char *const str</td>
</tr>
<tr>
<td>void</td>
<td><a href = "#Parser_">Parser_</a></td>
<td>struct Parser **const p_ptr</td>
</tr>
<tr>
<td>void</td>
<td><a href = "#ParserRewind">ParserRewind</a></td>
<td>struct Parser *p</td>
</tr>
<tr>
<td>int</td>
<td><a href = "#ParserParse">ParserParse</a></td>
<td>struct Parser *p, struct Files *const f, int invisible,
FILE *fp</td>
</tr>
</table>
<a name = "_detail"><!-- --></a><h2>Function Detail</h2>
<div><a name = "Parser"><!-- --></a>
<h3>Parser</h3>
<pre>struct Parser * <b>Parser</b> (char *const str)</pre>
<dl>
<dt>return</dt>
<dd>Creates a parser for the string, <em>str</em>.</dd>
</dl>
</div>
<div><a name = "Parser_"><!-- --></a>
<h3>Parser_</h3>
<pre>void <b>Parser_</b> (struct Parser **const p_ptr)</pre>
<dl>
<dt>parameter: p_ptr</dt>
<dd>A pointer to the <em>Parser</em> that's to be destucted.</dd>
</dl>
</div>
<div><a name = "ParserRewind"><!-- --></a>
<h3>ParserRewind</h3>
<pre>void <b>ParserRewind</b> (struct Parser *p)</pre>
<p>
Resets the parser, <em>p</em>.
</p>
<dl>
</dl>
</div>
<div><a name = "ParserParse"><!-- --></a>
<h3>ParserParse</h3>
<pre>int <b>ParserParse</b> (struct Parser *p, struct Files *const f, int invisible,
FILE *fp)</pre>
<p>
Parse, called recursively.
</p>
<dl>
<dt>parameter: f</dt>
<dd>Called in the handler to <em>ParserWidget</em>s.</dd>
<dt>parameter: invisible</dt>
<dd>No output.</dd>
<dt>parameter: fp</dt>
<dd>Output.</dd>
<dt>fixme</dt>
<dd>This fn needs rewriting; messy.</dd>
<dt>fixme</dt>
<dd>Invisible, hack.</dd>
</dl>
</div>
</body>
</html>