diff --git a/ChangeLog b/ChangeLog index 9cb1e544..bf402128 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +Sun Feb 13 16:15:03 HKT 2005 William Brack + + This change started out as a simple desire to speed up the + execution time of testapi.c, which was being delayed by + nameserver requests for non-existent URL's. From there it + just sort of grew, and grew.... + * nanohttp.c, nanoftp.c: changed the processing of URL's + to use the uri.c routines instead of custom code. + * include/libxml/xmlerror.h: added code XML_FTP_URL_SYNTAX + * uri.c: added accepting ipV6 addresses, in accordance with + RFC's 2732 and 2373 (TODO: allow ipV4 within ipV6) + * gentest.py, testapi.c: fixed a few problems with the + testing of the nanoftp and nanohttp routines. + * include/libxml/xmlversion.h: minor change to fix a + warning on the docs generation + * regenerated the docs + Sat Feb 12 09:07:11 HKT 2005 William Brack * xinclude.c: fixed xmlXIncludeParseFile to prevent diff --git a/doc/APIchunk0.html b/doc/APIchunk0.html index 997b59b3..805f11c7 100644 --- a/doc/APIchunk0.html +++ b/doc/APIchunk0.html @@ -242,6 +242,7 @@ A:link, A:visited, A:active { text-decoration: underline }
Bopomofo
xmlUCSIsBopomofo
BopomofoExtended
xmlUCSIsBopomofoExtended
Both
XML_SUBSTITUTE_BOTH
+xmlStreamPush
BoxDrawing
xmlUCSIsBoxDrawing
BraillePatterns
xmlUCSIsBraillePatterns
Buffer
xmlIOParseDTD
diff --git a/doc/APIchunk10.html b/doc/APIchunk10.html index f890431e..4133b119 100644 --- a/doc/APIchunk10.html +++ b/doc/APIchunk10.html @@ -52,6 +52,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSaveFileTo
xmlSaveFormatFileTo
xmlSetEntityReferenceFunc
+xmlStreamPush
xmlTextReaderCurrentDoc
xmlTextReaderExpand
xmlTextReaderSetErrorHandler
@@ -218,7 +219,6 @@ A:link, A:visited, A:active { text-decoration: underline }
checking
xlinkIsLink
xmlBufferWriteQuotedString
xmlBuildURI
-xmlMemFree
xmlUTF8Strlen
checkings
xmlValidateOneElement
checks
XML_SCHEMAS_ATTRGROUP_MARKED
@@ -330,6 +330,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlBuildRelativeURI
xmlSAX2GetSystemId
combining
IS_COMBINING_CH
+
come
xmlStreamPush
coment
xmlTextWriterEndComment
comes
xmlValidityErrorFunc
xmlValidityWarningFunc
@@ -504,7 +505,8 @@ A:link, A:visited, A:active { text-decoration: underline }
comprising
xmlXPathIntersection
computation
xmlXPathOrderDocElems
compute
xmlUTF8Strlen
-
computed
_xmlEntity
+
computed
XML_SCHEMAS_TYPE_FACETSNEEDVALUE
+_xmlEntity
xmlByteConsumed
xmlSchemaValPredefTypeNode
xmlSchemaValPredefTypeNodeNoNorm
diff --git a/doc/APIchunk11.html b/doc/APIchunk11.html index 777baa94..4de67275 100644 --- a/doc/APIchunk11.html +++ b/doc/APIchunk11.html @@ -358,6 +358,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlDictCreateSub
xmlDictReference
xmlHashCreateDict
+xmlStreamPush
dictionnary
_xmlParserCtxt
_xmlXPathContext
xmlDictCreate
@@ -370,6 +371,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlDictReference
xmlDictSize
xmlPatterncompile
+xmlStreamPush
did
XML_SCHEMAS_TYPE_BLOCK_DEFAULT
xmlTextReaderGetRemainder
xmlTextReaderStandalone
diff --git a/doc/APIchunk12.html b/doc/APIchunk12.html index fd7812da..b6e80df7 100644 --- a/doc/APIchunk12.html +++ b/doc/APIchunk12.html @@ -231,11 +231,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlListDataCompare
equivalent
xmlMallocAtomicLoc
xmlMallocLoc
-xmlMemFree
-xmlMemMalloc
-xmlMemRealloc
xmlMemStrdupLoc
-xmlMemoryStrdup
xmlNodeListGetRawString
xmlNodeListGetString
xmlReallocLoc
@@ -363,6 +359,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaNewMemParserCtxt
xmlSchemaNewParserCtxt
xmlSchemaValidateListSimpleTypeFacet
+xmlStreamPush
explicitly
xmlSAXDefaultVersion
explored
xmlXPathAxisFunc
exposing
xmlTextReaderRead
@@ -384,7 +381,8 @@ A:link, A:visited, A:active { text-decoration: underline } xlinkExtendedLinkSetFunk
xmlXPathNodeSetMerge
xmlXPtrLocationSetMerge
-
extension
XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION
+
extension
LIBXML_MODULE_EXTENSION
+XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION
XML_SCHEMAS_ELEM_FINAL_EXTENSION
XML_SCHEMAS_FINAL_DEFAULT_EXTENSION
XML_SCHEMAS_TYPE_BLOCK_EXTENSION
diff --git a/doc/APIchunk13.html b/doc/APIchunk13.html index d43cd9a6..1db52ff6 100644 --- a/doc/APIchunk13.html +++ b/doc/APIchunk13.html @@ -48,7 +48,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaValidateFacet
xmlSchemaValidateLengthFacet
xmlSchemaValidateListSimpleTypeFacet
-
facets
xmlSchemaCheckFacet
+
facets
XML_SCHEMAS_TYPE_FACETSNEEDVALUE
+xmlSchemaCheckFacet
fail
xmlC14NDocDumpMemory
xmlC14NDocSave
xmlC14NDocSaveTo
@@ -99,6 +100,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNanoHTTPOpenRedir
xmlNanoHTTPSave
xmlNewAutomata
+xmlPatternGetStreamCtxt
xmlPatternMatch
xmlRelaxNGGetParserErrors
xmlSaveFile
diff --git a/doc/APIchunk15.html b/doc/APIchunk15.html index 03cff701..fc016a7a 100644 --- a/doc/APIchunk15.html +++ b/doc/APIchunk15.html @@ -211,7 +211,9 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNanoHTTPMethodRedir
xmlNanoHTTPOpen
xmlNanoHTTPOpenRedir
-
indicates
xmlHasNsProp
+xmlStreamPush
+
indicates
XML_SCHEMAS_TYPE_FACETSNEEDVALUE
+xmlHasNsProp
xmlNanoFTPRead
xmlNanoFTPScanProxy
xmlNanoFTPUpdateURL
@@ -246,10 +248,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlInitNodeInfoSeq
xmlMallocAtomicLoc
xmlMallocLoc
-xmlMemMalloc
-xmlMemRealloc
xmlMemStrdupLoc
-xmlMemoryStrdup
xmlNanoFTPList
xmlParserAddNodeInfo
xmlParserFindNodeInfo
@@ -316,9 +315,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlAutomataGetInitState
xmlBufferCreateSize
xmlInitNodeInfoSeq
-xmlMemRealloc
xmlMemStrdupLoc
-xmlMemoryStrdup
xmlReallocLoc
xmlShell
xmlXPathNodeSetAdd
diff --git a/doc/APIchunk16.html b/doc/APIchunk16.html index 53bb9181..a44bb858 100644 --- a/doc/APIchunk16.html +++ b/doc/APIchunk16.html @@ -95,8 +95,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCharEncodingOutputFunc
xmlMallocAtomicLoc
xmlMallocLoc
-xmlMemMalloc
-xmlMemRealloc
xmlReallocLoc
lang
xmlNodeGetLang
xmlXPathLangFunction
@@ -176,6 +174,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNodeDump
xmlNodeDumpOutput
xmlShellPwd
+xmlStreamPop
xmlXPathDebugDumpCompExpr
xmlXPathDebugDumpObject
lexical
xmlParseDefaultDecl
@@ -329,10 +328,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlUnlockLibrary
logging
xmlMallocAtomicLoc
xmlMallocLoc
-xmlMemMalloc
-xmlMemRealloc
xmlMemStrdupLoc
-xmlMemoryStrdup
xmlReallocLoc
long
IS_BASECHAR
IS_COMBINING
diff --git a/doc/APIchunk17.html b/doc/APIchunk17.html index 74b905ac..af4cb7ee 100644 --- a/doc/APIchunk17.html +++ b/doc/APIchunk17.html @@ -61,7 +61,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlMallocFunc
xmlMallocLoc
xmlMemGet
-xmlMemMalloc
xmlMemSetup
mallocAtomicFunc
xmlGcMemGet
xmlGcMemSetup
@@ -140,6 +139,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCheckUTF8
means
xmlSetGenericErrorFunc
xmlSetStructuredErrorFunc
+xmlStreamPush
mechanism
_xmlXPathContext
xmlStructuredErrorFunc
xmlXPathRegisterFuncLookup
@@ -258,6 +258,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlModuleSymbol
xmlOutputMatchCallback
xmlStructuredErrorFunc
+
modules
LIBXML_MODULE_EXTENSION
month
ftpListCallback
more
XML_MAX_NAMELEN
xmlLoadExternalEntity
diff --git a/doc/APIchunk18.html b/doc/APIchunk18.html index 44a51019..2bdc6170 100644 --- a/doc/APIchunk18.html +++ b/doc/APIchunk18.html @@ -81,6 +81,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCheckUTF8
xmlDebugDumpString
need
WITH_TRIO
+XML_SCHEMAS_TYPE_FACETSNEEDVALUE
XML_SUBSTITUTE_BOTH
XML_SUBSTITUTE_NONE
XML_SUBSTITUTE_PEREF
diff --git a/doc/APIchunk19.html b/doc/APIchunk19.html index e482e6f3..edf45c62 100644 --- a/doc/APIchunk19.html +++ b/doc/APIchunk19.html @@ -67,7 +67,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlAutomataNewOnceTrans
xmlAutomataNewOnceTrans2
occurred
xmlMemStrdupLoc
-xmlMemoryStrdup
occurrence
xmlStrcasestr
xmlStrchr
xmlStrstr
@@ -147,6 +146,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlConvertSGMLCatalog
ononymous
_xmlSchema
onto
xmlParserInputBufferGrow
+xmlStreamPush
opaque
_xmlSchema
_xmlURI
open
htmlCtxtReadFd
diff --git a/doc/APIchunk20.html b/doc/APIchunk20.html index d690d5ac..a9f2d00e 100644 --- a/doc/APIchunk20.html +++ b/doc/APIchunk20.html @@ -124,7 +124,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlShellPwd
xmlShellValidate
xmlTextReaderRelaxNGValidate
-
pattern
xmlPatternMatch
+
pattern
xmlPatternGetStreamCtxt
+xmlPatternMatch
xmlPatterncompile
xmlTextReaderPreservePattern
pcdata
cdataBlock
@@ -254,6 +255,7 @@ A:link, A:visited, A:active { text-decoration: underline }
preceding-sibling
xmlXPathNextPrecedingSibling
precisely
xmlXPathSubstringFunction
precompiled
_xmlXPathParserContext
+xmlPatternGetStreamCtxt
xmlPatternMatch
xmlRegNewExecCtxt
xmlRelaxNGNewValidCtxt
@@ -505,6 +507,8 @@ A:link, A:visited, A:active { text-decoration: underline } xmlCreatePushParserCtxt
xmlCtxtResetPush
xmlParserInputBufferPush
+xmlStreamPop
+xmlStreamPush
xmlXPathEvalExpr
pushed
xmlRegExecErrInfo
xmlXPathFunction
diff --git a/doc/APIchunk21.html b/doc/APIchunk21.html index 0d8413bc..cb5c932f 100644 --- a/doc/APIchunk21.html +++ b/doc/APIchunk21.html @@ -119,7 +119,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlGcMemGet
xmlGcMemSetup
xmlMemGet
-xmlMemRealloc
xmlMemSetup
xmlReallocFunc
xmlReallocLoc
@@ -450,6 +449,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSetNsProp
xmlSetProp
xmlSetStructuredErrorFunc
+xmlStreamPush
resides
xmlTextReaderConstXmlLang
xmlTextReaderXmlLang
resize
xmlBufferResize
@@ -561,6 +561,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSAX2ExternalSubset
xmlSAX2InternalSubset
xmlShellPwd
+xmlStreamPush
xmlValidateRoot
xmlXPathNewValueTree
xmlXPathRoot
diff --git a/doc/APIchunk22.html b/doc/APIchunk22.html index 15ce36eb..7aff7ae4 100644 --- a/doc/APIchunk22.html +++ b/doc/APIchunk22.html @@ -469,8 +469,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlTextReaderStandalone
specifying
xmlMallocAtomicLoc
xmlMallocLoc
-xmlMemMalloc
-xmlMemRealloc
xmlReallocLoc
speed
xmlXPathOrderDocElems
speedup
xmlTextReaderConstString
@@ -608,27 +606,9 @@ A:link, A:visited, A:active { text-decoration: underline } xmlMemGet
xmlMemSetup
xmlMemStrdupLoc
-xmlMemoryStrdup
xmlStrdup
xmlStrdupFunc
-
stream
_xmlParserCtxt
-xmlCheckHTTPInput
-xmlCreateIOParserCtxt
-xmlFreeInputStream
-xmlHandleEntity
-xmlNewEntityInputStream
-xmlNewIOInputStream
-xmlNewInputFromFile
-xmlNewInputStream
-xmlNewStringInputStream
-xmlParsePEReference
-xmlParserHandlePEReference
-xmlParserHandleReference
-xmlPrintURI
-xmlPushInput
-xmlSwitchInputEncoding
-xmlTextReaderGetRemainder
-xmlTextReaderRead
+
streaming
xmlPatternGetStreamCtxt
streams
_xmlParserCtxt
xmlSkipBlankChars
strict
XML_SCHEMAS_ANYATTR_STRICT
@@ -647,6 +627,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlRegExecErrInfo
xmlRegExecNextValues
xmlRegexpCompile
+xmlStreamPush
xmlStrncatNew
stripping
xmlXPathNormalizeFunction
strncasecmp
xmlStrncasecmp
diff --git a/doc/APIchunk26.html b/doc/APIchunk26.html index 76a6b8c8..c99d5f7a 100644 --- a/doc/APIchunk26.html +++ b/doc/APIchunk26.html @@ -187,6 +187,7 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlFreeDoc
xmlTextReaderCurrentDoc
xmlFreeDocElementContent
xmlFreeElementContent
xmlFreeMutex
xmlFreeMutex
+
xmlFreeStreamCtxt
xmlPatternGetStreamCtxt
xmlGetGlobalState
xmlGetGlobalState
xmlGetNoNsProp
xmlGetProp
xmlGetNsProp
xmlGetProp
@@ -324,6 +325,7 @@ A:link, A:visited, A:active { text-decoration: underline }
xmlParserProperties
xmlTextReaderGetParserProp
xmlTextReaderSetParserProp
xmlPattern
LIBXML_PATTERN_ENABLED
+
xmlPatterncompile
xmlStreamPush
xmlPopInput:
xmlPopInput
xmlPushInput:
xmlPushInput
xmlRFreeMutex
xmlFreeRMutex
diff --git a/doc/APIchunk4.html b/doc/APIchunk4.html index 0ddc0106..082dd33f 100644 --- a/doc/APIchunk4.html +++ b/doc/APIchunk4.html @@ -205,6 +205,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParseExternalID
xmlParsePEReference
xmlParserHandlePEReference
+xmlStreamPush
xmlTextReaderCurrentDoc
NRK
_htmlElemDesc
NSDef
xmlNamespaceParseNSDef
diff --git a/doc/APIchunk7.html b/doc/APIchunk7.html index f4015380..eed7024d 100644 --- a/doc/APIchunk7.html +++ b/doc/APIchunk7.html @@ -235,6 +235,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlNewNodeEatName
xmlNewPI
xmlNewTextChild
+xmlPatternGetStreamCtxt
xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
Used
XML_SCHEMAS_ANY_LAX
diff --git a/doc/APIchunk8.html b/doc/APIchunk8.html index 76e4e7af..282a4d65 100644 --- a/doc/APIchunk8.html +++ b/doc/APIchunk8.html @@ -289,6 +289,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParserHandlePEReference
xmlParserHandleReference
xmlValidCtxtNormalizeAttributeValue
+
act
xmlStreamPush
activate
xmlTextReaderSetParserProp
activated
DEBUG_MEMORY
xmlAutomataNewAllTrans
@@ -434,8 +435,6 @@ A:link, A:visited, A:active { text-decoration: underline } xmlBuildQName
xmlMallocAtomicLoc
xmlMallocLoc
-xmlMemMalloc
-xmlMemRealloc
xmlNewMutex
xmlNewRMutex
xmlReallocLoc
@@ -444,10 +443,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlGetBufferAllocationScheme
xmlMallocAtomicLoc
xmlMallocLoc
-xmlMemMalloc
-xmlMemRealloc
xmlMemStrdupLoc
-xmlMemoryStrdup
xmlNormalizeURIPath
xmlReallocLoc
xmlSetBufferAllocationScheme
@@ -525,6 +521,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlHasProp
xmlKeepBlanksDefault
xmlNanoFTPProxy
+xmlStreamPush
xmlTextReaderPreserve
xmlTextReaderPreservePattern
xmlXPathStringEvalNumber
@@ -648,8 +645,6 @@ A:link, A:visited, A:active { text-decoration: underline }
area
xmlBufferCreateStatic
xmlMallocAtomicLoc
xmlMallocLoc
-xmlMemMalloc
-xmlMemRealloc
xmlParserInputBufferCreateMem
xmlParserInputBufferCreateStatic
xmlReallocLoc
diff --git a/doc/APIconstructors.html b/doc/APIconstructors.html index 45e705b3..8a22203b 100644 --- a/doc/APIconstructors.html +++ b/doc/APIconstructors.html @@ -481,6 +481,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSchemaGetBuiltInType
xmlSchemaGetPredefinedType

