faluco@1541: /**
faluco@1541: * vim: set ts=4 :
faluco@1541: * =============================================================================
faluco@1541: * SourceMod
ds@1947: * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
faluco@1541: * =============================================================================
faluco@1541: *
faluco@1541: * This program is free software; you can redistribute it and/or modify it under
faluco@1541: * the terms of the GNU General Public License, version 3.0, as published by the
faluco@1541: * Free Software Foundation.
faluco@1541: *
faluco@1541: * This program is distributed in the hope that it will be useful, but WITHOUT
faluco@1541: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
faluco@1541: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
faluco@1541: * details.
faluco@1541: *
faluco@1541: * You should have received a copy of the GNU General Public License along with
faluco@1541: * this program. If not, see .
faluco@1541: *
faluco@1541: * As a special exception, AlliedModders LLC gives you permission to link the
faluco@1541: * code of this program (as well as its derivative works) to "Half-Life 2," the
faluco@1541: * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
faluco@1541: * by the Valve Corporation. You must obey the GNU General Public License in
faluco@1541: * all respects for all other code used. Additionally, AlliedModders LLC grants
faluco@1541: * this exception to all derivative works. AlliedModders LLC defines further
faluco@1541: * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
faluco@1541: * or .
faluco@1541: *
faluco@1541: * Version: $Id$
faluco@1541: */
faluco@1541:
faluco@1541: #ifndef _INCLUDE_SOURCEMOD_COMPAT_WRAPPERS_H_
faluco@1541: #define _INCLUDE_SOURCEMOD_COMPAT_WRAPPERS_H_
faluco@1541:
faluco@1541: #if defined ORANGEBOX_BUILD
faluco@1541: #define CONVAR_REGISTER(object) ConVar_Register(0, object)
faluco@1541:
faluco@1541: inline bool IsFlagSet(ConCommandBase *cmd, int flag)
faluco@1541: {
faluco@1541: return cmd->IsFlagSet(flag);
faluco@1541: }
faluco@1541: inline void InsertServerCommand(const char *buf)
faluco@1541: {
dvander@1731: engine->InsertServerCommand(buf);
faluco@1541: }
faluco@1541: #else
faluco@1541: class CCommand
faluco@1541: {
faluco@1541: public:
faluco@1541: inline const char *ArgS() const
faluco@1541: {
faluco@1541: return engine->Cmd_Args();
faluco@1541: }
faluco@1541: inline int ArgC() const
faluco@1541: {
faluco@1541: return engine->Cmd_Argc();
faluco@1541: }
faluco@1541: inline const char *Arg(int index) const
faluco@1541: {
faluco@1541: return engine->Cmd_Argv(index);
faluco@1541: }
faluco@1541: };
faluco@1541:
faluco@1541: inline bool IsFlagSet(ConCommandBase *cmd, int flag)
faluco@1541: {
faluco@1541: return cmd->IsBitSet(flag);
faluco@1541: }
faluco@1541: inline void InsertServerCommand(const char *buf)
faluco@1541: {
faluco@1541: engine->InsertServerCommand(buf);
faluco@1541: }
faluco@1541:
dvander@1545: #define CVAR_INTERFACE_VERSION VENGINE_CVAR_INTERFACE_VERSION
dvander@1545:
faluco@1541: #define CONVAR_REGISTER(object) ConCommandBaseMgr::OneTimeInit(object)
faluco@1541: typedef FnChangeCallback FnChangeCallback_t;
faluco@1541: #endif //ORANGEBOX_BUILD
faluco@1541:
faluco@1541: #endif //_INCLUDE_SOURCEMOD_COMPAT_WRAPPERS_H_