Lines Matching refs:state_p
83 cli_change_opts (cli_state_t *state_p, /**< state of the command line option processor */ in cli_change_opts() argument
86 state_p->opts = options_p; in cli_change_opts()
98 cli_consume_option (cli_state_t *state_p) /**< state of the command line option processor */ in cli_consume_option() argument
100 if (state_p->error != NULL) in cli_consume_option()
105 if (state_p->argc <= 0) in cli_consume_option()
107 state_p->arg = NULL; in cli_consume_option()
111 const char *arg = state_p->argv[0]; in cli_consume_option()
113 state_p->arg = arg; in cli_consume_option()
124 for (const cli_opt_t *opt = state_p->opts; opt->id != CLI_OPT_DEFAULT; opt++) in cli_consume_option()
128 state_p->argc--; in cli_consume_option()
129 state_p->argv++; in cli_consume_option()
134 state_p->error = "Unknown long option"; in cli_consume_option()
140 for (const cli_opt_t *opt = state_p->opts; opt->id != CLI_OPT_DEFAULT; opt++) in cli_consume_option()
144 state_p->argc--; in cli_consume_option()
145 state_p->argv++; in cli_consume_option()
150 state_p->error = "Unknown option"; in cli_consume_option()
163 cli_consume_string (cli_state_t *state_p) /**< state of the command line option processor */ in cli_consume_string() argument
165 if (state_p->error != NULL) in cli_consume_string()
170 if (state_p->argc <= 0) in cli_consume_string()
172 state_p->error = "Expected string argument"; in cli_consume_string()
173 state_p->arg = NULL; in cli_consume_string()
177 state_p->arg = state_p->argv[0]; in cli_consume_string()
179 state_p->argc--; in cli_consume_string()
180 state_p->argv++; in cli_consume_string()
181 return state_p->arg; in cli_consume_string()
193 cli_consume_int (cli_state_t *state_p) /**< state of the command line option processor */ in cli_consume_int() argument
195 if (state_p->error != NULL) in cli_consume_int()
200 state_p->error = "Expected integer argument"; in cli_consume_int()
202 if (state_p->argc <= 0) in cli_consume_int()
204 state_p->arg = NULL; in cli_consume_int()
208 state_p->arg = state_p->argv[0]; in cli_consume_int()
211 long int value = strtol (state_p->arg, &endptr, 10); in cli_consume_int()
218 state_p->error = NULL; in cli_consume_int()
219 state_p->argc--; in cli_consume_int()
220 state_p->argv++; in cli_consume_int()