Lines Matching defs:nargs
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);
60 #define KEYWORD(symbol, flags, nargs, func) \
61 [ K_##symbol ] = { #symbol, func, nargs + 1, flags, },
65 int (*func)(int nargs, char **args);
66 unsigned char nargs;
77 #define kw_nargs(kw) (keyword_info[kw].nargs)
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)
298 if (nargs != 2) {
317 int nargs, char **args)
320 nargs > 1 ? args[1] : "");
323 state->context = parse_service(state, nargs, args);
330 state->context = parse_action(state, nargs, args);
337 parse_import(state, nargs, args);
349 int nargs;
351 nargs = 0;
368 if (nargs) {
372 parse_new_section(&state, kw, nargs, args);
374 state.parse_line(&state, nargs, args);
376 nargs = 0;
380 if (nargs < INIT_PARSER_MAXARGS) {
381 args[nargs++] = state.text;
566 void queue_builtin_action(int (*func)(int nargs, char **args), char *name)
610 static void *parse_service(struct parse_state *state, int nargs, char **args)
613 if (nargs < 3) {
628 nargs -= 2;
629 svc = calloc(1, sizeof(*svc) + sizeof(char*) * nargs);
636 memcpy(svc->args, args + 2, sizeof(char*) * nargs);
637 svc->args[nargs] = 0;
638 svc->nargs = nargs;
645 static void parse_line_service(struct parse_state *state, int nargs, char **args)
651 if (nargs == 0) {
662 if (nargs != 2) {
676 if (nargs != 3) {
698 if (nargs < 2) {
700 } else if (nargs > NR_SVC_SUPP_GIDS + 2) {
706 for (n = 2; n < nargs; n++) {
713 if (nargs < 2) {
716 svc->keycodes = malloc((nargs - 1) * sizeof(svc->keycodes[0]));
720 svc->nkeycodes = nargs - 1;
721 for (i = 1; i < nargs; i++) {
731 nargs--;
739 if (nargs < kw_nargs) {
745 cmd = malloc(sizeof(*cmd) + sizeof(char*) * nargs);
747 cmd->nargs = nargs;
748 memcpy(cmd->args, args, sizeof(char*) * nargs);
756 if (nargs < 2) {
773 if (nargs < 4) {
790 if (nargs > 4)
792 if (nargs > 5)
799 if (nargs != 2) {
806 if (nargs != 2) {
818 static void *parse_action(struct parse_state *state, int nargs, char **args)
821 if (nargs < 2) {
825 if (nargs > 2) {
838 static void parse_line_action(struct parse_state* state, int nargs, char **args)
842 int (*func)(int nargs, char **args);
845 if (nargs == 0) {
856 if (nargs < n) {
861 cmd = malloc(sizeof(*cmd) + sizeof(char*) * nargs);
863 cmd->nargs = nargs;
864 memcpy(cmd->args, args, sizeof(char*) * nargs);