From b6fe9fc6a4f31d4fa0ddad7fdfd3324cd1c88d3e Mon Sep 17 00:00:00 2001 From: verdant Date: Sun, 24 May 2026 13:55:39 +0800 Subject: Initial commit --- main.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 main.c (limited to 'main.c') diff --git a/main.c b/main.c new file mode 100644 index 0000000..5a87c71 --- /dev/null +++ b/main.c @@ -0,0 +1,33 @@ +#include +#include +#include +#include "parser.h" + +#define MAX_LINE_LEN 1024 + + +int main(int argc, char** argv) { + + char line[MAX_LINE_LEN]; + struct md_token* mt = malloc(sizeof(struct md_token)); + if (!mt) { + return -1; + } + + mt->idx = 0; + + while(fgets(line, sizeof(line), stdin) != NULL) { + mt->line_len = strlen(line); + mt->line = line; + if (line[0] == '#') { + int a = parse_title(mt); + } else { + parse_content(mt); + } + + + + mt->idx = 0; + } + return 0; +} -- cgit v1.2.3