1.1 --- a/plugins/include/string.inc Wed Apr 11 16:07:44 2007 +0000
1.2 +++ b/plugins/include/string.inc Wed Apr 11 16:24:50 2007 +0000
1.3 @@ -55,7 +55,29 @@
1.4 * 0 if str1 == str2
1.5 * 1 if str1 > str2
1.6 */
1.7 -native StrCompare(const String:str1[], const String:str2[], bool:caseSensitive=true);
1.8 +native strcmp(const String:str1[], const String:str2[], bool:caseSensitive=true);
1.9 +
1.10 +/**
1.11 + * Compares two strings parts lexographically.
1.12 + *
1.13 + * @param str1 First string (left).
1.14 + * @param str2 Second string (right).
1.15 + * @param num Number of characters to compare.
1.16 + * @param caseSensitive If true (default), comparison is case sensitive.
1.17 + * If false, comparison is case insensitive.
1.18 + * @return -1 if str1 < str2
1.19 + * 0 if str1 == str2
1.20 + * 1 if str1 > str2
1.21 + */
1.22 +native strncmp(const String:str1[], const String:str2[], num, bool:caseSensitive=true);
1.23 +
1.24 +/**
1.25 + * Backwards compatible stock - StrCompare is now strcmp
1.26 + */
1.27 +stock StrCompare(const String:str1[], const String:str2[], bool:caseSensitive=true)
1.28 +{
1.29 + return strcmp(str1, str2, caseSensitive);
1.30 +}
1.31
1.32 /**
1.33 * Returns whether two strings are equal.