src/util.h

changeset 11920
be80617ec59b
parent 11878
4c2661df91bb
child 12106
d7593d9b8bc9
--- a/src/util.h	Mon Oct 31 03:55:56 2005 +0000
+++ b/src/util.h	Mon Oct 31 04:27:06 2005 +0000
@@ -574,11 +574,30 @@
 char *gaim_str_add_cr(const char *str);
 
 /**
- * Strips all carriage returns from a string.
+ * Strips all instances of the given character from the
+ * given string.  The string is modified in place.  This
+ * is useful for stripping new line characters, for example.
+ *
+ * Example usage:
+ * gaim_str_strip_char(my_dumb_string, '\n');
  *
- * @param str The string to strip carriage returns from.
+ * @param str     The string to strip characters from.
+ * @param thechar The character to strip from the given string.
  */
-void gaim_str_strip_cr(char *str);
+void gaim_str_strip_char(char *str, char thechar);
+
+/**
+ * Given a string, this replaces all instances of one character
+ * with another.  This happens inline (the original string IS
+ * modified).
+ *
+ * @param string The string from which to replace stuff.
+ * @param delimiter The character you want replaced.
+ * @param replacement The character you want inserted in place
+ *        of the delimiting character.
+ */
+void gaim_util_chrreplace(char *string, char delimiter,
+						  char replacement);
 
 /**
  * Given a string, this replaces one substring with another

mercurial