diff options
author | Thomas White <taw@physics.org> | 2019-02-14 16:02:43 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-02-14 16:02:43 +0100 |
commit | c9456a1a73a8b781f4460d48c541a8977e249b91 (patch) | |
tree | 207f4c98184397a69c9e79fb7fb60511e3d31288 /libstorycode/narrative.c | |
parent | 7b9d04f56c0e22abaeec8dc779bd0800b0d93f79 (diff) |
Skeleton parser structure
Diffstat (limited to 'libstorycode/narrative.c')
-rw-r--r-- | libstorycode/narrative.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libstorycode/narrative.c b/libstorycode/narrative.c index 971af82..c2e0d27 100644 --- a/libstorycode/narrative.c +++ b/libstorycode/narrative.c @@ -28,3 +28,27 @@ #include <stdlib.h> #include <string.h> +#include "narrative.h" + +struct _narrative +{ + int n_items; + struct narrative_item *items; +}; + + +Narrative *narrative_new() +{ + Narrative *n; + n = malloc(sizeof(*n)); + if ( n == NULL ) return NULL; + n->n_items = 0; + n->items = NULL; + return n; +} + +void narrative_free(Narrative *n) +{ + free(n->items); + free(n); +} |