line_t *new_line() {
line_t *x = malloc(sizeof(line_t));
- x->text = (void*)0;
- x->prev = x->next = (void*)0;
+ x->text = NULL;
+ x->prev = x->next = NULL;
x->bits = x->length = x->offset = 0;
return x;
}
slide_t *new_slide() {
slide_t *x = malloc(sizeof(slide_t));
- x->line = (void*)0;
- x->prev = x->next = (void*)0;
+ x->line = NULL;
+ x->prev = x->next = NULL;
x->lines = 0;
return x;
}
deck_t *new_deck() {
deck_t *x = malloc(sizeof(deck_t));
- x->header = (void*)0;
- x->slide = (void*)0;
+ x->header = NULL;
+ x->slide = new_slide();
x->slides = x->headers = 0;
return x;
}
int l = 0; // line length
int hc = 0; // header count
int lc = 0; // line count
- int sc = 0; // slide count
+ int sc = 1; // slide count
int bits = 0; // markdown bits
deck_t *deck = new_deck();
- slide_t *slide = new_slide();
+ slide_t *slide = deck->slide;
line_t *line = NULL;
line_t *tmp = NULL;
cstring_t *text = cstring_init();
- // assign first slide to deck
- deck->slide = slide;
- sc++;
-
while ((c = fgetc(input)) != EOF) {
if (ferror(input)) {
fprintf(stderr, "markdown_load() failed to read input: %s\n", strerror(errno));