aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-08-10 13:56:34 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-08-10 13:56:34 +0000
commitb4441e6748170f63f19a3d0467d301f5852f161c (patch)
treeafe8f4108828e267390a6158e9312e1644a2818f /doc
parentec3ab9ec3e56a8d2c4f037a8714eba007c0dfcf3 (diff)
rename ep_tvb_fake_unicode() to tvb_get_ephemeral_faked_unicode() and update the README file.
svn path=/trunk/; revision=15271
Diffstat (limited to 'doc')
-rw-r--r--doc/README.developer29
1 files changed, 24 insertions, 5 deletions
diff --git a/doc/README.developer b/doc/README.developer
index c7ba8a0c07..d3a5258e9d 100644
--- a/doc/README.developer
+++ b/doc/README.developer
@@ -360,10 +360,10 @@ the buffer.
If you're fetching into such a chunk of memory a 2-byte Unicode string
from the buffer, and the string has a specified size, you can use
-"tvb_fake_unicode()", which will check whether the entire string is
-present before allocating a buffer for the string, and will also put a
-trailing '\0' at the end of the buffer. The resulting string will be a
-sequence of single-byte characters; the only Unicode characters that
+"tvb_get_ephemeral_faked_unicode()", which will check whether the entire
+string is present before allocating a buffer for the string, and will also
+put a trailing '\0' at the end of the buffer. The resulting string will be
+a sequence of single-byte characters; the only Unicode characters that
will be handled correctly are those in the ASCII range. (Ethereal's
ability to handle non-ASCII strings is limited; it needs to be
improved.)
@@ -896,7 +896,7 @@ tvbuff, starting at the specified offset, and containing the specified
length worth of characters (the length of the buffer will be length+1,
as it includes a null character to terminate the string).
-tvb_get_string() returns a bugger allocated by g_malloc() so you must
+tvb_get_string() returns a buffer allocated by g_malloc() so you must
g_free() it when you are finished with the string. Failure to g_free() this
buffer will lead to memory leaks.
tvb_get_ephemeral_string() returns a buffer allocated from a special heap
@@ -913,6 +913,25 @@ specified offset, and containing all characters from the tvbuff up to
and including a terminating null character in the tvbuff. "*lengthp"
will be set to the length of the string, including the terminating null.
+
+guint8 *tvb_fake_unicode(tvbuff_t*, gint offset, gint length);
+guint8 *tvb_get_ephemeral_faked_unicode(tvbuff_t*, gint offset, gint length);
+
+Converts a 2-byte unicode string to an ASCII string.
+Returns a null-terminated buffer containing data from the specified
+tvbuff, starting at the specified offset, and containing the specified
+length worth of characters (the length of the buffer will be length+1,
+as it includes a null character to terminate the string).
+
+tvb_fake_unicode() returns a buffer allocated by g_malloc() so you must
+g_free() it when you are finished with the string. Failure to g_free() this
+buffer will lead to memory leaks.
+tvb_get_ephemeral_faked_unicode() returns a buffer allocated from a special
+heap with a lifetime until the next packet is dissected. You do not need to
+free() this buffer, it will happen automatically once the next packet is
+dissected.
+
+
Copying memory:
guint8* tvb_memcpy(tvbuff_t*, guint8* target, gint offset, gint length);