2 * An implementation of markdown objects.
3 * Copyright (C) 2014 Michael Goehler
5 * This file is part of mdp.
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
28 line_t *x = malloc(sizeof(line_t));
30 x->prev = x->next = NULL;
31 x->bits = x->length = x->offset = 0;
35 line_t *next_line(line_t *prev) {
36 line_t *x = new_line();
42 slide_t *new_slide() {
43 slide_t *x = malloc(sizeof(slide_t));
45 x->prev = x->next = NULL;
50 slide_t *next_slide(slide_t *prev) {
51 slide_t *x = new_slide();
58 deck_t *x = malloc(sizeof(deck_t));
60 x->slide = new_slide();
61 x->slides = x->headers = 0;
65 void free_line(line_t *line) {
69 (line->text->delete)(line->text);
75 void free_deck(deck_t *deck) {
76 slide_t *slide, *next;
81 free_line(slide->line);
86 free_line(deck->header);