diff options
author | Thomas White <taw@bitwiz.org.uk> | 2012-10-12 00:53:34 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2012-10-12 00:53:34 +0200 |
commit | 350c51a006edba2a46e7f17bf05098b398a4cb80 (patch) | |
tree | b6a996032b7131eb72c5b070325c78a005087ed0 /src/storycode.c | |
parent | eea7bf93ada2a57fad1dac3e5233f703d1af02ff (diff) |
Move "frame" to new module
Diffstat (limited to 'src/storycode.c')
-rw-r--r-- | src/storycode.c | 54 |
1 files changed, 1 insertions, 53 deletions
diff --git a/src/storycode.c b/src/storycode.c index 3432090..1ef01d7 100644 --- a/src/storycode.c +++ b/src/storycode.c @@ -31,7 +31,7 @@ #include <ctype.h> #include "storycode.h" -#include "presentation.h" +#include "frame.h" struct _scblocklist @@ -393,58 +393,6 @@ static char *remove_blocks(const char *in, const char *blockname) } -static int alloc_ro(struct frame *fr) -{ - struct frame **new_ro; - - new_ro = realloc(fr->rendering_order, - fr->max_ro*sizeof(struct frame *)); - if ( new_ro == NULL ) return 1; - - fr->rendering_order = new_ro; - - return 0; -} - - -static struct frame *frame_new() -{ - struct frame *n; - - n = calloc(1, sizeof(struct frame)); - if ( n == NULL ) return NULL; - - n->rendering_order = NULL; - n->max_ro = 32; - alloc_ro(n); - - n->num_ro = 1; - n->rendering_order[0] = n; - - n->pl = NULL; - - return n; -} - - -static struct frame *add_subframe(struct frame *fr) -{ - struct frame *n; - - n = frame_new(); - if ( n == NULL ) return NULL; - - if ( fr->num_ro == fr->max_ro ) { - fr->max_ro += 32; - if ( alloc_ro(fr) ) return NULL; - } - - fr->rendering_order[fr->num_ro++] = n; - - return n; -} - - static void recursive_unpack(struct frame *fr, const char *sc) { SCBlockList *bl; |