postgresql/contrib/intarray
Tom Lane 220db7ccd8 Simplify and standardize conversions between TEXT datums and ordinary C
strings.  This patch introduces four support functions cstring_to_text,
cstring_to_text_with_len, text_to_cstring, and text_to_cstring_buffer, and
two macros CStringGetTextDatum and TextDatumGetCString.  A number of
existing macros that provided variants on these themes were removed.

Most of the places that need to make such conversions now require just one
function or macro call, in place of the multiple notational layers that used
to be needed.  There are no longer any direct calls of textout or textin,
and we got most of the places that were using handmade conversions via
memcpy (there may be a few still lurking, though).

This commit doesn't make any serious effort to eliminate transient memory
leaks caused by detoasting toasted text objects before they reach
text_to_cstring.  We changed PG_GETARG_TEXT_P to PG_GETARG_TEXT_PP in a few
places where it was easy, but much more could be done.

Brendan Jurd and Tom Lane
2008-03-25 22:42:46 +00:00
..
bench Add CVS tag lines to files that were lacking them. 2006-03-11 04:38:42 +00:00
data 1. Fixed error with empty array ( '{}' ), 2001-08-04 19:35:32 +00:00
expected Remove ill-considered (not to mention undocumented) attempt to make 2007-09-14 03:25:31 +00:00
sql Remove ill-considered (not to mention undocumented) attempt to make 2007-09-14 03:25:31 +00:00
Makefile Remove references to READMEs from /contrib Makefiles. 2007-11-10 23:59:52 +00:00
_int.h Modify LOOPBYTE/LOOPBIT macros to be more logical; rather than have the 2007-11-16 00:13:02 +00:00
_int.sql.in Add CVS version labels to all install/uninstall scripts. 2007-11-13 04:24:29 +00:00
_int_bool.c Simplify and standardize conversions between TEXT datums and ordinary C 2008-03-25 22:42:46 +00:00
_int_gin.c pgindent run for 8.3. 2007-11-15 21:14:46 +00:00
_int_gist.c Re-run pgindent with updated list of typedefs. (Updated README should 2007-11-15 22:25:18 +00:00
_int_op.c Magic blocks don't do us any good unless we use 'em ... so install one 2006-05-30 22:12:16 +00:00
_int_tool.c Replace direct assignments to VARATT_SIZEP(x) with SET_VARSIZE(x, len). 2007-02-27 23:48:10 +00:00
_intbig_gist.c Run pgindent on remaining files now that LOOPBYTE is a usable macro. 2007-11-16 01:12:24 +00:00
uninstall__int.sql Add CVS version labels to all install/uninstall scripts. 2007-11-13 04:24:29 +00:00