diff options
author | Robin Krahl <me@robin-krahl.de> | 2016-02-26 01:40:47 +0100 |
---|---|---|
committer | Robin Krahl <me@robin-krahl.de> | 2016-02-26 01:40:47 +0100 |
commit | 745c643c2f900c8efeb0ac0a8ea3a519b3a790ac (patch) | |
tree | 1cd84b4666b1ba13b5d81699cc940db52c1f6ee8 /dbfp.c | |
download | dbfp-745c643c2f900c8efeb0ac0a8ea3a519b3a790ac.tar.gz dbfp-745c643c2f900c8efeb0ac0a8ea3a519b3a790ac.tar.bz2 |
initial commit
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); +} |