command.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. void clish_command_dump(const clish_command_t *instance);
  31. _CLISH_GET_STR(command, name);
  32. _CLISH_GET_STR(command, text);
  33. _CLISH_SET_STR_ONCE(command, detail);
  34. _CLISH_GET_STR(command, detail);
  35. _CLISH_GET(command, clish_action_t *, action);
  36. _CLISH_GET(command, clish_config_t *, config);
  37. _CLISH_SET_STR_ONCE(command, regex_chars);
  38. _CLISH_GET_STR(command, regex_chars);
  39. _CLISH_SET_STR_ONCE(command, escape_chars);
  40. _CLISH_GET_STR(command, escape_chars);
  41. _CLISH_SET_STR_ONCE(command, viewname);
  42. _CLISH_GET_STR(command, viewname);
  43. _CLISH_SET_STR_ONCE(command, viewid);
  44. _CLISH_GET_STR(command, viewid);
  45. _CLISH_SET_ONCE(command, clish_param_t *, args);
  46. _CLISH_GET(command, clish_param_t *, args);
  47. _CLISH_GET(command, clish_paramv_t *, paramv);
  48. _CLISH_SET(command, clish_view_t *, pview);
  49. _CLISH_GET(command, clish_view_t *, pview);
  50. _CLISH_SET_STR(command, access);
  51. _CLISH_GET_STR(command, access);
  52. _CLISH_SET_STR(command, alias);
  53. _CLISH_GET_STR(command, alias);
  54. _CLISH_SET_STR(command, alias_view);
  55. _CLISH_GET_STR(command, alias_view);
  56. _CLISH_SET(command, bool_t, internal);
  57. _CLISH_GET(command, bool_t, internal);
  58. _CLISH_SET(command, bool_t, dynamic);
  59. _CLISH_GET(command, bool_t, dynamic);
  60. const char *clish_command__get_suffix(const clish_command_t * instance);
  61. unsigned int clish_command__get_param_count(const clish_command_t * instance);
  62. const clish_param_t *clish_command__get_param(const clish_command_t * instance,
  63. unsigned index);
  64. void clish_command__force_viewname(clish_command_t * instance, const char *viewname);
  65. void clish_command__force_viewid(clish_command_t * instance, const char *viewid);
  66. int clish_command__get_depth(const clish_command_t * instance);
  67. clish_view_restore_e clish_command__get_restore(const clish_command_t * instance);
  68. const clish_command_t * clish_command__get_orig(const clish_command_t * instance);
  69. const clish_command_t * clish_command__get_cmd(const clish_command_t * instance);
  70. bool_t clish_command_is_incomplete(const clish_command_t *instance);
  71. #endif /* _clish_command_h */