From 4ecb7a985fc36649aa74646b7d4b59fd391bbabb Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 11 Apr 2007 20:07:20 +0000 Subject: [PATCH] renamed another native, fixed backwards compat --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40687 --- core/smn_string.cpp | 8 +++++--- plugins/include/string.inc | 12 +++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/core/smn_string.cpp b/core/smn_string.cpp index fbeb139f..cca8271f 100644 --- a/core/smn_string.cpp +++ b/core/smn_string.cpp @@ -330,9 +330,11 @@ REGISTER_NATIVES(basicStrings) {"strlen", sm_strlen}, {"StrBreak", StrBreak}, {"StrContains", sm_contain}, - {"StrCompare", sm_strcmp}, - {"StrCompareN", sm_strncmp}, - {"StrCopy", sm_strcopy}, + {"strcmp", sm_strcmp}, + {"StrCompare", sm_strcmp}, /* Backwards compat shim */ + {"strncmp", sm_strncmp}, + {"strcopy", sm_strcopy}, + {"StrCopy", sm_strcopy}, /* Backwards compat shim */ {"StringToInt", sm_strconvint}, {"IntToString", sm_numtostr}, {"StringToFloat", sm_strtofloat}, diff --git a/plugins/include/string.inc b/plugins/include/string.inc index 5060a0bf..3821209d 100644 --- a/plugins/include/string.inc +++ b/plugins/include/string.inc @@ -73,6 +73,7 @@ native strncmp(const String:str1[], const String:str2[], num, bool:caseSensitive /** * Backwards compatible stock - StrCompare is now strcmp + * @deprecated Renamed to strcmp */ 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. * @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).