Parser

Copyright 2008, 2012 Neil Edelman, distributed under the terms of the GNU General Public License, see copying.txt

Parsing of strings. '~' on a line by itself is recognised in ".newsfile.rss" and ".sitemap.xml" as a <head>~<body>~<tail>; there should be two of them.

Parsed in ".index.html",

Further parsed in @(files) in ".index.html",

Parsed in ".newsfeed.rss",

minimum standard
C89/90
author
Neil
version
1.1; 2017-03 fixed pedantic warnings; command-line improvements
since
0.6; 2008-03-21

Declarations

struct Parser

struct Parser

See Parser.

struct Files

struct Files

Dependancy on Files.

typedef int (*ParserWidget)(struct Files *const files, FILE *const fp)

typedef int (*ParserWidget)(struct Files *const files, FILE *const fp)

All ParserWidgets are in Widget.c.

Function Summary

Return TypeFunction NameArgument List
struct Parser * Parser char *const str
void Parser_ struct Parser **const p_ptr
void ParserRewind struct Parser *p
int ParserParse struct Parser *p, struct Files *const f, int invisible, FILE *fp

Function Detail

Parser

struct Parser * Parser (char *const str)
return
Creates a parser for the string, str.

Parser_

void Parser_ (struct Parser **const p_ptr)
parameter: p_ptr
A pointer to the Parser that's to be destucted.

ParserRewind

void ParserRewind (struct Parser *p)

Resets the parser, p.

ParserParse

int ParserParse (struct Parser *p, struct Files *const f, int invisible,
	FILE *fp)

Parse, called recursively.

parameter: f
Called in the handler to ParserWidgets.
parameter: invisible
No output.
parameter: fp
Output.
fixme
This fn needs rewriting; messy.
fixme
Invisible, hack.