libxml2_plugin.c 693 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include <stdlib.h>
  2. #include <errno.h>
  3. #include <string.h>
  4. #include <assert.h>
  5. #include <faux/faux.h>
  6. #include <faux/str.h>
  7. #include <faux/error.h>
  8. #include <klish/kxml.h>
  9. #include <klish/kscheme.h>
  10. #include <klish/kdb.h>
  11. uint8_t kdb_libxml2_major = KDB_MAJOR;
  12. uint8_t kdb_libxml2_minor = KDB_MINOR;
  13. bool_t kdb_libxml2_load_scheme(kdb_t *db, kscheme_t *scheme)
  14. {
  15. faux_ini_t *ini = NULL;
  16. faux_error_t *error = NULL;
  17. const char *xml_path = NULL;
  18. assert(db);
  19. if (!db)
  20. return BOOL_FALSE;
  21. // Get configuration info from kdb object
  22. ini = kdb_ini(db);
  23. if (ini)
  24. xml_path = faux_ini_find(ini, "XMLPath");
  25. error = kdb_error(db);
  26. return kxml_load_scheme(scheme, xml_path, error);
  27. }