Type xmlSchemaValidCtxtPtr:

xmlSchemaNewValidCtxt
+

Type xmlStreamCtxtPtr:

xmlPatternGetStreamCtxt

Type xmlTextReaderPtr:

xmlNewTextReader
xmlNewTextReaderFilename
xmlReaderForDoc
diff --git a/doc/APIfiles.html b/doc/APIfiles.html index b50ca677..5411aac7 100644 --- a/doc/APIfiles.html +++ b/doc/APIfiles.html @@ -858,10 +858,16 @@ A:link, A:visited, A:active { text-decoration: underline } xmlSwitchToEncoding

Module pattern:

xmlFreePattern
xmlFreePatternList
+xmlFreeStreamCtxt
xmlPattern
+xmlPatternGetStreamCtxt
xmlPatternMatch
xmlPatternPtr
xmlPatterncompile
+xmlStreamCtxt
+xmlStreamCtxtPtr
+xmlStreamPop
+xmlStreamPush

Module relaxng:

XML_RELAXNGP_CRNG
XML_RELAXNGP_FREE_DOC
XML_RELAXNGP_NONE
@@ -1033,6 +1039,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE
XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION
XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION
+XML_SCHEMAS_TYPE_FACETSNEEDVALUE
XML_SCHEMAS_TYPE_FINAL_DEFAULT
XML_SCHEMAS_TYPE_FINAL_EXTENSION
XML_SCHEMAS_TYPE_FINAL_LIST
@@ -1085,6 +1092,9 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMA_TYPE_EXTENSION
XML_SCHEMA_TYPE_FACET
XML_SCHEMA_TYPE_GROUP
+XML_SCHEMA_TYPE_IDC_KEY
+XML_SCHEMA_TYPE_IDC_KEYREF
+XML_SCHEMA_TYPE_IDC_UNIQUE
XML_SCHEMA_TYPE_LIST
XML_SCHEMA_TYPE_NOTATION
XML_SCHEMA_TYPE_RESTRICTION
@@ -1875,6 +1885,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_FTP_ACCNT
XML_FTP_EPSV_ANSWER
XML_FTP_PASV_ANSWER
+XML_FTP_URL_SYNTAX
XML_HTML_STRUCURE_ERROR
XML_HTML_UNKNOWN_TAG
XML_HTTP_UNKNOWN_HOST
@@ -2293,6 +2304,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAV_CVC_ENUMERATION_VALID
XML_SCHEMAV_CVC_FACET_VALID
XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID
+XML_SCHEMAV_CVC_IDC
XML_SCHEMAV_CVC_LENGTH_VALID
XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID
XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID
diff --git a/doc/APIfunctions.html b/doc/APIfunctions.html index 61897c75..7aa8600d 100644 --- a/doc/APIfunctions.html +++ b/doc/APIfunctions.html @@ -357,6 +357,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStrchr
xmlStrcmp
xmlStrdup
+xmlStreamPush
xmlStringCurrentChar
xmlStringDecodeEntities
xmlStringGetNodeList
@@ -1698,6 +1699,7 @@ A:link, A:visited, A:active { text-decoration: underline }

Type xmlParserSeverities:

xmlTextReaderErrorFunc

Type xmlPatternPtr:

xmlFreePattern
xmlFreePatternList
+xmlPatternGetStreamCtxt
xmlPatternMatch

Type xmlRMutexPtr:

xmlFreeRMutex
xmlRMutexLock
@@ -1843,6 +1845,9 @@ A:link, A:visited, A:active { text-decoration: underline } xmlMemSetup

Type xmlStrdupFunc *:

xmlGcMemGet
xmlMemGet
+

Type xmlStreamCtxtPtr:

xmlFreeStreamCtxt
+xmlStreamPop
+xmlStreamPush

Type xmlStructuredErrorFunc:

xmlSetStructuredErrorFunc
xmlTextReaderSetStructuredErrorHandler
xmlThrDefSetStructuredErrorFunc
diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html index 5cb4140f..86ff490a 100644 --- a/doc/APIsymbols.html +++ b/doc/APIsymbols.html @@ -427,6 +427,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_FTP_ACCNT
XML_FTP_EPSV_ANSWER
XML_FTP_PASV_ANSWER
+XML_FTP_URL_SYNTAX
XML_GET_CONTENT
XML_GET_LINE
XML_HTML_DOCUMENT_NODE
@@ -1050,6 +1051,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE
XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION
XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION
+XML_SCHEMAS_TYPE_FACETSNEEDVALUE
XML_SCHEMAS_TYPE_FINAL_DEFAULT
XML_SCHEMAS_TYPE_FINAL_EXTENSION
XML_SCHEMAS_TYPE_FINAL_LIST
@@ -1110,6 +1112,7 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMAV_CVC_ENUMERATION_VALID
XML_SCHEMAV_CVC_FACET_VALID
XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID
+XML_SCHEMAV_CVC_IDC
XML_SCHEMAV_CVC_LENGTH_VALID
XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID
XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID
@@ -1178,6 +1181,9 @@ A:link, A:visited, A:active { text-decoration: underline } XML_SCHEMA_TYPE_EXTENSION
XML_SCHEMA_TYPE_FACET
XML_SCHEMA_TYPE_GROUP
+XML_SCHEMA_TYPE_IDC_KEY
+XML_SCHEMA_TYPE_IDC_KEYREF
+XML_SCHEMA_TYPE_IDC_UNIQUE
XML_SCHEMA_TYPE_LIST
XML_SCHEMA_TYPE_NOTATION
XML_SCHEMA_TYPE_RESTRICTION
@@ -1844,6 +1850,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlFreePropList
xmlFreeRMutex
xmlFreeRefTable
+xmlFreeStreamCtxt
xmlFreeTextReader
xmlFreeTextWriter
xmlFreeURI
@@ -2317,6 +2324,7 @@ A:link, A:visited, A:active { text-decoration: underline } xmlParserVersion
xmlParserWarning
xmlPattern
+xmlPatternGetStreamCtxt
xmlPatternMatch
xmlPatternPtr
xmlPatterncompile
@@ -2625,6 +2633,10 @@ A:link, A:visited, A:active { text-decoration: underline } xmlStrcmp
xmlStrdup
xmlStrdupFunc
+xmlStreamCtxt
+xmlStreamCtxtPtr
+xmlStreamPop
+xmlStreamPush
xmlStringComment
xmlStringCurrentChar
xmlStringDecodeEntities
diff --git a/doc/html/libxml-pattern.html b/doc/html/libxml-pattern.html index 2bf3ec3c..35ce4b7e 100644 --- a/doc/html/libxml-pattern.html +++ b/doc/html/libxml-pattern.html @@ -13,19 +13,36 @@ A:link, A:visited, A:active { text-decoration: underline } Module pattern from libxml2
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module pattern from libxml2

