diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2007-02-07 13:45:28 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2007-02-07 13:45:28 +0000 |
commit | 92fd73681d3288b4d89b66d99023a8f116b8bed6 (patch) | |
tree | 3c64cc0160f837e43ec1bf7772829e61c4ae0e67 /epan/strutil.h | |
parent | bc2ca610836d19dfc506e484abc3dba07e37a522 (diff) |
From: Gisle Vanem
The file epan/dissectors/packet-k12.c uses the function
strcasestr() which is not available on e.g. Windows. So I cooked
up a patch to epan/strutil.c to add epan_strcasestr() (is there a more
suited place for such a function?)
svn path=/trunk/; revision=20734
Diffstat (limited to 'epan/strutil.h')
-rw-r--r-- | epan/strutil.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/epan/strutil.h b/epan/strutil.h index 10bf242da4..5e5eac1df4 100644 --- a/epan/strutil.h +++ b/epan/strutil.h @@ -205,6 +205,16 @@ guint8 * convert_string_to_hex(const char *string, size_t *nbytes); */ char * convert_string_case(const char *string, gboolean case_insensitive); +/** Finds the first occurence of string 'needle' in string 'haystack'. + * The matching is done in a case insensitive manner. + * + * @param haystack The string possibly containing the substring + * @param needle The substring to be searched + * @return A pointer into 'haystack' where 'needle' is first found. + * Otherwise it returns NULL. + */ +char * epan_strcasestr(const char *haystack, const char *needle); + /* g_strlcat() does not exist in GLib 1.2[.x] */ #if GLIB_MAJOR_VERSION < 2 gsize g_strlcat(gchar *dst, gchar *src, gsize size); |