diff options
Diffstat (limited to 'src/api.c')
-rw-r--r-- | src/api.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/api.c b/src/api.c new file mode 100644 index 0000000..cffa8e9 --- /dev/null +++ b/src/api.c @@ -0,0 +1,34 @@ + +#if HAVE_CONFIG_H +#include <config.h> +#endif + +#include <yaml/yaml.h> + +/* + * Create a new parser. + */ + +yaml_parser_t * +yaml_parser_new(void) +{ + yaml_parser_t *parser; + + parser = malloc(sizeof(yaml_parser_t)); + if (!parser) return NULL; + + memset(parser, 0, sizeof(yaml_parser_t)); + + return parser; +} + +/* + * Destroy a parser object. + */ + +void +yaml_parser_delete(yaml_parser_t *parser) +{ + free(parser); +} + |