Lines Matching refs:arg

39 parse_auto_binary_operation (const char *arg)
41 if (arg != NULL && *arg != '\0')
43 int length = strlen (arg);
44 while (isspace (arg[length - 1]) && length > 0)
46 if (strncmp (arg, "on", length) == 0
47 || strncmp (arg, "1", length) == 0
48 || strncmp (arg, "yes", length) == 0
49 || strncmp (arg, "enable", length) == 0)
51 else if (strncmp (arg, "off", length) == 0
52 || strncmp (arg, "0", length) == 0
53 || strncmp (arg, "no", length) == 0
54 || strncmp (arg, "disable", length) == 0)
56 else if (strncmp (arg, "auto", length) == 0
57 || (strncmp (arg, "-1", length) == 0 && length > 1))
65 parse_binary_operation (char *arg)
69 if (!arg || !*arg)
72 length = strlen (arg);
74 while (arg[length - 1] == ' ' || arg[length - 1] == '\t')
77 if (strncmp (arg, "on", length) == 0
78 || strncmp (arg, "1", length) == 0
79 || strncmp (arg, "yes", length) == 0
80 || strncmp (arg, "enable", length) == 0)
82 else if (strncmp (arg, "off", length) == 0
83 || strncmp (arg, "0", length) == 0
84 || strncmp (arg, "no", length) == 0
85 || strncmp (arg, "disable", length) == 0)
101 do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
114 if (arg == NULL)
115 arg = "";
116 new = (char *) xmalloc (strlen (arg) + 2);
117 p = arg;
153 if (arg == NULL)
154 arg = "";
157 *(char **) c->var = savestring (arg, strlen (arg));
160 if (arg == NULL)
164 *(char **) c->var = tilde_expand (arg);
167 *(int *) c->var = parse_binary_operation (arg);
170 *(enum auto_boolean *) c->var = parse_auto_binary_operation (arg);
173 if (arg == NULL)
175 *(unsigned int *) c->var = parse_and_eval_long (arg);
182 if (arg == NULL)
184 val = parse_and_eval_long (arg);
194 if (arg == NULL)
196 *(int *) c->var = parse_and_eval_long (arg);
207 if (arg == NULL)
221 p = strchr (arg, ' ');
224 len = p - arg;
226 len = strlen (arg);
230 if (strncmp (arg, c->enums[i], len) == 0)
246 error ("Undefined item: \"%s\".", arg);
249 error ("Ambiguous item \"%s\".", arg);