kaction.h 727 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /** @file action.h
  2. *
  3. * @brief Klish scheme's "action" entry
  4. */
  5. #ifndef _klish_kaction_h
  6. #define _klish_kaction_h
  7. typedef struct kaction_s kaction_t;
  8. typedef struct iaction_s {
  9. char *sym;
  10. char *lock;
  11. char *interrupt;
  12. char *interactive;
  13. char *exec_on;
  14. char *update_retcode;
  15. } iaction_t;
  16. typedef enum {
  17. KACTION_ERROR_OK,
  18. KACTION_ERROR_MALLOC,
  19. KACTION_ERROR_LIST
  20. } kaction_error_e;
  21. typedef enum {
  22. KACTION_COND_FAIL,
  23. KACTION_COND_SUCCESS,
  24. KACTION_COND_ALWAYS
  25. } kaction_cond_e;
  26. C_DECL_BEGIN
  27. kaction_t *kaction_new(iaction_t info);
  28. kaction_t *kaction_new_static(iaction_t info);
  29. void kaction_free(kaction_t *action);
  30. const char *kaction_name(const kaction_t *action);
  31. C_DECL_END
  32. #endif // _klish_kaction_h