aboutsummaryrefslogtreecommitdiff
path: root/dbfp.c
diff options
context:
space:
mode:
authorRobin Krahl <me@robin-krahl.de>2016-02-26 01:40:47 +0100
committerRobin Krahl <me@robin-krahl.de>2016-02-26 01:40:47 +0100
commit745c643c2f900c8efeb0ac0a8ea3a519b3a790ac (patch)
tree1cd84b4666b1ba13b5d81699cc940db52c1f6ee8 /dbfp.c
downloaddbfp-745c643c2f900c8efeb0ac0a8ea3a519b3a790ac.tar.gz
dbfp-745c643c2f900c8efeb0ac0a8ea3a519b3a790ac.tar.bz2
initial commit
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);
+}