kscheme.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /** @file kscheme.h
  2. *
  3. * @brief Klish Scheme
  4. */
  5. #ifndef _klish_kscheme_h
  6. #define _klish_kscheme_h
  7. #include <faux/list.h>
  8. #include <klish/kplugin.h>
  9. #include <klish/kentry.h>
  10. #include <klish/kcontext_base.h>
  11. typedef struct kscheme_s kscheme_t;
  12. typedef faux_list_node_t kscheme_plugins_node_t;
  13. typedef faux_list_node_t kscheme_entrys_node_t;
  14. C_DECL_BEGIN
  15. kscheme_t *kscheme_new(void);
  16. void kscheme_free(kscheme_t *scheme);
  17. bool_t kscheme_prepare(kscheme_t *scheme, kcontext_t *context, faux_error_t *error);
  18. bool_t kscheme_fini(kscheme_t *scheme, kcontext_t *context, faux_error_t *error);
  19. // PLUGINs
  20. faux_list_t *kscheme_plugins(const kscheme_t *scheme);
  21. bool_t kscheme_add_plugins(kscheme_t *scheme, kplugin_t *plugin);
  22. kplugin_t *kscheme_find_plugin(const kscheme_t *scheme, const char *name);
  23. ssize_t kscheme_plugins_len(const kscheme_t *scheme);
  24. kscheme_plugins_node_t *kscheme_plugins_iter(const kscheme_t *scheme);
  25. kplugin_t *kscheme_plugins_each(kscheme_plugins_node_t **iter);
  26. // ENTRYs
  27. kentry_t *kscheme_find_entry_by_path(const kscheme_t *scheme, const char *name);
  28. faux_list_t *kscheme_entrys(const kscheme_t *scheme);
  29. bool_t kscheme_add_entrys(kscheme_t *scheme, kentry_t *entry);
  30. kentry_t *kscheme_find_entry(const kscheme_t *scheme, const char *name);
  31. ssize_t kscheme_entrys_len(const kscheme_t *scheme);
  32. kscheme_entrys_node_t *kscheme_entrys_iter(const kscheme_t *scheme);
  33. kentry_t *kscheme_entrys_each(kscheme_entrys_node_t **iter);
  34. C_DECL_END
  35. #endif // _klish_kscheme_h