X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=include%2Fparser.h;h=4140389ee14302c5d1c506ee1970003bbd25cb4e;hb=e51b855ccbe106c89063653e1f7e79b1a0a03887;hp=1a113e035bb1687762497ea028b707adba8c22ef;hpb=0cb71268b17951d68ae97e12593afcd6b6aaabbb;p=smdp.git diff --git a/include/parser.h b/include/parser.h index 1a113e0..4140389 100644 --- a/include/parser.h +++ b/include/parser.h @@ -5,7 +5,7 @@ * Functions necessary to parse a file and transform its content into * a deck of slides containing lines. All based on markdown formating * rules. - * Copyright (C) 2014 Michael Goehler + * Copyright (C) 2015 Michael Goehler * * This file is part of mdp. * @@ -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,17 +38,23 @@ #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); -int 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); int next_word(cstring_t *text, int i);