moving functions
This commit is contained in:
parent
4696810e4b
commit
f86e34f88c
1 changed files with 19 additions and 14 deletions
33
cmarkdown.c
33
cmarkdown.c
|
@ -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("<",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("&",stdout);
|
||||
else if(*p == '"')
|
||||
fputs(""",stdout);
|
||||
else if(*p == '>')
|
||||
fputs(">",stdout);
|
||||
else if(*p == '<')
|
||||
fputs("<",stdout);
|
||||
else
|
||||
putchar(*p);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
process(const char *begin, const char *end, int isblock) {
|
||||
const char *p, *q;
|
||||
|
|
Loading…
Add table
Reference in a new issue