API Menu
API Indexes
Related links

allows to compile and test pattern expressions for nodes either in a tree or based on a parser state.

Table of Contents

Structure xmlPattern
struct _xmlPattern The content of this structure is not made public by the API.
Typedef xmlPattern * xmlPatternPtr
+
Structure xmlStreamCtxt
struct _xmlStreamCtxt +The content of this structure is not made public by the API. +
Typedef xmlStreamCtxt * xmlStreamCtxtPtr
 
void	xmlFreePattern			(xmlPatternPtr comp)
void	xmlFreePatternList		(xmlPatternPtr comp)
+
void	xmlFreeStreamCtxt		(xmlStreamCtxtPtr stream)
+
xmlStreamCtxtPtr	xmlPatternGetStreamCtxt	(xmlPatternPtr comp)
int	xmlPatternMatch			(xmlPatternPtr comp, 
xmlNodePtr node)
xmlPatternPtr	xmlPatterncompile	(const xmlChar * pattern, 
xmlDict * dict,
int flags,
const xmlChar ** namespaces)
+
int	xmlStreamPop			(xmlStreamCtxtPtr stream)
+
int	xmlStreamPush			(xmlStreamCtxtPtr stream, 
const xmlChar * name,
const xmlChar * ns)

Description

Structure xmlPattern

Structure xmlPattern
struct _xmlPattern { The content of this structure is not made public by the API. +}

Structure xmlStreamCtxt

Structure xmlStreamCtxt
struct _xmlStreamCtxt { +The content of this structure is not made public by the API. }

Function: xmlFreePattern

void	xmlFreePattern			(xmlPatternPtr comp)

Free up the memory allocated by @comp

comp:an XSLT comp

Function: xmlFreePatternList

void	xmlFreePatternList		(xmlPatternPtr comp)

Free up the memory allocated by all the elements of @comp

-
comp:an XSLT comp list

Function: xmlPatternMatch

int	xmlPatternMatch			(xmlPatternPtr comp, 
xmlNodePtr node)
+
comp:an XSLT comp list

Function: xmlFreeStreamCtxt

void	xmlFreeStreamCtxt		(xmlStreamCtxtPtr stream)
+

Free the stream context

+
stream:the stream context

Function: xmlPatternGetStreamCtxt

xmlStreamCtxtPtr	xmlPatternGetStreamCtxt	(xmlPatternPtr comp)
+

Get a streaming context for that pattern Use xmlFreeStreamCtxt to free the context.

+
comp:the precompiled pattern
Returns:a pointer to the context or NULL in case of failure

Function: xmlPatternMatch

int	xmlPatternMatch			(xmlPatternPtr comp, 
xmlNodePtr node)

Test wether the node matches the pattern

comp:the precompiled pattern
node:a node
Returns:1 if it matches, 0 if it doesn't and -1 in case of failure

Function: xmlPatterncompile

xmlPatternPtr	xmlPatterncompile	(const xmlChar * pattern, 
xmlDict * dict,
int flags,
const xmlChar ** namespaces)

Compile a pattern.

-
pattern:the pattern to compile
dict:an optional dictionnary for interned strings
flags:compilation flags, undefined yet
namespaces:the prefix definitions, array of [URI, prefix] or NULL
Returns:the compiled for of the pattern or NULL in case of error

Daniel Veillard

+

pattern:the pattern to compile
dict:an optional dictionnary for interned strings
flags:compilation flags, undefined yet
namespaces:the prefix definitions, array of [URI, prefix] or NULL
Returns:the compiled for of the pattern or NULL in case of error

Function: xmlStreamPop

int	xmlStreamPop			(xmlStreamCtxtPtr stream)
+

push one level from the stream.

+
stream:the stream context
Returns:-1 in case of error, 0 otherwise.

Function: xmlStreamPush

int	xmlStreamPush			(xmlStreamCtxtPtr stream, 
const xmlChar * name,
const xmlChar * ns)
+

push new data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionnary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset.

+
stream:the stream context
name:the current name
ns:the namespace name
Returns:-1 in case of error, 1 if the current state in the stream is a match and 0 otherwise.

Daniel Veillard

diff --git a/doc/html/libxml-schemasInternals.html b/doc/html/libxml-schemasInternals.html index 04c0a12b..92aae086 100644 --- a/doc/html/libxml-schemasInternals.html +++ b/doc/html/libxml-schemasInternals.html @@ -10,7 +10,7 @@ A:link, A:visited, A:active { text-decoration: underline } Module schemasInternals from libxml2
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module schemasInternals from libxml2

API Menu
API Indexes
Related links

internal interfaces for the XML Schemas handling and schema validity checking

Table of Contents

#define XML_SCHEMAS_ANYATTR_LAX
#define XML_SCHEMAS_ANYATTR_SKIP
#define XML_SCHEMAS_ANYATTR_STRICT
#define XML_SCHEMAS_ANY_LAX
#define XML_SCHEMAS_ANY_SKIP
#define XML_SCHEMAS_ANY_STRICT
#define XML_SCHEMAS_ATTRGROUP_GLOBAL
#define XML_SCHEMAS_ATTRGROUP_MARKED
#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED
#define XML_SCHEMAS_ATTR_FIXED
#define XML_SCHEMAS_ATTR_GLOBAL
#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED
#define XML_SCHEMAS_ATTR_NSDEFAULT
#define XML_SCHEMAS_ATTR_USE_OPTIONAL
#define XML_SCHEMAS_ATTR_USE_PROHIBITED
#define XML_SCHEMAS_ATTR_USE_REQUIRED
#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION
#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION
#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION
#define XML_SCHEMAS_ELEM_ABSTRACT
#define XML_SCHEMAS_ELEM_BLOCK_ABSENT
#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION
#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION
#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION
#define XML_SCHEMAS_ELEM_CIRCULAR
#define XML_SCHEMAS_ELEM_DEFAULT
#define XML_SCHEMAS_ELEM_FINAL_ABSENT
#define XML_SCHEMAS_ELEM_FINAL_EXTENSION
#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION
#define XML_SCHEMAS_ELEM_FIXED
#define XML_SCHEMAS_ELEM_GLOBAL
#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED
#define XML_SCHEMAS_ELEM_NILLABLE
#define XML_SCHEMAS_ELEM_NSDEFAULT
#define XML_SCHEMAS_ELEM_REF
#define XML_SCHEMAS_ELEM_TOPLEVEL
#define XML_SCHEMAS_FACET_COLLAPSE
#define XML_SCHEMAS_FACET_PRESERVE
#define XML_SCHEMAS_FACET_REPLACE
#define XML_SCHEMAS_FACET_UNKNOWN
#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION
#define XML_SCHEMAS_FINAL_DEFAULT_LIST
#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION
#define XML_SCHEMAS_FINAL_DEFAULT_UNION
#define XML_SCHEMAS_INCLUDING_CONVERT_NS
#define XML_SCHEMAS_QUALIF_ATTR
#define XML_SCHEMAS_QUALIF_ELEM
#define XML_SCHEMAS_TYPE_ABSTRACT
#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT
#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION
#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION
#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE
#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION
#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION
#define XML_SCHEMAS_TYPE_FINAL_DEFAULT
#define XML_SCHEMAS_TYPE_FINAL_EXTENSION
#define XML_SCHEMAS_TYPE_FINAL_LIST
#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION
#define XML_SCHEMAS_TYPE_FINAL_UNION
#define XML_SCHEMAS_TYPE_GLOBAL
#define XML_SCHEMAS_TYPE_MARKED
#define XML_SCHEMAS_TYPE_MIXED
#define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD
#define XML_SCHEMAS_TYPE_VARIETY_ABSENT
#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC
#define XML_SCHEMAS_TYPE_VARIETY_LIST
#define XML_SCHEMAS_TYPE_VARIETY_UNION
#define XML_SCHEMAS_WILDCARD_COMPLETE
Structure xmlSchemaAnnot
struct _xmlSchemaAnnot + Module schemasInternals from libxml2
Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module schemasInternals from libxml2

API Menu
API Indexes
Related links

internal interfaces for the XML Schemas handling and schema validity checking

Table of Contents

#define XML_SCHEMAS_ANYATTR_LAX
#define XML_SCHEMAS_ANYATTR_SKIP
#define XML_SCHEMAS_ANYATTR_STRICT
#define XML_SCHEMAS_ANY_LAX
#define XML_SCHEMAS_ANY_SKIP
#define XML_SCHEMAS_ANY_STRICT
#define XML_SCHEMAS_ATTRGROUP_GLOBAL
#define XML_SCHEMAS_ATTRGROUP_MARKED
#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED
#define XML_SCHEMAS_ATTR_FIXED
#define XML_SCHEMAS_ATTR_GLOBAL
#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED
#define XML_SCHEMAS_ATTR_NSDEFAULT
#define XML_SCHEMAS_ATTR_USE_OPTIONAL
#define XML_SCHEMAS_ATTR_USE_PROHIBITED
#define XML_SCHEMAS_ATTR_USE_REQUIRED
#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION
#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION
#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION
#define XML_SCHEMAS_ELEM_ABSTRACT
#define XML_SCHEMAS_ELEM_BLOCK_ABSENT
#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION
#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION
#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION
#define XML_SCHEMAS_ELEM_CIRCULAR
#define XML_SCHEMAS_ELEM_DEFAULT
#define XML_SCHEMAS_ELEM_FINAL_ABSENT
#define XML_SCHEMAS_ELEM_FINAL_EXTENSION
#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION
#define XML_SCHEMAS_ELEM_FIXED
#define XML_SCHEMAS_ELEM_GLOBAL
#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED
#define XML_SCHEMAS_ELEM_NILLABLE
#define XML_SCHEMAS_ELEM_NSDEFAULT
#define XML_SCHEMAS_ELEM_REF
#define XML_SCHEMAS_ELEM_TOPLEVEL
#define XML_SCHEMAS_FACET_COLLAPSE
#define XML_SCHEMAS_FACET_PRESERVE
#define XML_SCHEMAS_FACET_REPLACE
#define XML_SCHEMAS_FACET_UNKNOWN
#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION
#define XML_SCHEMAS_FINAL_DEFAULT_LIST
#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION
#define XML_SCHEMAS_FINAL_DEFAULT_UNION
#define XML_SCHEMAS_INCLUDING_CONVERT_NS
#define XML_SCHEMAS_QUALIF_ATTR
#define XML_SCHEMAS_QUALIF_ELEM
#define XML_SCHEMAS_TYPE_ABSTRACT
#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT
#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION
#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION
#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE
#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION
#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION
#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE
#define XML_SCHEMAS_TYPE_FINAL_DEFAULT
#define XML_SCHEMAS_TYPE_FINAL_EXTENSION
#define XML_SCHEMAS_TYPE_FINAL_LIST
#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION
#define XML_SCHEMAS_TYPE_FINAL_UNION
#define XML_SCHEMAS_TYPE_GLOBAL
#define XML_SCHEMAS_TYPE_MARKED
#define XML_SCHEMAS_TYPE_MIXED
#define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD
#define XML_SCHEMAS_TYPE_VARIETY_ABSENT
#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC
#define XML_SCHEMAS_TYPE_VARIETY_LIST
#define XML_SCHEMAS_TYPE_VARIETY_UNION
#define XML_SCHEMAS_WILDCARD_COMPLETE
Structure xmlSchemaAnnot
struct _xmlSchemaAnnot
Typedef xmlSchemaAnnot * xmlSchemaAnnotPtr
 
Structure xmlSchemaAttribute
struct _xmlSchemaAttribute
Structure xmlSchemaAttributeGroup
struct _xmlSchemaAttributeGroup @@ -97,6 +97,7 @@ The content of this structure is not made public by the API.

Macro: XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE

#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE

Marks the item as a builtin primitive.

Macro: XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION

#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION

the simple or complex type has a derivation method of "extension".

Macro: XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION

#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION

the simple or complex type has a derivation method of "restriction".

+

