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 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32 static GHashTable* ex_opts = NULL;
34 gboolean ex_opt_add(const gchar* optarg) {
38 ex_opts = g_hash_table_new(g_str_hash,g_str_equal);
40 splitted = g_strsplit(optarg,":",2);
42 if (splitted[0] && splitted[1]) {
43 GPtrArray* this_opts = (GPtrArray *)g_hash_table_lookup(ex_opts,splitted[0]);
46 g_ptr_array_add(this_opts,splitted[1]);
49 this_opts = g_ptr_array_new();
50 g_ptr_array_add(this_opts,splitted[1]);
51 g_hash_table_insert(ex_opts,splitted[0],this_opts);
63 gint ex_opt_count(const gchar* key) {
69 this_opts = (GPtrArray *)g_hash_table_lookup(ex_opts,key);
72 return this_opts->len;
78 const gchar* ex_opt_get_nth(const gchar* key, guint index) {
84 this_opts = (GPtrArray *)g_hash_table_lookup(ex_opts,key);
87 if (this_opts->len > index) {
88 return (const gchar *)g_ptr_array_index(this_opts,index);
99 extern const gchar* ex_opt_get_next(const gchar* key) {
100 GPtrArray* this_opts;
105 this_opts = (GPtrArray *)g_hash_table_lookup(ex_opts,key);
109 return (const gchar *)g_ptr_array_remove_index(this_opts,0);
118 * Editor modelines - http://www.wireshark.org/tools/modelines.html
123 * indent-tabs-mode: nil
126 * vi: set shiftwidth=4 tabstop=8 expandtab:
127 * :indentSize=4:tabSize=8:noTabs=true: