Re: Text <-> C string

From: Volkan YAZICI <yazicivo(at)ttmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Text <-> C string
Date: 2008-03-19 17:55:22
Message-ID: 87y78e7g51.fsf@alamut.mobiliz.com.tr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Wed, 19 Mar 2008, Sam Mason <sam(at)samason(dot)me(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2008-03-19 18:07:29 Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that
Previous Message Sam Mason 2008-03-19 17:44:36 Re: [PATCHES] Text <-> C string

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2008-03-19 18:16:44 Re: Final Thoughts for 8.3 on LWLocking and Scalability
Previous Message Sam Mason 2008-03-19 17:44:36 Re: [PATCHES] Text <-> C string