aboutsummaryrefslogtreecommitdiffstats
path: root/ui/commandline.h
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-06-18 16:49:23 -0400
committerAnders Broman <a.broman58@gmail.com>2016-06-19 05:56:45 +0000
commit9b5b4443cf50aa0e5d98d8129a5c65c6c76a838b (patch)
treea481f214d8452490e5cb0c00255e51f442ce8bc2 /ui/commandline.h
parentdeef1dc1ff22183c0b70ea65775c23c404c641bb (diff)
Refactor command-line handling of GUI options.
Both GTK and Qt both use the same command-line options, so refactor the parsing and (possibly) applying of those arguments to a single location. Ping-Bug: 12546 Change-Id: Ib31e576c509c5d3d21c33d3247640d9f9c68661b Reviewed-on: https://code.wireshark.org/review/16006 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/commandline.h')
-rw-r--r--ui/commandline.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/ui/commandline.h b/ui/commandline.h
new file mode 100644
index 0000000000..2f0beeec20
--- /dev/null
+++ b/ui/commandline.h
@@ -0,0 +1,86 @@
+/* commandline.h
+ * Common command line handling between GUIs
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __COMMANDLINE_H__
+#define __COMMANDLINE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+extern void commandline_print_usage(gboolean for_help_option);
+
+typedef struct commandline_capture_param_info
+{
+ GString *comp_info_str;
+ GString *runtime_info_str;
+ gboolean arg_error;
+#ifndef HAVE_LIBPCAP
+ gboolean capture_option_specified;
+#endif
+} commandline_capture_param_info_t;
+
+extern void commandline_capture_options(int argc, char *argv[], commandline_capture_param_info_t* param_info);
+
+/* Command-line options that don't have direct API calls to handle the data */
+typedef struct commandline_param_info
+{
+ gboolean arg_error;
+#ifdef HAVE_LIBPCAP
+ gboolean list_link_layer_types;
+ gboolean start_capture;
+#else
+ gboolean capture_option_specified;
+#endif
+ e_prefs *prefs_p;
+ search_direction jump_backwards;
+ guint go_to_packet;
+ gchar* jfilter;
+ gchar* cf_name;
+ gchar* rfilter;
+ gchar* dfilter;
+ GSList *disable_protocol_slist;
+ GSList *enable_heur_slist;
+ GSList *disable_heur_slist;
+
+} commandline_param_info_t;
+
+extern void commandline_other_options(int argc, char *argv[], commandline_param_info_t* param_info, gboolean opt_reset);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __COMMANDLINE_H__ */
+
+/*
+ * Editor modelines
+ *
+ * Local Variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * ex: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */