renamed another native, fixed backwards compat

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40687
This commit is contained in:
David Anderson 2007-04-11 20:07:20 +00:00
parent e42773b07d
commit 4ecb7a985f
2 changed files with 16 additions and 4 deletions

View File

@ -330,9 +330,11 @@ REGISTER_NATIVES(basicStrings)
{"strlen", sm_strlen}, {"strlen", sm_strlen},
{"StrBreak", StrBreak}, {"StrBreak", StrBreak},
{"StrContains", sm_contain}, {"StrContains", sm_contain},
{"StrCompare", sm_strcmp}, {"strcmp", sm_strcmp},
{"StrCompareN", sm_strncmp}, {"StrCompare", sm_strcmp}, /* Backwards compat shim */
{"StrCopy", sm_strcopy}, {"strncmp", sm_strncmp},
{"strcopy", sm_strcopy},
{"StrCopy", sm_strcopy}, /* Backwards compat shim */
{"StringToInt", sm_strconvint}, {"StringToInt", sm_strconvint},
{"IntToString", sm_numtostr}, {"IntToString", sm_numtostr},
{"StringToFloat", sm_strtofloat}, {"StringToFloat", sm_strtofloat},

View File

@ -73,6 +73,7 @@ native strncmp(const String:str1[], const String:str2[], num, bool:caseSensitive
/** /**
* Backwards compatible stock - StrCompare is now strcmp * Backwards compatible stock - StrCompare is now strcmp
* @deprecated Renamed to strcmp
*/ */
stock StrCompare(const String:str1[], const String:str2[], bool:caseSensitive=true) stock StrCompare(const String:str1[], const String:str2[], bool:caseSensitive=true)
{ {
@ -104,7 +105,16 @@ stock bool:StrEqual(const String:str1[], const String:str2[], bool:caseSensitive
* @param source Source string buffer to copy from. * @param source Source string buffer to copy from.
* @return Number of cells written. * @return Number of cells written.
*/ */
native StrCopy(String:dest[], destLen, const String:source[]); native strcopy(String:dest[], destLen, const String:source[]);
/**
* Backwards compatibility stock - use strcopy
* @deprecated Renamed to strcopy
*/
stock StrCopy(String:dest[], destLen, const String:source[])
{
return strcopy(dest, destLen, source);
}
/** /**
* Formats a string according to the SourceMod format rules (see documentation). * Formats a string according to the SourceMod format rules (see documentation).