/* print.h
* Definitions for printing packet analysis trees.
*
- * $Id: print.h,v 1.5 1998/10/10 03:32:20 gerald Exp $
+ * $Id: print.h,v 1.18 2000/01/22 06:22:19 guy Exp $
*
- * Gilbert Ramirez <gram@verdict.uthscsa.edu>
+ * Gilbert Ramirez <gram@xiexie.org>
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#ifndef __PRINT_H__
#define __PRINT_H__
-typedef struct pr_opts {
- int output_format; /* 0=text, 1=postscript */
- int output_dest; /* 0=cmd, 1=file */
- char *file;
- char *cmd;
+#define PR_FMT_TEXT 0
+#define PR_FMT_PS 1
- /* for the dialogue box */
- GtkWidget *cmd_te;
- GtkWidget *file_te;
-} pr_opts;
+typedef struct {
+ gboolean to_file; /* TRUE if we're printing to a file */
+ char *dest; /* if printing to file, pathname;
+ if not, command string */
+ gint format; /* text or PostScript */
+ gboolean print_summary; /* TRUE if we should just print summary;
+ FALSE if we should print protocol tree. */
+ gboolean print_hex; /* TRUE if we should also print hex data;
+ FALSE if we should print only if not dissected. */
+ gboolean expand_all; /* TRUE if we should expand all levels;
+ FALSE if we should expand as displayed. */
+} print_args_t;
/* Functions in print.h */
-GtkWidget *printer_prefs_show();
-void printer_prefs_ok(GtkWidget *w);
-void printer_prefs_cancel(GtkWidget *w);
-void print_tree(const u_char *pd, frame_data *fd, GtkTree *tree);
-void print_tree_text(FILE *fh, const u_char *pd, frame_data *fd, GtkTree *tree);
-void print_tree_ps(FILE *fh, const u_char *pd, frame_data *fd, GtkTree *tree);
+FILE *open_print_dest(int to_file, const char *dest);
+void close_print_dest(int to_file, FILE *fh);
+void print_preamble(FILE *fh, gint format);
+void print_finale(FILE *fh, gint format);
+void proto_tree_print(gboolean print_one_packet, print_args_t *print_args,
+ GNode *protocol_tree, const u_char *pd, frame_data *fd, FILE *fh);
+void print_hex_data(FILE *fh, gint format, register const u_char *cp,
+ register u_int length, char_enc encoding);
+void print_line(FILE *fh, gint format, char *line);
#endif /* print.h */