X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=include%2Fparser.h;h=67d15d4b49f4ef6bbd778d773bcb760438a0b025;hb=d8422e5afe7b7637f8412f3d27969a52d2a7f014;hp=99f68ff7cef1783a10284bcd1f00af6bcb5c44f7;hpb=bdd26d4dde3b3d3180619cc81622081025ca6cb5;p=smdp.git diff --git a/include/parser.h b/include/parser.h index 99f68ff..67d15d4 100644 --- a/include/parser.h +++ b/include/parser.h @@ -28,6 +28,7 @@ * function: markdown_analyse which is used to identify line wide formating * rules in given line * function: markdown_debug to print a report of the generated data structure + * function: adjust_line_length to calculate line length excluding markup * function: is_utf8 detects multi-byte char * function: length_utf8 calculates the amount of bytes used for a multi-byte * char @@ -37,16 +38,21 @@ #include "common.h" #include "markdown.h" +#include "cstack.h" + +#if defined( CYGWIN ) +#undef WEOF +#define WEOF (0xffff) +#endif // defined( CYGWIN ) #define EXPAND_TABS 4 #define CODE_INDENT 4 #define UNORDERED_LIST_MAX_LEVEL 3 deck_t *markdown_load(FILE *input); -int markdown_analyse(cstring_t *text); +int markdown_analyse(cstring_t *text, int prev); void markdown_debug(deck_t *deck, int debug); -bool is_utf8(char ch); -int length_utf8(char ch); +void adjust_line_length(line_t *line); int next_nonblank(cstring_t *text, int i); int prev_blank(cstring_t *text, int i); int next_blank(cstring_t *text, int i);