diff src/util.h @ 9277:185fbd8b5998

[gaim-migrate @ 10080] I added a util function to turn some binary string into an ASCIIZ string so I can more easily eyeball it and realize I don't know what it means. And I added some yahoo code to print out some strings like that. Actually one of them I do what it means. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Mon, 14 Jun 2004 00:54:45 +0000
parents 9171e528d7e5
children fe0291162312
line wrap: on
line diff
--- a/src/util.h	Sun Jun 13 20:43:43 2004 +0000
+++ b/src/util.h	Mon Jun 14 00:54:45 2004 +0000
@@ -567,6 +567,20 @@
  */
 char *gaim_str_seconds_to_string(guint sec);
 
+/**
+ * Converts a binary string into a NUL terminated ascii string,
+ * replacing nonascii characters and characters below SPACE (including
+ * NUL) into \xyy, where yy are two hex digits. Also backslashes are
+ * changed into two backslashes (\\). The returned, newly allocated
+ * can be outputted to the console, and must be g_free()d.
+ *
+ * @param binary A string of random data, possibly with embedded NULs
+ *               and such.
+ * @param len The length in bytes of the input string. Must not be 0.
+ *
+ * @return A newly allocated ASCIIZ string.
+ */
+char *gaim_str_binary_to_ascii(const unsigned char *binary, guint len);
 /*@}*/