summaryrefslogtreecommitdiff
path: root/src/lxml/includes
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2014-05-28 21:04:55 +0200
committerStefan Behnel <stefan_ml@behnel.de>2014-05-28 21:04:55 +0200
commit35316b052af48921657813bb68563fe4a301d1b8 (patch)
tree6868381e6a66a12f61650f1c86f3401138e950e4 /src/lxml/includes
parent593f24af60b8edcd296426d8ae637aea240b8651 (diff)
downloadpython-lxml-35316b052af48921657813bb68563fe4a301d1b8.tar.gz
use per-document hash tables for XML IDs and allow disabling them completely with collect_ids=False
Diffstat (limited to 'src/lxml/includes')
-rw-r--r--src/lxml/includes/tree.pxd5
-rw-r--r--src/lxml/includes/xmlparser.pxd16
2 files changed, 17 insertions, 4 deletions
diff --git a/src/lxml/includes/tree.pxd b/src/lxml/includes/tree.pxd
index 64664c9f..a6cadfbb 100644
--- a/src/lxml/includes/tree.pxd
+++ b/src/lxml/includes/tree.pxd
@@ -66,6 +66,11 @@ cdef extern from "libxml/hash.h":
ctypedef void (*xmlHashScanner)(void* payload, void* data, const_xmlChar* name) # may require GIL!
void xmlHashScan(xmlHashTable* table, xmlHashScanner f, void* data) nogil
void* xmlHashLookup(xmlHashTable* table, const_xmlChar* name) nogil
+ ctypedef void (*xmlHashDeallocator)(void *payload, xmlChar *name)
+ cdef xmlHashTable* xmlHashCreate(int size)
+ cdef xmlHashTable* xmlHashCreateDict(int size, xmlDict *dict)
+ cdef int xmlHashSize(xmlHashTable* table)
+ cdef void xmlHashFree(xmlHashTable* table, xmlHashDeallocator f)
cdef extern from *: # actually "libxml/dict.h"
# libxml/dict.h appears to be broken to include in C
diff --git a/src/lxml/includes/xmlparser.pxd b/src/lxml/includes/xmlparser.pxd
index 9b0ded41..b9b09da5 100644
--- a/src/lxml/includes/xmlparser.pxd
+++ b/src/lxml/includes/xmlparser.pxd
@@ -1,6 +1,7 @@
from libc.string cimport const_char
-from lxml.includes.tree cimport xmlDoc, xmlNode, xmlDict, xmlDtd, const_xmlChar
+from lxml.includes.tree cimport (
+ xmlDoc, xmlNode, xmlDict, xmlDtd, xmlChar, const_xmlChar)
from lxml.includes.tree cimport xmlInputReadCallback, xmlInputCloseCallback
from lxml.includes.xmlerror cimport xmlError, xmlStructuredErrorFunc
@@ -82,8 +83,14 @@ cdef extern from "libxml/tree.h":
xmlStructuredErrorFunc serror
void* _private
-cdef extern from "libxml/xmlIO.h":
- cdef xmlParserInputBuffer* xmlAllocParserInputBuffer(int enc) nogil
+
+cdef extern from "libxml/SAX2.h" nogil:
+ cdef void xmlSAX2StartDocument(void* ctxt)
+
+
+cdef extern from "libxml/xmlIO.h" nogil:
+ cdef xmlParserInputBuffer* xmlAllocParserInputBuffer(int enc)
+
cdef extern from "libxml/parser.h":
@@ -92,7 +99,8 @@ cdef extern from "libxml/parser.h":
cdef void xmlDictFree(xmlDict* sub) nogil
cdef int xmlDictReference(xmlDict* dict) nogil
- cdef int XML_COMPLETE_ATTRS # SAX option for adding DTD default attributes
+ cdef int XML_COMPLETE_ATTRS # SAX option for adding DTD default attributes
+ cdef int XML_SKIP_IDS # SAX option for not building an XML ID dict
ctypedef struct xmlParserCtxt:
xmlDoc* myDoc