postgresql/src/backend/tsearch
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
..
Makefile Refactor backend makefiles to remove lots of duplicate code 2008-02-19 10:30:09 +00:00
dict.c Simplify and standardize conversions between TEXT datums and ordinary C 2008-03-25 22:42:46 +00:00
dict_ispell.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
dict_simple.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
dict_synonym.c Add a CaseSensitive parameter to synonym dictionaries. 2008-03-10 03:01:28 +00:00
dict_thesaurus.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
hunspell_sample.affix Add regression tests for ispell, synonym and thesaurus dictionaries. 2007-09-11 11:54:42 +00:00
ispell_sample.affix Add regression tests for ispell, synonym and thesaurus dictionaries. 2007-09-11 11:54:42 +00:00
ispell_sample.dict Add regression tests for ispell, synonym and thesaurus dictionaries. 2007-09-11 11:54:42 +00:00
regis.c Fix RS_isRegis() to agree exactly with RS_compile()'s idea of what's a valid 2008-01-21 02:46:11 +00:00
spell.c Fix RS_isRegis() to agree exactly with RS_compile()'s idea of what's a valid 2008-01-21 02:46:11 +00:00
synonym_sample.syn Add regression tests for ispell, synonym and thesaurus dictionaries. 2007-09-11 11:54:42 +00:00
thesaurus_sample.ths Have text search thesaurus files use "?" for stop words. 2007-11-10 15:39:34 +00:00
to_tsany.c Simplify and standardize conversions between TEXT datums and ordinary C 2008-03-25 22:42:46 +00:00
ts_locale.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
ts_parse.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
ts_utils.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
wparser.c Tweak new error message to conform to style guidelines. 2008-01-15 18:22:47 +00:00
wparser_def.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00