diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-05-14 00:49:05 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-05-14 00:49:05 +0000 |
commit | 14b616c35d40cce1ee05592f15e548183f1fb235 (patch) | |
tree | 917e02f5b08e86246f2b18c717a6818ab430d77d /epan/tvbuff.h | |
parent | 723b213c8909521bba4d0492b2110545898a9378 (diff) |
Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_item() calls.
Add new "add_packet_field" method to the TreeItem class, taking a
protocol field (*not* a protocol), TvbRange, and encoding value as
arguments.
Add the ENC_ values to init.lua. Make them all hex #defines so
make-init-lua.pl can easily extract them.
Export tvb_unicode_strsize() for use by Lua (and elsewhere as desired).
Note that it handles UTF-16 and UTF-8, and fix the comment to note that
its count of hexadectets *does* include the null terminator (that's what
the code does).
svn path=/trunk/; revision=42621
Diffstat (limited to 'epan/tvbuff.h')
-rw-r--r-- | epan/tvbuff.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/epan/tvbuff.h b/epan/tvbuff.h index d535fd0fca..d37f62b15f 100644 --- a/epan/tvbuff.h +++ b/epan/tvbuff.h @@ -393,6 +393,14 @@ extern gint tvb_pbrk_guint8(tvbuff_t *, const gint offset, const gint maxlength, */ extern guint tvb_strsize(tvbuff_t *tvb, const gint offset); +/** Find size of UCS-2 or UTF-16 stringz (NUL-terminated string) by + * looking for terminating 16-bit NUL. The size of the string includes + * the terminating NUL. + * + * If the NUL isn't found, it throws the appropriate exception. + */ +extern guint tvb_unicode_strsize(tvbuff_t *tvb, const gint offset); + /** Find length of string by looking for end of zero terminated string, up to * 'maxlength' characters'; if 'maxlength' is -1, searches to end * of tvbuff. |