X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=include%2Fmarkdown.h;h=28b48e066c501336d184d0dbc33dd45354d9e472;hb=76cedc9066d3fd65788f86ea5d0b71db98bb6e24;hp=357de78d3ff0e815c81c0f47176263d4e31c1d3c;hpb=b83e558d4fa221404aadb87bac1c25ce82774efd;p=smdp.git diff --git a/include/markdown.h b/include/markdown.h index 357de78..28b48e0 100644 --- a/include/markdown.h +++ b/include/markdown.h @@ -19,18 +19,21 @@ 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; @@ -38,7 +41,16 @@ typedef struct _document_t { line_t *title; line_t *author; line_t *date; - page_t *pages; + 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); +document_t *markdown_load(FILE *input); + #endif // !defined( MARKDOWN_H )