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;
line_t *title;
line_t *author;
line_t *date;
- page_t *pages;
+ page_t *page;
} document_t;
+line_t *new_line() {
+ line_t *x = malloc(sizeof(line_t));
+ return x;
+}
+
+line_t *next_line(line_t *prev) {
+ line_t *x = new_line();
+ x->prev = prev;
+ prev->next = x;
+ return x;
+}
+
+page_t *new_page() {
+ page_t *x = malloc(sizeof(page_t));
+ return x;
+}
+
+page_t *next_page(page_t *prev) {
+ page_t *x = new_page();
+ x->prev = prev;
+ prev->next = x;
+ return x;
+}
+
+document_t *new_document() {
+ document_t *x = malloc(sizeof(document_t));
+ return x;
+}
+
#endif // !defined( MARKDOWN_H )