| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Classes | Functions
introspection.h File Reference
`#include <stddef.h>`
`#include <ws_symbol_export.h>`

Go to the source code of this file.

## Classes
struct | ws_enum_t
| Represents a symbolic enumeration entry. More...

## Functions
WS_DLL_PUBLIC const ws_enum_t * | ws_enums_bsearch (const ws_enum_t *enums, size_t count, const char *needle)
| Performs a binary search for a symbolic enumeration entry.

## Detailed Description

Copyright 2021, João Valverde j@v6e.nosp@m..pt

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

## Function Documentation

## ◆ ws_enums_bsearch()

WS_DLL_PUBLIC const ws_enum_t * ws_enums_bsearch | ( | const ws_enum_t * | enums,
|  | size_t | count,
|  | const char * | needle
| ) |  |

Performs a binary search for a symbolic enumeration entry.

Searches a sorted array of `ws_enum_t` entries for the given symbolic name. The array must be sorted by the `symbol` field in ascending order for binary search to work.

Parameters

  enums | Pointer to the array of enumeration entries.
  count | Number of entries in the array.
  needle | The symbolic name to search for.

Returns
  A pointer to the matching `ws_enum_t` entry, or NULL if not found.