From 745c643c2f900c8efeb0ac0a8ea3a519b3a790ac Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Fri, 26 Feb 2016 01:40:47 +0100 Subject: initial commit --- dbfp.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 dbfp.c (limited to 'dbfp.c') diff --git a/dbfp.c b/dbfp.c new file mode 100644 index 0000000..0bba365 --- /dev/null +++ b/dbfp.c @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2016 Robin Krahl + * + * dbfp.c + */ + +#include "dbfp.h" + +#include +#include +#include + +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); +} -- cgit v1.2.1