/** * GDBM wrapper functions for Vala bindings. * * These wrapper functions handle the datum struct conversion between * C and Vala types. */ #ifndef GDBM_WRAPPER_H #define GDBM_WRAPPER_H #include #include G_BEGIN_DECLS /** * Wrapper for gdbm_exists that takes a string key. */ int gdbm_exists_wrapper(GDBM_FILE dbf, const char *key); /** * Wrapper for gdbm_fetch that returns a GBytes object. * Returns NULL if key not found. * Caller must unref the result. */ GBytes* gdbm_fetch_wrapper(GDBM_FILE dbf, const char *key); /** * Wrapper for gdbm_store that takes a string key and GBytes content. */ int gdbm_store_wrapper(GDBM_FILE dbf, const char *key, GBytes *content, int flag); /** * Wrapper for gdbm_delete that takes a string key. */ int gdbm_delete_wrapper(GDBM_FILE dbf, const char *key); /** * Wrapper for gdbm_firstkey that returns a string. * Returns NULL if database is empty. * Caller must free the result. */ char* gdbm_firstkey_wrapper(GDBM_FILE dbf); /** * Wrapper for gdbm_nextkey that returns a string. * Returns NULL if no more keys. * Caller must free the result. */ char* gdbm_nextkey_wrapper(GDBM_FILE dbf, const char *prev_key); G_END_DECLS #endif /* GDBM_WRAPPER_H */