private.h 691 B

123456789101112131415161718192021222324252627282930313233343536
  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. char *name;
  20. char *text;
  21. char *pattern;
  22. char *range;
  23. clish_ptype_method_e method;
  24. clish_ptype_preprocess_e preprocess;
  25. unsigned last_name; /* index used for auto-completion */
  26. union {
  27. regex_t regexp;
  28. clish_ptype_integer_t integer;
  29. clish_ptype_select_t select;
  30. } u;
  31. clish_action_t *action;
  32. };