blob: 0bba3655aa23bcbca34204323be0a231d8cf1b24 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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);
}
|