kcommand.h 855 B

123456789101112131415161718192021222324252627282930313233
  1. /** @file kcommand.h
  2. *
  3. * @brief Klish scheme's "command" entry
  4. */
  5. #ifndef _klish_kcommand_h
  6. #define _klish_kcommand_h
  7. #include <klish/kparam.h>
  8. #include <klish/kaction.h>
  9. typedef struct kcommand_s kcommand_t;
  10. C_DECL_BEGIN
  11. kcommand_t *kcommand_new(const char *name);
  12. void kcommand_free(kcommand_t *command);
  13. const char *kcommand_name(const kcommand_t *command);
  14. const char *kcommand_help(const kcommand_t *command);
  15. bool_t kcommand_set_help(kcommand_t *command, const char *help);
  16. bool_t kcommand_add_param(kcommand_t *command, kparam_t *param);
  17. kparam_t *kcommand_find_param(const kcommand_t *command, const char *name);
  18. ssize_t kcommand_params_len(const kcommand_t *command);
  19. bool_t kcommand_add_action(kcommand_t *command, kaction_t *action);
  20. ssize_t kcommand_actions_len(const kcommand_t *command);
  21. C_DECL_END
  22. #endif // _klish_kcommand_h