kcommand.h 701 B

12345678910111213141516171819202122232425262728293031323334
  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. typedef struct icommand_s {
  11. char *name;
  12. char *help;
  13. iparam_t * (*params)[];
  14. iaction_t * (*actions)[];
  15. } icommand_t;
  16. C_DECL_BEGIN
  17. kcommand_t *kcommand_new(icommand_t info);
  18. kcommand_t *kcommand_new_static(icommand_t info);
  19. void kcommand_free(kcommand_t *command);
  20. const char *kcommand_name(const kcommand_t *command);
  21. const char *kcommand_help(const kcommand_t *command);
  22. bool_t kcommand_add_param(kcommand_t *command, kparam_t *param);
  23. C_DECL_END
  24. #endif // _klish_kcommand_h