summaryrefslogtreecommitdiff
path: root/doc/en/weechat_plugin_api.en.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/en/weechat_plugin_api.en.adoc')
-rw-r--r--doc/en/weechat_plugin_api.en.adoc71
1 files changed, 71 insertions, 0 deletions
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc
index 6b558350e..9467a53d0 100644
--- a/doc/en/weechat_plugin_api.en.adoc
+++ b/doc/en/weechat_plugin_api.en.adoc
@@ -768,6 +768,77 @@ int diff = weechat_string_charcasecmp ("aaa", "CCC"); /* == -2 */
[NOTE]
This function is not available in scripting API.
+==== strcmp
+
+_WeeChat ≥ 3.8._
+
+Case sensitive string comparison.
+
+Prototype:
+
+[source,c]
+----
+int weechat_strcmp (const char *string1, const char *string2);
+----
+
+Arguments:
+
+* _string1_: first string for comparison
+* _string2_: second string for comparison
+
+Return value: arithmetic result of subtracting the last compared UTF-8 char in
+_string2_ from the last compared UTF-8 char in _string1_:
+
+* < 0 if string1 < string2
+* 0 if string1 == string2
+* > 0 if string1 > string2
+
+C example:
+
+[source,c]
+----
+int diff = weechat_strcmp ("aaa", "ccc"); /* == -2 */
+----
+
+[NOTE]
+This function is not available in scripting API.
+
+==== strncmp
+
+_WeeChat ≥ 3.8._
+
+Case sensitive string comparison, for _max_ chars.
+
+Prototype:
+
+[source,c]
+----
+int weechat_strncmp (const char *string1, const char *string2, int max);
+----
+
+Arguments:
+
+* _string1_: first string for comparison
+* _string2_: second string for comparison
+* _max_: max chars to compare
+
+Return value: arithmetic result of subtracting the last compared UTF-8 char in
+_string2_ from the last compared UTF-8 char in _string1_:
+
+* < 0 if string1 < string2
+* 0 if string1 == string2
+* > 0 if string1 > string2
+
+C example:
+
+[source,c]
+----
+int diff = weechat_strncmp ("aabb", "aacc", 2); /* == 0 */
+----
+
+[NOTE]
+This function is not available in scripting API.
+
==== strcasecmp
_Updated in 1.0, 3.8._