Lets give this function a more descriptive name. I've also improved
the comments in the header and source files.
There should be no user visible changes after this commit.
if (cmd_name[0] == '-')
cmd_name++;
- cmd = mi_lookup (cmd_name);
+ cmd = mi_cmd_lookup (cmd_name);
ui_out_emit_tuple tuple_emitter (uiout, "command");
uiout->field_string ("exists", cmd != NULL ? "true" : "false");
MI_TABLE_SIZE = 227
};
-/* Exported function used to obtain info from the table. */
+/* See mi-cmds.h. */
+
struct mi_cmd *
-mi_lookup (const char *command)
+mi_cmd_lookup (const char *command)
{
return *lookup_table (command);
}
int *suppress_notification;
};
-/* Lookup a command in the MI command table. */
+/* Lookup a command in the MI command table, returns nullptr if COMMAND is
+ not found. */
-extern struct mi_cmd *mi_lookup (const char *command);
+extern struct mi_cmd *mi_cmd_lookup (const char *command);
/* Debug flag */
extern int mi_debug_p;
}
/* Find the command in the MI table. */
- parse->cmd = mi_lookup (parse->command);
+ parse->cmd = mi_cmd_lookup (parse->command);
if (parse->cmd == NULL)
throw_error (UNDEFINED_COMMAND_ERROR,
_("Undefined MI command: %s"), parse->command);