core-legacy/include/database.h
Tobias Reisinger 9d2c48d645 add: macro endpoints
add: basic macro support
fix: database locking with lock-pointer
fix: memory leaks
2020-09-04 00:28:49 +02:00

42 lines
665 B
C

#ifndef CORE_DATABASE_H
#define CORE_DATABASE_H
#include <sqlite3.h>
typedef int database_transaction_lock;
extern sqlite3 *global_database;
void
database_init();
void
database_free();
void
database_migrate();
void
database_transaction_begin(database_transaction_lock *lock);
void
database_transaction_commit(database_transaction_lock *lock);
void
database_transaction_rollback(database_transaction_lock *lock);
int
database_helper_get_id(sqlite3_stmt *stmt);
int*
database_helper_get_ids(sqlite3_stmt *stmt);
char*
database_helper_get_string(sqlite3_stmt *stmt);
char**
database_helper_get_strings(sqlite3_stmt *stmt);
#endif /* CORE_DATABASE_H */