X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=include%2Fmarkdown.h;h=dc759e075fcd6adcb88aa7a3b9ce0aa7d729cba7;hb=3b1d8241131284a13ca059f399d7113075daf351;hp=ee6dff73b918f0e8ebe8d3e1518959b51f8472ed;hpb=5ef15d236a390f60d3bfb435325c6b40e3bfede2;p=smdp.git diff --git a/include/markdown.h b/include/markdown.h index ee6dff7..dc759e0 100644 --- a/include/markdown.h +++ b/include/markdown.h @@ -7,20 +7,15 @@ */ #include "cstring.h" - -#define SET_BIT(var, pos) ((var) |= (1<<(pos))) -#define CLEAR_BIT(var, pos) ((var) &= (~(1<<(pos)))) -#define TOGGLE_BIT(var, pos) ((var) ^= (1<<(pos))) -#define CHECK_BIT(var, pos) ((var) & (1<<(pos))) +#include "bitops.h" enum line_bitmask { - IS_HEADER, - IS_HEADER2, + IS_H1, + IS_H2, IS_QUOTE, IS_CODE, - IS_LIST, - IS_NUMLIST, - IS_HR + IS_HR, + IS_EMPTY }; typedef struct _line_t { @@ -28,6 +23,7 @@ typedef struct _line_t { struct _line_t *prev; struct _line_t *next; int bits; + int length; int offset; } line_t; @@ -47,8 +43,5 @@ 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 )