kaction.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. typedef struct kaction_s kaction_t;
  10. typedef enum {
  11. KACTION_COND_NONE,
  12. KACTION_COND_FAIL,
  13. KACTION_COND_SUCCESS,
  14. KACTION_COND_ALWAYS
  15. } kaction_cond_e;
  16. C_DECL_BEGIN
  17. kaction_t *kaction_new(void);
  18. void kaction_free(kaction_t *action);
  19. const char *kaction_sym_ref(const kaction_t *action);
  20. bool_t kaction_set_sym_ref(kaction_t *action, const char *sym_ref);
  21. const char *kaction_lock(const kaction_t *action);
  22. bool_t kaction_set_lock(kaction_t *action, const char *lock);
  23. bool_t kaction_interrupt(const kaction_t *action);
  24. bool_t kaction_set_interrupt(kaction_t *action, bool_t interrupt);
  25. bool_t kaction_interactive(const kaction_t *action);
  26. bool_t kaction_set_interactive(kaction_t *action, bool_t interactive);
  27. kaction_cond_e kaction_exec_on(const kaction_t *action);
  28. bool_t kaction_set_exec_on(kaction_t *action, kaction_cond_e exec_on);
  29. bool_t kaction_update_retcode(const kaction_t *action);
  30. bool_t kaction_set_update_retcode(kaction_t *action, bool_t update_retcode);
  31. const char *kaction_script(const kaction_t *action);
  32. bool_t kaction_set_script(kaction_t *action, const char *script);
  33. ksym_t *kaction_sym(const kaction_t *action);
  34. bool_t kaction_set_sym(kaction_t *action, ksym_t *sym);
  35. C_DECL_END
  36. #endif // _klish_kaction_h