X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=include%2Fmarkdown.h;h=4d5105c268324f17d94f9c50fffd19c691880cd6;hb=c8c3b3d8b2755bddb5c9562ead12d659c31f3090;hp=357de78d3ff0e815c81c0f47176263d4e31c1d3c;hpb=b83e558d4fa221404aadb87bac1c25ce82774efd;p=smdp.git diff --git a/include/markdown.h b/include/markdown.h index 357de78..4d5105c 100644 --- a/include/markdown.h +++ b/include/markdown.h @@ -19,26 +19,37 @@ enum line_bitmask { IS_QUOTE, IS_CODE, IS_LIST, - IS_NUMLIST + IS_NUMLIST, + IS_HR }; typedef struct _line_t { cstring_t *text; + struct _line_t *prev; struct _line_t *next; int bits; - int left_white_space; + int offset; } line_t; typedef struct _page_t { - line_t *lines; + line_t *line; + struct _page_t *prev; struct _page_t *next; } page_t; typedef struct _document_t { - line_t *title; - line_t *author; - line_t *date; - page_t *pages; + line_t *header; + page_t *page; } document_t; +line_t *new_line(); +line_t *next_line(line_t *prev); +page_t *new_page(); +page_t *next_page(page_t *prev); +document_t *new_document(); +int is_utf8(char ch); +int next_nonblank(cstring_t *text, int i); +int next_blank(cstring_t *text, int i); +document_t *markdown_load(FILE *input); + #endif // !defined( MARKDOWN_H )