Lines Matching full:args
43 static void *parse_service(struct parse_state *state, int nargs, char **args);
44 static void parse_line_service(struct parse_state *state, int nargs, char **args);
46 static void *parse_action(struct parse_state *state, int nargs, char **args);
47 static void parse_line_action(struct parse_state *state, int nargs, char **args);
60 int (*func)(int nargs, char **args);
158 void parse_line_no_op(struct parse_state *state, int nargs, char **args)
163 int nargs, char **args)
165 printf("[ %s %s ]\n", args[0],
166 nargs > 1 ? args[1] : "");
169 state->context = parse_service(state, nargs, args);
176 state->context = parse_action(state, nargs, args);
186 int ret = init_parse_config_file(args[1]);
188 ERROR("could not import file %s\n", args[1]);
197 char *args[INIT_PARSER_MAXARGS];
214 int kw = lookup_keyword(args[0]);
217 parse_new_section(&state, kw, nargs, args);
219 state.parse_line(&state, nargs, args);
226 args[nargs++] = state.text;
399 void queue_builtin_action(int (*func)(int nargs, char **args), char *name)
410 cmd->args[0] = name;
439 static void *parse_service(struct parse_state *state, int nargs, char **args)
446 if (!valid_name(args[1])) {
447 parse_error(state, "invalid service name '%s'\n", args[1]);
451 svc = service_find_by_name(args[1]);
453 parse_error(state, "ignored duplicate definition of service '%s'\n", args[1]);
463 svc->name = args[1];
465 memcpy(svc->args, args + 2, sizeof(char*) * nargs);
466 svc->args[nargs] = 0;
474 static void parse_line_service(struct parse_state *state, int nargs, char **args)
486 kw = lookup_keyword(args[0]);
494 svc->classname = args[1];
508 svc->ioprio_pri = strtoul(args[2], 0, 8);
515 if (!strcmp(args[1], "rt")) {
517 } else if (!strcmp(args[1], "be")) {
519 } else if (!strcmp(args[1], "idle")) {
534 svc->gid = decode_uid(args[1]);
536 svc->supp_gids[n-2] = decode_uid(args[n]);
551 svc->keycodes[i - 1] = atoi(args[i]);
561 args++;
562 kw = lookup_keyword(args[0]);
564 args[0]);
569 parse_error(state, "%s requires %d %s\n", args[0], kw_nargs - 1,
577 memcpy(cmd->args, args, sizeof(char*) * nargs);
594 ei->name = args[1];
595 ei->value = args[2];
606 if (strcmp(args[2],"dgram") && strcmp(args[2],"stream")
607 && strcmp(args[2],"seqpacket")) {
616 si->name = args[1];
617 si->type = args[2];
618 si->perm = strtoul(args[3], 0, 8);
620 si->uid = decode_uid(args[4]);
622 si->gid = decode_uid(args[5]);
631 svc->uid = decode_uid(args[1]);
635 parse_error(state, "invalid option '%s'\n", args[0]);
639 static void *parse_action(struct parse_state *state, int nargs, char **args)
651 act->name = args[1];
658 static void parse_line_action(struct parse_state* state, int nargs, char **args)
662 int (*func)(int nargs, char **args);
669 kw = lookup_keyword(args[0]);
671 parse_error(state, "invalid command '%s'\n", args[0]);
677 parse_error(state, "%s requires %d %s\n", args[0], n - 1,
684 memcpy(cmd->args, args, sizeof(char*) * nargs);