aboutsummaryrefslogtreecommitdiff
path: root/dbfp.c
diff options
context:
space:
mode:
Diffstat (limited to 'dbfp.c')
-rw-r--r--dbfp.c31
1 files changed, 31 insertions, 0 deletions
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 <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);
+}