summaryrefslogtreecommitdiff
path: root/src/data_store.c
blob: eb8cb861edde4776c2aa382e76d56ffa12019e0b (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
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "data_store.h"

static data_store_t *d = NULL;

// returns global data store
data_store_t* data_store(void)
{
	if(!d)
	{
		d = malloc(sizeof(data_store_t));
		memset(d, 0, sizeof(data_store_t));
	}

	return d;
}

void destroy_data_store(void)
{
	free(d);
	d = NULL;
}