added strncmp

renamed StrCompare to strcmp

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40686
This commit is contained in:
David Anderson
2007-04-11 16:24:50 +00:00
parent 3474ba74a5
commit e42773b07d
3 changed files with 40 additions and 1 deletions
+23 -1
View File
@@ -55,7 +55,29 @@ native StrContains(const String:str[], const String:substr[], bool:caseSensitive
* 0 if str1 == str2
* 1 if str1 > str2
*/
native StrCompare(const String:str1[], const String:str2[], bool:caseSensitive=true);
native strcmp(const String:str1[], const String:str2[], bool:caseSensitive=true);
/**
* Compares two strings parts lexographically.
*
* @param str1 First string (left).
* @param str2 Second string (right).
* @param num Number of characters to compare.
* @param caseSensitive If true (default), comparison is case sensitive.
* If false, comparison is case insensitive.
* @return -1 if str1 < str2
* 0 if str1 == str2
* 1 if str1 > str2
*/
native strncmp(const String:str1[], const String:str2[], num, bool:caseSensitive=true);
/**
* Backwards compatible stock - StrCompare is now strcmp
*/
stock StrCompare(const String:str1[], const String:str2[], bool:caseSensitive=true)
{
return strcmp(str1, str2, caseSensitive);
}
/**
* Returns whether two strings are equal.