| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- /**
- * 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 <glib.h>
- #include <gdbm.h>
- 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 */
|