Ethereal-dev: Re: [Ethereal-dev] Adding list-type data to a column

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Olivier Biot" <ethereal@xxxxxxxxxx>
Date: Fri, 6 Feb 2004 01:02:38 +0100
I just checked this in. Thanks for the feedback! Developers now can
use the following methods too: col_append_sep_str() and
col_append_sep_fstr() which take the separator as 3rd function
argument. Both methods will print the separator only if the column is
empty.

Both methods are useful in conjunction with encapsulation of PDUs.

Regards,

Olivier
----- Original Message ----- 
From: Guy Harris

|
| On Feb 5, 2004, at 3:32 PM, Olivier Biot wrote:
|
| > Should the check for the start of the column data be:
| >   if (cinfo->col_data[0]) {
| >     col_append_str(cinfo, el, separator ? separator : ", ");
| >   }
| > or should I use cinfo->col_buf[0] in the conditional addition of
the
| > separator?
|
| If you're appending to a column, then either the column was set by
| "col_set_str()", in which case the string pointed to by "col_data"
has
| to be copied to "col_buf", or it wasn't set by "col_set_str()" or
has
| subsequently be changed by another "col_" routine, in which case
| "col_data" just points to "col_buf".
|
| That's handled by "COL_CHECK_APPEND()".
|
| Therefore, it's just a matter of style; "col_append_str()" and
| "col_append_fstr()" use "col_buf", so I'd use "col_buf".  (The idea
is
| that you're updating the buffer.)