"Brendan Jurd" <direvus@gmail.com> writes:
> On 26/03/2008, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> ... What I think is more useful is
>> a strlcpy()-like function that copies into a caller-supplied buffer
>> of limited size. For lack of a better idea I propose defining it
>> *exactly* like strlcpy:
>>
>> extern size_t textlcpy(char *dst, const text *src, size_t siz);
> I'm all for providing a function with this behaviour, but is
> textlcpy() a bit ambiguous?
Fair enough, I'm not wedded to that name. Search-and-replace is
still easy enough at this point ...
> 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)
Anyone have other ideas?
regards, tom lane