Update large includes for transitional syntax #2 (#511)

This commit is contained in:
ErikMinekus
2016-05-21 09:16:49 -04:00
committed by Nicholas Hastings
parent f91d659c6f
commit 542bb59978
11 changed files with 414 additions and 497 deletions
+40 -60
View File
@@ -91,8 +91,6 @@ enum APLRes
*
* If any run-time error is thrown during this callback, the plugin will be marked
* as failed.
*
* @noreturn
*/
forward void OnPluginStart();
@@ -102,7 +100,7 @@ forward void OnPluginStart();
* not be called, but old plugins with only AskPluginLoad() will work.
*/
#pragma deprecated Use AskPluginLoad2() instead
forward bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max);
forward bool AskPluginLoad(Handle myself, bool late, char[] error, int err_max);
/**
* Called before OnPluginStart, in case the plugin wants to check for load failure.
@@ -123,7 +121,7 @@ forward bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max);
* @param err_max Maximum number of characters for error message buffer.
* @return APLRes_Success for load success, APLRes_Failure or APLRes_SilentFailure otherwise
*/
forward APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max);
forward APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max);
/**
* Called when the plugin is about to be unloaded.
@@ -131,8 +129,6 @@ forward APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
* It is not necessary to close any handles or remove hooks in this function.
* SourceMod guarantees that plugin shutdown automatically and correctly releases
* all resources.
*
* @noreturn
*/
forward void OnPluginEnd();
@@ -140,9 +136,8 @@ forward void OnPluginEnd();
* Called when the plugin's pause status is changing.
*
* @param pause True if the plugin is being paused, false otherwise.
* @noreturn
*/
forward void OnPluginPauseChange(bool:pause);
forward void OnPluginPauseChange(bool pause);
/**
* Called before every server frame. Note that you should avoid
@@ -170,8 +165,6 @@ forward void OnMapEnd();
*
* @note This will always be called once and only once per map. It will be
* called after OnMapStart().
*
* @noreturn
*/
forward void OnConfigsExecuted();
@@ -187,8 +180,6 @@ forward void OnConfigsExecuted();
*
* Unlike OnMapStart() and OnConfigsExecuted(), this is not called on
* late loads that occur after OnMapStart().
*
* @noreturn
*/
forward void OnAutoConfigsBuffered();
@@ -210,7 +201,7 @@ forward void OnAllPluginsLoaded();
*
* @return Handle of the calling plugin.
*/
native Handle:GetMyHandle();
native Handle GetMyHandle();
/**
* Returns an iterator that can be used to search through plugins.
@@ -219,7 +210,7 @@ native Handle:GetMyHandle();
* CloseHandle().
* @error Invalid Handle.
*/
native Handle:GetPluginIterator();
native Handle GetPluginIterator();
/**
* Returns whether there are more plugins available in the iterator.
@@ -228,7 +219,7 @@ native Handle:GetPluginIterator();
* @return True on more plugins, false otherwise.
* @error Invalid Handle.
*/
native bool:MorePlugins(Handle:iter);
native bool MorePlugins(Handle iter);
/**
* Returns the current plugin in the iterator and advances the iterator.
@@ -238,7 +229,7 @@ native bool:MorePlugins(Handle:iter);
* the iterator is advanced.
* @error Invalid Handle.
*/
native Handle:ReadPlugin(Handle:iter);
native Handle ReadPlugin(Handle iter);
/**
* Returns a plugin's status.
@@ -247,7 +238,7 @@ native Handle:ReadPlugin(Handle:iter);
* @return Status code for the plugin.
* @error Invalid Handle.
*/
native PluginStatus:GetPluginStatus(Handle:plugin);
native PluginStatus GetPluginStatus(Handle plugin);
/**
* Retrieves a plugin's file name relative to the plugins folder.
@@ -255,10 +246,9 @@ native PluginStatus:GetPluginStatus(Handle:plugin);
* @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
* @param buffer Buffer to the store the file name.
* @param maxlength Maximum length of the name buffer.
* @noreturn
* @error Invalid Handle.
*/
native GetPluginFilename(Handle:plugin, String:buffer[], maxlength);
native void GetPluginFilename(Handle plugin, char[] buffer, int maxlength);
/**
* Retrieves whether or not a plugin is being debugged.
@@ -267,7 +257,7 @@ native GetPluginFilename(Handle:plugin, String:buffer[], maxlength);
* @return True if being debugged, false otherwise.
* @error Invalid Handle.
*/
native bool:IsPluginDebugging(Handle:plugin);
native bool IsPluginDebugging(Handle plugin);
/**
* Retrieves a plugin's public info.
@@ -279,7 +269,7 @@ native bool:IsPluginDebugging(Handle:plugin);
* @return True on success, false if property is not available.
* @error Invalid Handle.
*/
native bool:GetPluginInfo(Handle:plugin, PluginInfo:info, String:buffer[], maxlength);
native bool GetPluginInfo(Handle plugin, PluginInfo info, char[] buffer, int maxlength);
/**
* Finds a plugin by its order in the list from the "plugins list" server
@@ -291,7 +281,7 @@ native bool:GetPluginInfo(Handle:plugin, PluginInfo:info, String:buffer[], maxle
* @return Plugin Handle on success, INVALID_HANDLE if no plugin
* matches the given number.
*/
native Handle:FindPluginByNumber(order_num);
native Handle FindPluginByNumber(int order_num);
/**
* Causes the plugin to enter a failed state. An error will be thrown and
@@ -308,10 +298,9 @@ native Handle:FindPluginByNumber(order_num);
*
* @param string Format specifier string.
* @param ... Formatting arguments.
* @noreturn
* @error Always throws SP_ERROR_ABORT.
*/
native SetFailState(const String:string[], any:...);
native void SetFailState(const char[] string, any ...);
/**
* Aborts the current callback and throws an error. This function
@@ -319,10 +308,9 @@ native SetFailState(const String:string[], any:...);
*
* @param fmt String format.
* @param ... Format arguments.
* @noreturn
* @error Always!
*/
native ThrowError(const String:fmt[], any:...);
native void ThrowError(const char[] fmt, any ...);
/**
* Gets the system time as a unix timestamp.
@@ -330,7 +318,7 @@ native ThrowError(const String:fmt[], any:...);
* @param bigStamp Optional array to store the 64bit timestamp in.
* @return 32bit timestamp (number of seconds since unix epoch).
*/
native GetTime(bigStamp[2]={0,0});
native int GetTime(int bigStamp[2]={0,0});
/**
* Produces a date and/or time string value for a timestamp.
@@ -342,10 +330,9 @@ native GetTime(bigStamp[2]={0,0});
* @param maxlength Maximum length of output string buffer.
* @param format Formatting rules (passing NULL_STRING will use the rules defined in sm_datetime_format).
* @param stamp Optional time stamp.
* @noreturn
* @error Buffer too small or invalid time format.
*/
native FormatTime(String:buffer[], maxlength, const String:format[], stamp=-1);
native void FormatTime(char[] buffer, int maxlength, const char[] format, int stamp=-1);
/**
* Loads a game config file.
@@ -354,7 +341,7 @@ native FormatTime(String:buffer[], maxlength, const String:format[], stamp=-1);
* and the extension should be omitted.
* @return A handle to the game config file or INVALID_HANDLE in failure.
*/
native Handle:LoadGameConfigFile(const String:file[]);
native Handle LoadGameConfigFile(const char[] file);
/**
* Returns an offset value.
@@ -363,7 +350,7 @@ native Handle:LoadGameConfigFile(const String:file[]);
* @param key Key to retrieve from the offset section.
* @return An offset, or -1 on failure.
*/
native GameConfGetOffset(Handle:gc, const String:key[]);
native int GameConfGetOffset(Handle gc, const char[] key);
/**
* Gets the value of a key from the "Keys" section.
@@ -374,7 +361,7 @@ native GameConfGetOffset(Handle:gc, const String:key[]);
* @param maxlen Maximum length of output string buffer.
* @return True if key existed, false otherwise.
*/
native bool:GameConfGetKeyValue(Handle:gc, const String:key[], String:buffer[], maxlen);
native bool GameConfGetKeyValue(Handle gc, const char[] key, char[] buffer, int maxlen);
/**
* Finds an address calculation in a GameConfig file,
@@ -384,7 +371,7 @@ native bool:GameConfGetKeyValue(Handle:gc, const String:key[], String:buffer[],
* @param name Name of the property to find.
* @return An address calculated on success, or 0 on failure.
*/
native Address:GameConfGetAddress(Handle:gameconf, const String:name[]);
native Address GameConfGetAddress(Handle gameconf, const char[] name);
/**
* Returns the operating system's "tick count," which is a number of
@@ -393,7 +380,7 @@ native Address:GameConfGetAddress(Handle:gameconf, const String:name[]);
*
* @return Tick count in milliseconds.
*/
native GetSysTickCount();
native int GetSysTickCount();
/**
* Specifies that the given config file should be executed after plugin load.
@@ -406,18 +393,16 @@ native GetSysTickCount();
* @param name Name of the config file, excluding the .cfg extension.
* If empty, <plugin.filename.cfg> is assumed.
* @param folder Folder under cfg/ to use. By default this is "sourcemod."
* @noreturn
*/
native AutoExecConfig(bool:autoCreate=true, const String:name[]="", const String:folder[]="sourcemod");
native void AutoExecConfig(bool autoCreate=true, const char[] name="", const char[] folder="sourcemod");
/**
* Registers a library name for identifying as a dependency to
* other plugins.
*
* @param name Library name.
* @noreturn
*/
native RegPluginLibrary(const String:name[]);
native void RegPluginLibrary(const char[] name);
/**
* Returns whether a library exists. This function should be considered
@@ -428,7 +413,7 @@ native RegPluginLibrary(const String:name[]);
* @param name Library name of a plugin or extension.
* @return True if exists, false otherwise.
*/
native bool:LibraryExists(const String:name[]);
native bool LibraryExists(const char[] name);
/**
* Returns the status of an extension, by filename.
@@ -441,7 +426,7 @@ native bool:LibraryExists(const String:name[]);
* 0 if the extension loaded but reported an error.
* 1 if the extension is running without error.
*/
native GetExtensionFileStatus(const String:name[], String:error[]="", maxlength=0);
native int GetExtensionFileStatus(const char[] name, char[] error="", int maxlength=0);
/**
* Called after a library is added that the current plugin references
@@ -450,7 +435,7 @@ native GetExtensionFileStatus(const String:name[], String:error[]="", maxlength=
*
* @param name Library name.
*/
forward void OnLibraryAdded(const String:name[]);
forward void OnLibraryAdded(const char[] name);
/**
* Called right before a library is removed that the current plugin references
@@ -459,7 +444,7 @@ forward void OnLibraryAdded(const String:name[]);
*
* @param name Library name.
*/
forward void OnLibraryRemoved(const String:name[]);
forward void OnLibraryRemoved(const char[] name);
#define MAPLIST_FLAG_MAPSFOLDER (1<<0) /**< On failure, use all maps in the maps folder. */
#define MAPLIST_FLAG_CLEARARRAY (1<<1) /**< If an input array is specified, clear it before adding. */
@@ -513,10 +498,10 @@ forward void OnLibraryRemoved(const String:name[]);
* least one item. The serial number is updated to a positive number.
* @error Invalid array Handle that is not INVALID_HANDLE.
*/
native Handle:ReadMapList(Handle:array=INVALID_HANDLE,
&serial=-1,
const String:str[]="default",
flags=MAPLIST_FLAG_CLEARARRAY);
native Handle ReadMapList(Handle array=INVALID_HANDLE,
int &serial=-1,
const char[] str="default",
int flags=MAPLIST_FLAG_CLEARARRAY);
/**
* Makes a compatibility binding for map lists. For example, if a function previously used
@@ -525,9 +510,8 @@ native Handle:ReadMapList(Handle:array=INVALID_HANDLE,
*
* @param name Configuration name that would be used with ReadMapList().
* @param file Default file to use.
* @noreturn
*/
native SetMapListCompatBind(const String:name[], const String:file[]);
native void SetMapListCompatBind(const char[] name, const char[] file);
/**
* Called when a client has sent chat text. This must return either true or
@@ -539,7 +523,7 @@ native SetMapListCompatBind(const String:name[], const String:file[]);
* @param client Client index. The server (0) will never be passed.
* @return True if client is spamming the server, false otherwise.
*/
forward bool:OnClientFloodCheck(client);
forward bool OnClientFloodCheck(int client);
/**
* Called after a client's flood check has been computed. This can be used
@@ -551,9 +535,8 @@ forward bool:OnClientFloodCheck(client);
*
* @param client Client index. The server (0) will never be passed.
* @param blocked True if client flooded last "say", false otherwise.
* @noreturn
*/
forward void OnClientFloodResult(client, bool:blocked);
forward void OnClientFloodResult(int client, bool blocked);
/**
* Feature types.
@@ -603,7 +586,7 @@ enum FeatureStatus
*
* @return True if GetFeatureStatus will work, false otherwise.
*/
stock bool:CanTestFeatures()
stock bool CanTestFeatures()
{
return LibraryExists("__CanTestFeatures__");
}
@@ -615,7 +598,7 @@ stock bool:CanTestFeatures()
* @param name Feature name.
* @return Feature status.
*/
native FeatureStatus:GetFeatureStatus(FeatureType:type, const String:name[]);
native FeatureStatus GetFeatureStatus(FeatureType type, const char[] name);
/**
* Requires that a given feature is available. If it is not, SetFailState()
@@ -625,10 +608,9 @@ native FeatureStatus:GetFeatureStatus(FeatureType:type, const String:name[]);
* @param name Feature name.
* @param fmt Message format string, or empty to use default.
* @param ... Message format parameters, if any.
* @noreturn
*/
native RequireFeature(FeatureType:type, const String:name[],
const String:fmt[]="", any:...);
native void RequireFeature(FeatureType type, const char[] name,
const char[] fmt="", any ...);
/**
* Represents how many bytes we can read from an address with one load
@@ -652,7 +634,7 @@ enum Address
* @param size How many bytes should be read.
* @return The value that is stored at that address.
*/
native LoadFromAddress(Address:addr, NumberType:size);
native int LoadFromAddress(Address addr, NumberType size);
/**
* Store up to 4 bytes to a memory address.
@@ -660,11 +642,9 @@ native LoadFromAddress(Address:addr, NumberType:size);
* @param addr Address to a memory location.
* @param data Value to store at the address.
* @param size How many bytes should be written.
* @noreturn
*/
native StoreToAddress(Address:addr, data, NumberType:size);
native void StoreToAddress(Address addr, int data, NumberType size);
#include <helpers>
#include <entity>
#include <entity_prop_stocks>