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

From Bruce Momjian
Subject Re: Text <-> C string
Date
Msg-id 200803251805.m2PI5wu07323@momjian.us
Whole thread Raw
In response to Re: Text <-> C string  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> > A text_to_cstring_with_len() or text_to_cstring_limit() might be more
> > to the point, and more consistent with the other functions in the
> > family.
> 
> Hmm.  The thing that's bothering me is that the length is the size
> of the *destination*, which is not like cstring_to_text_with_len,
> so using a closely similar name might be confusing.  Of those two
> I'd go with text_to_cstring_limit.  Another thought that comes to
> mind is
> 
> void text_to_cstring_buffer(const text *src, char *dst, size_t dst_len)

I think I like buffer.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://postgres.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: Sam Mason
Date:
Subject: Re: writing a MIN(RECORD) aggregate
Next
From: Alvaro Herrera
Date:
Subject: Re: Text <-> C string