47 Error(
LOCATION,
"Too many debug console commands! Please inform a coder to increase DC_MAX_COMMANDS.");
56 Error(
LOCATION,
"Debug Command %s already exists! Please inform a coder immediately.", _name);
65 if (i < dc_commands_size) {
66 for (
int j = dc_commands_size; j >
i; --j) {
67 dc_commands[j] = dc_commands[j - 1];
69 dc_commands[
i] =
this;
79 DCF(debug,
"Runs a command in debug mode.")
94 if (
stricmp(dc_commands[i]->
name, command.c_str()) == 0) {
99 if (i == dc_commands_size) {
100 dc_printf(
"<debug> Command not found: '%s'\n", command.c_str());
104 dc_printf(
"<debug> Executing command: '%s'\n", command.c_str());
106 dc_commands[
i]->
func();
121 if ((command ==
"help") || (command ==
"man"))
124 dc_printf(
"GTVA Command: Sorry pilot. You're on your own.\n");
127 }
else if (command !=
"") {
129 if (
stricmp(dc_commands[i]->
name, command.c_str()) == 0) {
134 if (i == dc_commands_size) {
135 dc_printf(
"Command not found: '%s'\n", command.c_str());
143 dc_printf(
"FreeSpace Open Debug Console\n");
144 dc_printf(
" These commands are defined internally.\n");
145 dc_printf(
" Typing 'help function_name' will give the short help on the function.\n");
146 dc_printf(
" Some functions may have detailed help, try passing \"help\" or \"--help\" to them.");
147 dc_printf(
" F3 selects last command line. Up and Down arrow keys scroll through the command history\n");
DCF(debug,"Runs a command in debug mode.")
void dc_shell_resize(void)
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
debug_command dc_man("man","Also displays the help list", dcf_help)
Class to aggregate a debug command with its name (as shown in the console) and short help...
void(* func)()
Pointer to the function that to run when this command is evoked.
void _cdecl void void _cdecl Error(const char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
GLuint const GLchar * name
void dc_stuff_string_white(char *out_str, size_t maxlen)
Stuffs a whitespace delimited string to out_str from the command line, stopping at the end of the com...
debug_command * dc_commands[DC_MAX_COMMANDS]
An overhauled/updated debug console to allow monitoring, testing, and general debugging of new featur...
bool Dc_debug_on
Flag used to print console and command debugging strings.
void dc_printf(const char *format,...)
Prints the given char string to the debug console.
bool dc_pause_output(void)
Pauses the output of a command and allows user to scroll through the output history.
Parsing functions for the command line. Previously known as the command line scanner.
void dc_shell_resize_buf(void)
bool dc_maybe_stuff_string_white(char *str, size_t len)
Tries to stuff a whitespace delimited string to out_str from the command line, stopping at the end of...