private.h 666 B

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