| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Functions
ex-opt.h File Reference
`#include <stdbool.h>`
`#include "ws_symbol_export.h"`

Go to the source code of this file.

## Functions
WS_DLL_PUBLIC bool | ex_opt_add (const char *ws_optarg)
| Adds an option to a hash table.
WS_DLL_PUBLIC int | ex_opt_count (const char *key)
| Counts the number of options associated with a given key.
WS_DLL_PUBLIC const char * | ex_opt_get_nth (const char *key, unsigned key_index)
| Retrieves the nth option value for a given key.
WS_DLL_PUBLIC char * | ex_opt_get_next (const char *key)
| Retrieves and removes the next option value associated with a given key.

## Detailed Description

eXtension command line options

(c) 2006, Luis E. Garcia Ontanon luis@.nosp@m.onta.nosp@m.non.o.nosp@m.rg

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

## ◆ ex_opt_add()

WS_DLL_PUBLIC bool ex_opt_add | ( | const char * | ws_optarg | ) |

Adds an option to a hash table.

Parameters

  ws_optarg | The argument string to be added.

Returns
  true if the addition is successful, false otherwise.

## ◆ ex_opt_count()

WS_DLL_PUBLIC int ex_opt_count | ( | const char * | key | ) |

Counts the number of options associated with a given key.

Parameters

  key | The key for which to count options.

Returns
  int The number of options associated with the key, or 0 if no such key exists.

## ◆ ex_opt_get_next()

WS_DLL_PUBLIC char * ex_opt_get_next | ( | const char * | key | ) |

Retrieves and removes the next option value associated with a given key.

Note that the caller must free the returned pointer.

Parameters

  key | The key for which to retrieve the next option value.

Returns
  char* A pointer to the retrieved option value, or NULL if no more values are available.

## ◆ ex_opt_get_nth()

WS_DLL_PUBLIC const char * ex_opt_get_nth | ( | const char * | key,
|  | unsigned | key_index )

Retrieves the nth option value for a given key.

Parameters

  key | The key to look up in the options hash table.
  key_index | The index of the option to retrieve.

Returns
  The value of the nth option, or NULL if not found.