diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-04-16 05:55:41 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-04-16 05:55:41 +0000 |
commit | be87c92de895566695252a4b704efa395289dd66 (patch) | |
tree | 5963fd73ddd1bb1d6a67b13bafebe4ab5a0b96c7 /epan/column-utils.c | |
parent | 14183154957e431e7b63c8551f6cdfe4c4386680 (diff) |
Pull the stuff done in "dissect_packet()" to initialize a column_info
structure into its own routine; rename "col_init()" to "col_setup()",
and call the new routine "col_init()".
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7467 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/column-utils.c')
-rw-r--r-- | epan/column-utils.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/epan/column-utils.c b/epan/column-utils.c index 006b66d509..5a7b0cf3cd 100644 --- a/epan/column-utils.c +++ b/epan/column-utils.c @@ -1,7 +1,7 @@ /* column-utils.c * Routines for column utilities. * - * $Id: column-utils.c,v 1.33 2003/04/16 04:52:52 guy Exp $ + * $Id: column-utils.c,v 1.34 2003/04/16 05:55:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -48,7 +48,7 @@ /* Allocate all the data structures for constructing column data, given the number of columns. */ void -col_init(column_info *col_info, gint num_cols) +col_setup(column_info *col_info, gint num_cols) { col_info->num_cols = num_cols; col_info->col_fmt = (gint *) g_malloc(sizeof(gint) * num_cols); @@ -62,6 +62,22 @@ col_init(column_info *col_info, gint num_cols) col_info->col_expr_val = (gchar **) g_malloc(sizeof(gchar *) * num_cols); } +/* Initialize the data structures for constructing column data. */ +void +col_init(column_info *cinfo) +{ + int i; + + for (i = 0; i < cinfo->num_cols; i++) { + cinfo->col_buf[i][0] = '\0'; + cinfo->col_data[i] = cinfo->col_buf[i]; + cinfo->col_fence[i] = 0; + cinfo->col_expr[i][0] = '\0'; + cinfo->col_expr_val[i][0] = '\0'; + } + cinfo->writable = TRUE; +} + gboolean col_get_writable(column_info *cinfo) { |