From 951d1f91a4595500d50af52245eb0dbeff829aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 22 Aug 2015 09:30:08 +0200 Subject: api: add function string_hex_dump() --- doc/en/weechat_plugin_api.en.asciidoc | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'doc/en') 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._ -- cgit v1.2.3