diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2016-10-22 22:33:23 +0100 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2016-10-24 21:01:56 +0000 |
commit | 04761f220b77814bfd460da7026b61c7687f687a (patch) | |
tree | e0385aef4fa23d83e138ce300ee513e2e34536aa /epan/wmem/wmem_list.c | |
parent | 79de3f5e2986486b9a3ed55af86644ab746ffe65 (diff) | |
download | wireshark-04761f220b77814bfd460da7026b61c7687f687a.tar.gz |
Add wmem_list_find_custom()
Change-Id: I5c4f85df0a1899d629386581de2c2c3ec0812d54
Reviewed-on: https://code.wireshark.org/review/18440
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'epan/wmem/wmem_list.c')
-rw-r--r-- | epan/wmem/wmem_list.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/epan/wmem/wmem_list.c b/epan/wmem/wmem_list.c index 8422ed86c9..d494b6ff1d 100644 --- a/epan/wmem/wmem_list.c +++ b/epan/wmem/wmem_list.c @@ -126,6 +126,20 @@ wmem_list_find(wmem_list_t *list, const void *data) return NULL; } +wmem_list_frame_t * +wmem_list_find_custom(wmem_list_t *list, const void *data, GCompareFunc compare_func) +{ + wmem_list_frame_t *cur; + + for (cur = list->head; cur != NULL; cur = cur->next) { + if (compare_func(cur->data, data) == 0) { + return cur; + } + } + + return NULL; +} + void wmem_list_prepend(wmem_list_t *list, void *data) { |