Ethereal-dev: Re: [Ethereal-dev] ememification of tvb_get_tring() and friends

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

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Tue, 02 Aug 2005 23:22:08 +0200
Maynard, Chris wrote:

Since the "ephemeral" names are transitional only, I don't think it
matters too much, since eventually they will be renamed back to their
originals without the "ephemeral" designation anyway.  Or has that idea
changed?
As far as I understood Ronnie, this will be the permanent names in the "future".

The only other comment I would like to make is that if we do end up with
a 2nd set of functions designed to malloc() memory for the string (or
whatever the case may be), that the names are much more explicit.  For
example, I personally think that something like
tvb_get_malloced_string(), or perhaps even more simply
tvb_malloc_string(), are much clearer names for what this function would
do.  I think this makes things crystal clear that when this function is
called, memory will be allocated for the string, and it will therefore
need to be manually freed by the caller at some point.
As Ronnie stated, these function would be rarely used.

In these rare cases, a separate call to g_strdup() might be a better idea to keep the tvb API slight and simple ...

Regards, ULFL