2 * Routines for handling column preferences
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
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.
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.
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.
38 #include <epan/timestamp.h>
39 #include <epan/prefs.h>
40 #include <epan/nstime.h>
41 #include <epan/dfilter/dfilter.h>
42 #include <epan/column.h>
43 #include <epan/packet.h>
45 /* Given a format number (as defined in column_info.h), returns its equivalent
48 col_format_to_string(const gint fmt) {
49 const gchar *slist[] = {
50 "%q", /* 0) COL_8021Q_VLAN_ID */
51 "%Yt", /* 1) COL_ABS_DATE_TIME */
52 "%At", /* 2) COL_ABS_TIME */
53 "%c", /* 3) COL_CIRCUIT_ID */
54 "%Xd", /* 4) COL_DSTIDX */
55 "%Xs", /* 5) COL_SRCIDX */
56 "%V", /* 6) COL_VSAN */
57 "%B", /* 7) COL_CUMULATIVE_BYTES */
58 "%Cus", /* 8) COL_CUSTOM */
59 "%y", /* 9) COL_DCE_CALL */
60 "%z", /* 10) COL_DCE_CTX */
61 "%Tt", /* 11) COL_DELTA_TIME */
62 "%dct", /* 12) COL_DELTA_CONV_TIME */
63 "%Gt", /* 13) COL_DELTA_TIME_DIS */
64 "%rd", /* 14) COL_RES_DST */
65 "%ud", /* 15) COL_UNRES_DST */
66 "%rD", /* 16) COL_RES_DST_PORT */
67 "%uD", /* 17) COL_UNRES_DST_PORT */
68 "%d", /* 18) COL_DEF_DST */
69 "%D", /* 19) COL_DEF_DST_PORT */
70 "%a", /* 20) COL_EXPERT */
71 "%I", /* 21) COL_IF_DIR */
72 "%XO", /* 22) COL_OXID */
73 "%XR", /* 23) COL_RXID */
74 "%C", /* 24) !! DEPRECATED !! - COL_FR_DLCI */
75 "%F", /* 25) COL_FREQ_CHAN */
76 "%l", /* 26) !! DEPRECATED !! - COL_BSSGP_TLLI */
77 "%P", /* 27) !! DEPRECATED !! - COL_HPUX_DEVID */
78 "%H", /* 28) !! DEPRECATED !! - COL_HPUX_SUBSYS */
79 "%hd", /* 29) COL_DEF_DL_DST */
80 "%hs", /* 30) COL_DEF_DL_SRC */
81 "%rhd", /* 31) COL_RES_DL_DST */
82 "%uhd", /* 32) COL_UNRES_DL_DST */
83 "%rhs", /* 33) COL_RES_DL_SRC*/
84 "%uhs", /* 34) COL_UNRES_DL_SRC */
85 "%e", /* 35) COL_RSSI */
86 "%x", /* 36) COL_TX_RATE */
87 "%f", /* 37) COL_DSCP_VALUE */
88 "%i", /* 38) COL_INFO */
89 "%U", /* 39) !! DEPRECATED !! - COL_COS_VALUE */
90 "%rnd", /* 40) COL_RES_NET_DST */
91 "%und", /* 41) COL_UNRES_NET_DST */
92 "%rns", /* 42) COL_RES_NET_SRC */
93 "%uns", /* 43) COL_UNRES_NET_SRC */
94 "%nd", /* 44) COL_DEF_NET_DST */
95 "%ns", /* 45) COL_DEF_NET_SRC */
96 "%m", /* 46) COL_NUMBER */
97 "%L", /* 47) COL_PACKET_LENGTH */
98 "%p", /* 48) COL_PROTOCOL */
99 "%Rt", /* 49) COL_REL_TIME */
100 "%rct", /* 50) !! DEPRECATED !! - COL_REL_CONV_TIME */
101 "%s", /* 51) COL_DEF_SRC */
102 "%S", /* 52) COL_DEF_SRC_PORT */
103 "%rs", /* 53) COL_RES_SRC */
104 "%us", /* 54) COL_UNRES_SRC */
105 "%rS", /* 55) COL_RES_SRC_PORT */
106 "%uS", /* 56) COL_UNRES_SRC_PORT */
107 "%E", /* 57) COL_TEI */
108 "%t" /* 58) COL_CLS_TIME */
111 if (fmt < 0 || fmt >= NUM_COL_FMTS)
117 /* Given a format number (as defined in column_info.h), returns its
119 static const gchar *dlist[NUM_COL_FMTS] = {
120 "802.1Q VLAN id", /* 0) COL_8021Q_VLAN_ID */
121 "Absolute date and time", /* 1) COL_ABS_DATE_TIME */
122 "Absolute time", /* 2) COL_ABS_TIME */
123 "Circuit ID", /* 3) COL_CIRCUIT_ID */
124 "Cisco Dst PortIdx", /* 4) COL_DSTIDX */
125 "Cisco Src PortIdx", /* 5) COL_SRCIDX */
126 "Cisco VSAN", /* 6) COL_VSAN */
127 "Cumulative Bytes" , /* 7) COL_CUMULATIVE_BYTES */
128 "Custom", /* 8) COL_CUSTOM */
129 "DCE/RPC call (cn_call_id / dg_seqnum)", /* 9) COL_DCE_CALL */
130 "DCE/RPC context ID (cn_ctx_id)", /* 10) COL_DCE_CTX */
131 "Delta time", /* 11) COL_DELTA_TIME */
132 "Delta time (conversation)", /* 12) COL_DELTA_CONV_TIME */
133 "Delta time displayed", /* 13) COL_DELTA_TIME_DIS */
134 "Dest addr (resolved)", /* 14) COL_RES_DST */
135 "Dest addr (unresolved)", /* 15) COL_UNRES_DST */
136 "Dest port (resolved)", /* 16) COL_RES_DST_PORT */
137 "Dest port (unresolved)", /* 17) COL_UNRES_DST_PORT */
138 "Destination address", /* 18) COL_DEF_DST */
139 "Destination port", /* 19) COL_DEF_DST_PORT */
140 "Expert Info Severity", /* 20) COL_EXPERT */
141 "FW-1 monitor if/direction", /* 21) COL_IF_DIR */
142 "Fibre Channel OXID", /* 22) COL_OXID */
143 "Fibre Channel RXID", /* 23) COL_RXID */
144 "Frame Relay DLCI", /* 24) !! DEPRECATED !! - COL_FR_DLCI */
145 "Frequency/Channel", /* 25) COL_FREQ_CHAN */
146 "GPRS BSSGP TLLI", /* 26) !! DEPRECATED !! - COL_BSSGP_TLLI */
147 "HP-UX Device ID", /* 27) !! DEPRECATED !! - COL_HPUX_DEVID */
148 "HP-UX Subsystem", /* 28) !! DEPRECATED !! - COL_HPUX_SUBSYS */
149 "Hardware dest addr", /* 29) COL_DEF_DL_DST */
150 "Hardware src addr", /* 30) COL_DEF_DL_SRC */
151 "Hw dest addr (resolved)", /* 31) COL_RES_DL_DST */
152 "Hw dest addr (unresolved)", /* 32) COL_UNRES_DL_DST */
153 "Hw src addr (resolved)", /* 33) COL_RES_DL_SRC*/
154 "Hw src addr (unresolved)", /* 34) COL_UNRES_DL_SRC */
155 "IEEE 802.11 RSSI", /* 35) COL_RSSI */
156 "IEEE 802.11 TX rate", /* 36) COL_TX_RATE */
157 "IP DSCP Value", /* 37) COL_DSCP_VALUE */
158 "Information", /* 38) COL_INFO */
159 "L2 COS Value (802.1p)", /* 39) !! DEPRECATED !! - COL_COS_VALUE */
160 "Net dest addr (resolved)", /* 40) COL_RES_NET_DST */
161 "Net dest addr (unresolved)", /* 41) COL_UNRES_NET_DST */
162 "Net src addr (resolved)", /* 42) COL_RES_NET_SRC */
163 "Net src addr (unresolved)", /* 43) COL_UNRES_NET_SRC */
164 "Network dest addr", /* 44) COL_DEF_NET_DST */
165 "Network src addr", /* 45) COL_DEF_NET_SRC */
166 "Number", /* 46) COL_NUMBER */
167 "Packet length (bytes)" , /* 47) COL_PACKET_LENGTH */
168 "Protocol", /* 48) COL_PROTOCOL */
169 "Relative time", /* 49) COL_REL_TIME */
170 "Relative time (conversation)", /* 50) !! DEPRECATED !! - COL_REL_CONV_TIME */
171 "Source address", /* 51) COL_DEF_SRC */
172 "Source port", /* 52) COL_DEF_SRC_PORT */
173 "Src addr (resolved)", /* 53) COL_RES_SRC */
174 "Src addr (unresolved)", /* 54) COL_UNRES_SRC */
175 "Src port (resolved)", /* 55) COL_RES_SRC_PORT */
176 "Src port (unresolved)", /* 56) COL_UNRES_SRC_PORT */
177 "TEI", /* 57) COL_TEI */
178 "Time (format as specified)" /* 58) COL_CLS_TIME */
182 col_format_desc(const gint fmt) {
183 g_assert((fmt >= 0) && (fmt < NUM_COL_FMTS));
187 /* Marks each array element true if it can be substituted for the given
190 get_column_format_matches(gboolean *fmt_list, const gint format) {
192 /* Get the obvious: the format itself */
193 if ((format >= 0) && (format < NUM_COL_FMTS))
194 fmt_list[format] = TRUE;
196 /* Get any formats lower down on the chain */
199 fmt_list[COL_RES_DL_SRC] = TRUE;
200 fmt_list[COL_RES_NET_SRC] = TRUE;
203 fmt_list[COL_RES_DL_SRC] = TRUE;
204 fmt_list[COL_RES_NET_SRC] = TRUE;
207 fmt_list[COL_UNRES_DL_SRC] = TRUE;
208 fmt_list[COL_UNRES_NET_SRC] = TRUE;
211 fmt_list[COL_RES_DL_DST] = TRUE;
212 fmt_list[COL_RES_NET_DST] = TRUE;
215 fmt_list[COL_RES_DL_DST] = TRUE;
216 fmt_list[COL_RES_NET_DST] = TRUE;
219 fmt_list[COL_UNRES_DL_DST] = TRUE;
220 fmt_list[COL_UNRES_NET_DST] = TRUE;
223 fmt_list[COL_RES_DL_SRC] = TRUE;
226 fmt_list[COL_RES_DL_DST] = TRUE;
228 case COL_DEF_NET_SRC:
229 fmt_list[COL_RES_NET_SRC] = TRUE;
231 case COL_DEF_NET_DST:
232 fmt_list[COL_RES_NET_DST] = TRUE;
234 case COL_DEF_SRC_PORT:
235 fmt_list[COL_RES_SRC_PORT] = TRUE;
237 case COL_DEF_DST_PORT:
238 fmt_list[COL_RES_DST_PORT] = TRUE;
241 fmt_list[COL_OXID] = TRUE;
244 fmt_list[COL_RXID] = TRUE;
247 fmt_list[COL_IF_DIR] = TRUE;
250 fmt_list[COL_CIRCUIT_ID] = TRUE;
253 fmt_list[COL_SRCIDX] = TRUE;
256 fmt_list[COL_DSTIDX] = TRUE;
259 fmt_list[COL_VSAN] = TRUE;
262 fmt_list[COL_TX_RATE] = TRUE;
265 fmt_list[COL_RSSI] = TRUE;
267 case COL_HPUX_SUBSYS:
268 fmt_list[COL_HPUX_SUBSYS] = TRUE;
271 fmt_list[COL_HPUX_DEVID] = TRUE;
274 fmt_list[COL_DCE_CALL] = TRUE;
277 fmt_list[COL_DCE_CTX] = TRUE;
279 case COL_8021Q_VLAN_ID:
280 fmt_list[COL_8021Q_VLAN_ID] = TRUE;
283 fmt_list[COL_DSCP_VALUE] = TRUE;
286 fmt_list[COL_COS_VALUE] = TRUE;
289 fmt_list[COL_TEI] = TRUE;
292 fmt_list[COL_FR_DLCI] = TRUE;
295 fmt_list[COL_BSSGP_TLLI] = TRUE;
298 fmt_list[COL_EXPERT] = TRUE;
301 fmt_list[COL_FREQ_CHAN] = TRUE;
304 fmt_list[COL_CUSTOM] = TRUE;
311 /* Returns a string representing the longest possible value for
312 a timestamp column type. */
314 get_timestamp_column_longest_string(const gint type, const gint precision)
318 case(TS_ABSOLUTE_WITH_DATE):
320 case(TS_PREC_AUTO_SEC):
321 case(TS_PREC_FIXED_SEC):
322 return "0000-00-00 00:00:00";
324 case(TS_PREC_AUTO_DSEC):
325 case(TS_PREC_FIXED_DSEC):
326 return "0000-00-00 00:00:00.0";
328 case(TS_PREC_AUTO_CSEC):
329 case(TS_PREC_FIXED_CSEC):
330 return "0000-00-00 00:00:00.00";
332 case(TS_PREC_AUTO_MSEC):
333 case(TS_PREC_FIXED_MSEC):
334 return "0000-00-00 00:00:00.000";
336 case(TS_PREC_AUTO_USEC):
337 case(TS_PREC_FIXED_USEC):
338 return "0000-00-00 00:00:00.000000";
340 case(TS_PREC_AUTO_NSEC):
341 case(TS_PREC_FIXED_NSEC):
342 return "0000-00-00 00:00:00.000000000";
345 g_assert_not_reached();
350 case(TS_PREC_AUTO_SEC):
351 case(TS_PREC_FIXED_SEC):
354 case(TS_PREC_AUTO_DSEC):
355 case(TS_PREC_FIXED_DSEC):
358 case(TS_PREC_AUTO_CSEC):
359 case(TS_PREC_FIXED_CSEC):
360 return "00:00:00.00";
362 case(TS_PREC_AUTO_MSEC):
363 case(TS_PREC_FIXED_MSEC):
364 return "00:00:00.000";
366 case(TS_PREC_AUTO_USEC):
367 case(TS_PREC_FIXED_USEC):
368 return "00:00:00.000000";
370 case(TS_PREC_AUTO_NSEC):
371 case(TS_PREC_FIXED_NSEC):
372 return "00:00:00.000000000";
375 g_assert_not_reached();
378 case(TS_RELATIVE): /* fallthrough */
382 case(TS_PREC_AUTO_SEC):
383 case(TS_PREC_FIXED_SEC):
386 case(TS_PREC_AUTO_DSEC):
387 case(TS_PREC_FIXED_DSEC):
390 case(TS_PREC_AUTO_CSEC):
391 case(TS_PREC_FIXED_CSEC):
394 case(TS_PREC_AUTO_MSEC):
395 case(TS_PREC_FIXED_MSEC):
398 case(TS_PREC_AUTO_USEC):
399 case(TS_PREC_FIXED_USEC):
400 return "0000.000000";
402 case(TS_PREC_AUTO_NSEC):
403 case(TS_PREC_FIXED_NSEC):
404 return "0000.000000000";
407 g_assert_not_reached();
411 /* This is enough to represent 2^63 (signed 64-bit integer) + fractions */
413 case(TS_PREC_AUTO_SEC):
414 case(TS_PREC_FIXED_SEC):
415 return "0000000000000000000";
417 case(TS_PREC_AUTO_DSEC):
418 case(TS_PREC_FIXED_DSEC):
419 return "0000000000000000000.0";
421 case(TS_PREC_AUTO_CSEC):
422 case(TS_PREC_FIXED_CSEC):
423 return "0000000000000000000.00";
425 case(TS_PREC_AUTO_MSEC):
426 case(TS_PREC_FIXED_MSEC):
427 return "0000000000000000000.000";
429 case(TS_PREC_AUTO_USEC):
430 case(TS_PREC_FIXED_USEC):
431 return "0000000000000000000.000000";
433 case(TS_PREC_AUTO_NSEC):
434 case(TS_PREC_FIXED_NSEC):
435 return "0000000000000000000.000000000";
438 g_assert_not_reached();
442 return "0000.000000";
445 g_assert_not_reached();
448 /* never reached, satisfy compiler */
452 /* Returns the longer string of the column title or the hard-coded width of
453 * its contents for building the packet list layout. */
455 get_column_width_string(const gint format, const gint col)
457 if(strlen(get_column_longest_string(format)) >
458 strlen(get_column_title(col)))
459 return get_column_longest_string(format);
461 return get_column_title(col);
464 /* Returns a string representing the longest possible value for a
465 particular column type. See also get_column_width_string() above.
467 Except for the COL...SRC and COL...DST columns, these are used
468 only when a capture is being displayed while it's taking place;
469 they are arguably somewhat fragile, as changes to the code that
470 generates them don't cause these widths to change, but that's
471 probably not too big a problem, given that the sizes are
472 recomputed based on the actual data in the columns when the capture
473 is done, and given that the width for COL...SRC and COL...DST columns
474 is somewhat arbitrary in any case. We should probably clean
475 that up eventually, though. */
477 get_column_longest_string(const gint format)
484 return get_timestamp_column_longest_string(timestamp_get_type(), timestamp_get_precision());
486 case COL_ABS_DATE_TIME:
487 return get_timestamp_column_longest_string(TS_ABSOLUTE_WITH_DATE, timestamp_get_precision());
490 return get_timestamp_column_longest_string(TS_ABSOLUTE, timestamp_get_precision());
493 return get_timestamp_column_longest_string(TS_RELATIVE, timestamp_get_precision());
496 return get_timestamp_column_longest_string(TS_DELTA, timestamp_get_precision());
498 case COL_DELTA_TIME_DIS:
499 return get_timestamp_column_longest_string(TS_DELTA_DIS, timestamp_get_precision());
501 case COL_REL_CONV_TIME: /* 'abuse' TS_RELATIVE to set the time format */
502 case COL_DELTA_CONV_TIME: /* for the conversation related time columns */
503 return get_timestamp_column_longest_string(TS_RELATIVE, timestamp_get_precision());
510 case COL_UNRES_DL_SRC:
511 case COL_DEF_NET_SRC:
512 case COL_RES_NET_SRC:
513 case COL_UNRES_NET_SRC:
519 case COL_UNRES_DL_DST:
520 case COL_DEF_NET_DST:
521 case COL_RES_NET_DST:
522 case COL_UNRES_NET_DST:
523 return "00000000.000000000000"; /* IPX-style */
525 case COL_DEF_SRC_PORT:
526 case COL_RES_SRC_PORT:
527 case COL_UNRES_SRC_PORT:
528 case COL_DEF_DST_PORT:
529 case COL_RES_DST_PORT:
530 case COL_UNRES_DST_PORT:
534 return "Protocol"; /* not the longest, but the longest is too long */
536 case COL_PACKET_LENGTH:
539 case COL_CUMULATIVE_BYTES:
547 return "i 00000000 I";
565 case COL_HPUX_SUBSYS:
566 return "OTS9000-TRANSPORT";
577 case COL_8021Q_VLAN_ID:
599 return "9999 MHz [A 999]";
602 return "0000000000"; /* not the longest, but the longest is too long */
604 default: /* COL_INFO */
605 return "Source port: kerberos-master Destination port: kerberos-master";
610 /* Returns the longest possible width, in characters, for a particular
613 get_column_char_width(const gint format)
615 return (gint)strlen(get_column_longest_string(format));
619 get_column_format(const gint col)
621 GList *clp = g_list_nth(prefs.col_list, col);
624 if (!clp) /* Invalid column requested */
627 cfmt = (fmt_data *) clp->data;
629 return(get_column_format_from_str(cfmt->fmt));
633 set_column_format(const gint col, const gint fmt)
635 GList *clp = g_list_nth(prefs.col_list, col);
638 if (!clp) /* Invalid column requested */
641 cfmt = (fmt_data *) clp->data;
644 cfmt->fmt = g_strdup(col_format_to_string(fmt));
648 get_column_format_from_str(const gchar *str)
652 for (i = 0; i < NUM_COL_FMTS; i++) {
653 if (strcmp(str, col_format_to_string(i)) == 0)
656 return -1; /* illegal */
660 get_column_title(const gint col)
662 GList *clp = g_list_nth(prefs.col_list, col);
665 if (!clp) /* Invalid column requested */
668 cfmt = (fmt_data *) clp->data;
674 set_column_title(const gint col, const gchar *title)
676 GList *clp = g_list_nth(prefs.col_list, col);
679 if (!clp) /* Invalid column requested */
682 cfmt = (fmt_data *) clp->data;
684 g_free (cfmt->title);
685 cfmt->title = g_strdup (title);
689 get_column_visible(const gint col)
691 GList *clp = g_list_nth(prefs.col_list, col);
694 if (!clp) /* Invalid column requested */
697 cfmt = (fmt_data *) clp->data;
699 return(cfmt->visible);
703 set_column_visible(const gint col, gboolean visible)
705 GList *clp = g_list_nth(prefs.col_list, col);
708 if (!clp) /* Invalid column requested */
711 cfmt = (fmt_data *) clp->data;
713 cfmt->visible = visible;
717 get_column_resolved(const gint col)
719 GList *clp = g_list_nth(prefs.col_list, col);
722 if (!clp) /* Invalid column requested */
725 cfmt = (fmt_data *) clp->data;
727 return(cfmt->resolved);
731 set_column_resolved(const gint col, gboolean resolved)
733 GList *clp = g_list_nth(prefs.col_list, col);
736 if (!clp) /* Invalid column requested */
739 cfmt = (fmt_data *) clp->data;
741 cfmt->resolved = resolved;
745 get_column_custom_field(const gint col)
747 GList *clp = g_list_nth(prefs.col_list, col);
750 if (!clp) /* Invalid column requested */
753 cfmt = (fmt_data *) clp->data;
755 return(cfmt->custom_field);
759 set_column_custom_field(const gint col, const char *custom_field)
761 GList *clp = g_list_nth(prefs.col_list, col);
764 if (!clp) /* Invalid column requested */
767 cfmt = (fmt_data *) clp->data;
769 g_free (cfmt->custom_field);
770 cfmt->custom_field = g_strdup (custom_field);
774 get_column_custom_occurrence(const gint col)
776 GList *clp = g_list_nth(prefs.col_list, col);
779 if (!clp) /* Invalid column requested */
782 cfmt = (fmt_data *) clp->data;
784 return(cfmt->custom_occurrence);
788 set_column_custom_occurrence(const gint col, const gint custom_occurrence)
790 GList *clp = g_list_nth(prefs.col_list, col);
793 if (!clp) /* Invalid column requested */
796 cfmt = (fmt_data *) clp->data;
798 cfmt->custom_occurrence = custom_occurrence;
802 build_column_format_array(column_info *cinfo, const gint num_cols, const gboolean reset_fences)
806 /* Build the column format array */
807 col_setup(cinfo, num_cols);
809 for (i = 0; i < cinfo->num_cols; i++) {
810 cinfo->col_fmt[i] = get_column_format(i);
811 cinfo->col_title[i] = g_strdup(get_column_title(i));
813 if (cinfo->col_fmt[i] == COL_CUSTOM) {
814 cinfo->col_custom_field[i] = g_strdup(get_column_custom_field(i));
815 cinfo->col_custom_occurrence[i] = get_column_custom_occurrence(i);
816 if(!dfilter_compile(cinfo->col_custom_field[i], &cinfo->col_custom_dfilter[i])) {
817 /* XXX: Should we issue a warning? */
818 g_free(cinfo->col_custom_field[i]);
819 cinfo->col_custom_field[i] = NULL;
820 cinfo->col_custom_occurrence[i] = 0;
821 cinfo->col_custom_dfilter[i] = NULL;
824 cinfo->col_custom_field[i] = NULL;
825 cinfo->col_custom_occurrence[i] = 0;
826 cinfo->col_custom_dfilter[i] = NULL;
829 cinfo->fmt_matx[i] = (gboolean *) g_malloc0(sizeof(gboolean) * NUM_COL_FMTS);
830 get_column_format_matches(cinfo->fmt_matx[i], cinfo->col_fmt[i]);
831 cinfo->col_data[i] = NULL;
833 if (cinfo->col_fmt[i] == COL_INFO)
834 cinfo->col_buf[i] = (gchar *) g_malloc(sizeof(gchar) * COL_MAX_INFO_LEN);
836 cinfo->col_buf[i] = (gchar *) g_malloc(sizeof(gchar) * COL_MAX_LEN);
839 cinfo->col_fence[i] = 0;
841 cinfo->col_expr.col_expr[i] = (gchar *) g_malloc(sizeof(gchar) * COL_MAX_LEN);
842 cinfo->col_expr.col_expr_val[i] = (gchar *) g_malloc(sizeof(gchar) * COL_MAX_LEN);
845 cinfo->col_expr.col_expr[i] = NULL;
846 cinfo->col_expr.col_expr_val[i] = NULL;
848 for (i = 0; i < cinfo->num_cols; i++) {
851 for (j = 0; j < NUM_COL_FMTS; j++) {
852 if (!cinfo->fmt_matx[i][j])
855 if (cinfo->col_first[j] == -1)
856 cinfo->col_first[j] = i;
858 cinfo->col_last[j] = i;