1
0

command.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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/bintree.h"
  8. #include "lub/argv.h"
  9. #include "clish/types.h"
  10. #include "clish/macros.h"
  11. #include "clish/pargv.h"
  12. #include "clish/view.h"
  13. #include "clish/param.h"
  14. #include "clish/action.h"
  15. #include "clish/config.h"
  16. clish_command_t *clish_command_new(const char *name, const char *help);
  17. clish_command_t *clish_command_new_link(const char *name,
  18. const char *help, const clish_command_t * ref);
  19. clish_command_t * clish_command_alias_to_link(clish_command_t *instance, clish_command_t *ref);
  20. int clish_command_bt_compare(const void *clientnode, const void *clientkey);
  21. void clish_command_bt_getkey(const void *clientnode, lub_bintree_key_t * key);
  22. size_t clish_command_bt_offset(void);
  23. clish_command_t *clish_command_choose_longest(clish_command_t * cmd1,
  24. clish_command_t * cmd2);
  25. int
  26. clish_command_diff(const clish_command_t * cmd1, const clish_command_t * cmd2);
  27. void clish_command_delete(clish_command_t *instance);
  28. void clish_command_insert_param(clish_command_t *instance,
  29. clish_param_t *param);
  30. int clish_command_help(const clish_command_t *instance);
  31. void clish_command_dump(const clish_command_t *instance);
  32. _CLISH_GET_STR(command, name);
  33. _CLISH_GET_STR(command, text);
  34. _CLISH_SET_STR_ONCE(command, detail);
  35. _CLISH_GET_STR(command, detail);
  36. _CLISH_GET(command, clish_action_t *, action);
  37. _CLISH_GET(command, clish_config_t *, config);
  38. _CLISH_SET_STR_ONCE(command, regex_chars);
  39. _CLISH_GET_STR(command, regex_chars);
  40. _CLISH_SET_STR_ONCE(command, escape_chars);
  41. _CLISH_GET_STR(command, escape_chars);
  42. _CLISH_SET_STR_ONCE(command, viewname);
  43. _CLISH_GET_STR(command, viewname);
  44. _CLISH_SET_STR_ONCE(command, viewid);
  45. _CLISH_GET_STR(command, viewid);
  46. _CLISH_SET_ONCE(command, clish_param_t *, args);
  47. _CLISH_GET(command, clish_param_t *, args);
  48. _CLISH_GET(command, clish_paramv_t *, paramv);
  49. _CLISH_SET(command, clish_view_t *, pview);
  50. _CLISH_GET(command, clish_view_t *, pview);
  51. _CLISH_SET_STR(command, access);
  52. _CLISH_GET_STR(command, access);
  53. _CLISH_SET_STR(command, alias);
  54. _CLISH_GET_STR(command, alias);
  55. _CLISH_SET_STR(command, alias_view);
  56. _CLISH_GET_STR(command, alias_view);
  57. _CLISH_SET(command, bool_t, interrupt);
  58. _CLISH_GET(command, bool_t, interrupt);
  59. _CLISH_SET(command, bool_t, internal);
  60. _CLISH_GET(command, bool_t, internal);
  61. _CLISH_SET(command, bool_t, dynamic);
  62. _CLISH_GET(command, bool_t, dynamic);
  63. _CLISH_SET(command, bool_t, lock);
  64. _CLISH_GET(command, bool_t, lock);
  65. const char *clish_command__get_suffix(const clish_command_t * instance);
  66. unsigned int clish_command__get_param_count(const clish_command_t * instance);
  67. const clish_param_t *clish_command__get_param(const clish_command_t * instance,
  68. unsigned index);
  69. void clish_command__force_viewname(clish_command_t * instance, const char *viewname);
  70. void clish_command__force_viewid(clish_command_t * instance, const char *viewid);
  71. int clish_command__get_depth(const clish_command_t * instance);
  72. clish_view_restore_e clish_command__get_restore(const clish_command_t * instance);
  73. const clish_command_t * clish_command__get_orig(const clish_command_t * instance);
  74. const clish_command_t * clish_command__get_cmd(const clish_command_t * instance);
  75. #endif /* _clish_command_h */