X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=tmp.c;fp=tmp.c;h=7e8589e20e79d9a659efe3af9170aace7c51b329;hb=3b1d8241131284a13ca059f399d7113075daf351;hp=33b8603aef9d62b6c247d5d3eeb2c1060fc09684;hpb=f2bc670605162224119269271f7c07459c9de0a8;p=smdp.git diff --git a/tmp.c b/tmp.c index 33b8603..7e8589e 100644 --- a/tmp.c +++ b/tmp.c @@ -63,44 +63,7 @@ int main(int argc, char *argv[]) { doc = markdown_load(input); if(debug > 0) { - // print header to STDERR - int offset; - line_t *header; - if(doc->header) { - header = doc->header; - while(header && - header->length > 0 && - header->text->text[0] == '%') { - - offset = next_blank(header->text, 0) + 1; - fprintf(stderr, "header: %s\n", &header->text->text[offset]); - header = header->next; - } - } - - // print page/line count to STDERR - int cp = 0, cl = 0; - page_t *page = doc->page; - line_t *line; - while(page) { - cp++; - if(debug > 1) { - fprintf(stderr, "page %i:\n", cp); - } - line = page->line; - cl = 0; - while(line) { - cl++; - if(debug > 1) { - fprintf(stderr, " line %i: bits = %i, length = %i\n", cl, line->bits, line->length); - } - line = line->next; - } - if(debug == 1) { - fprintf(stderr, "page %i: %i lines\n", cp, cl); - } - page = page->next; - } + markdown_debug(doc, debug); } }