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: "Maynard, Chris" <Christopher.Maynard@xxxxxxxxx>
Date: Tue, 2 Aug 2005 17:50:16 -0400
Hmm.  In the interest of "keeping the tvb API slight and simple ", might
it not be a better idea to simply rename the ephemeral functions back to
the originals?  I'm not sure that ephemeral, transitional, or any other
special designation will help all that much in understanding what the
function does.  Currently, all tvb_get_xyz() functions have simple,
succinct function names such as tvb_get_guint8(), tvb_get_ntohs(), ...
Once everyone becomes accustomed to NOT trying to free the memory from a
call to tvb_get_string(), I think the code will be much more readable
and understandable going forward than by replacing those calls with,
what IMHO, are more cryptic and less understandable function names.  I
think most people will first have to look up ephemeral in the dictionary
to find out what it means, then they'll probably also need to look into
the source code to see what it actually does before being able to use it
with confidence, whereas the original name will be as common and as easy
to use as a call to tvb_get_guint8() is.

Ok, just one man's opinion I guess.  I don't pretend to know better than
the real Ethereal experts, but thanks for "listening". :)
- Chris


-----Original Message-----
From: ethereal-dev-bounces@xxxxxxxxxxxx
[mailto:ethereal-dev-bounces@xxxxxxxxxxxx] On Behalf Of Ulf Lamping
Sent: Tuesday, August 02, 2005 5:22 PM
To: Ethereal development
Subject: Re: [Ethereal-dev] ememification of tvb_get_tring() and friends

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

_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev

-----------------------------------------
This email may contain confidential and privileged material for the
sole use of the intended recipient(s). Any review, use, retention,
distribution or disclosure by others is strictly prohibited. If you are
not the intended recipient (or authorized to receive for the
recipient), please contact the sender by reply email and delete all
copies of this message. Also, email is susceptible to data corruption,
interception, tampering, unauthorized amendment and viruses. We only
send and receive emails on the basis that we are not liable for any
such corruption, interception, tampering, amendment or viruses or any
consequence thereof.