@ -173,20 +173,45 @@ DEF_CONSOLE_CMD(ConScreenShot)
return NULL ;
}
DEF_CONSOLE_CMD ( Con Var Info)
DEF_CONSOLE_CMD ( Con InfoVar )
{
if ( argc < 2 ) return NULL ;
if ( argt [ 1 ] ! = ICONSOLE_VAR_REFERENCE ) {
IConsoleError ( " variable must be an variable reference" ) ;
IConsoleError ( " first argument must be an variable reference" ) ;
} else {
_iconsole_var * item ;
item = ( _iconsole_var * ) argv [ 1 ] ;
IConsolePrintF ( _iconsole_color_default , " variable_name: %s " , item - > name ) ;
IConsolePrintF ( _iconsole_color_default , " variable_type: %i " , item - > type ) ;
IConsolePrintF ( _iconsole_color_default , " variable_addr: %i " , item - > addr ) ;
if ( item - > _malloc ) IConsolePrintF ( _iconsole_color_default , " variable_malloc: internal allocated " ) ; else IConsolePrintF ( _iconsole_color_default , " variable_malloc: external allocated " ) ;
IConsolePrintF ( _iconsole_color_default , " var_name: %s " , item - > name ) ;
IConsolePrintF ( _iconsole_color_default , " var_type: %i " , item - > type ) ;
IConsolePrintF ( _iconsole_color_default , " var_addr: %i " , item - > addr ) ;
if ( item - > _malloc ) IConsolePrintF ( _iconsole_color_default , " var_malloc: internal " ) ; else IConsolePrintF ( _iconsole_color_default , " var_malloc: external " ) ;
if ( item - > hook_access ) IConsoleWarning ( " var_access hooked " ) ;
if ( item - > hook_before_change ) IConsoleWarning ( " var_before_change hooked " ) ;
if ( item - > hook_after_change ) IConsoleWarning ( " var_after_change hooked " ) ;
}
return NULL ;
}
DEF_CONSOLE_CMD ( ConInfoCmd )
{
if ( argc < 2 ) return NULL ;
if ( argt [ 1 ] ! = ICONSOLE_VAR_UNKNOWN ) {
IConsoleError ( " first argument must be an commandname " ) ;
} else {
_iconsole_cmd * item ;
item = IConsoleCmdGet ( argv [ 1 ] ) ;
if ( item = = NULL ) {
IConsoleError ( " the given command was not found " ) ;
return NULL ;
}
IConsolePrintF ( _iconsole_color_default , " cmd_name: %s " , item - > name ) ;
IConsolePrintF ( _iconsole_color_default , " cmd_addr: %i " , item - > addr ) ;
if ( item - > hook_access ) IConsoleWarning ( " cmd_access hooked " ) ;
if ( item - > hook_before_exec ) IConsoleWarning ( " cmd_before_exec hooked " ) ;
if ( item - > hook_after_exec ) IConsoleWarning ( " cmd_after_exec hooked " ) ;
}
return NULL ;
}
DEF_CONSOLE_CMD ( ConDebugLevel )
@ -338,28 +363,29 @@ void IConsoleStdLibRegister()
( void ) ConResetTile ; // Silence warning, this is only used in _DEBUG
# endif
// functions [please add them alphabeticaly]
// functions [please add them alphabeticaly]
# ifdef ENABLE_NETWORK
IConsoleCmdRegister ( " connect " , ConNetworkConnect ) ;
IConsoleCmdHook ( " connect " , ICONSOLE_HOOK_ACCESS , ConCmdHookNoNetwork ) ;
# endif
# endif
IConsoleCmdRegister ( " debug_level " , ConDebugLevel ) ;
IConsoleCmdRegister ( " dump_vars " , ConListDumpVariables ) ;
IConsoleCmdRegister ( " echo " , ConEcho ) ;
IConsoleCmdRegister ( " echoc " , ConEchoC ) ;
IConsoleCmdRegister ( " exit " , ConExit ) ;
IConsoleCmdRegister ( " help " , ConHelp ) ;
IConsoleCmdRegister ( " help " , ConHelp ) ;
IConsoleCmdRegister ( " info_cmd " , ConInfoCmd ) ;
IConsoleCmdRegister ( " info_var " , ConInfoVar ) ;
IConsoleCmdRegister ( " list_cmds " , ConListCommands ) ;
IConsoleCmdRegister ( " list_vars " , ConListVariables ) ;
IConsoleCmdRegister ( " printf " , ConPrintF ) ;
IConsoleCmdRegister ( " printfc " , ConPrintFC ) ;
IConsoleCmdRegister ( " quit " , ConExit ) ;
IConsoleCmdRegister ( " random " , ConRandom ) ;
IConsoleCmdRegister ( " list_cmds " , ConListCommands ) ;
IConsoleCmdRegister ( " list_vars " , ConListVariables ) ;
IConsoleCmdRegister ( " resetengines " , ConResetEngines ) ;
IConsoleCmdHook ( " resetengines " , ICONSOLE_HOOK_ACCESS , ConCmdHookNoNetwork ) ;
IConsoleCmdRegister ( " screenshot " , ConScreenShot ) ;
IConsoleCmdRegister ( " scrollto " , ConScrollToTile ) ;
IConsoleCmdRegister ( " varinfo " , ConVarInfo ) ;
// variables [please add them alphabeticaly]
IConsoleVarRegister ( " con_developer " , ( void * ) & _stdlib_con_developer , ICONSOLE_VAR_BOOLEAN ) ;