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