# console_func.h File Reference

Console functions used outside of the console code. More...

`#include "console_type.h"`

Go to the source code of this file.

## Functions
void | IConsoleInit ()
void | IConsoleFree ()
void | IConsoleClose ()
void | IConsolePrint (ConsoleColour colour_code, const char *string)
| Handle the printing of text entered into the console or redirected there by any other means.
void CDECL | IConsolePrintF (ConsoleColour colour_code, const char *s,...)
| Handle the printing of text entered into the console or redirected there by any other means.
void | IConsoleDebug (const char *dbg, const char *string)
| It is possible to print debugging information to the console, which is achieved by using this function.
void | IConsoleWarning (const char *string)
| It is possible to print warnings to the console.
void | IConsoleError (const char *string)
| It is possible to print error information to the console.
void | IConsoleCmdExec (const char *cmdstr)
| Execute a given command passed to us.
## Variables
IConsoleModes | _iconsole_mode

## Detailed Description

Console functions used outside of the console code.

Definition in file console_func.h.

## Function Documentation

void IConsoleCmdExec | ( | const char * | cmdstr | ) |

Execute a given command passed to us.

First chop it up into individual tokens (seperated by spaces), then execute it if possible

Parameters:

  | cmdstr | string to be parsed and executed

Definition at line 751 of file console.cpp.

References CS_ALPHANUMERAL, IConsoleVar::hook, ICON_MAX_STREAMSIZE, IConsoleAliasExec(), IConsoleAliasGet(), IConsoleCmdGet(), IConsoleError(), IConsoleHookHandle(), IConsolePrintF(), IConsoleVarExec(), IConsoleVarGet(), IsValidChar(), and lengthof.

Referenced by IConsoleAliasExec().

void IConsoleDebug | ( | const char * | dbg,
|  | const char * | string |
| ) |  |  |

It is possible to print debugging information to the console, which is achieved by using this function.

Can only be used by debug() in debug.cpp. You need at least a level 2 (developer) for debugging messages to show up

Parameters:

  | dbg | debugging category
  | string | debugging message

Definition at line 139 of file console.cpp.

References IConsolePrintF().

void IConsoleError | ( | const char * | string | ) |

It is possible to print error information to the console.

This can include game errors, or errors in general you would want the user to notice

Definition at line 160 of file console.cpp.

References IConsolePrintF().

Referenced by IConsoleAliasExec(), IConsoleCmdExec(), and IConsoleVarExec().

void IConsolePrint | ( | ConsoleColour | colour_code,
|  | const char * | string |
| ) |  |  |

Handle the printing of text entered into the console or redirected there by any other means.

Text can be redirected to other clients in a network game as well as to a logfile. If the network server is a dedicated server, all activities are also logged. All lines to print are added to a temporary buffer which can be used as a history to print them onscreen

Parameters:

  | colour_code | the colour of the command. Red in case of errors, etc.
  | string | the message entered or output on the console (notice, error, etc.)

Definition at line 85 of file console.cpp.

References IConsoleGUIPrint(), str_strip_colours(), and str_validate().

Referenced by IConsolePrintF().

void CDECL IConsolePrintF | ( | ConsoleColour | colour_code,
|  | const char * | s,
|  |  | ... |
| ) |  |  |

Handle the printing of text entered into the console or redirected there by any other means.

Uses printf() style format, for more information look at IConsolePrint()

Definition at line 119 of file console.cpp.

References buf, ICON_MAX_STREAMSIZE, and IConsolePrint().

Referenced by IConsoleAliasExec(), IConsoleCmdExec(), IConsoleDebug(), IConsoleError(), IConsoleGetSetting(), IConsoleListSettings(), IConsoleVarExec(), IConsoleVarPrintGetValue(), IConsoleVarPrintSetValue(), and IConsoleWarning().

void IConsoleWarning | ( | const char * | string | ) |

It is possible to print warnings to the console.

These are mostly errors or mishaps, but non-fatal. You need at least a level 1 (developer) for debugging messages to show up

Definition at line 150 of file console.cpp.

References IConsolePrintF().