4 * Extension command line options
6 * (c) 2006, Luis E. Garcia Ontanon <luis@ontanon.org>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
20 static GHashTable
* ex_opts
= NULL
;
22 gboolean
ex_opt_add(const gchar
* optarg
) {
26 ex_opts
= g_hash_table_new(g_str_hash
,g_str_equal
);
28 splitted
= g_strsplit(optarg
,":",2);
30 if (splitted
[0] && splitted
[1]) {
31 GPtrArray
* this_opts
= (GPtrArray
*)g_hash_table_lookup(ex_opts
,splitted
[0]);
34 g_ptr_array_add(this_opts
,splitted
[1]);
37 this_opts
= g_ptr_array_new();
38 g_ptr_array_add(this_opts
,splitted
[1]);
39 g_hash_table_insert(ex_opts
,splitted
[0],this_opts
);
51 gint
ex_opt_count(const gchar
* key
) {
57 this_opts
= (GPtrArray
*)g_hash_table_lookup(ex_opts
,key
);
60 return this_opts
->len
;
66 const gchar
* ex_opt_get_nth(const gchar
* key
, guint key_index
) {
72 this_opts
= (GPtrArray
*)g_hash_table_lookup(ex_opts
,key
);
75 if (this_opts
->len
> key_index
) {
76 return (const gchar
*)g_ptr_array_index(this_opts
,key_index
);
87 extern const gchar
* ex_opt_get_next(const gchar
* key
) {
93 this_opts
= (GPtrArray
*)g_hash_table_lookup(ex_opts
,key
);
97 return (const gchar
*)g_ptr_array_remove_index(this_opts
,0);
106 * Editor modelines - https://www.wireshark.org/tools/modelines.html
111 * indent-tabs-mode: nil
114 * vi: set shiftwidth=4 tabstop=8 expandtab:
115 * :indentSize=4:tabSize=8:noTabs=true: