kaction.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /** @file kaction.h
  2. *
  3. * @brief Klish scheme's "action" entry
  4. */
  5. #ifndef _klish_kaction_h
  6. #define _klish_kaction_h
  7. #include <faux/error.h>
  8. #include <klish/ksym.h>
  9. #include <klish/kplugin.h>
  10. typedef struct kaction_s kaction_t;
  11. typedef enum {
  12. KACTION_COND_NONE,
  13. KACTION_COND_FAIL,
  14. KACTION_COND_SUCCESS,
  15. KACTION_COND_ALWAYS,
  16. KACTION_COND_NEVER,
  17. } kaction_cond_e;
  18. C_DECL_BEGIN
  19. kaction_t *kaction_new(void);
  20. void kaction_free(kaction_t *action);
  21. const char *kaction_sym_ref(const kaction_t *action);
  22. bool_t kaction_set_sym_ref(kaction_t *action, const char *sym_ref);
  23. const char *kaction_lock(const kaction_t *action);
  24. bool_t kaction_set_lock(kaction_t *action, const char *lock);
  25. bool_t kaction_interrupt(const kaction_t *action);
  26. bool_t kaction_set_interrupt(kaction_t *action, bool_t interrupt);
  27. bool_t kaction_interactive(const kaction_t *action);
  28. bool_t kaction_set_interactive(kaction_t *action, bool_t interactive);
  29. kaction_cond_e kaction_exec_on(const kaction_t *action);
  30. bool_t kaction_set_exec_on(kaction_t *action, kaction_cond_e exec_on);
  31. bool_t kaction_meet_exec_conditions(const kaction_t *action, int current_retcode);
  32. bool_t kaction_update_retcode(const kaction_t *action);
  33. bool_t kaction_set_update_retcode(kaction_t *action, bool_t update_retcode);
  34. const char *kaction_script(const kaction_t *action);
  35. bool_t kaction_set_script(kaction_t *action, const char *script);
  36. ksym_t *kaction_sym(const kaction_t *action);
  37. bool_t kaction_set_sym(kaction_t *action, ksym_t *sym);
  38. kplugin_t *kaction_plugin(const kaction_t *action);
  39. bool_t kaction_set_plugin(kaction_t *action, kplugin_t *plugin);
  40. tri_t kaction_permanent(const kaction_t *action);
  41. bool_t kaction_set_permanent(kaction_t *action, tri_t permanent);
  42. bool_t kaction_is_permanent(const kaction_t *action);
  43. tri_t kaction_sync(const kaction_t *action);
  44. bool_t kaction_set_sync(kaction_t *action, tri_t sync);
  45. bool_t kaction_is_sync(const kaction_t *action);
  46. C_DECL_END
  47. #endif // _klish_kaction_h