forked from cory/tildefriends
Resuming work to move all DB access off the main thread.
This commit is contained in:
16
src/ssb.db.h
16
src/ssb.db.h
@ -55,6 +55,22 @@ bool tf_ssb_db_blob_has(tf_ssb_t* ssb, const char* id);
|
||||
*/
|
||||
bool tf_ssb_db_blob_get(tf_ssb_t* ssb, const char* id, uint8_t** out_blob, size_t* out_size);
|
||||
|
||||
/**
|
||||
** A function called when a blob is retrieved from the database.
|
||||
** @param id The blob identifier.
|
||||
** @param user_data The user data.
|
||||
*/
|
||||
typedef void(tf_ssb_db_blob_get_callback_t)(bool found, const uint8_t* data, size_t size, void* user_data);
|
||||
|
||||
/**
|
||||
** Retrieve a blob from the database asynchronously.
|
||||
** @param ssb The SSB instance.
|
||||
** @param id The blob identifier.
|
||||
** @param callback Callback called with the result.
|
||||
** @param user_data The user data.
|
||||
*/
|
||||
void tf_ssb_db_blob_get_async(tf_ssb_t* ssb, const char* id, tf_ssb_db_blob_get_callback_t* callback, void* user_data);
|
||||
|
||||
/**
|
||||
** A function called when a message is stored in the database.
|
||||
** @param id The message identifier.
|
||||
|
Reference in New Issue
Block a user