command.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * command.h
  3. */
  4. #ifndef _clish_command_h
  5. #define _clish_command_h
  6. typedef struct clish_command_s clish_command_t;
  7. #include "lub/argv.h"
  8. #include "clish/types.h"
  9. #include "clish/macros.h"
  10. #include "clish/pargv.h"
  11. #include "clish/view.h"
  12. #include "clish/param.h"
  13. #include "clish/action.h"
  14. #include "clish/config.h"
  15. clish_command_t *clish_command_new(const char *name, const char *help);
  16. clish_command_t *clish_command_new_link(const char *name,
  17. const char *help, const clish_command_t *ref);
  18. clish_command_t * clish_command_alias_to_link(clish_command_t *instance, clish_command_t *ref);
  19. int clish_command_compare(const void *clientnode, const void *clientkey);
  20. clish_command_t *clish_command_choose_longest(clish_command_t *cmd1,
  21. clish_command_t * cmd2);
  22. int clish_command_diff(const clish_command_t *cmd1, const clish_command_t *cmd2);
  23. void clish_command_delete(void *instance);
  24. void clish_command_insert_param(clish_command_t *instance,
  25. clish_param_t *param);
  26. int clish_command_help(const clish_command_t *instance);
  27. void clish_command_dump(const clish_command_t *instance);
  28. _CLISH_GET_STR(command, name);
  29. _CLISH_GET_STR(command, text);
  30. _CLISH_SET_STR_ONCE(command, detail);
  31. _CLISH_GET_STR(command, detail);
  32. _CLISH_GET(command, clish_action_t *, action);
  33. _CLISH_GET(command, clish_config_t *, config);
  34. _CLISH_SET_STR_ONCE(command, regex_chars);
  35. _CLISH_GET_STR(command, regex_chars);
  36. _CLISH_SET_STR_ONCE(command, escape_chars);
  37. _CLISH_GET_STR(command, escape_chars);
  38. _CLISH_SET_STR_ONCE(command, viewname);
  39. _CLISH_GET_STR(command, viewname);
  40. _CLISH_SET_STR_ONCE(command, viewid);
  41. _CLISH_GET_STR(command, viewid);
  42. _CLISH_SET_ONCE(command, clish_param_t *, args);
  43. _CLISH_GET(command, clish_param_t *, args);
  44. _CLISH_GET(command, clish_paramv_t *, paramv);
  45. _CLISH_SET(command, clish_view_t *, pview);
  46. _CLISH_GET(command, clish_view_t *, pview);
  47. _CLISH_SET_STR(command, access);
  48. _CLISH_GET_STR(command, access);
  49. _CLISH_SET_STR(command, alias);
  50. _CLISH_GET_STR(command, alias);
  51. _CLISH_SET_STR(command, alias_view);
  52. _CLISH_GET_STR(command, alias_view);
  53. _CLISH_SET(command, bool_t, internal);
  54. _CLISH_GET(command, bool_t, internal);
  55. _CLISH_SET(command, bool_t, dynamic);
  56. _CLISH_GET(command, bool_t, dynamic);
  57. const char *clish_command__get_suffix(const clish_command_t * instance);
  58. unsigned int clish_command__get_param_count(const clish_command_t * instance);
  59. const clish_param_t *clish_command__get_param(const clish_command_t * instance,
  60. unsigned index);
  61. void clish_command__force_viewname(clish_command_t * instance, const char *viewname);
  62. void clish_command__force_viewid(clish_command_t * instance, const char *viewid);
  63. int clish_command__get_depth(const clish_command_t * instance);
  64. clish_view_restore_e clish_command__get_restore(const clish_command_t * instance);
  65. const clish_command_t * clish_command__get_orig(const clish_command_t * instance);
  66. const clish_command_t * clish_command__get_cmd(const clish_command_t * instance);
  67. // Find functions
  68. int clish_command_fn_find_by_name(const void *key, const void *data);
  69. #endif /* _clish_command_h */