summaryrefslogtreecommitdiff
path: root/doc/en/weechat_plugin_api.en.asciidoc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-08-22 09:30:08 +0200
committerSébastien Helleu <flashcode@flashtux.org>2015-08-22 09:30:08 +0200
commit951d1f91a4595500d50af52245eb0dbeff829aca (patch)
tree1bafff9fc29544d5045b8fca90aee6836c8c416d /doc/en/weechat_plugin_api.en.asciidoc
parent8b47243516dab4462eb57fca2e3ce79b34b5c146 (diff)
downloadweechat-951d1f91a4595500d50af52245eb0dbeff829aca.zip
api: add function string_hex_dump()
Diffstat (limited to 'doc/en/weechat_plugin_api.en.asciidoc')
-rw-r--r--doc/en/weechat_plugin_api.en.asciidoc41
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/en/weechat_plugin_api.en.asciidoc b/doc/en/weechat_plugin_api.en.asciidoc
index 2398e45e7..823f80252 100644
--- a/doc/en/weechat_plugin_api.en.asciidoc
+++ b/doc/en/weechat_plugin_api.en.asciidoc
@@ -1818,6 +1818,47 @@ length = weechat_string_decode_base64 (string, result);
[NOTE]
This function is not available in scripting API.
+==== string_hex_dump
+
+_WeeChat ≥ 1.4._
+
+Display a dump of data as hexadecimal and ascii bytes.
+
+Prototype:
+
+[source,C]
+----
+char *string_hex_dump (const char *data, int data_size, int bytes_per_line,
+ const char *prefix, const char *suffix);
+----
+
+Arguments:
+
+* 'data': the data to dump
+* 'data_size': number of bytes to dump in 'data'
+* 'bytes_per_line': number of bytes to display in each line
+* 'prefix': the prefix to display at the beginning of each line
+ (optional, can be NULL)
+* 'suffix': the suffix to display at the end of each line
+ (optional, can be NULL)
+
+Return value:
+
+* string with dump of data (must be freed by calling "free" after use)
+
+C example:
+
+[source,C]
+----
+char *string = "abc def-ghi";
+char *dump = weechat_string_hex_dump (string, strlen (string), 8, " >> ", NULL);
+/* dump == " >> 61 62 63 20 64 65 66 2D a b c d e f - \n"
+ " >> 67 68 69 g h i " */
+----
+
+[NOTE]
+This function is not available in scripting API.
+
==== string_is_command_char
_WeeChat ≥ 0.3.2._