kscheme.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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/kptype.h>
  10. #include <klish/kview.h>
  11. #include <klish/kcontext_base.h>
  12. typedef struct kscheme_s kscheme_t;
  13. typedef faux_list_node_t kscheme_views_node_t;
  14. typedef faux_list_node_t kscheme_ptypes_node_t;
  15. typedef faux_list_node_t kscheme_plugins_node_t;
  16. C_DECL_BEGIN
  17. kscheme_t *kscheme_new(void);
  18. void kscheme_free(kscheme_t *scheme);
  19. // VIEWs
  20. faux_list_t *kscheme_views(const kscheme_t *scheme);
  21. bool_t kscheme_add_view(kscheme_t *scheme, kview_t *view);
  22. kview_t *kscheme_find_view(const kscheme_t *scheme, const char *name);
  23. ssize_t kscheme_views_len(const kscheme_t *scheme);
  24. kscheme_views_node_t *kscheme_views_iter(const kscheme_t *scheme);
  25. kview_t *kscheme_views_each(kscheme_views_node_t **iter);
  26. // PTYPEs
  27. faux_list_t *kscheme_ptypes(const kscheme_t *scheme);
  28. bool_t kscheme_add_ptype(kscheme_t *scheme, kptype_t *ptype);
  29. kptype_t *kscheme_find_ptype(const kscheme_t *scheme, const char *name);
  30. ssize_t kscheme_ptypes_len(const kscheme_t *scheme);
  31. kscheme_ptypes_node_t *kscheme_ptypes_iter(const kscheme_t *scheme);
  32. kptype_t *kscheme_ptypes_each(kscheme_ptypes_node_t **iter);
  33. // PLUGINs
  34. faux_list_t *kscheme_plugins(const kscheme_t *scheme);
  35. bool_t kscheme_add_plugin(kscheme_t *scheme, kplugin_t *plugin);
  36. kplugin_t *kscheme_find_plugin(const kscheme_t *scheme, const char *name);
  37. ssize_t kscheme_plugins_len(const kscheme_t *scheme);
  38. kscheme_plugins_node_t *kscheme_plugins_iter(const kscheme_t *scheme);
  39. kplugin_t *kscheme_plugins_each(kscheme_plugins_node_t **iter);
  40. bool_t kscheme_prepare(kscheme_t *scheme, kcontext_t *context, faux_error_t *error);
  41. bool_t kscheme_fini(kscheme_t *scheme, kcontext_t *context, faux_error_t *error);
  42. C_DECL_END
  43. #endif // _klish_kscheme_h