summaryrefslogtreecommitdiff
path: root/contrib/xml2/xpath.c
AgeCommit message (Collapse)Author
2008-03-25Simplify and standardize conversions between TEXT datums and ordinary CTom Lane
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
2007-07-15Fix a passel of signed vs unsigned char warnings.Tom Lane
2007-02-27Replace direct assignments to VARATT_SIZEP(x) with SET_VARSIZE(x, len).Tom Lane
Get rid of VARATT_SIZE and VARATT_DATA, which were simply redundant with VARSIZE and VARDATA, and as a consequence almost no code was using the longer names. Rename the length fields of struct varlena and various derived structures to catch anyplace that was accessing them directly; and clean up various places so caught. In itself this patch doesn't change any behavior at all, but it is necessary infrastructure if we hope to play any games with the representation of varlena headers. Greg Stark and Tom Lane
2006-10-04pgindent run for 8.2.Bruce Momjian
2006-09-16Rename xml_valid() to xml_is_well_formed(), but provide a temporaryTom Lane
alias with the old name for backwards compatibility. Per discussion, the old name is actively wrong because validity and well-formedness have different meanings in XML.
2006-09-11Move xml2's PG_MODULE_MAGIC block to the right source file, per Michael Fuhr.Tom Lane
2006-05-23Remove CXT_printf/CXT1_printf macros. If anyone had found them to be ofTom Lane
any use in the past many years, we'd have made some effort to include them in all executor node types; but in fact they were only in nodeAppend.c and nodeIndexscan.c, up until I copied nodeIndexscan.c's occurrence into the new bitmap node types. Remove some other unused macros in execdebug.h, too. Some day the whole header probably ought to go away in favor of better-designed facilities.
2006-03-01Attached is a patch that replaces a bunch of places where StringInfosNeil Conway
are unnecessarily allocated on the heap rather than the stack. If the StringInfo doesn't outlive the stack frame in which it is created, there is no need to allocate it on the heap via makeStringInfo() -- stack allocation is faster. While it's not a big deal unless the code is in a critical path, I don't see a reason not to save a few cycles -- using stack allocation is not less readable. I also cleaned up a bit of code along the way: moved variable declarations into a more tightly-enclosing scope where possible, fixed some pointless copying of strings in dblink, etc.
2006-03-01This patch makes the error message strings throughout the backendNeil Conway
more compliant with the error message style guide. In particular, errdetail should begin with a capital letter and end with a period, whereas errmsg should not. I also fixed a few related issues in passing, such as fixing the repeated misspelling of "lexeme" in contrib/tsearch2 (per Tom's suggestion).
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
2005-07-09Fix inadequate error checking: you can't assume that fcinfo->resultinfoTom Lane
is a ReturnSetInfo unless you've tested it with IsA.
2005-01-09Fix segfault when xpath_list function is applied to an invalid document.Tom Lane
John Gray
2004-12-02Attached is a patch that adds the function xml_encode_special_chars toBruce Momjian
the xml2 contrib module. It's against 8.0beta4. It's intended for commit. Markus Bertheau <[email protected]>
2004-10-13Cleanup some unnecessary void * casts when using pfree() in contrib/xmlNeil Conway
and contrib/xml2
2004-08-29Pgindent run for 8.0.Bruce Momjian
2004-03-07contrib/xml2 updates from John Gray:Neil Conway
I have changed the name of the new parse function to xml_valid and fixed a reference to SortMem which meant that the code as supplied would work against 7.3 and 7.4 but wouldn't work in CVS.
2004-03-05Move new version of contrib/ xml into xml2, keep old version in /xml.Bruce Momjian