private.h 720 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * ptype.h
  3. */
  4. #include "clish/pargv.h"
  5. #include "lub/bintree.h"
  6. #include "lub/argv.h"
  7. #include <sys/types.h>
  8. #include <regex.h>
  9. typedef struct clish_ptype_integer_s clish_ptype_integer_t;
  10. struct clish_ptype_integer_s {
  11. int min;
  12. int max;
  13. };
  14. typedef struct clish_ptype_select_s clish_ptype_select_t;
  15. struct clish_ptype_select_s {
  16. lub_argv_t *items;
  17. };
  18. struct clish_ptype_s {
  19. lub_bintree_node_t bt_node;
  20. char *name;
  21. char *text;
  22. char *pattern;
  23. char *range;
  24. clish_ptype_method_e method;
  25. clish_ptype_preprocess_e preprocess;
  26. unsigned last_name; /* index used for auto-completion */
  27. union {
  28. regex_t regexp;
  29. clish_ptype_integer_t integer;
  30. clish_ptype_select_t select;
  31. } u;
  32. clish_action_t *action;
  33. };