12#ifndef __CWIST_NUKE_DB_H__
13#define __CWIST_NUKE_DB_H__
21#define CWIST_NUKE_OK 0
22#define CWIST_NUKE_ERR_GENERIC (-1)
23#define CWIST_NUKE_ERR_LOW_MEMORY (-2)
int cwist_nuke_deserialize(unsigned char *data, sqlite3_int64 data_len)
Load a raw SQLite byte buffer into the in-memory database.
sqlite3 * cwist_nuke_get_db(void)
Get the raw SQLite3 handle for the In-Memory DB.
void cwist_nuke_close(void)
Close databases safely. Performs a final synchronization before closing handles.
int cwist_nuke_sync(void)
Force synchronization from Memory to Disk.
int cwist_nuke_init(const char *disk_path, int sync_interval_ms)
Initialize Nuke DB.
void cwist_nuke_signal_handler(int signum)
Internal signal handler. Typically set up by cwist_nuke_init.
unsigned char * cwist_nuke_serialize(sqlite3_int64 *out_size)
Serialize the in-memory database to a raw byte buffer.
sqlite3 * disk_db
The backup disk database handle.
char * disk_path
Path to the disk database file.
bool is_disk_mode
True if running in low-memory disk fallback mode.
bool load_successful
True if initial load from disk was successful.
bool auto_sync
Whether auto-sync is enabled.
sqlite3 * mem_db
The active in-memory database handle.
int sync_interval_ms
Sync interval in milliseconds.