Ugh, fixed Linux build for real by removing stray underscores.
3 * =============================================================================
4 * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
5 * =============================================================================
7 * This file is part of the SourceMod/SourcePawn SDK.
9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License, version 3.0, as published by the
11 * Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * You should have received a copy of the GNU General Public License along with
19 * this program. If not, see <http://www.gnu.org/licenses/>.
21 * As a special exception, AlliedModders LLC gives you permission to link the
22 * code of this program (as well as its derivative works) to "Half-Life 2," the
23 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 * by the Valve Corporation. You must obey the GNU General Public License in
25 * all respects for all other code used. Additionally, AlliedModders LLC grants
26 * this exception to all derivative works. AlliedModders LLC defines further
27 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 * or <http://www.sourcemod.net/license.php>.
33 #if defined _sdktools_included
36 #define _sdktools_included
39 #include <sdktools_engine>
40 #include <sdktools_functions>
41 #if !defined SDKTOOLS_DISABLE_SOUNDAPI
42 #include <sdktools_sound>
44 #include <sdktools_stringtables>
45 #include <sdktools_trace>
46 #include <sdktools_tempents>
47 #include <sdktools_tempents_stocks>
48 #include <sdktools_voice>
49 #include <sdktools_entinput>
50 #include <sdktools_entoutput>
54 SDKCall_Static, /**< Static call */
55 SDKCall_Entity, /**< CBaseEntity call */
56 SDKCall_Player, /**< CBasePlayer call */
57 SDKCall_GameRules, /**< CGameRules call */
58 SDKCall_EntityList, /**< CGlobalEntityList call */
63 SDKLibrary_Server, /**< server.dll/server_i486.so */
64 SDKLibrary_Engine, /**< engine.dll/engine_*.so */
67 enum SDKFuncConfSource
69 SDKConf_Virtual = 0, /**< Read a virtual index from the Offsets section */
70 SDKConf_Signature = 1, /**< Read a signature from the Signatures section */
75 SDKType_CBaseEntity, /**< CBaseEntity (always as pointer) */
76 SDKType_CBasePlayer, /**< CBasePlayer (always as pointer) */
77 SDKType_Vector, /**< Vector (pointer, byval, or byref) */
78 SDKType_QAngle, /**< QAngles (pointer, byval, or byref) */
79 SDKType_PlainOldData, /**< Integer/generic data <=32bit (any) */
80 SDKType_Float, /**< Float (any) */
81 SDKType_Edict, /**< edict_t (always as pointer) */
82 SDKType_String, /**< NULL-terminated string (always as pointer) */
83 SDKType_Bool, /**< Boolean (any) */
88 SDKPass_Pointer, /**< Pass as a pointer */
89 SDKPass_Plain, /**< Pass as plain data */
90 SDKPass_ByValue, /**< Pass an object by value */
91 SDKPass_ByRef, /**< Pass an object by reference */
94 #define VDECODE_FLAG_ALLOWNULL (1<<0) /**< Allow NULL for pointers */
95 #define VDECODE_FLAG_ALLOWNOTINGAME (1<<1) /**< Allow players not in game */
96 #define VDECODE_FLAG_ALLOWWORLD (1<<2) /**< Allow World entity */
97 #define VDECODE_FLAG_BYREF (1<<3) /**< Floats/ints by reference */
99 #define VENCODE_FLAG_COPYBACK (1<<0) /**< Copy back data once done */
102 * Starts the preparation of an SDK call.
104 * @param type Type of function call this will be.
107 native StartPrepSDKCall(SDKCallType:type);
110 * Sets the virtual index of the SDK call if it is virtual.
112 * @param vtblidx Virtual table index.
115 native PrepSDKCall_SetVirtual(vtblidx);
118 * Finds an address in a library and sets it as the address to use for the SDK call.
120 * @param lib Library to use.
121 * @param signature Binary data to search for in the library. If it starts with '@',
122 * the bytes parameter is ignored and the signature is interpreted
123 * as a symbol lookup in the library.
124 * @param bytes Number of bytes in the binary search string.
125 * @return True on success, false if nothing was found.
127 native bool:PrepSDKCall_SetSignature(SDKLibrary:lib, const String:signature[], bytes);
130 * Finds an address or virtual function index in a GameConfig file and sets it as
131 * the calling information for the SDK call.
133 * @param gameconf GameConfig Handle, or INVALID_HANDLE to use sdktools.games.txt.
134 * @param source Whether to look in Offsets or Signatures.
135 * @param name Name of the property to find.
136 * @return True on success, false if nothing was found.
138 native bool:PrepSDKCall_SetFromConf(Handle:gameconf, SDKFuncConfSource:source, const String:name[]);
141 * Sets the return information of an SDK call. Do not call this if there is no return data.
142 * This must be called if there is a return value (i.e. it is not necessarily safe to ignore
145 * @param type Data type to convert to/from.
146 * @param pass How the data is passed in C++.
147 * @param decflags Flags on decoding from the plugin to C++.
148 * @param encflags Flags on encoding from C++ to the plugin.
151 native PrepSDKCall_SetReturnInfo(SDKType:type, SDKPassMethod:pass, decflags=0, encflags=0);
154 * Adds a parameter to the calling convention. This should be called in normal ascending order.
156 * @param type Data type to convert to/from.
157 * @param pass How the data is passed in C++.
158 * @param decflags Flags on decoding from the plugin to C++.
159 * @param encflags Flags on encoding from C++ to the plugin.
162 native PrepSDKCall_AddParameter(SDKType:type, SDKPassMethod:pass, decflags=0, encflags=0);
165 * Finalizes an SDK call preparation and returns the resultant Handle.
167 * @return A new SDKCall Handle on success, or INVALID_HANDLE on failure.
169 native Handle:EndPrepSDKCall();
172 * Calls an SDK function with the given parameters.
174 * If the call type is Entity or Player, the index MUST ALWAYS be the FIRST parameter passed.
175 * If the call type is GameRules, then nothing special needs to be passed.
176 * If the return value is a Vector or QAngles, the SECOND parameter must be a Float[3].
177 * If the return value is a string, the THIRD parameter must be a String buffer, and the
178 * FOURTH parameter must be the maximum length.
179 * All parameters must be passed after the above is followed. Failure to follow these
180 * rules will result in crashes or wildly unexpected behavior!
182 * If the return value is a float or integer, the return value will be this value.
183 * If the return value is a CBaseEntity, CBasePlayer, or edict, the return value will
184 * always be the entity index, or -1 for NULL.
186 * @param call SDKCall Handle.
187 * @param ... Call Parameters.
188 * @return Simple return value, if any.
189 * @error Invalid Handle or internal decoding error.
191 native any:SDKCall(Handle:call, any:...);
193 #include <sdktools_stocks>
196 * Do not edit below this line!
198 public Extension:__ext_sdktools =
201 file = "sdktools.ext",
202 #if defined AUTOLOAD_EXTENSIONS
207 #if defined REQUIRE_EXTENSIONS