Lines Matching refs:cmd

62 set_cmd_cfunc (struct cmd_list_element *cmd, cmd_cfunc_ftype *cfunc)
65 cmd->func = NULL;
67 cmd->func = do_cfunc;
68 cmd->function.cfunc = cfunc; /* Ok. */
78 set_cmd_sfunc (struct cmd_list_element *cmd, cmd_sfunc_ftype *sfunc)
81 cmd->func = NULL;
83 cmd->func = do_sfunc;
84 cmd->function.sfunc = sfunc; /* Ok. */
88 cmd_cfunc_eq (struct cmd_list_element *cmd,
91 return cmd->func == do_cfunc && cmd->function.cfunc == cfunc;
95 set_cmd_context (struct cmd_list_element *cmd, void *context)
97 cmd->context = context;
101 get_cmd_context (struct cmd_list_element *cmd)
103 return cmd->context;
107 cmd_type (struct cmd_list_element *cmd)
109 return cmd->type;
113 set_cmd_completer (struct cmd_list_element *cmd,
116 cmd->completer = completer; /* Ok. */
202 deprecate_cmd (struct cmd_list_element *cmd, char *replacement)
204 cmd->flags |= (CMD_DEPRECATED | DEPRECATED_WARN_USER);
207 cmd->replacement = replacement;
209 cmd->replacement = NULL;
211 return cmd;
528 c->next->hookee_pre->hook_pre = 0; /* hooked cmd gets away. */
892 which the last word was matched, and will return a pointer to the cmd
1213 struct cmd_list_element *cmd = NULL;
1217 if (!lookup_cmd_composition (*text, &alias, &prefix_cmd, &cmd))
1222 || (cmd->flags & DEPRECATED_WARN_USER) ) )
1228 if (alias && !(cmd->flags & CMD_DEPRECATED))
1236 printf_filtered ("%s", cmd->name);
1238 if (alias && (cmd->flags & CMD_DEPRECATED))
1247 if (alias && !(cmd->flags & CMD_DEPRECATED))
1256 if (cmd->replacement)
1257 printf_filtered ("Use '%s'.\n\n", cmd->replacement);
1266 cmd->flags &= ~DEPRECATED_WARN_USER;
1279 Set *cmd to point to the command LINE indicates.
1281 If any of *alias, *prefix_cmd, or *cmd cannot be determined or do not
1289 struct cmd_list_element **cmd)
1297 *cmd = NULL;
1306 prev_cmd = *cmd;
1344 *cmd = 0;
1346 *cmd = find_cmd (command, len, cur_list, 1, &nfound);
1351 if (!*cmd || nfound == 0)
1358 *cmd = find_cmd (command, len, cur_list, 1, &nfound);
1361 if (*cmd == (struct cmd_list_element *) -1)
1366 if (*cmd == NULL)
1370 if ((*cmd)->cmd_pointer)
1372 /* cmd was actually an alias, we note that an alias was used
1373 (by assigning *alais) and we set *cmd.
1375 *alias = *cmd;
1376 *cmd = (*cmd)->cmd_pointer;
1380 if ((*cmd)->prefixlist)
1381 cur_list = *(*cmd)->prefixlist;
1534 cmd_func_p (struct cmd_list_element *cmd)
1536 return (cmd->func != NULL);
1542 cmd_func (struct cmd_list_element *cmd, char *args, int from_tty)
1544 if (cmd_func_p (cmd))
1545 (*cmd->func) (cmd, args, from_tty);