2017-10-12 18:11:21 +02:00
|
|
|
#ifndef H_ORDERDB
|
|
|
|
#define H_ORDERDB
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2017-10-14 08:43:01 +02:00
|
|
|
typedef enum {
|
|
|
|
DB_NONE,
|
|
|
|
DB_MEMORY,
|
|
|
|
DB_MMAP,
|
|
|
|
DB_BDB,
|
|
|
|
DB_SQLITE
|
|
|
|
} db_backend;
|
|
|
|
|
2017-10-12 18:11:21 +02:00
|
|
|
typedef struct order_data {
|
|
|
|
const char *_str;
|
|
|
|
int _refcount;
|
|
|
|
} order_data;
|
|
|
|
|
2017-10-14 08:43:01 +02:00
|
|
|
db_backend orderdb_open(db_backend choices[]);
|
2017-10-12 18:11:21 +02:00
|
|
|
void orderdb_close(void);
|
|
|
|
|
|
|
|
order_data *odata_load(int id);
|
|
|
|
int odata_save(order_data *od);
|
|
|
|
void odata_release(order_data * od);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|