summaryrefslogtreecommitdiff
path: root/database.h
blob: c7f751290aa6ef03d90f8642c58fd58b1b5cf268 (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
#ifndef GITROLEX_DATABASE_H
#define GITROLEX_DATABASE_H

#include <stdlib.h>
#include <stdio.h>

/**
 * This file implements a simple key value database using
 * double precision floating point numbers. Strings may need to
 * be supported at some point
 */

struct Database_t {
  char *path;
  int maxSize; // in bytes
};

enum DatabaseError_t {
  OK = 0,
  OUT_OF_SPACE
};

enum DatabaseError_t database_getDouble(struct *Database_t db, const char *path, double *val);
enum DatabaseError_t database_setDouble(struct *Database_t db, const char *path, double *val);


#endif