Lines Matching defs:state

48 static void *parse_service(struct parse_state *state, int nargs, char **args);
49 static void parse_line_service(struct parse_state *state, int nargs, char **args);
51 static void *parse_action(struct parse_state *state, int nargs, char **args);
52 static void parse_line_action(struct parse_state *state, int nargs, char **args);
169 void parse_line_no_op(struct parse_state *state, int nargs, char **args)
291 void parse_import(struct parse_state *state, int nargs, char **args)
293 struct listnode *import_list = state->priv;
306 state->line, state->filename);
316 void parse_new_section(struct parse_state *state, int kw,
323 state->context = parse_service(state, nargs, args);
324 if (state->context) {
325 state->parse_line = parse_line_service;
330 state->context = parse_action(state, nargs, args);
331 if (state->context) {
332 state->parse_line = parse_line_action;
337 parse_import(state, nargs, args);
340 state->parse_line = parse_line_no_op;
345 struct parse_state state;
352 state.filename = fn;
353 state.line = 0;
354 state.ptr = s;
355 state.nexttoken = 0;
356 state.parse_line = parse_line_no_op;
359 state.priv = &import_list;
362 switch (next_token(&state)) {
364 state.parse_line(&state, 0, 0);
367 state.line++;
371 state.parse_line(&state, 0, 0);
372 parse_new_section(&state, kw, nargs, args);
374 state.parse_line(&state, nargs, args);
381 args[nargs++] = state.text;
606 static void *parse_service(struct parse_state *state, int nargs, char **args)
610 parse_error(state, "services must have a name and a program\n");
614 parse_error(state, "invalid service name '%s'\n", args[1]);
620 parse_error(state, "ignored duplicate definition of service '%s'\n", args[1]);
627 parse_error(state, "out of memory\n");
641 static void parse_line_service(struct parse_state *state, int nargs, char **args)
643 struct service *svc = state->context;
659 parse_error(state, "class option requires a classname\n");
673 parse_error(state, "ioprio optin usage: ioprio <rt|be|idle> <ioprio 0-7>\n");
678 parse_error(state, "priority value must be range 0 - 7\n");
689 parse_error(state, "ioprio option usage: ioprio <rt|be|idle> <0-7>\n");
695 parse_error(state, "group option requires a group id\n");
697 parse_error(state, "group option accepts at most %d supp. groups\n",
710 parse_error(state, "keycodes option requires atleast one keycode\n");
714 parse_error(state, "could not allocate keycodes\n");
731 parse_error(state, "invalid command '%s'\n", args[0]);
736 parse_error(state, "%s requires %d %s\n", args[0], kw_nargs - 1,
753 parse_error(state, "setenv option requires name and value arguments\n");
758 parse_error(state, "out of memory\n");
770 parse_error(state, "socket option requires name, type, perm arguments\n");
775 parse_error(state, "socket type must be 'dgram', 'stream' or 'seqpacket'\n");
780 parse_error(state, "out of memory\n");
796 parse_error(state, "user option requires a user id\n");
804 parse_error(state, "seclabel option requires a label string\n");
812 parse_error(state, "invalid option '%s'\n", args[0]);
816 static void *parse_action(struct parse_state *state, int nargs, char **args)
820 parse_error(state, "actions must have a trigger\n");
824 parse_error(state, "actions may not have extra parameters\n");
835 static void parse_line_action(struct parse_state* state, int nargs, char **args)
838 struct action *act = state->context;
848 parse_error(state, "invalid command '%s'\n", args[0]);
854 parse_error(state, "%s requires %d %s\n", args[0], n - 1,