diff options
Diffstat (limited to 'dbfp.c')
-rw-r--r-- | dbfp.c | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -0,0 +1,31 @@ +/* + * Copyright (C) 2016 Robin Krahl <robin.krahl@ireas.org> + * + * dbfp.c + */ + +#include "dbfp.h" + +#include <errno.h> +#include <stdlib.h> +#include <string.h> + +int dbfp_init(struct dbfp *dbfp, char *key) +{ + if (!dbfp || !key) + return EINVAL; + + dbfp->key = strdup(key); + if (!dbfp->key) + return ENOMEM; + + return 0; +} + +void dbfp_close(struct dbfp *dbfp) +{ + if (!dbfp) + return; + + free(dbfp->key); +} |