1234567891011121314151617181920212223242526272829303132333435 |
- /*
- * ptype.h
- */
- #include "clish/pargv.h"
- #include "lub/argv.h"
- #include <sys/types.h>
- #include <regex.h>
- typedef struct clish_ptype_integer_s clish_ptype_integer_t;
- struct clish_ptype_integer_s {
- int min;
- int max;
- };
- typedef struct clish_ptype_select_s clish_ptype_select_t;
- struct clish_ptype_select_s {
- lub_argv_t *items;
- };
- struct clish_ptype_s {
- char *name;
- char *text;
- char *pattern;
- char *range;
- clish_ptype_method_e method;
- clish_ptype_preprocess_e preprocess;
- unsigned last_name; /* index used for auto-completion */
- union {
- regex_t regexp;
- clish_ptype_integer_t integer;
- clish_ptype_select_t select;
- } u;
- clish_action_t *action;
- };
|