aboutsummaryrefslogtreecommitdiffstats
path: root/epan/print_stream.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-11-21 19:22:54 -0800
committerGuy Harris <guy@alum.mit.edu>2014-11-22 03:24:17 +0000
commit7d7fc47a2a2ce31a3726e422b1c35c9a213add61 (patch)
tree698fb85ed3cc7b271cdb8d94f55efcfd1baad1f6 /epan/print_stream.h
parent08475ff67309409bb7f828a85f6ed43c0aefb615 (diff)
Split the low-level print stream code into a separate file.
Put the low-level print stream code from epan/print.c into epan/print_stream.c, leaving the higher-level stuff in print.c Change-Id: Iae961f168ec655a29f434257b1af0937fca9f025 Reviewed-on: https://code.wireshark.org/review/5436 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/print_stream.h')
-rw-r--r--epan/print_stream.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/epan/print_stream.h b/epan/print_stream.h
new file mode 100644
index 0000000000..3a326c45e8
--- /dev/null
+++ b/epan/print_stream.h
@@ -0,0 +1,73 @@
+/* print.h
+ * Definitions for printing packet analysis trees.
+ *
+ * Gilbert Ramirez <gram@alumni.rice.edu>
+ *
+ * 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 __PRINT_STREAM_H__
+#define __PRINT_STREAM_H__
+
+#include "ws_symbol_export.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/*
+ * Print stream code; this provides a "print stream" class with subclasses
+ * of various sorts. Additional subclasses might be implemented elsewhere.
+ */
+struct print_stream;
+
+typedef struct print_stream_ops {
+ gboolean (*print_preamble)(struct print_stream *self, gchar *filename, const char *version_string);
+ gboolean (*print_line)(struct print_stream *self, int indent,
+ const char *line);
+ gboolean (*print_bookmark)(struct print_stream *self,
+ const gchar *name, const gchar *title);
+ gboolean (*new_page)(struct print_stream *self);
+ gboolean (*print_finale)(struct print_stream *self);
+ gboolean (*destroy)(struct print_stream *self);
+} print_stream_ops_t;
+
+typedef struct print_stream {
+ const print_stream_ops_t *ops;
+ void *data;
+} print_stream_t;
+
+WS_DLL_PUBLIC print_stream_t *print_stream_text_new(gboolean to_file, const char *dest);
+WS_DLL_PUBLIC print_stream_t *print_stream_text_stdio_new(FILE *fh);
+WS_DLL_PUBLIC print_stream_t *print_stream_ps_new(gboolean to_file, const char *dest);
+WS_DLL_PUBLIC print_stream_t *print_stream_ps_stdio_new(FILE *fh);
+
+WS_DLL_PUBLIC gboolean print_preamble(print_stream_t *self, gchar *filename, const char *version_string);
+WS_DLL_PUBLIC gboolean print_line(print_stream_t *self, int indent, const char *line);
+WS_DLL_PUBLIC gboolean print_bookmark(print_stream_t *self, const gchar *name,
+ const gchar *title);
+WS_DLL_PUBLIC gboolean new_page(print_stream_t *self);
+WS_DLL_PUBLIC gboolean print_finale(print_stream_t *self);
+WS_DLL_PUBLIC gboolean destroy_print_stream(print_stream_t *self);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* print_stream.h */