Qt: Add missing multi-field column validation
[metze/wireshark/wip.git] / epan / column-info.h
1 /* column-info.h
2  * Definitions for column structures and routines
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 #ifndef __COLUMN_INFO_H__
24 #define __COLUMN_INFO_H__
25
26 #include <glib.h>
27 #include <epan/column-utils.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
32
33 /** @file
34  * Column info.
35  */
36
37 #define COL_MAX_LEN 256
38 #define COL_MAX_INFO_LEN 4096
39
40 /** Column expression */
41 typedef struct {
42   const gchar **col_expr;     /**< Filter expression */
43   gchar      **col_expr_val;  /**< Value for filter expression */
44 } col_expr_t;
45
46 /** Individual column info */
47 typedef struct {
48   gint                col_fmt;              /**< Format of column */
49   gboolean           *fmt_matx;             /**< Specifies which formats apply to a column */
50   gchar              *col_title;            /**< Column titles */
51   gchar              *col_custom_fields;    /**< Custom column fields */
52   gint                col_custom_occurrence;/**< Custom column field occurrence */
53   GSList             *col_custom_fields_ids;/**< Custom column fields id */
54   struct epan_dfilter *col_custom_dfilter;  /**< Compiled custom column field */
55   const gchar        *col_data;             /**< Column data */
56   gchar              *col_buf;              /**< Buffer into which to copy data for column */
57   int                 col_fence;            /**< Stuff in column buffer before this index is immutable */
58 } col_item_t;
59
60 /** Column info */
61 struct epan_column_info {
62   const struct epan_session *epan;
63   gint                num_cols;             /**< Number of columns */
64   col_item_t         *columns;              /**< All column data */
65   gint               *col_first;            /**< First column number with a given format */
66   gint               *col_last;             /**< Last column number with a given format */
67   col_expr_t          col_expr;             /**< Column expressions and values */
68   gboolean            writable;             /**< writable or not @todo Are we still writing to the columns? */
69   GRegex             *prime_regex;          /**< Used to prime custom columns */
70 };
71
72 #ifdef __cplusplus
73 }
74 #endif /* __cplusplus */
75
76 #endif /* __COLUMN_INFO_H__ */