Clean up white space.
[obnox/wireshark/wip.git] / print.h
1 /* print.h
2  * Definitions for printing packet analysis trees.
3  *
4  * $Id: print.h,v 1.20 2000/08/11 13:34:26 deniel Exp $
5  *
6  * Gilbert Ramirez <gram@xiexie.org>
7  *
8  * Ethereal - Network traffic analyzer
9  * By Gerald Combs <gerald@zing.org>
10  * Copyright 1998 Gerald Combs
11  *
12  * 
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  * 
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  * 
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
26  */
27
28 #ifndef __PRINT_H__
29 #define __PRINT_H__
30
31 #include "packet.h"
32
33 #define PR_FMT_TEXT 0
34 #define PR_FMT_PS   1
35
36 typedef struct {
37   gboolean      to_file;        /* TRUE if we're printing to a file */
38   char          *dest;          /* if printing to file, pathname;
39                                    if not, command string */
40   gint          format;         /* text or PostScript */
41   gboolean      print_summary;  /* TRUE if we should just print summary;
42                                    FALSE if we should print protocol tree. */
43   gboolean      print_hex;      /* TRUE if we should also print hex data;
44                                    FALSE if we should print only if not dissected. */
45   gboolean      expand_all;     /* TRUE if we should expand all levels;
46                                    FALSE if we should expand as displayed. */
47 } print_args_t;
48
49 /* Functions in print.h */
50
51 FILE *open_print_dest(int to_file, const char *dest);
52 void close_print_dest(int to_file, FILE *fh);
53 void print_preamble(FILE *fh, gint format);
54 void print_finale(FILE *fh, gint format);
55 void proto_tree_print(gboolean print_one_packet, print_args_t *print_args,
56     GNode *protocol_tree, const u_char *pd, frame_data *fd, FILE *fh);
57 void print_hex_data(FILE *fh, gint format, register const u_char *cp,
58     register u_int length, char_enc encoding);
59 void print_line(FILE *fh, gint format, char *line);
60
61 #endif /* print.h */