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

From Volkan YAZICI
Subject Re: Text <-> C string
Date
Msg-id 87y78e7g51.fsf@alamut.mobiliz.com.tr
Whole thread Raw
In response to Re: [PATCHES] Text <-> C string  (Sam Mason <sam@samason.me.uk>)
Responses Re: Text <-> C string
List pgsql-hackers
On Wed, 19 Mar 2008, Sam Mason <sam@samason.me.uk> writes:
> ...
>   char * str = cstring_of_text(src_text);
> ...
>
> I think I got my original inspiration for doing it this way around from
> the Caml language.

Also, used in Common Lisp as class accessors:
 char *s = cstring_of(text); text *t = text_of(cstring);

But I'd vote for TextPGetCString style Tom suggested for the eye-habit
compatibility with the rest of the code.


Regards.


pgsql-hackers by date:

Previous
From: Sam Mason
Date:
Subject: Re: [PATCHES] Text <-> C string
Next
From: Andrew Dunstan
Date:
Subject: Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that