From 80150e196a9ce072914967ac2be567b6bc207ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Wed, 18 Dec 2013 14:18:45 +0000 Subject: [PATCH] Added col_clear_fence(). svn path=/trunk/; revision=54220 --- epan/column-utils.c | 16 ++++++++++++++++ epan/column-utils.h | 10 ++++++++++ 2 files changed, 26 insertions(+) diff --git a/epan/column-utils.c b/epan/column-utils.c index db4c485e6f..622c7374f9 100644 --- a/epan/column-utils.c +++ b/epan/column-utils.c @@ -161,6 +161,22 @@ col_set_fence(column_info *cinfo, const gint el) } } +/* Clear the fence for a column. */ +void +col_clear_fence(column_info *cinfo, const gint el) +{ + int i; + + if (!CHECK_COL(cinfo, el)) + return; + + for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) { + if (cinfo->fmt_matx[i][el]) { + cinfo->col_fence[i] = 0; + } + } +} + /* Gets the text of a column */ const gchar * col_get_text(column_info *cinfo, const gint el) diff --git a/epan/column-utils.h b/epan/column-utils.h index e892e51f37..bc760bea1c 100644 --- a/epan/column-utils.h +++ b/epan/column-utils.h @@ -108,6 +108,16 @@ WS_DLL_PUBLIC void col_set_writable(column_info *cinfo, const gboolean writable) */ WS_DLL_PUBLIC void col_set_fence(column_info *cinfo, const gint col); +/** Clears a fence for the current column content + * + * This can be useful if a protocol wants to remove whatever + * a previous protocol has added to the column. + * + * @param cinfo the current packet row + * @param col the column to use, e.g. COL_INFO + */ +WS_DLL_PUBLIC void col_clear_fence(column_info *cinfo, const gint col); + /** Gets the text of a column element. * * @param cinfo the current packet row