Macro: XML_SCHEMAS_TYPE_FACETSNEEDVALUE

#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE

indicates if the facets need a computed value

Macro: XML_SCHEMAS_TYPE_FINAL_DEFAULT

#define XML_SCHEMAS_TYPE_FINAL_DEFAULT

the simpleType has a final of "default".

Macro: XML_SCHEMAS_TYPE_FINAL_EXTENSION

#define XML_SCHEMAS_TYPE_FINAL_EXTENSION

the complexType has a final of "extension".

Macro: XML_SCHEMAS_TYPE_FINAL_LIST

#define XML_SCHEMAS_TYPE_FINAL_LIST

the simpleType has a final of "list".

@@ -188,6 +189,7 @@ The content of this structure is not made public by the API. xmlSchemaContentType contentType const xmlChar * refPrefix xmlSchemaValPtr defVal + void * idcs }

Structure xmlSchemaFacet

Structure xmlSchemaFacet
struct _xmlSchemaFacet { xmlSchemaTypeType type : The kind of type struct _xmlSchemaFacet * next : the next type if in a sequence ... @@ -263,6 +265,9 @@ The content of this structure is not made public by the API. XML_SCHEMA_TYPE_LIST = 19 XML_SCHEMA_TYPE_UNION = 20 XML_SCHEMA_TYPE_ANY_ATTRIBUTE = 21 + XML_SCHEMA_TYPE_IDC_UNIQUE = 22 + XML_SCHEMA_TYPE_IDC_KEY = 23 + XML_SCHEMA_TYPE_IDC_KEYREF = 24 XML_SCHEMA_FACET_MININCLUSIVE = 1000 XML_SCHEMA_FACET_MINEXCLUSIVE = 1001 XML_SCHEMA_FACET_MAXINCLUSIVE = 1002 diff --git a/doc/html/libxml-xmlerror.html b/doc/html/libxml-xmlerror.html index c586bf77..49df9d10 100644 --- a/doc/html/libxml-xmlerror.html +++ b/doc/html/libxml-xmlerror.html @@ -62,7 +62,7 @@ void xmlStructuredErrorFunc (void * userD XML_FROM_OUTPUT = 7 : The serialization code XML_FROM_IO = 8 : The Input/Output stack XML_FROM_FTP = 9 : The FTP module - XML_FROM_HTTP = 10 : The FTP module + XML_FROM_HTTP = 10 : The HTTP module XML_FROM_XINCLUDE = 11 : The XInclude processing XML_FROM_XPATH = 12 : The XPath module XML_FROM_XPOINTER = 13 : The XPointer module @@ -647,6 +647,7 @@ void xmlStructuredErrorFunc (void * userD XML_SCHEMAV_CVC_AU = 1874 : 1874 XML_SCHEMAV_CVC_TYPE_1 = 1875 : 1875 XML_SCHEMAV_CVC_TYPE_2 = 1876 : 1876 + XML_SCHEMAV_CVC_IDC = 1877 : 1877 XML_XPTR_UNKNOWN_SCHEME = 1900 XML_XPTR_CHILDSEQ_START = 1901 : 1901 XML_XPTR_EVAL_FAILED = 1902 : 1902 @@ -658,6 +659,7 @@ void xmlStructuredErrorFunc (void * userD XML_FTP_PASV_ANSWER = 2000 XML_FTP_EPSV_ANSWER = 2001 : 2001 XML_FTP_ACCNT = 2002 : 2002 + XML_FTP_URL_SYNTAX = 2003 : 2003 XML_HTTP_URL_SYNTAX = 2020 XML_HTTP_USE_IP = 2021 : 2021 XML_HTTP_UNKNOWN_HOST = 2022 : 2022 diff --git a/doc/html/libxml-xmlmemory.html b/doc/html/libxml-xmlmemory.html index b02572a9..1c03185d 100644 --- a/doc/html/libxml-xmlmemory.html +++ b/doc/html/libxml-xmlmemory.html @@ -74,14 +74,14 @@ void * xmlMallocFunc (size_t size)
Returns:an int representing the number of blocks

Function: xmlMemDisplay

void	xmlMemDisplay			(FILE * fp)

show in-extenso the memory blocks allocated

fp:a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist

Function: xmlMemFree

void	xmlMemFree			(void * ptr)
-

a free() equivalent, with error checking.

-
ptr:the memory block pointer

Function: xmlMemGet

int	xmlMemGet			(xmlFreeFunc * freeFunc, 
xmlMallocFunc * mallocFunc,
xmlReallocFunc * reallocFunc,
xmlStrdupFunc * strdupFunc)
+

+
ptr:

Function: xmlMemGet

int	xmlMemGet			(xmlFreeFunc * freeFunc, 
xmlMallocFunc * mallocFunc,
xmlReallocFunc * reallocFunc,
xmlStrdupFunc * strdupFunc)

Provides the memory access functions set currently in use

freeFunc:place to save the free() function in use
mallocFunc:place to save the malloc() function in use
reallocFunc:place to save the realloc() function in use
strdupFunc:place to save the strdup() function in use
Returns:0 on success

Function: xmlMemMalloc

void *	xmlMemMalloc			(size_t size)
-

a malloc() equivalent, with logging of the allocation info.

-
size:an int specifying the size in byte to allocate.
Returns:a pointer to the allocated area or NULL in case of lack of memory.

Function: xmlMemRealloc

void *	xmlMemRealloc			(void * ptr, 
size_t size)
-

a realloc() equivalent, with logging of the allocation info.

-
ptr:the initial memory block pointer
size:an int specifying the size in byte to allocate.
Returns:a pointer to the allocated area or NULL in case of lack of memory.

Function: xmlMemSetup

int	xmlMemSetup			(xmlFreeFunc freeFunc, 
xmlMallocFunc mallocFunc,
xmlReallocFunc reallocFunc,
xmlStrdupFunc strdupFunc)
+

+
size:
Returns:

Function: xmlMemRealloc

void *	xmlMemRealloc			(void * ptr, 
size_t size)
+

+
ptr:
size:
Returns:

Function: xmlMemSetup

int	xmlMemSetup			(xmlFreeFunc freeFunc, 
xmlMallocFunc mallocFunc,
xmlReallocFunc reallocFunc,
xmlStrdupFunc strdupFunc)

Override the default memory access functions with a new set This has to be called before any other libxml routines ! Should this be blocked if there was already some allocations done ?

freeFunc:the free() function to use
mallocFunc:the malloc() function to use
reallocFunc:the realloc() function to use
strdupFunc:the strdup() function to use
Returns:0 on success

Function: xmlMemShow

void	xmlMemShow			(FILE * fp, 
int nr)

show a show display of the memory allocated, and dump the @nr last allocated areas which were not freed

@@ -92,8 +92,8 @@ void * xmlMallocFunc (size_t size)
Returns:an int representing the amount of memory allocated.

Function: xmlMemoryDump

void	xmlMemoryDump			(void)

Dump in-extenso the memory blocks allocated to the file .memorylist

Function: xmlMemoryStrdup

char *	xmlMemoryStrdup			(const char * str)
-

a strdup() equivalent, with logging of the allocation info.

-
str:the initial string pointer
Returns:a pointer to the new string or NULL if allocation error occurred.

Function type: xmlReallocFunc

Function type: xmlReallocFunc
+

+
str:
Returns:

Function type: xmlReallocFunc

Function type: xmlReallocFunc
 void *	xmlReallocFunc			(void * mem, 
size_t size)

Signature for a realloc() implementation.

mem:an already allocated block of memory
size:the new size requested in bytes
Returns:a pointer to the newly reallocated block or NULL in case of error.

Function: xmlReallocLoc

void *	xmlReallocLoc			(void * ptr, 
size_t size,
const char * file,
int line)
diff --git a/doc/html/libxml-xmlschemas.html b/doc/html/libxml-xmlschemas.html index ce3e9e4b..a07e2f9c 100644 --- a/doc/html/libxml-xmlschemas.html +++ b/doc/html/libxml-xmlschemas.html @@ -65,6 +65,7 @@ void xmlSchemaValidityWarningFunc (v void * includes : the includes, this is opaque for now int preserve : whether to free the document int counter : used to give ononymous components uniqu + xmlHashTablePtr idcDef }

Structure xmlSchemaParserCtxt

Structure xmlSchemaParserCtxt
struct _xmlSchemaParserCtxt { The content of this structure is not made public by the API. }

Structure xmlSchemaValidCtxt

Structure xmlSchemaValidCtxt
struct _xmlSchemaValidCtxt { diff --git a/doc/html/libxml-xmlversion.html b/doc/html/libxml-xmlversion.html index a52577a1..885cfb35 100644 --- a/doc/html/libxml-xmlversion.html +++ b/doc/html/libxml-xmlversion.html @@ -28,7 +28,7 @@ A:link, A:visited, A:active { text-decoration: underline }

Macro: LIBXML_ISO8859X_ENABLED

#define LIBXML_ISO8859X_ENABLED

Whether ISO-8859-* support is made available in case iconv is not

Macro: LIBXML_LEGACY_ENABLED

#define LIBXML_LEGACY_ENABLED

Whether the deprecated APIs are compiled in for compatibility

Macro: LIBXML_MODULES_ENABLED

#define LIBXML_MODULES_ENABLED

Whether the module interfaces are compiled in

-

Macro: LIBXML_MODULE_EXTENSION

#define LIBXML_MODULE_EXTENSION

+

Macro: LIBXML_MODULE_EXTENSION

#define LIBXML_MODULE_EXTENSION

The file extension for the modules

Macro: LIBXML_OUTPUT_ENABLED

#define LIBXML_OUTPUT_ENABLED

Whether the serialization/saving support is configured in

Macro: LIBXML_PATTERN_ENABLED

#define LIBXML_PATTERN_ENABLED

Whether the xmlPattern node selection interface is configured in

Macro: LIBXML_PUSH_ENABLED

#define LIBXML_PUSH_ENABLED

Whether the push parsing interfaces are configured in

diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index 2af30ee7..0dde5097 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -2065,6 +2065,7 @@ + @@ -3690,6 +3691,7 @@ Whether the module interfaces are compiled in + The file extension for the modules Whether the serialization/saving support is configured in @@ -4552,7 +4554,7 @@ - + @@ -4575,6 +4577,7 @@ + @@ -10069,9 +10072,9 @@ actually an xmlCharEncoding'/> - a free() equivalent, with error checking. + - + Provides the memory access functions set currently in use @@ -10082,15 +10085,15 @@ actually an xmlCharEncoding'/> - a malloc() equivalent, with logging of the allocation info. - - + + + - a realloc() equivalent, with logging of the allocation info. - - - + + + + Override the default memory access functions with a new set This has to be called before any other libxml routines ! Should this be blocked if there was already some allocations done ? @@ -10122,9 +10125,9 @@ actually an xmlCharEncoding'/> - a strdup() equivalent, with logging of the allocation info. - - + + + defined(LIBXML_MODULES_ENABLED) diff --git a/doc/libxml2-refs.xml b/doc/libxml2-refs.xml index 9e9f2af8..f69a5bac 100644 --- a/doc/libxml2-refs.xml +++ b/doc/libxml2-refs.xml @@ -421,6 +421,7 @@ + @@ -3716,6 +3717,7 @@ + @@ -11781,6 +11783,7 @@ + @@ -17663,8 +17666,6 @@ - - @@ -17675,10 +17676,7 @@ - - - @@ -17974,8 +17972,6 @@ - - @@ -18679,7 +18675,6 @@ - @@ -20641,11 +20636,7 @@ - - - - @@ -20887,6 +20878,7 @@ + @@ -22172,10 +22164,7 @@ - - - @@ -22258,9 +22247,7 @@ - - @@ -22634,8 +22621,6 @@ - - @@ -22973,10 +22958,7 @@ - - - @@ -23077,7 +23059,6 @@ - @@ -23384,6 +23365,9 @@ + + + @@ -23894,7 +23878,6 @@ - @@ -25141,7 +25124,6 @@ - @@ -26467,8 +26449,6 @@ - - @@ -26684,7 +26664,6 @@ - diff --git a/elfgcchack.h b/elfgcchack.h index 2d6964d3..ca392ecc 100644 --- a/elfgcchack.h +++ b/elfgcchack.h @@ -1563,6 +1563,12 @@ extern __typeof (xmlFreeRefTable) xmlFreeRefTable__internal_alias __attribute((v extern __typeof (xmlFreeRefTable) xmlFreeRefTable __attribute((alias("xmlFreeRefTable__internal_alias"))); #define xmlFreeRefTable xmlFreeRefTable__internal_alias +#if defined(LIBXML_PATTERN_ENABLED) +extern __typeof (xmlFreeStreamCtxt) xmlFreeStreamCtxt__internal_alias __attribute((visibility("hidden"))); +extern __typeof (xmlFreeStreamCtxt) xmlFreeStreamCtxt __attribute((alias("xmlFreeStreamCtxt__internal_alias"))); +#define xmlFreeStreamCtxt xmlFreeStreamCtxt__internal_alias +#endif + #if defined(LIBXML_READER_ENABLED) extern __typeof (xmlFreeTextReader) xmlFreeTextReader__internal_alias __attribute((visibility("hidden"))); extern __typeof (xmlFreeTextReader) xmlFreeTextReader __attribute((alias("xmlFreeTextReader__internal_alias"))); @@ -3275,6 +3281,12 @@ extern __typeof (xmlParserWarning) xmlParserWarning__internal_alias __attribute( extern __typeof (xmlParserWarning) xmlParserWarning __attribute((alias("xmlParserWarning__internal_alias"))); #define xmlParserWarning xmlParserWarning__internal_alias +#if defined(LIBXML_PATTERN_ENABLED) +extern __typeof (xmlPatternGetStreamCtxt) xmlPatternGetStreamCtxt__internal_alias __attribute((visibility("hidden"))); +extern __typeof (xmlPatternGetStreamCtxt) xmlPatternGetStreamCtxt __attribute((alias("xmlPatternGetStreamCtxt__internal_alias"))); +#define xmlPatternGetStreamCtxt xmlPatternGetStreamCtxt__internal_alias +#endif + #if defined(LIBXML_PATTERN_ENABLED) extern __typeof (xmlPatternMatch) xmlPatternMatch__internal_alias __attribute((visibility("hidden"))); extern __typeof (xmlPatternMatch) xmlPatternMatch __attribute((alias("xmlPatternMatch__internal_alias"))); @@ -4469,6 +4481,18 @@ extern __typeof (xmlStrdup) xmlStrdup__internal_alias __attribute((visibility("h extern __typeof (xmlStrdup) xmlStrdup __attribute((alias("xmlStrdup__internal_alias"))); #define xmlStrdup xmlStrdup__internal_alias +#if defined(LIBXML_PATTERN_ENABLED) +extern __typeof (xmlStreamPop) xmlStreamPop__internal_alias __attribute((visibility("hidden"))); +extern __typeof (xmlStreamPop) xmlStreamPop __attribute((alias("xmlStreamPop__internal_alias"))); +#define xmlStreamPop xmlStreamPop__internal_alias +#endif + +#if defined(LIBXML_PATTERN_ENABLED) +extern __typeof (xmlStreamPush) xmlStreamPush__internal_alias __attribute((visibility("hidden"))); +extern __typeof (xmlStreamPush) xmlStreamPush __attribute((alias("xmlStreamPush__internal_alias"))); +#define xmlStreamPush xmlStreamPush__internal_alias +#endif + extern __typeof (xmlStringCurrentChar) xmlStringCurrentChar__internal_alias __attribute((visibility("hidden"))); extern __typeof (xmlStringCurrentChar) xmlStringCurrentChar __attribute((alias("xmlStringCurrentChar__internal_alias"))); #define xmlStringCurrentChar xmlStringCurrentChar__internal_alias diff --git a/gentest.py b/gentest.py index c8e675d1..234685ca 100755 --- a/gentest.py +++ b/gentest.py @@ -112,12 +112,12 @@ skipped_functions = [ "xmlIORead", "xmlReadIO", "xmlCtxtReadIO", "htmlIORead", "htmlReadIO", "htmlCtxtReadIO", "xmlReaderNewIO", "xmlBufferDump", "xmlNanoFTPConnect", -"xmlNanoFTPConnectTo", +"xmlNanoFTPConnectTo", "xmlNanoHTTPMethod", "xmlNanoHTTPMethodRedir", # Complex I/O APIs "xmlCreateIOParserCtxt", "xmlParserInputBufferCreateIO", "xmlRegisterInputCallbacks", "xmlReaderForIO", "xmlOutputBufferCreateIO", "xmlRegisterOutputCallbacks", -"xmlSaveToIO", +"xmlSaveToIO", "xmlIOHTTPOpenW", # library state cleanup, generate false leak informations and other # troubles, heavillyb tested otherwise. "xmlCleanupParser", "xmlRelaxNGCleanupTypes", "xmlSetListDoc", @@ -129,7 +129,7 @@ skipped_functions = [ "xmlTextReaderReadInnerXml", "xmlTextReaderReadOuterXml", "xmlTextReaderReadString", # destructor -"xmlListDelete", "xmlOutputBufferClose", "xmlNanoFTPClose", +"xmlListDelete", "xmlOutputBufferClose", "xmlNanoFTPClose", "xmlNanoHTTPClose", # deprecated "xmlCatalogGetPublic", "xmlCatalogGetSystem", "xmlEncodeEntities", "xmlNewGlobalNs", "xmlHandleEntity", "xmlNamespaceParseNCName", @@ -326,17 +326,25 @@ def type_convert(str, name, info, module, function, pos): string.find(info, "URL") != -1: if string.find(function, "Save") != -1 or \ string.find(function, "Create") != -1 or \ - string.find(function, "Write") != -1: + string.find(function, "Write") != -1 or \ + string.find(function, "Fetch") != -1: return('fileoutput') return('filepath') if res == 'void_ptr': if module == 'nanoftp' and name == 'ctx': return('xmlNanoFTPCtxtPtr') - if function == 'xmlNanoFTPNewCtxt': + if function == 'xmlNanoFTPNewCtxt' or \ + function == 'xmlNanoFTPConnectTo' or \ + function == 'xmlNanoFTPOpen': return('xmlNanoFTPCtxtPtr') if module == 'nanohttp' and name == 'ctx': return('xmlNanoHTTPCtxtPtr') - if function == 'xmlIOHTTPOpenW': + if function == 'xmlNanoHTTPMethod' or \ + function == 'xmlNanoHTTPMethodRedir' or \ + function == 'xmlNanoHTTPOpen' or \ + function == 'xmlNanoHTTPOpenRedir': + return('xmlNanoHTTPCtxtPtr'); + if function == 'xmlIOHTTPOpen': return('xmlNanoHTTPCtxtPtr') if string.find(name, "data") != -1: return('userdata') diff --git a/include/libxml/xmlerror.h b/include/libxml/xmlerror.h index b31b45c0..29231eb2 100644 --- a/include/libxml/xmlerror.h +++ b/include/libxml/xmlerror.h @@ -44,7 +44,7 @@ typedef enum { XML_FROM_OUTPUT, /* The serialization code */ XML_FROM_IO, /* The Input/Output stack */ XML_FROM_FTP, /* The FTP module */ - XML_FROM_HTTP, /* The FTP module */ + XML_FROM_HTTP, /* The HTTP module */ XML_FROM_XINCLUDE, /* The XInclude processing */ XML_FROM_XPATH, /* The XPath module */ XML_FROM_XPOINTER, /* The XPointer module */ @@ -665,6 +665,7 @@ typedef enum { XML_FTP_PASV_ANSWER = 2000, XML_FTP_EPSV_ANSWER, /* 2001 */ XML_FTP_ACCNT, /* 2002 */ + XML_FTP_URL_SYNTAX, /* 2003 */ XML_HTTP_URL_SYNTAX = 2020, XML_HTTP_USE_IP, /* 2021 */ XML_HTTP_UNKNOWN_HOST, /* 2022 */ diff --git a/nanoftp.c b/nanoftp.c index 0df98da5..ac0c2f09 100644 --- a/nanoftp.c +++ b/nanoftp.c @@ -296,11 +296,11 @@ xmlNanoFTPProxy(const char *host, int port, const char *user, static void xmlNanoFTPScanURL(void *ctx, const char *URL) { xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr) ctx; - const char *cur = URL; - char buf[XML_NANO_MAX_URLBUF]; - int indx = 0; - int port = 0; + xmlURIPtr uri; + /* + * Clear any existing data from the context + */ if (ctxt->protocol != NULL) { xmlFree(ctxt->protocol); ctxt->protocol = NULL; @@ -314,122 +314,38 @@ xmlNanoFTPScanURL(void *ctx, const char *URL) { ctxt->path = NULL; } if (URL == NULL) return; - buf[indx] = 0; - while ((*cur != 0) && (indx < XML_NANO_MAX_URLBUF - 1)) { - if ((cur[0] == ':') && (cur[1] == '/') && (cur[2] == '/')) { - buf[indx] = 0; - ctxt->protocol = xmlMemStrdup(buf); - indx = 0; - cur += 3; - break; - } - buf[indx++] = *cur++; - } - if (*cur == 0) return; - buf[indx] = 0; - /* allow user@ and user:pass@ forms */ - { - const char *p = strchr(cur, '@'); - if(p) { - while(indx < XML_NANO_MAX_URLBUF-1) { - if(cur[0] == ':' || cur[0] == '@') break; - buf[indx++] = *cur++; - } - buf[indx] = 0; - ctxt->user = xmlMemStrdup(buf); - indx = 0; - if(cur[0] == ':') { - cur++; - while(indx < XML_NANO_MAX_URLBUF-1) { - if(cur[0] == '@') break; - buf[indx++] = *cur++; - } - buf[indx] = 0; - ctxt->passwd = xmlMemStrdup(buf); - indx = 0; - } - cur = p+1; + uri = xmlParseURI(URL); + if (uri == NULL) + return; + + if ((uri->scheme == NULL) || (uri->server == NULL)) { + xmlFreeURI(uri); + return; + } + + ctxt->protocol = xmlMemStrdup(uri->scheme); + ctxt->hostname = xmlMemStrdup(uri->server); + if (uri->path != NULL) + ctxt->path = xmlMemStrdup(uri->path); + else + ctxt->path = xmlMemStrdup("/"); + if (uri->port != 0) + ctxt->port = uri->port; + + if (uri->user != NULL) { + char *cptr; + if ((cptr=strchr(uri->user, ':')) == NULL) + ctxt->user = xmlMemStrdup(uri->user); + else { + ctxt->user = (char *)xmlStrndup((xmlChar *)uri->user, + (cptr - uri->user)); + ctxt->passwd = xmlMemStrdup(cptr+1); } } - while (indx < XML_NANO_MAX_URLBUF - 1) { - if ((strchr (cur, '[') && !strchr (cur, ']')) || - (!strchr (cur, '[') && strchr (cur, ']'))) { - xmlGenericError (xmlGenericErrorContext, "\nxmlNanoFTPScanURL: %s", - "Syntax Error\n"); - return; - } + xmlFreeURI(uri); - if (cur[0] == '[') { - cur++; - while ((cur[0] != ']') && (indx < XML_NANO_MAX_URLBUF-1)) - buf[indx++] = *cur++; - if (indx >= XML_NANO_MAX_URLBUF-1) { - xmlGenericError(xmlGenericErrorContext, - "\nxmlNanoFTPScanURL: %s", "Syntax Error\n"); - return; - } - - if (!strchr (buf, ':')) { - xmlGenericError (xmlGenericErrorContext, "\nxmlNanoFTPScanURL: %s", - "Use [IPv6]/IPv4 format\n"); - return; - } - - buf[indx] = 0; - ctxt->hostname = xmlMemStrdup (buf); - indx = 0; - cur += 1; - if (cur[0] == ':') { - cur++; - while (*cur >= '0' && *cur <= '9') { - port *= 10; - port += *cur - '0'; - cur++; - } - - if (port != 0) ctxt->port = port; - while ((cur[0] != '/') && (*cur != 0)) - cur++; - } - break; - } - else { /* address is an IPv4 one*/ - if (cur[0] == ':') { - buf[indx] = 0; - ctxt->hostname = xmlMemStrdup (buf); - indx = 0; - cur += 1; - while ((*cur >= '0') && (*cur <= '9')) { - port *= 10; - port += *cur - '0'; - cur++; - } - if (port != 0) ctxt->port = port; - while ((cur[0] != '/') && (*cur != 0)) - cur++; - break; - } - if ((*cur == '/') || (*cur == 0)) { - buf[indx] = 0; - ctxt->hostname = xmlMemStrdup (buf); - indx = 0; - break; - } - } - buf[indx++] = *cur++; - } - if (*cur == 0) - ctxt->path = xmlMemStrdup("/"); - else { - indx = 0; - buf[indx] = 0; - while ((*cur != 0) && (indx < XML_NANO_MAX_URLBUF-1)) - buf[indx++] = *cur++; - buf[indx] = 0; - ctxt->path = xmlMemStrdup(buf); - } } /** @@ -449,10 +365,7 @@ xmlNanoFTPScanURL(void *ctx, const char *URL) { int xmlNanoFTPUpdateURL(void *ctx, const char *URL) { xmlNanoFTPCtxtPtr ctxt = (xmlNanoFTPCtxtPtr) ctx; - const char *cur = URL; - char buf[XML_NANO_MAX_URLBUF]; - int indx = 0; - int port = 0; + xmlURIPtr uri; if (URL == NULL) return(-1); @@ -462,104 +375,37 @@ xmlNanoFTPUpdateURL(void *ctx, const char *URL) { return(-1); if (ctxt->hostname == NULL) return(-1); - buf[indx] = 0; - while ((*cur != 0) && (indx < XML_NANO_MAX_URLBUF-1)) { - if ((cur[0] == ':') && (cur[1] == '/') && (cur[2] == '/')) { - buf[indx] = 0; - if (strcmp(ctxt->protocol, buf)) - return(-1); - indx = 0; - cur += 3; - break; - } - buf[indx++] = *cur++; - } - if (*cur == 0) + + uri = xmlParseURI(URL); + if (uri == NULL) return(-1); - buf[indx] = 0; - while (indx < XML_NANO_MAX_URLBUF-1) { - if ((strchr (cur, '[') && !strchr (cur, ']')) || - (!strchr (cur, '[') && strchr (cur, ']'))) { - xmlGenericError (xmlGenericErrorContext, "\nxmlNanoFTPUpdateURL: %s", - "Syntax Error\n"); - return (-1); - } - - if (cur[0] == '[') { - cur++; - while ((cur[0] != ']') && (indx < XML_NANO_MAX_URLBUF-1)) - buf[indx++] = *cur++; - - if (!strchr (buf, ':')) { - xmlGenericError (xmlGenericErrorContext, "\nxmlNanoFTPUpdateURL: %s", - "Use [IPv6]/IPv4 format\n"); - return (-1); - } - - buf[indx] = 0; - if (strcmp (ctxt->hostname, buf)) - return (-1); - indx = 0; - cur += 1; - if (cur[0] == ':') { - cur++; - while (*cur >= '0' && *cur <= '9') { - port *= 10; - port += *cur - '0'; - cur++; - } - - if (port != ctxt->port) - return (-1); - while ((cur[0] != '/') && (*cur != 0)) - cur++; - } - break; - } - else { - if (cur[0] == ':') { - buf[indx] = 0; - if (strcmp (ctxt->hostname, buf)) - return (-1); - indx = 0; - cur += 1; - while ((*cur >= '0') && (*cur <= '9')) { - port *= 10; - port += *cur - '0'; - cur++; - } - if (port != ctxt->port) - return (-1); - while ((cur[0] != '/') && (*cur != 0)) - cur++; - break; - } - if ((*cur == '/') || (*cur == 0)) { - buf[indx] = 0; - if (strcmp (ctxt->hostname, buf)) - return (-1); - indx = 0; - break; - } - } - buf[indx++] = *cur++; + if ((uri->scheme == NULL) || (uri->server == NULL)) { + xmlFreeURI(uri); + return(-1); } + if ((strcmp(ctxt->protocol, uri->scheme)) || + (strcmp(ctxt->hostname, uri->server)) || + ((uri->port != 0) && (ctxt->port != uri->port))) { + xmlFreeURI(uri); + return(-1); + } + + if (uri->port != 0) + ctxt->port = uri->port; + if (ctxt->path != NULL) { xmlFree(ctxt->path); ctxt->path = NULL; } - if (*cur == 0) + if (uri->path == NULL) ctxt->path = xmlMemStrdup("/"); - else { - indx = 0; - buf[indx] = 0; - while ((*cur != 0) && (indx < XML_NANO_MAX_URLBUF-1)) - buf[indx++] = *cur++; - buf[indx] = 0; - ctxt->path = xmlMemStrdup(buf); - } + else + ctxt->path = xmlMemStrdup(uri->path); + + xmlFreeURI(uri); + return(0); } @@ -575,105 +421,38 @@ xmlNanoFTPUpdateURL(void *ctx, const char *URL) { void xmlNanoFTPScanProxy(const char *URL) { - const char *cur = URL; - char buf[XML_NANO_MAX_URLBUF]; - int indx = 0; - int port = 0; + xmlURIPtr uri; if (proxy != NULL) { xmlFree(proxy); proxy = NULL; } - if (proxyPort != 0) { - proxyPort = 0; - } + proxyPort = 0; + #ifdef DEBUG_FTP if (URL == NULL) - xmlGenericError(xmlGenericErrorContext, "Removing FTP proxy info\n"); + xmlGenericError(xmlGenericErrorContext, + "Removing FTP proxy info\n"); else - xmlGenericError(xmlGenericErrorContext, "Using FTP proxy %s\n", URL); + xmlGenericError(xmlGenericErrorContext, + "Using FTP proxy %s\n", URL); #endif if (URL == NULL) return; - buf[indx] = 0; - while ((*cur != 0) && (indx < XML_NANO_MAX_URLBUF-1)) { - if ((cur[0] == ':') && (cur[1] == '/') && (cur[2] == '/')) { - buf[indx] = 0; - indx = 0; - cur += 3; - break; - } - buf[indx++] = *cur++; + + uri = xmlParseURI(URL); + if ((uri == NULL) || (uri->scheme == NULL) || + (strcmp(uri->scheme, "ftp")) || (uri->server == NULL)) { + __xmlIOErr(XML_FROM_FTP, XML_FTP_URL_SYNTAX, "Syntax Error\n"); + if (uri != NULL) + xmlFreeURI(uri); + return; } - if (*cur == 0) return; + + proxy = xmlMemStrdup(uri->server); + if (uri->port != 0) + proxyPort = uri->port; - buf[indx] = 0; - while (indx < XML_NANO_MAX_URLBUF-1) { - if ((strchr (cur, '[') && !strchr (cur, ']')) || - (!strchr (cur, '[') && strchr (cur, ']'))) { - xmlGenericError (xmlGenericErrorContext, "\nxmlNanoFTPScanProxy: %s", - "Syntax error\n"); - return; - } - - if (cur[0] == '[') { - cur++; - while ((cur[0] != ']') && (indx < XML_NANO_MAX_URLBUF-1)) - buf[indx++] = *cur++; - if (indx >= XML_NANO_MAX_URLBUF-1) { - xmlGenericError (xmlGenericErrorContext, - "\nxmlNanoFTPScanProxy: %s", "Syntax error\n"); - return; - } - - if (!strchr (buf, ':')) { - xmlGenericError (xmlGenericErrorContext, "\nxmlNanoFTPScanProxy: %s", - "Use [IPv6]/IPv4 format\n"); - return; - } - - buf[indx] = 0; - proxy = xmlMemStrdup (buf); - indx = 0; - cur += 1; - if (cur[0] == ':') { - cur++; - while (*cur >= '0' && *cur <= '9') { - port *= 10; - port += *cur - '0'; - cur++; - } - - if (port != 0) proxyPort = port; - while ((cur[0] != '/') && (*cur != 0)) - cur++; - } - break; - } - else { - if (cur[0] == ':') { - buf[indx] = 0; - proxy = xmlMemStrdup (buf); - indx = 0; - cur += 1; - while ((*cur >= '0') && (*cur <= '9')) { - port *= 10; - port += *cur - '0'; - cur++; - } - if (port != 0) proxyPort = port; - while ((cur[0] != '/') && (*cur != 0)) - cur++; - break; - } - if ((*cur == '/') || (*cur == 0)) { - buf[indx] = 0; - proxy = xmlMemStrdup (buf); - indx = 0; - break; - } - } - buf[indx++] = *cur++; - } + xmlFreeURI(uri); } /** @@ -1489,6 +1268,7 @@ xmlNanoFTPCwd(void *ctx, const char *directory) { int res; if ((ctxt == NULL) || (ctxt->controlFd < 0)) return(-1); + if (directory == NULL) return 0; /* * Expected response code for CWD: @@ -1537,6 +1317,7 @@ xmlNanoFTPDele(void *ctx, const char *file) { int res; if ((ctxt == NULL) || (ctxt->controlFd < 0) || (file == NULL)) return(-1); + if (file == NULL) return (0); /* * Expected response code for DELE: @@ -1940,6 +1721,7 @@ xmlNanoFTPList(void *ctx, ftpListCallback callback, void *userData, fd_set rfd, efd; struct timeval tv; + if (ctxt == NULL) return (-1); if (filename == NULL) { if (xmlNanoFTPCwd(ctxt, ctxt->path) < 1) return(-1); @@ -2113,6 +1895,7 @@ xmlNanoFTPGet(void *ctx, ftpDataCallback callback, void *userData, fd_set rfd; struct timeval tv; + if (ctxt == NULL) return(-1); if ((filename == NULL) && (ctxt->path == NULL)) return(-1); if (callback == NULL) @@ -2182,7 +1965,8 @@ xmlNanoFTPRead(void *ctx, void *dest, int len) { len = recv(ctxt->dataFd, dest, len, 0); if (len <= 0) { - __xmlIOErr(XML_FROM_FTP, 0, "recv failed"); + if (len < 0) + __xmlIOErr(XML_FROM_FTP, 0, "recv failed"); xmlNanoFTPCloseConnection(ctxt); } #ifdef DEBUG_FTP diff --git a/nanohttp.c b/nanohttp.c index 0a726839..ef88fd08 100644 --- a/nanohttp.c +++ b/nanohttp.c @@ -268,12 +268,10 @@ xmlNanoHTTPCleanup(void) { static void xmlNanoHTTPScanURL(xmlNanoHTTPCtxtPtr ctxt, const char *URL) { - const char *cur = URL; - char buf[4096]; - int indx = 0; - const int indxMax = 4096 - 1; - int port = 0; - + xmlURIPtr uri; + /* + * Clear any existing data from the context + */ if (ctxt->protocol != NULL) { xmlFree(ctxt->protocol); ctxt->protocol = NULL; @@ -287,92 +285,26 @@ xmlNanoHTTPScanURL(xmlNanoHTTPCtxtPtr ctxt, const char *URL) { ctxt->path = NULL; } if (URL == NULL) return; - buf[indx] = 0; - while ((*cur != 0) && (indx < indxMax)) { - if ((cur[0] == ':') && (cur[1] == '/') && (cur[2] == '/')) { - buf[indx] = 0; - ctxt->protocol = xmlMemStrdup(buf); - indx = 0; - cur += 3; - break; - } - buf[indx++] = *cur++; + + uri = xmlParseURI(URL); + if (uri == NULL) + return; + + if ((uri->scheme == NULL) || (uri->server == NULL)) { + xmlFreeURI(uri); + return; } - if (*cur == 0) return; - - buf[indx] = 0; - while (indx < indxMax) { - if ((strchr (cur, '[') && !strchr (cur, ']')) || - (!strchr (cur, '[') && strchr (cur, ']'))) { - __xmlIOErr(XML_FROM_HTTP, XML_HTTP_URL_SYNTAX, - "Syntax Error\n"); - return; - } - - if (cur[0] == '[') { - cur++; - while ((cur[0] != ']') && (indx < indxMax)) - buf[indx++] = *cur++; - if (!strchr (buf, ':')) { - __xmlIOErr(XML_FROM_HTTP, XML_HTTP_USE_IP, - "Use [IPv6]/IPv4 format\n"); - return; - } + ctxt->protocol = xmlMemStrdup(uri->scheme); + ctxt->hostname = xmlMemStrdup(uri->server); + if (uri->path != NULL) + ctxt->path = xmlMemStrdup(uri->path); + else + ctxt->path = xmlMemStrdup("/"); + if (uri->port != 0) + ctxt->port = uri->port; - buf[indx] = 0; - ctxt->hostname = xmlMemStrdup (buf); - indx = 0; - cur += 1; - if (cur[0] == ':') { - cur++; - while (*cur >= '0' && *cur <= '9') { - port *= 10; - port += *cur - '0'; - cur++; - } - - if (port != 0) ctxt->port = port; - while ((cur[0] != '/') && (*cur != 0)) - cur++; - } - break; - } - else { - if (cur[0] == ':') { - buf[indx] = 0; - ctxt->hostname = xmlMemStrdup (buf); - indx = 0; - cur += 1; - while ((*cur >= '0') && (*cur <= '9')) { - port *= 10; - port += *cur - '0'; - cur++; - } - if (port != 0) ctxt->port = port; - while ((cur[0] != '/') && (*cur != 0)) - cur++; - break; - } - if ((*cur == '/') || (*cur == 0)) { - buf[indx] = 0; - ctxt->hostname = xmlMemStrdup (buf); - indx = 0; - break; - } - } - buf[indx++] = *cur++; - } - if (*cur == 0) - ctxt->path = xmlMemStrdup("/"); - else { - indx = 0; - buf[indx] = 0; - while ((*cur != 0) && (indx < indxMax)) - buf[indx++] = *cur++; - buf[indx] = 0; - ctxt->path = xmlMemStrdup(buf); - } + xmlFreeURI(uri); } /** @@ -387,19 +319,14 @@ xmlNanoHTTPScanURL(xmlNanoHTTPCtxtPtr ctxt, const char *URL) { void xmlNanoHTTPScanProxy(const char *URL) { - const char *cur = URL; - char buf[4096]; - int indx = 0; - const int indxMax = 4096 - 1; - int port = 0; + xmlURIPtr uri; if (proxy != NULL) { xmlFree(proxy); proxy = NULL; } - if (proxyPort != 0) { - proxyPort = 0; - } + proxyPort = 0; + #ifdef DEBUG_HTTP if (URL == NULL) xmlGenericError(xmlGenericErrorContext, @@ -409,80 +336,21 @@ xmlNanoHTTPScanProxy(const char *URL) { "Using HTTP proxy %s\n", URL); #endif if (URL == NULL) return; - buf[indx] = 0; - while ((*cur != 0) && (indx < indxMax)) { - if ((cur[0] == ':') && (cur[1] == '/') && (cur[2] == '/')) { - buf[indx] = 0; - indx = 0; - cur += 3; - break; - } - buf[indx++] = *cur++; + + uri = xmlParseURI(URL); + if ((uri == NULL) || (uri->scheme == NULL) || + (strcmp(uri->scheme, "http")) || (uri->server == NULL)) { + __xmlIOErr(XML_FROM_HTTP, XML_HTTP_URL_SYNTAX, "Syntax Error\n"); + if (uri != NULL) + xmlFreeURI(uri); + return; } - if (*cur == 0) return; + + proxy = xmlMemStrdup(uri->server); + if (uri->port != 0) + proxyPort = uri->port; - buf[indx] = 0; - while (indx < indxMax) { - if ((strchr (cur, '[') && !strchr (cur, ']')) || - (!strchr (cur, '[') && strchr (cur, ']'))) { - __xmlIOErr(XML_FROM_HTTP, XML_HTTP_URL_SYNTAX, "Syntax Error\n"); - return; - } - - if (cur[0] == '[') { - cur++; - while ((cur[0] != ']') && (indx < indxMax)) - buf[indx++] = *cur++; - - if (!strchr (buf, ':')) { - __xmlIOErr(XML_FROM_HTTP, XML_HTTP_USE_IP, - "Use [IPv6]/IPv4 format\n"); - return; - } - - buf[indx] = 0; - proxy = xmlMemStrdup (buf); - indx = 0; - cur += 1; - if (cur[0] == ':') { - cur++; - while (*cur >= '0' && *cur <= '9') { - port *= 10; - port += *cur - '0'; - cur++; - } - - if (port != 0) proxyPort = port; - while ((cur[0] != '/') && (*cur != 0)) - cur ++; - } - break; - } - else { - if (cur[0] == ':') { - buf[indx] = 0; - proxy = xmlMemStrdup (buf); - indx = 0; - cur += 1; - while ((*cur >= '0') && (*cur <= '9')) { - port *= 10; - port += *cur - '0'; - cur++; - } - if (port != 0) proxyPort = port; - while ((cur[0] != '/') && (*cur != 0)) - cur++; - break; - } - if ((*cur == '/') || (*cur == 0)) { - buf[indx] = 0; - proxy = xmlMemStrdup (buf); - indx = 0; - break; - } - } - buf[indx++] = *cur++; - } + xmlFreeURI(uri); } /** @@ -1551,6 +1419,7 @@ xmlNanoHTTPFetch(const char *URL, const char *filename, char **contentType) { int fd; int len; + if (filename == NULL) return(-1); ctxt = xmlNanoHTTPOpen(URL, contentType); if (ctxt == NULL) return(-1); @@ -1595,7 +1464,7 @@ xmlNanoHTTPSave(void *ctxt, const char *filename) { int fd; int len; - if (ctxt == NULL) return(-1); + if ((ctxt == NULL) || (filename == NULL)) return(-1); if (!strcmp(filename, "-")) fd = 0; diff --git a/testapi.c b/testapi.c index 14421372..c10d50ec 100644 --- a/testapi.c +++ b/testapi.c @@ -193,6 +193,14 @@ int main(int argc, char **argv) { */ void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra); +/* + We need some "remote" addresses, but want to avoid getting into + name resolution delays, so we use these +*/ +#define REMOTE1GOOD "http://localhost/" +#define REMOTE1BAD "http://missing. example.org/" +#define REMOTE2GOOD "ftp://localhost/foo" + #define gen_nb_void_ptr 2 static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { @@ -392,8 +400,8 @@ static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) { if (no == 2) return("test/ent2"); if (no == 3) return("test/valid/REC-xml-19980210.xml"); if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd"); - if (no == 5) return("http://missing.example.org/"); - if (no == 6) return("http://missing. example.org/"); + if (no == 5) return(REMOTE1GOOD); + if (no == 6) return(REMOTE1BAD); return(NULL); } static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { @@ -413,9 +421,9 @@ static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSE static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) { if (no == 0) return("/missing.xml"); if (no == 1) return(""); - if (no == 2) return("ftp://missing.example.org/foo"); - if (no == 3) return("http://missing.example.org/"); - if (no == 4) return("http://missing. example.org/"); + if (no == 2) return(REMOTE2GOOD); + if (no == 3) return(REMOTE1GOOD); + if (no == 4) return(REMOTE1BAD); return(NULL); } static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { @@ -464,8 +472,8 @@ static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIB if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE)); if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE)); if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE)); - if (no == 5) return(xmlParserInputBufferCreateFilename("http://missing.example.org/", XML_CHAR_ENCODING_NONE)); - if (no == 6) return(xmlParserInputBufferCreateFilename("http://missing. example.org/", XML_CHAR_ENCODING_NONE)); + if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE)); + if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE)); return(NULL); } static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) { @@ -642,8 +650,8 @@ static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr v #ifdef LIBXML_FTP_ENABLED #define gen_nb_xmlNanoFTPCtxtPtr 4 static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlNanoFTPNewCtxt("ftp://example.com/")); - if (no == 1) return(xmlNanoFTPNewCtxt("http://example.com/")); + if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD)); + if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD)); if (no == 2) return(xmlNanoFTPNewCtxt("foo")); return(NULL); } @@ -656,10 +664,16 @@ static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATT #ifdef LIBXML_HTTP_ENABLED #define gen_nb_xmlNanoHTTPCtxtPtr 1 -static void *gen_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { +static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) { + if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL)); + if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL)); + if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL)); return(NULL); } -static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { +static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) { + if (val != NULL) { + xmlNanoHTTPClose(val); + } } #endif @@ -667,7 +681,7 @@ static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_ static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) { if (no == 0) return(XML_CHAR_ENCODING_UTF8); if (no == 1) return(XML_CHAR_ENCODING_NONE); - if (no == 0) return(XML_CHAR_ENCODING_8859_1); + if (no == 2) return(XML_CHAR_ENCODING_8859_1); return(XML_CHAR_ENCODING_ERROR); } static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { @@ -800,8 +814,15 @@ static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) { #ifdef LIBXML_HTML_ENABLED static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) { } +static void desret_xmlNanoHTTPCtxtPtr(void *val) { + xmlNanoHTTPClose(val); +} +#endif +#ifdef LIBXML_FTP_ENABLED +static void desret_xmlNanoFTPCtxtPtr(void *val) { + xmlNanoFTPClose(val); +} #endif - /* cut and pasted from autogenerated to avoid troubles */ #define gen_nb_const_xmlChar_ptr_ptr 1 static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { @@ -11527,8 +11548,32 @@ static int test_xmlNanoFTPNewCtxt(void) { int test_ret = 0; +#if defined(LIBXML_FTP_ENABLED) + int mem_base; + void * ret_val; + const char * URL; /* The URL used to initialize the context */ + int n_URL; + + for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { + mem_base = xmlMemBlocks(); + URL = gen_filepath(n_URL, 0); + + ret_val = xmlNanoFTPNewCtxt(URL); + desret_xmlNanoFTPCtxtPtr(ret_val); + call_tests++; + des_filepath(n_URL, URL, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlNanoFTPNewCtxt", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_URL); + printf("\n"); + } + } + function_tests++; +#endif - /* missing type support */ return(test_ret); } @@ -11548,7 +11593,7 @@ test_xmlNanoFTPOpen(void) { URL = gen_filepath(n_URL, 0); ret_val = xmlNanoFTPOpen(URL); - desret_void_ptr(ret_val); + desret_xmlNanoFTPCtxtPtr(ret_val); call_tests++; des_filepath(n_URL, URL, 0); xmlResetLastError(); @@ -11763,7 +11808,7 @@ static int test_nanoftp(void) { int test_ret = 0; - if (quiet == 0) printf("Testing nanoftp : 15 of 22 functions ...\n"); + if (quiet == 0) printf("Testing nanoftp : 16 of 22 functions ...\n"); test_ret += test_xmlNanoFTPCheckResponse(); test_ret += test_xmlNanoFTPCleanup(); test_ret += test_xmlNanoFTPCloseConnection(); @@ -11847,38 +11892,6 @@ test_xmlNanoHTTPCleanup(void) { } -static int -test_xmlNanoHTTPClose(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - void * ctx; /* the HTTP context */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); - - xmlNanoHTTPClose(ctx); - call_tests++; - des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPClose", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - static int test_xmlNanoHTTPContentLength(void) { int test_ret = 0; @@ -11968,19 +11981,19 @@ test_xmlNanoHTTPFetch(void) { char ** contentType; /* if available the Content-Type information will be returned at that location */ int n_contentType; - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { + for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) { + for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) { mem_base = xmlMemBlocks(); - URL = gen_filepath(n_URL, 0); - filename = gen_filepath(n_filename, 1); + URL = gen_fileoutput(n_URL, 0); + filename = gen_fileoutput(n_filename, 1); contentType = gen_char_ptr_ptr(n_contentType, 2); ret_val = xmlNanoHTTPFetch(URL, filename, contentType); desret_int(ret_val); call_tests++; - des_filepath(n_URL, URL, 0); - des_filepath(n_filename, filename, 1); + des_fileoutput(n_URL, URL, 0); + des_fileoutput(n_filename, filename, 1); des_char_ptr_ptr(n_contentType, contentType, 2); xmlResetLastError(); if (mem_base != xmlMemBlocks()) { @@ -12027,151 +12040,6 @@ test_xmlNanoHTTPInit(void) { } -static int -test_xmlNanoHTTPMethod(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - void * ret_val; - const char * URL; /* The URL to load */ - int n_URL; - char * method; /* the HTTP method to use */ - int n_method; - char * input; /* the input string if any */ - int n_input; - char ** contentType; /* the Content-Type information IN and OUT */ - int n_contentType; - char * headers; /* the extra headers */ - int n_headers; - int ilen; /* input length */ - int n_ilen; - - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_method = 0;n_method < gen_nb_const_char_ptr;n_method++) { - for (n_input = 0;n_input < gen_nb_const_char_ptr;n_input++) { - for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) { - for (n_headers = 0;n_headers < gen_nb_const_char_ptr;n_headers++) { - for (n_ilen = 0;n_ilen < gen_nb_int;n_ilen++) { - mem_base = xmlMemBlocks(); - URL = gen_filepath(n_URL, 0); - method = gen_const_char_ptr(n_method, 1); - input = gen_const_char_ptr(n_input, 2); - contentType = gen_char_ptr_ptr(n_contentType, 3); - headers = gen_const_char_ptr(n_headers, 4); - ilen = gen_int(n_ilen, 5); - - ret_val = xmlNanoHTTPMethod(URL, (const char *)method, (const char *)input, contentType, (const char *)headers, ilen); - desret_void_ptr(ret_val); - call_tests++; - des_filepath(n_URL, URL, 0); - des_const_char_ptr(n_method, (const char *)method, 1); - des_const_char_ptr(n_input, (const char *)input, 2); - des_char_ptr_ptr(n_contentType, contentType, 3); - des_const_char_ptr(n_headers, (const char *)headers, 4); - des_int(n_ilen, ilen, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPMethod", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URL); - printf(" %d", n_method); - printf(" %d", n_input); - printf(" %d", n_contentType); - printf(" %d", n_headers); - printf(" %d", n_ilen); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoHTTPMethodRedir(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - void * ret_val; - const char * URL; /* The URL to load */ - int n_URL; - char * method; /* the HTTP method to use */ - int n_method; - char * input; /* the input string if any */ - int n_input; - char ** contentType; /* the Content-Type information IN and OUT */ - int n_contentType; - char ** redir; /* the redirected URL OUT */ - int n_redir; - char * headers; /* the extra headers */ - int n_headers; - int ilen; /* input length */ - int n_ilen; - - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_method = 0;n_method < gen_nb_const_char_ptr;n_method++) { - for (n_input = 0;n_input < gen_nb_const_char_ptr;n_input++) { - for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) { - for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) { - for (n_headers = 0;n_headers < gen_nb_const_char_ptr;n_headers++) { - for (n_ilen = 0;n_ilen < gen_nb_int;n_ilen++) { - mem_base = xmlMemBlocks(); - URL = gen_filepath(n_URL, 0); - method = gen_const_char_ptr(n_method, 1); - input = gen_const_char_ptr(n_input, 2); - contentType = gen_char_ptr_ptr(n_contentType, 3); - redir = gen_char_ptr_ptr(n_redir, 4); - headers = gen_const_char_ptr(n_headers, 5); - ilen = gen_int(n_ilen, 6); - - ret_val = xmlNanoHTTPMethodRedir(URL, (const char *)method, (const char *)input, contentType, redir, (const char *)headers, ilen); - desret_void_ptr(ret_val); - call_tests++; - des_filepath(n_URL, URL, 0); - des_const_char_ptr(n_method, (const char *)method, 1); - des_const_char_ptr(n_input, (const char *)input, 2); - des_char_ptr_ptr(n_contentType, contentType, 3); - des_char_ptr_ptr(n_redir, redir, 4); - des_const_char_ptr(n_headers, (const char *)headers, 5); - des_int(n_ilen, ilen, 6); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPMethodRedir", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URL); - printf(" %d", n_method); - printf(" %d", n_input); - printf(" %d", n_contentType); - printf(" %d", n_redir); - printf(" %d", n_headers); - printf(" %d", n_ilen); - printf("\n"); - } - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - static int test_xmlNanoHTTPMimeType(void) { int test_ret = 0; @@ -12225,7 +12093,7 @@ test_xmlNanoHTTPOpen(void) { contentType = gen_char_ptr_ptr(n_contentType, 1); ret_val = xmlNanoHTTPOpen(URL, contentType); - desret_void_ptr(ret_val); + desret_xmlNanoHTTPCtxtPtr(ret_val); call_tests++; des_filepath(n_URL, URL, 0); des_char_ptr_ptr(n_contentType, contentType, 1); @@ -12270,7 +12138,7 @@ test_xmlNanoHTTPOpenRedir(void) { redir = gen_char_ptr_ptr(n_redir, 2); ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir); - desret_void_ptr(ret_val); + desret_xmlNanoHTTPCtxtPtr(ret_val); call_tests++; des_filepath(n_URL, URL, 0); des_char_ptr_ptr(n_contentType, contentType, 1); @@ -12454,16 +12322,13 @@ static int test_nanohttp(void) { int test_ret = 0; - if (quiet == 0) printf("Testing nanohttp : 16 of 17 functions ...\n"); + if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n"); test_ret += test_xmlNanoHTTPAuthHeader(); test_ret += test_xmlNanoHTTPCleanup(); - test_ret += test_xmlNanoHTTPClose(); test_ret += test_xmlNanoHTTPContentLength(); test_ret += test_xmlNanoHTTPEncoding(); test_ret += test_xmlNanoHTTPFetch(); test_ret += test_xmlNanoHTTPInit(); - test_ret += test_xmlNanoHTTPMethod(); - test_ret += test_xmlNanoHTTPMethodRedir(); test_ret += test_xmlNanoHTTPMimeType(); test_ret += test_xmlNanoHTTPOpen(); test_ret += test_xmlNanoHTTPOpenRedir(); @@ -26899,7 +26764,7 @@ test_xmlIOHTTPOpen(void) { filename = gen_filepath(n_filename, 0); ret_val = xmlIOHTTPOpen(filename); - desret_void_ptr(ret_val); + desret_xmlNanoHTTPCtxtPtr(ret_val); call_tests++; des_filepath(n_filename, filename, 0); xmlResetLastError(); @@ -26918,16 +26783,6 @@ test_xmlIOHTTPOpen(void) { } -static int -test_xmlIOHTTPOpenW(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - static int test_xmlIOHTTPRead(void) { int test_ret = 0; @@ -27780,7 +27635,6 @@ test_xmlIO(void) { test_ret += test_xmlIOHTTPClose(); test_ret += test_xmlIOHTTPMatch(); test_ret += test_xmlIOHTTPOpen(); - test_ret += test_xmlIOHTTPOpenW(); test_ret += test_xmlIOHTTPRead(); test_ret += test_xmlNoNetExternalEntityLoader(); test_ret += test_xmlNormalizeWindowsPath(); diff --git a/uri.c b/uri.c index fd6b5882..09abd3d7 100644 --- a/uri.c +++ b/uri.c @@ -1,7 +1,7 @@ /** * uri.c: set of generic URI related routines * - * Reference: RFC 2396 + * Reference: RFCs 2396, 2732 and 2373 * * See Copyright for the status of this software. * @@ -78,12 +78,14 @@ /* - * reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," + * reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," | + * "[" | "]" */ #define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \ ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \ - ((x) == '+') || ((x) == '$') || ((x) == ',')) + ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \ + ((x) == ']')) /* * unreserved = alphanum | mark @@ -159,7 +161,7 @@ (IS_RESERVED(*(p)))) /* -* unwise = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`" +* unwise = "{" | "}" | "|" | "\" | "^" | "`" */ #define IS_UNWISE(p) \ @@ -1199,11 +1201,16 @@ xmlParseURIOpaquePart(xmlURIPtr uri, const char **str) * userinfo = *( unreserved | escaped | * ";" | ":" | "&" | "=" | "+" | "$" | "," ) * hostport = host [ ":" port ] - * host = hostname | IPv4address + * host = hostname | IPv4address | IPv6reference * hostname = *( domainlabel "." ) toplabel [ "." ] * domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum * toplabel = alpha | alpha *( alphanum | "-" ) alphanum - * IPv4address = 1*digit "." 1*digit "." 1*digit "." 1*digit + * IPv6reference = "[" IPv6address "]" + * IPv6address = hexpart [ ":" IPv4address ] + * IPv4address = 1*3digit "." 1*3digit "." 1*3digit "." 1*3digit + * hexpart = hexseq | hexseq "::" [ hexseq ]| "::" [ hexseq ] + * hexseq = hex4 *( ":" hex4) + * hex4 = 1*4hexdig * port = *digit * * Returns 0 or the error code @@ -1212,7 +1219,8 @@ static int xmlParseURIServer(xmlURIPtr uri, const char **str) { const char *cur; const char *host, *tmp; - const int IPmax = 4; + const int IPV4max = 4; + const int IPV6max = 8; int oct; if (str == NULL) @@ -1221,7 +1229,7 @@ xmlParseURIServer(xmlURIPtr uri, const char **str) { cur = *str; /* - * is there an userinfo ? + * is there a userinfo ? */ while (IS_USERINFO(cur)) NEXT(cur); if (*cur == '@') { @@ -1252,21 +1260,60 @@ xmlParseURIServer(xmlURIPtr uri, const char **str) { return(0); } /* - * host part of hostport can derive either an IPV4 address - * or an unresolved name. Check the IP first, it easier to detect - * errors if wrong one + * host part of hostport can denote an IPV4 address, an IPV6 address + * or an unresolved name. Check the IP first, its easier to detect + * errors if wrong one. + * An IPV6 address must start with a '[' and end with a ']'. */ - for (oct = 0; oct < IPmax; ++oct) { - if (*cur == '.') - return(3); /* e.g. http://.xml/ or http://18.29..30/ */ - while(IS_DIGIT(*cur)) cur++; - if (oct == (IPmax-1)) - continue; - if (*cur != '.') - break; - cur++; + if (*cur == '[') { + int compress=0; + cur++; + for (oct = 0; oct < IPV6max; ++oct) { + if (*cur == ':') { + if (compress) + return(3); /* multiple compression attempted */ + if (!oct) { /* initial char is compression */ + if (*++cur != ':') + return(3); + } + compress = 1; /* set compression-encountered flag */ + cur++; /* skip over the second ':' */ + continue; + } + while(IS_HEX(*cur)) cur++; + if (oct == (IPV6max-1)) + continue; + if (*cur != ':') + break; + cur++; + } + if ((!compress) && (oct != IPV6max)) + return(3); + if (*cur != ']') + return(3); + if (uri != NULL) { + if (uri->server != NULL) xmlFree(uri->server); + uri->server = (char *)xmlStrndup((xmlChar *)host+1, + (cur-host)-1); + } + cur++; + } else { + /* + * Not IPV6, maybe IPV4 + */ + for (oct = 0; oct < IPV4max; ++oct) { + if (*cur == '.') + return(3); /* e.g. http://.xml/ or http://18.29..30/ */ + while(IS_DIGIT(*cur)) cur++; + if (oct == (IPV4max-1)) + continue; + if (*cur != '.') + break; + cur++; + } } - if (oct < IPmax || (*cur == '.' && cur++) || IS_ALPHA(*cur)) { + if ((host[0] != '[') && (oct < IPV4max || (*cur == '.' && cur++) || + IS_ALPHA(*cur))) { /* maybe host_name */ if (!IS_ALPHANUM(*cur)) return(4); /* e.g. http://xml.$oft */ @@ -1300,8 +1347,10 @@ xmlParseURIServer(xmlURIPtr uri, const char **str) { if (uri != NULL) { if (uri->authority != NULL) xmlFree(uri->authority); uri->authority = NULL; - if (uri->server != NULL) xmlFree(uri->server); - uri->server = xmlURIUnescapeString(host, cur - host, NULL); + if (host[0] != '[') { /* it's not an IPV6 addr */ + if (uri->server != NULL) xmlFree(uri->server); + uri->server = xmlURIUnescapeString(host, cur - host, NULL); + } } /* * finish by checking for a port presence. diff --git a/win32/libxml2.def.src b/win32/libxml2.def.src index cb7bede3..64173080 100644 --- a/win32/libxml2.def.src +++ b/win32/libxml2.def.src @@ -805,6 +805,7 @@ xmlFreeProp xmlFreePropList xmlFreeRMutex xmlFreeRefTable +xmlFreeStreamCtxt xmlFreeTextReader xmlFreeTextWriter xmlFreeURI @@ -1296,6 +1297,7 @@ xmlParserPrintFileInfo xmlParserValidityError xmlParserValidityWarning xmlParserWarning +xmlPatternGetStreamCtxt xmlPatternMatch xmlPatterncompile xmlPedanticParserDefault @@ -1695,6 +1697,8 @@ xmlStrcat xmlStrchr xmlStrcmp xmlStrdup +xmlStreamPop +xmlStreamPush xmlStringCurrentChar xmlStringDecodeEntities xmlStringGetNodeList