summaryrefslogtreecommitdiff
path: root/epan/strutil.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2007-01-11 22:12:33 +0000
committerGerald Combs <gerald@wireshark.org>2007-01-11 22:12:33 +0000
commitdef1f435fcc72329f170d120f82233e18f523ebf (patch)
tree06f89c3c54818c78533d28e22ad77511fe97ed0e /epan/strutil.h
parent2b15cb01564e381c890022ed037bf65ed02e81da (diff)
downloadwireshark-def1f435fcc72329f170d120f82233e18f523ebf.tar.gz
Fix compilation problems under Windows. In the GTK code, convert SSIDs
to GByteArrays. Add format_uri() to strutil, which formats a byte string with percent-escapes. Fixup whitespace and indentation. svn path=/trunk/; revision=20397
Diffstat (limited to 'epan/strutil.h')
-rw-r--r--epan/strutil.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/epan/strutil.h b/epan/strutil.h
index 0f7b8b4b95..10bf242da4 100644
--- a/epan/strutil.h
+++ b/epan/strutil.h
@@ -107,10 +107,26 @@ gboolean hex_str_to_bytes(const char *hex_str, GByteArray *bytes,
* @param bytes The GByteArray that will receive the bytes. This
* must be initialized by the caller.
* @return True if the string was converted successfully
+ * @see format_uri()
*/
gboolean uri_str_to_bytes(const char *uri_str, GByteArray *bytes);
-/** Turn a OID string representation (dot notaion) into a byte array.
+/** Turn a byte array into an RFC 3986 percent-encoded string.
+ *
+ * @param bytes The GByteArray that will receive the bytes. This
+ * must be initialized by the caller.
+ * @param reserved_chars Normally the "gen-delims" and "sub-delims"
+ * from RFC 3986 (":/?#[]@" and "!$&'()*+,;=" respectively)
+ * plus space (hex value 20) are treated as reserved characters.
+ * If this variable is non-NULL, its contents will be used
+ * instead.
+ * @note Any non-printing character determined by isprint(), along
+ * with the % character itself are always reserved.
+ * @see uri_str_to_bytes(), format_text(), isprint()
+ */
+gchar* format_uri(const GByteArray *bytes, const gchar *reserved_chars);
+
+/** Turn a OID string representation (dot notation) into a byte array.
*
* @param oid_str The OID string (dot notaion).
* @param bytes The GByteArray that will receive the bytes. This