regen pidl all: rm epan/dissectors/pidl/*-stamp; pushd epan/dissectors/pidl/ && make...
[wireshark-sm.git] / wsutil / introspection.c
blobc571c8d5b557c450bd91942dc3a604f8a4550842
1 /*
2 * Copyright 2021, João Valverde <j@v6e.pt>
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10 #include "config.h"
11 #include "introspection.h"
12 #include <string.h>
13 #include <stdlib.h>
16 static int
17 compare_enum(const void *needle, const void *memb)
19 return strcmp(needle, ((const ws_enum_t *)memb)->symbol);
22 const ws_enum_t *
23 ws_enums_bsearch(const ws_enum_t *enums, size_t count,
24 const char *needle)
26 return bsearch(needle, enums, count, sizeof(ws_enum_t), compare_enum);