diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-08-10 13:41:13 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-08-10 13:41:13 +0000 |
commit | ec3ab9ec3e56a8d2c4f037a8714eba007c0dfcf3 (patch) | |
tree | 05b2dac45e4d53ecfac0cd8657236f9e4ded41b7 /epan/tvbuff.h | |
parent | 19dd9f815952fd4d841c1935319c2987781c51be (diff) | |
download | wireshark-ec3ab9ec3e56a8d2c4f037a8714eba007c0dfcf3.tar.gz |
rename ep_tvb_get_string() to tvb_get_ephemeral_string() asnd update the documentation in README.developer
svn path=/trunk/; revision=15270
Diffstat (limited to 'epan/tvbuff.h')
-rw-r--r-- | epan/tvbuff.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/epan/tvbuff.h b/epan/tvbuff.h index ca367978fb..859c40365a 100644 --- a/epan/tvbuff.h +++ b/epan/tvbuff.h @@ -413,6 +413,7 @@ extern gchar * tvb_format_text(tvbuff_t *tvb, gint offset, gint size); */ extern gchar *tvb_format_stringzpad(tvbuff_t *tvb, gint offset, gint size); + /** * Given a tvbuff, an offset, and a length, allocate a buffer big enough * to hold a non-null-terminated string of that length at that offset, @@ -420,13 +421,18 @@ extern gchar *tvb_format_stringzpad(tvbuff_t *tvb, gint offset, gint size); * to the string. * * Throws an exception if the tvbuff ends before the string does. + * + * tvb_get_string() returns a string allocated by g_malloc() and therefore + * MUST be g_free() by the caller in order not to leak + * memory. + * + * tvb_get_ephemeral_string() returns a string that does not need to be freed, + * instead it will automatically be freed once the next + * packet is dissected. */ extern guint8 *tvb_get_string(tvbuff_t *tvb, gint offset, gint length); -/* Same as above but the buffer returned from this function does not have to - * be freed. It will be automatically freed after the packet is dissected. - * Buffers allocated by this function are NOT persistent. - */ -extern guint8 *ep_tvb_get_string(tvbuff_t *tvb, gint offset, gint length); +extern guint8 *tvb_get_ephemeral_string(tvbuff_t *tvb, gint offset, gint length); + /** * Given a tvbuff and an offset, with the offset assumed to refer to |