diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2011-04-13 16:56:24 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2011-04-13 16:56:24 +0000 |
commit | 9246c41703309b14121e2e646324a50e16e79bbe (patch) | |
tree | d9119b221ad5ac22649facb16b9cc172842a4704 /epan/strutil.h | |
parent | 763603d3b6717cc5d35c5e117af165ddef9438ff (diff) | |
download | wireshark-9246c41703309b14121e2e646324a50e16e79bbe.tar.gz |
Change ws_strdup_escape_underscore() function to be more general, by
accepting any character as the escaped character. Change existing
uses to use '_' for the underscore escaping.
svn path=/trunk/; revision=36627
Diffstat (limited to 'epan/strutil.h')
-rw-r--r-- | epan/strutil.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/epan/strutil.h b/epan/strutil.h index 83c040a06e..38da893a25 100644 --- a/epan/strutil.h +++ b/epan/strutil.h @@ -239,21 +239,23 @@ char * escape_string(char *dst, const char *string); void IA5_7BIT_decode(unsigned char * dest, const unsigned char* src, int len); -/** Copy a string, escaping the underscores in it +/** Copy a string, escaping the 'chr' characters in it * * @param str The string to be copied - * @return A copy of the string with every original underscore being - * transformed into double underscores. + * @param char The character to be escaped + * @return A copy of the string with every original 'chr' being + * transformed into double 'chr'. */ -gchar* ws_strdup_escape_underscore (const gchar *str); +gchar* ws_strdup_escape_char (const gchar *str, const gchar chr); -/** Copy a string, unescaping the underscores in it +/** Copy a string, unescaping the 'chr' characters in it * * @param str The string to be copied - * @return A copy of the string with every occurence of double underscores in - * the original string being copied as a single underscore. + * @param char The character to be escaped + * @return A copy of the string with every occurence of double 'chr' in + * the original string being copied as a single 'chr'. */ -gchar* ws_strdup_unescape_underscore (const gchar *str); +gchar* ws_strdup_unescape_char (const gchar *str, const gchar chr); /** Replace values in a string * |