From Richard van der Hoff:
[obnox/wireshark/wip.git] / epan / column-utils.h
1 /* column-utils.h
2  * Definitions for column utility structures and routines
3  *
4  * $Id$
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@ethereal.com>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  */
24
25 #ifndef __COLUMN_UTILS_H__
26 #define __COLUMN_UTILS_H__
27
28 #include <glib.h>
29
30 #define COL_MAX_LEN 256
31 #define COL_MAX_INFO_LEN 4096
32
33 #include "column_info.h"
34 #include "packet_info.h"
35
36 /* Allocate all the data structures for constructing column data, given
37    the number of columns. */
38 extern void     col_setup(column_info *, gint);
39
40 /* Initialize the data structures for constructing column data. */
41 extern void     col_init(column_info *);
42
43 /* Utility routines used by packet*.c */
44
45 extern gboolean col_get_writable(column_info *);
46 extern void     col_set_writable(column_info *, gboolean);
47 extern gint     check_col(column_info *, gint);
48 extern void     col_set_fence(column_info *, gint);
49 extern void     col_clear(column_info *, gint);
50 extern void     col_set_str(column_info *, gint, const gchar *);
51 #if __GNUC__ >= 2
52 extern void     col_add_fstr(column_info *, gint, const gchar *, ...)
53     __attribute__((format (printf, 3, 4)));
54 extern void     col_append_fstr(column_info *, gint, const gchar *, ...)
55     __attribute__((format (printf, 3, 4)));
56 extern void     col_append_sep_fstr(column_info *, gint, const gchar *sep,
57                 const gchar *fmt, ...)
58     __attribute__((format (printf, 4, 5)));
59 extern void     col_prepend_fstr(column_info *, gint, const gchar *, ...)
60     __attribute__((format (printf, 3, 4)));
61 #else
62 extern void     col_add_fstr(column_info *, gint, const gchar *, ...);
63 extern void     col_append_fstr(column_info *, gint, const gchar *, ...);
64 extern void     col_append_sep_fstr(column_info *, gint, const gchar *sep,
65                 const gchar *fmt, ...);
66 extern void     col_prepend_fstr(column_info *, gint, const gchar *, ...);
67 #endif
68 extern void     col_add_str(column_info *, gint, const gchar *);
69 extern void     col_append_str(column_info *, gint, const gchar *);
70 extern void     col_append_sep_str(column_info *, gint, const gchar *sep,
71                 const gchar *str);
72 extern void     col_set_cls_time(frame_data *, column_info *, int);
73 extern void     fill_in_columns(packet_info *);
74
75 #endif /* __COLUMN_UTILS_H__ */