summaryrefslogtreecommitdiff
path: root/src/console_internal.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2010-02-10 17:32:39 +0000
committersmatz <smatz@openttd.org>2010-02-10 17:32:39 +0000
commit023fc16894b191b4841da5f01480907653089301 (patch)
tree6098f6ce044589c0473593b0a01882ff956d3603 /src/console_internal.h
parentd8a0278cf2d78efeb96846568e0cddaa46c60cf2 (diff)
downloadopenttd-023fc16894b191b4841da5f01480907653089301.tar.xz
(svn r19083) -Cleanup: remove support for modifying variables from console
Diffstat (limited to 'src/console_internal.h')
-rw-r--r--src/console_internal.h56
1 files changed, 8 insertions, 48 deletions
diff --git a/src/console_internal.h b/src/console_internal.h
index d4b3748a0..0be93bf19 100644
--- a/src/console_internal.h
+++ b/src/console_internal.h
@@ -19,16 +19,6 @@ enum {
ICON_MAX_STREAMSIZE = 2048, ///< maximum length of a totally expanded command
};
-enum IConsoleVarTypes {
- ICONSOLE_VAR_BOOLEAN,
- ICONSOLE_VAR_BYTE,
- ICONSOLE_VAR_UINT16,
- ICONSOLE_VAR_UINT32,
- ICONSOLE_VAR_INT16,
- ICONSOLE_VAR_INT32,
- ICONSOLE_VAR_STRING
-};
-
enum IConsoleHookTypes {
ICONSOLE_HOOK_ACCESS,
ICONSOLE_HOOK_PRE_ACTION,
@@ -36,15 +26,15 @@ enum IConsoleHookTypes {
};
/** --Hooks--
- * Hooks are certain triggers get get accessed/executed on either
- * access, before execution/change or after execution/change. This allows
+ * Hooks are certain triggers that are executed on either
+ * access, before execution or after execution. This allows
* for general flow of permissions or special action needed in some cases
*/
typedef bool IConsoleHook();
struct IConsoleHooks{
- IConsoleHook *access; ///< trigger when accessing the variable/command
- IConsoleHook *pre; ///< trigger before the variable/command is changed/executed
- IConsoleHook *post; ///< trigger after the variable/command is changed/executed
+ IConsoleHook *access; ///< trigger when accessing the command
+ IConsoleHook *pre; ///< trigger before the command is executed
+ IConsoleHook *post; ///< trigger after the command is executed
};
/** --Commands--
@@ -64,31 +54,10 @@ struct IConsoleCmd {
IConsoleHooks hook; ///< any special trigger action that needs executing
};
-/** --Variables--
- * Variables are pointers to real ingame variables which allow for
- * changing while ingame. After changing they keep their new value
- * and can be used for debugging, gameplay, etc. It accepts:
- * - no arguments; just print out current value
- * - '= <new value>' to assign a new value to the variable
- * - '++' to increase value by one
- * - '--' to decrease value by one
- */
-struct IConsoleVar {
- char *name; ///< name of the variable
- IConsoleVar *next; ///< next variable in list
-
- void *addr; ///< the address where the variable is pointing at
- uint32 size; ///< size of the variable, used for strings
- char *help; ///< the optional help string shown when requesting information
- IConsoleVarTypes type; ///< type of variable (for correct assignment/output)
- IConsoleCmdProc *proc; ///< some variables need really special handling, use a callback function for that
- IConsoleHooks hook; ///< any special trigger action that needs executing
-};
-
/** --Aliases--
* Aliases are like shortcuts for complex functions, variable assignments,
- * etc. You can use a simple alias to rename a longer command (eg 'lv' for
- * 'list_vars' for example), or concatenate more commands into one
+ * etc. You can use a simple alias to rename a longer command (eg 'set' for
+ * 'setting' for example), or concatenate more commands into one
* (eg. 'ng' for 'load %A; unpause; debug_level 5'). Aliases can parse the arguments
* given to them in the command line.
* - "%A - %Z" substitute arguments 1 t/m 26
@@ -105,7 +74,6 @@ struct IConsoleAlias {
/* console parser */
extern IConsoleCmd *_iconsole_cmds; ///< list of registred commands
-extern IConsoleVar *_iconsole_vars; ///< list of registred vars
extern IConsoleAlias *_iconsole_aliases; ///< list of registred aliases
/* console functions */
@@ -117,19 +85,11 @@ void IConsoleAliasRegister(const char *name, const char *cmd);
IConsoleCmd *IConsoleCmdGet(const char *name);
IConsoleAlias *IConsoleAliasGet(const char *name);
-/* Variables */
-void IConsoleVarRegister(const char *name, void *addr, IConsoleVarTypes type, const char *help);
-void IConsoleVarStringRegister(const char *name, void *addr, uint32 size, const char *help);
-IConsoleVar *IConsoleVarGet(const char *name);
-void IConsoleVarPrintGetValue(const IConsoleVar *var);
-
-/* console std lib (register ingame commands/aliases/variables) */
+/* console std lib (register ingame commands/aliases) */
void IConsoleStdLibRegister();
/* Hooking code */
void IConsoleCmdHookAdd(const char *name, IConsoleHookTypes type, IConsoleHook *proc);
-void IConsoleVarHookAdd(const char *name, IConsoleHookTypes type, IConsoleHook *proc);
-void IConsoleVarProcAdd(const char *name, IConsoleCmdProc *proc);
/* Supporting functions */
bool GetArgumentInteger(uint32 *value, const char *arg);