Mercurial > pidgin.yaz
comparison src/util.h @ 11920:52f27ffe68a5
[gaim-migrate @ 14211]
sf patch #1339035, from Sadrul Habib Chowdhury
"Remove the \n in Yahoo! status messages when showing them in the buddy
list inline."
Also some changes from me. I changed gaim_str_strip_cr(char *text) to
gaim_str_strip_char(char *text, char thechar). I don't know why, really,
but it seems like it could be more useful this way. Eh
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 31 Oct 2005 04:27:06 +0000 |
parents | f672349cfc1c |
children | 36a0c8719af3 |
comparison
equal
deleted
inserted
replaced
11919:51832ad72a6b | 11920:52f27ffe68a5 |
---|---|
572 * @return The string with carriage returns. | 572 * @return The string with carriage returns. |
573 */ | 573 */ |
574 char *gaim_str_add_cr(const char *str); | 574 char *gaim_str_add_cr(const char *str); |
575 | 575 |
576 /** | 576 /** |
577 * Strips all carriage returns from a string. | 577 * Strips all instances of the given character from the |
578 * | 578 * given string. The string is modified in place. This |
579 * @param str The string to strip carriage returns from. | 579 * is useful for stripping new line characters, for example. |
580 */ | 580 * |
581 void gaim_str_strip_cr(char *str); | 581 * Example usage: |
582 * gaim_str_strip_char(my_dumb_string, '\n'); | |
583 * | |
584 * @param str The string to strip characters from. | |
585 * @param thechar The character to strip from the given string. | |
586 */ | |
587 void gaim_str_strip_char(char *str, char thechar); | |
588 | |
589 /** | |
590 * Given a string, this replaces all instances of one character | |
591 * with another. This happens inline (the original string IS | |
592 * modified). | |
593 * | |
594 * @param string The string from which to replace stuff. | |
595 * @param delimiter The character you want replaced. | |
596 * @param replacement The character you want inserted in place | |
597 * of the delimiting character. | |
598 */ | |
599 void gaim_util_chrreplace(char *string, char delimiter, | |
600 char replacement); | |
582 | 601 |
583 /** | 602 /** |
584 * Given a string, this replaces one substring with another | 603 * Given a string, this replaces one substring with another |
585 * and returns a newly allocated string. | 604 * and returns a newly allocated string. |
586 * | 605 * |