kdb.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /** @file kdb.h
  2. *
  3. * @brief Klish db
  4. */
  5. #ifndef _klish_kdb_h
  6. #define _klish_kdb_h
  7. #include <stdint.h>
  8. // Current API version
  9. #define KDB_MAJOR 1
  10. #define KDB_MINOR 0
  11. // Shared object filename template. Insert db ID or db "name" field
  12. // instead "%s". Consider db ID as an "internal native name". The "name"
  13. // field can differ from ID and it's just used within scheme to refer db.
  14. // Consider it as alias of ID.
  15. #define KDB_SONAME_FMT "libkdb_%s.so"
  16. // db's API version symbols
  17. #define KDB_MAJOR_FMT "kdb_%s_major"
  18. #define KDB_MINOR_FMT "kdb_%s_minor"
  19. // db's init and fini functions
  20. #define KDB_INIT_FMT "kdb_%s_init"
  21. #define KDB_FINI_FMT "kdb_%s_fini"
  22. // db's load and deploy functions
  23. #define KDB_INIT_FMT "kdb_%s_load_scheme"
  24. #define KDB_FINI_FMT "kdb_%s_deploy_scheme"
  25. typedef struct kdb_s kdb_t;
  26. C_DECL_BEGIN
  27. kdb_t *kdb_new(const char *name, const char *sofile);
  28. void kdb_free(kdb_t *db);
  29. const char *kdb_name(const kdb_t *db);
  30. const char *kdb_sofile(const kdb_t *db);
  31. const char *kdb_options(const kdb_t *db);
  32. bool_t kdb_set_options(kdb_t *db, const char *options);
  33. C_DECL_END
  34. #endif // _klish_kdb_h