moving functions

This commit is contained in:
gottox@rootkit.lan 2007-12-14 12:48:19 +01:00
parent 4696810e4b
commit f86e34f88c

View file

@ -24,7 +24,6 @@ struct Tag {
void eprint(const char *format, ...); /* Prints error and exits */
void hprint(const char *begin, const char *end); /* escapes HTML and prints it to stdout*/
unsigned int doamp(const char *begin, const char *end, int first);
/* Parser for & */
unsigned int dohtml(const char *begin, const char *end, int first);
@ -45,6 +44,7 @@ unsigned int dosurround(const char *begin, const char *end, int first);
/* Parser for surrounding tags */
unsigned int dounderline(const char *begin, const char *end, int first);
/* Parser for underline tags */
void hprint(const char *begin, const char *end); /* escapes HTML and prints it to stdout*/
void process(const char *begin, const char *end, int isblock);
/* Processes range between begin and end. */
@ -117,19 +117,6 @@ eprint(const char *format, ...) {
exit(EXIT_FAILURE);
}
void
hprint(const char *begin, const char *end) {
const char *p;
for(p = begin; p && p != end; p++) {
if(*p == '&') fputs("&",stdout);
else if(*p == '"') fputs(""",stdout);
else if(*p == '>') fputs(">",stdout);
else if(*p == '<') fputs("&lt;",stdout);
else putchar(*p);
}
}
unsigned int
doamp(const char *begin, const char *end, int first) {
const char *p;
@ -475,6 +462,24 @@ dounderline(const char *begin, const char *end, int first) {
return 0;
}
void
hprint(const char *begin, const char *end) {
const char *p;
for(p = begin; p && p != end; p++) {
if(*p == '&')
fputs("&amp;",stdout);
else if(*p == '"')
fputs("&quot;",stdout);
else if(*p == '>')
fputs("&gt;",stdout);
else if(*p == '<')
fputs("&lt;",stdout);
else
putchar(*p);
}
}
void
process(const char *begin, const char *end, int isblock) {
const char *p, *q;