Logo Search packages:      
Sourcecode: wireshark version File versions

gint tvb_strncaseeql ( tvbuff_t *  tvb,
gint  offset,
const gchar *  str,
gint  size 
)

Call g_ascii_strncasecmp after checking if enough chars left, returning 0 if it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1.

Definition at line 1917 of file tvbuff.c.

{
      const guint8 *ptr;

      ptr = ensure_contiguous_no_exception(tvb, offset, size, NULL);

      if (ptr) {
            int cmp = g_ascii_strncasecmp((const char *)ptr, str, size);

            /*
             * Return 0 if equal, -1 otherwise.
             */
            return (cmp == 0 ? 0 : -1);
      } else {
            /*
             * Not enough characters in the tvbuff to match the
             * string.
             */
            return -1;
      }
}


Generated by  Doxygen 1.6.0   Back to index