private.h 829 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. typedef struct clish_ptype_regex_s clish_ptype_regex_t;
  19. struct clish_ptype_regex_s {
  20. bool_t is_compiled;
  21. regex_t re;
  22. };
  23. struct clish_ptype_s {
  24. lub_bintree_node_t bt_node;
  25. char *name;
  26. char *text;
  27. char *pattern;
  28. char *range;
  29. clish_ptype_method_e method;
  30. clish_ptype_preprocess_e preprocess;
  31. unsigned last_name; /* index used for auto-completion */
  32. union {
  33. clish_ptype_regex_t regex;
  34. clish_ptype_integer_t integer;
  35. clish_ptype_select_t select;
  36. } u;
  37. };