-tmp: tmp.c cstring.o markdown.o markdown_io.o
- cc -g -o tmp tmp.c cstring.o markdown.o markdown_io.o
+tmp: tmp.c cstring.o markdown.o parser.o
+ cc -g -o tmp tmp.c cstring.o markdown.o parser.o
-markdown_io.o: markdown_io.c cstring.o markdown.o
- cc -g -c markdown_io.c -o markdown_io.o -lmarkdown
+parser.o: parser.c cstring.o markdown.o
+ cc -g -c parser.c -o parser.o -lmarkdown
markdown.o: markdown.c cstring.o
cc -g -c markdown.c -o markdown.o -lcstring
--- /dev/null
+#if !defined( BITOPS_H )
+#define BITOPS_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)))
+
+#endif // !defined( BITOPS_H )
*/
#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_H1,
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);
-int next_blank(cstring_t *text, int i);
-document_t *markdown_load(FILE *input);
#endif // !defined( MARKDOWN_H )
--- /dev/null
+#if !defined( PARSER_H )
+#define PARSER_H
+
+#include "markdown.h"
+
+document_t *markdown_load(FILE *input);
+int markdown_analyse(cstring_t *text);
+int is_utf8(char ch);
+int next_nonblank(cstring_t *text, int i);
+int next_blank(cstring_t *text, int i);
+
+#endif // !defined( PARSER_H )
#include <stdio.h>
#include <stdlib.h>
-#include "include/cstring.h"
-#include "include/markdown.h"
+#include "include/parser.h"
document_t *markdown_load(FILE *input) {
#include <stdlib.h>
#include <string.h>
-#include "include/markdown.h"
+#include "include/parser.h"
void usage() {
fprintf(stderr, "Usage: tmp [OPTION]... [FILE]\n");