OpenTTD
console_internal.h
Go to the documentation of this file.
1 /* $Id: console_internal.h 24900 2013-01-08 22:46:42Z planetmaker $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8  */
9 
12 #ifndef CONSOLE_INTERNAL_H
13 #define CONSOLE_INTERNAL_H
14 
15 #include "gfx_type.h"
16 
17 static const uint ICON_CMDLN_SIZE = 1024;
18 static const uint ICON_MAX_STREAMSIZE = 2048;
19 
25 };
26 
35 typedef bool IConsoleCmdProc(byte argc, char *argv[]);
36 typedef ConsoleHookResult IConsoleHook(bool echo);
37 struct IConsoleCmd {
38  char *name;
40 
42  IConsoleHook *hook;
43 };
44 
57 struct IConsoleAlias {
58  char *name;
60 
61  char *cmdline;
62 };
63 
64 /* console parser */
67 
68 /* console functions */
69 void IConsoleClearBuffer();
70 
71 /* Commands */
72 void IConsoleCmdRegister(const char *name, IConsoleCmdProc *proc, IConsoleHook *hook = NULL);
73 void IConsoleAliasRegister(const char *name, const char *cmd);
74 IConsoleCmd *IConsoleCmdGet(const char *name);
75 IConsoleAlias *IConsoleAliasGet(const char *name);
76 
77 /* console std lib (register ingame commands/aliases) */
78 void IConsoleStdLibRegister();
79 
80 /* Supporting functions */
81 bool GetArgumentInteger(uint32 *value, const char *arg);
82 
83 void IConsoleGUIInit();
84 void IConsoleGUIFree();
85 void IConsoleGUIPrint(TextColour colour_code, char *string);
86 char *RemoveUnderscores(char *name);
87 
88 #endif /* CONSOLE_INTERNAL_H */