Re: [PATCHES] Text <-> C string - Mailing list pgsql-hackers

From Sam Mason
Subject Re: [PATCHES] Text <-> C string
Date
Msg-id 20080319174436.GC6870@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to Re: [PATCHES] Text <-> C string  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Text <-> C string  (Volkan YAZICI <yazicivo@ttmail.com>)
List pgsql-hackers
On Wed, Mar 19, 2008 at 12:51:35PM -0400, Tom Lane wrote:
> "Brendan Jurd" <direvus@gmail.com> writes:
> > char * text_cstring(const text *t)
> 
> What do people think of text_to_cstring?

I tend to put things the other way around in my code, i.e:
 char * cstring_of_text(const text *t)

mainly because things read more easily---type definitions of new
variables are next to the first part of the word.
 char * str = cstring_of_text(src_text);
vs. char * str = text_to_cstring(src_text);

I think I got my original inspiration for doing it this way around from
the Caml language.

 Sam


pgsql-hackers by date:

Previous
From: Michael Meskes
Date:
Subject: Re: Request for feature - ECPGget_PGconn
Next
From: Volkan YAZICI
Date:
Subject: Re: Text <-> C string