diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-11-10 09:15:57 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-11-10 09:15:57 +0000 |
commit | b63646ecc04d82112d8a669769f87f88a106c6cd (patch) | |
tree | bef2510abe1bd0233e895b1e277e7925a6eb775d /epan/tvbuff.h | |
parent | ae4915d52ae3f5daeb45a491330bccc0a8abdb8a (diff) | |
download | wireshark-b63646ecc04d82112d8a669769f87f88a106c6cd.tar.gz |
Allow "tvb_find_guint8()", "tvb_pbrk_guint8()", and "tvb_strnlen()" to
take -1 as a "maxlength" value, meaning "to the end of the tvbuff".
svn path=/trunk/; revision=2598
Diffstat (limited to 'epan/tvbuff.h')
-rw-r--r-- | epan/tvbuff.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/epan/tvbuff.h b/epan/tvbuff.h index c8f8ab8700..295625bf26 100644 --- a/epan/tvbuff.h +++ b/epan/tvbuff.h @@ -9,7 +9,7 @@ * the data of a backing tvbuff, or can be a composite of * other tvbuffs. * - * $Id: tvbuff.h,v 1.3 2000/11/10 06:50:37 guy Exp $ + * $Id: tvbuff.h,v 1.4 2000/11/10 09:15:57 guy Exp $ * * Copyright (c) 2000 by Gilbert Ramirez <gram@xiexie.org> * @@ -245,11 +245,13 @@ guint8* tvb_memdup(tvbuff_t*, gint offset, gint length); * tvbuff_free_cb_t() is called, if any. */ guint8* tvb_get_ptr(tvbuff_t*, gint offset, gint length); -/* Find first occurence of needle in tvbuff, starting at offset. Searches - * at most maxlength number of bytes. Returns the offset of the found needle, - * or -1 if not found. Will not throw an exception, even if maxlength exceeds - * boundary of tvbuff; in that case, -1 will be returned if the boundary is - * reached before finding needle. */ +/* Find first occurence of any of the needles in tvbuff, starting at offset. + * Searches at most maxlength number of bytes; if maxlength is -1, searches + * to end of tvbuff. + * Returns the offset of the found needle, or -1 if not found. + * Will not throw an exception, even if maxlength exceeds boundary of tvbuff; + * in that case, -1 will be returned if the boundary is reached before + * finding needle. */ gint tvb_find_guint8(tvbuff_t*, gint offset, guint maxlength, guint8 needle); /* Find first occurence of any of the needles in tvbuff, starting at offset. @@ -260,9 +262,14 @@ gint tvb_find_guint8(tvbuff_t*, gint offset, guint maxlength, guint8 needle); gint tvb_pbrk_guint8(tvbuff_t *, gint offset, guint maxlength, guint8 *needles); /* Find length of string by looking for end of string ('\0'), up to - * 'max_length' characters'. Returns -1 if 'max_length' reached - * before finding EOS. */ + * 'maxlength' characters'; if 'maxlength' is -1, searches to end + * of tvbuff. + * Returns -1 if 'maxlength' reached before finding EOS. */ gint tvb_strnlen(tvbuff_t*, gint offset, guint maxlength); + +/* + * Format the data in the tvb from offset for size ... + */ guint8 * tvb_format_text(tvbuff_t *tvb, gint offset, gint size); /* Looks for a stringz (NUL-terminated string) in tvbuff and copies |