comparison 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
comparison
equal deleted inserted replaced
9276:9a294bf90cd0 9277:185fbd8b5998
565 * @return A human-readable form, containing days, hours, minutes, and 565 * @return A human-readable form, containing days, hours, minutes, and
566 * seconds. 566 * seconds.
567 */ 567 */
568 char *gaim_str_seconds_to_string(guint sec); 568 char *gaim_str_seconds_to_string(guint sec);
569 569
570 /**
571 * Converts a binary string into a NUL terminated ascii string,
572 * replacing nonascii characters and characters below SPACE (including
573 * NUL) into \xyy, where yy are two hex digits. Also backslashes are
574 * changed into two backslashes (\\). The returned, newly allocated
575 * can be outputted to the console, and must be g_free()d.
576 *
577 * @param binary A string of random data, possibly with embedded NULs
578 * and such.
579 * @param len The length in bytes of the input string. Must not be 0.
580 *
581 * @return A newly allocated ASCIIZ string.
582 */
583 char *gaim_str_binary_to_ascii(const unsigned char *binary, guint len);
570 /*@}*/ 584 /*@}*/
571 585
572 586
573 /**************************************************************************/ 587 /**************************************************************************/
574 /** @name URI/URL Functions */ 588 /** @name URI/URL Functions */