aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/column.c37
-rw-r--r--epan/column.h4
2 files changed, 30 insertions, 11 deletions
diff --git a/epan/column.c b/epan/column.c
index 6d4fa62..1851dbf 100644
--- a/epan/column.c
+++ b/epan/column.c
@@ -808,22 +808,15 @@ get_column_tooltip(const gint col)
}
void
-build_column_format_array(column_info *cinfo, const gint num_cols, const gboolean reset_fences)
+col_finalize(column_info *cinfo)
{
int i;
col_item_t* col_item;
- /* Build the column format array */
- col_setup(cinfo, num_cols);
-
for (i = 0; i < cinfo->num_cols; i++) {
col_item = &cinfo->columns[i];
- col_item->col_fmt = get_column_format(i);
- col_item->col_title = g_strdup(get_column_title(i));
if (col_item->col_fmt == COL_CUSTOM) {
- col_item->col_custom_fields = g_strdup(get_column_custom_fields(i));
- col_item->col_custom_occurrence = get_column_custom_occurrence(i);
if(!dfilter_compile(col_item->col_custom_fields, &col_item->col_custom_dfilter, NULL)) {
/* XXX: Should we issue a warning? */
g_free(col_item->col_custom_fields);
@@ -863,9 +856,6 @@ build_column_format_array(column_info *cinfo, const gint num_cols, const gboolea
else
col_item->col_buf = (gchar *) g_malloc(sizeof(gchar) * COL_MAX_LEN);
- if(reset_fences)
- col_item->col_fence = 0;
-
cinfo->col_expr.col_expr[i] = "";
cinfo->col_expr.col_expr_val[i] = (gchar *) g_malloc(sizeof(gchar) * COL_MAX_LEN);
}
@@ -888,6 +878,31 @@ build_column_format_array(column_info *cinfo, const gint num_cols, const gboolea
}
}
+void
+build_column_format_array(column_info *cinfo, const gint num_cols, const gboolean reset_fences)
+{
+ int i;
+ col_item_t* col_item;
+
+ /* Build the column format array */
+ col_setup(cinfo, num_cols);
+
+ for (i = 0; i < cinfo->num_cols; i++) {
+ col_item = &cinfo->columns[i];
+ col_item->col_fmt = get_column_format(i);
+ col_item->col_title = g_strdup(get_column_title(i));
+ if (col_item->col_fmt == COL_CUSTOM) {
+ col_item->col_custom_fields = g_strdup(get_column_custom_fields(i));
+ col_item->col_custom_occurrence = get_column_custom_occurrence(i);
+ }
+
+ if(reset_fences)
+ col_item->col_fence = 0;
+ }
+
+ col_finalize(cinfo);
+}
+
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
diff --git a/epan/column.h b/epan/column.h
index 365652e..04a219a 100644
--- a/epan/column.h
+++ b/epan/column.h
@@ -80,6 +80,10 @@ gchar *get_column_tooltip(const gint col);
WS_DLL_PUBLIC
void
+col_finalize(column_info *cinfo);
+
+WS_DLL_PUBLIC
+void
build_column_format_array(column_info *cinfo, const gint num_cols, const gboolean reset_fences);
WS_DLL_PUBLIC