#ifndef Py_BUILD_CORE_BUILTIN
#define Py_BUILD_CORE_MODULE …
#endif
#include "Python.h"
#include "pycore_import.h"
#include "pycore_pyhash.h"
#include <stddef.h>
#include "expat.h"
#include "pyexpat.h"
#define STATIC_CHILDREN …
#if defined(_MSC_VER)
#define LOCAL …
#else
#define LOCAL(type) …
#endif
#define JOIN_GET(p) …
#define JOIN_SET(p, flag) …
#define JOIN_OBJ(p) …
Py_LOCAL_INLINE(void)
_set_joined_ptr(PyObject **p, PyObject *new_joined_ptr)
{ … }
static void _clear_joined_ptr(PyObject **p)
{ … }
elementtreestate;
static struct PyModuleDef elementtreemodule;
static inline elementtreestate*
get_elementtree_state(PyObject *module)
{ … }
static inline elementtreestate *
get_elementtree_state_by_cls(PyTypeObject *cls)
{ … }
static inline elementtreestate *
get_elementtree_state_by_type(PyTypeObject *tp)
{ … }
static int
elementtree_clear(PyObject *m)
{ … }
static int
elementtree_traverse(PyObject *m, visitproc visit, void *arg)
{ … }
static void
elementtree_free(void *m)
{ … }
LOCAL(PyObject*)
list_join(PyObject* list)
{ … }
static int
is_empty_dict(PyObject *obj)
{ … }
ElementObjectExtra;
ElementObject;
#define Element_CheckExact(st, op) …
#define Element_Check(st, op) …
LOCAL(int)
create_extra(ElementObject* self, PyObject* attrib)
{ … }
LOCAL(void)
dealloc_extra(ElementObjectExtra *extra)
{ … }
LOCAL(void)
clear_extra(ElementObject* self)
{ … }
LOCAL(PyObject*)
create_new_element(elementtreestate *st, PyObject *tag, PyObject *attrib)
{ … }
static PyObject *
element_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ … }
static PyObject*
get_attrib_from_keywords(PyObject *kwds)
{ … }
static int
element_init(PyObject *self, PyObject *args, PyObject *kwds)
{ … }
LOCAL(int)
element_resize(ElementObject* self, Py_ssize_t extra)
{ … }
LOCAL(void)
raise_type_error(PyObject *element)
{ … }
LOCAL(int)
element_add_subelement(elementtreestate *st, ElementObject *self,
PyObject *element)
{ … }
LOCAL(PyObject*)
element_get_attrib(ElementObject* self)
{ … }
LOCAL(PyObject*)
element_get_text(ElementObject* self)
{ … }
LOCAL(PyObject*)
element_get_tail(ElementObject* self)
{ … }
static PyObject*
subelement(PyObject *self, PyObject *args, PyObject *kwds)
{ … }
static int
element_gc_traverse(ElementObject *self, visitproc visit, void *arg)
{ … }
static int
element_gc_clear(ElementObject *self)
{ … }
static void
element_dealloc(ElementObject* self)
{ … }
static PyObject *
_elementtree_Element_append_impl(ElementObject *self, PyTypeObject *cls,
PyObject *subelement)
{ … }
static PyObject *
_elementtree_Element_clear_impl(ElementObject *self)
{ … }
static PyObject *
_elementtree_Element___copy___impl(ElementObject *self, PyTypeObject *cls)
{ … }
LOCAL(PyObject *) deepcopy(elementtreestate *, PyObject *, PyObject *);
static PyObject *
_elementtree_Element___deepcopy___impl(ElementObject *self, PyObject *memo)
{ … }
LOCAL(PyObject *)
deepcopy(elementtreestate *st, PyObject *object, PyObject *memo)
{ … }
static size_t
_elementtree_Element___sizeof___impl(ElementObject *self)
{ … }
#define PICKLED_TAG …
#define PICKLED_CHILDREN …
#define PICKLED_ATTRIB …
#define PICKLED_TAIL …
#define PICKLED_TEXT …
static PyObject *
_elementtree_Element___getstate___impl(ElementObject *self)
{ … }
static PyObject *
element_setstate_from_attributes(elementtreestate *st,
ElementObject *self,
PyObject *tag,
PyObject *attrib,
PyObject *text,
PyObject *tail,
PyObject *children)
{ … }
static PyObject *
element_setstate_from_Python(elementtreestate *st, ElementObject *self,
PyObject *state)
{ … }
static PyObject *
_elementtree_Element___setstate___impl(ElementObject *self,
PyTypeObject *cls, PyObject *state)
{ … }
LOCAL(int)
checkpath(PyObject* tag)
{ … }
static PyObject *
_elementtree_Element_extend_impl(ElementObject *self, PyTypeObject *cls,
PyObject *elements)
{ … }
static PyObject *
_elementtree_Element_find_impl(ElementObject *self, PyTypeObject *cls,
PyObject *path, PyObject *namespaces)
{ … }
static PyObject *
_elementtree_Element_findtext_impl(ElementObject *self, PyTypeObject *cls,
PyObject *path, PyObject *default_value,
PyObject *namespaces)
{ … }
static PyObject *
_elementtree_Element_findall_impl(ElementObject *self, PyTypeObject *cls,
PyObject *path, PyObject *namespaces)
{ … }
static PyObject *
_elementtree_Element_iterfind_impl(ElementObject *self, PyTypeObject *cls,
PyObject *path, PyObject *namespaces)
{ … }
static PyObject *
_elementtree_Element_get_impl(ElementObject *self, PyObject *key,
PyObject *default_value)
{ … }
static PyObject *
create_elementiter(elementtreestate *st, ElementObject *self, PyObject *tag,
int gettext);
static PyObject *
_elementtree_Element_iter_impl(ElementObject *self, PyTypeObject *cls,
PyObject *tag)
{ … }
static PyObject *
_elementtree_Element_itertext_impl(ElementObject *self, PyTypeObject *cls)
{ … }
static PyObject*
element_getitem(PyObject* self_, Py_ssize_t index)
{ … }
static int
element_bool(PyObject* self_)
{ … }
static PyObject *
_elementtree_Element_insert_impl(ElementObject *self, Py_ssize_t index,
PyObject *subelement)
{ … }
static PyObject *
_elementtree_Element_items_impl(ElementObject *self)
{ … }
static PyObject *
_elementtree_Element_keys_impl(ElementObject *self)
{ … }
static Py_ssize_t
element_length(ElementObject* self)
{ … }
static PyObject *
_elementtree_Element_makeelement_impl(ElementObject *self, PyTypeObject *cls,
PyObject *tag, PyObject *attrib)
{ … }
static PyObject *
_elementtree_Element_remove_impl(ElementObject *self, PyObject *subelement)
{ … }
static PyObject*
element_repr(ElementObject* self)
{ … }
static PyObject *
_elementtree_Element_set_impl(ElementObject *self, PyObject *key,
PyObject *value)
{ … }
static int
element_setitem(PyObject* self_, Py_ssize_t index, PyObject* item)
{ … }
static PyObject*
element_subscr(PyObject* self_, PyObject* item)
{ … }
static int
element_ass_subscr(PyObject* self_, PyObject* item, PyObject* value)
{ … }
static PyObject*
element_tag_getter(ElementObject *self, void *closure)
{ … }
static PyObject*
element_text_getter(ElementObject *self, void *closure)
{ … }
static PyObject*
element_tail_getter(ElementObject *self, void *closure)
{ … }
static PyObject*
element_attrib_getter(ElementObject *self, void *closure)
{ … }
#define _VALIDATE_ATTR_VALUE(V) …
static int
element_tag_setter(ElementObject *self, PyObject *value, void *closure)
{ … }
static int
element_text_setter(ElementObject *self, PyObject *value, void *closure)
{ … }
static int
element_tail_setter(ElementObject *self, PyObject *value, void *closure)
{ … }
static int
element_attrib_setter(ElementObject *self, PyObject *value, void *closure)
{ … }
ParentLocator;
ElementIterObject;
static void
elementiter_dealloc(ElementIterObject *it)
{ … }
static int
elementiter_traverse(ElementIterObject *it, visitproc visit, void *arg)
{ … }
static int
parent_stack_push_new(ElementIterObject *it, ElementObject *parent)
{ … }
static PyObject *
elementiter_next(ElementIterObject *it)
{ … }
static PyType_Slot elementiter_slots[] = …;
static PyType_Spec elementiter_spec = …;
#define INIT_PARENT_STACK_SIZE …
static PyObject *
create_elementiter(elementtreestate *st, ElementObject *self, PyObject *tag,
int gettext)
{ … }
TreeBuilderObject;
#define TreeBuilder_CheckExact(st, op) …
static PyObject *
treebuilder_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ … }
static int
_elementtree_TreeBuilder___init___impl(TreeBuilderObject *self,
PyObject *element_factory,
PyObject *comment_factory,
PyObject *pi_factory,
int insert_comments, int insert_pis)
{ … }
static int
treebuilder_gc_traverse(TreeBuilderObject *self, visitproc visit, void *arg)
{ … }
static int
treebuilder_gc_clear(TreeBuilderObject *self)
{ … }
static void
treebuilder_dealloc(TreeBuilderObject *self)
{ … }
static PyObject *
_elementtree__set_factories_impl(PyObject *module, PyObject *comment_factory,
PyObject *pi_factory)
{ … }
static int
treebuilder_extend_element_text_or_tail(elementtreestate *st, PyObject *element,
PyObject **data, PyObject **dest,
PyObject *name)
{ … }
LOCAL(int)
treebuilder_flush_data(TreeBuilderObject* self)
{ … }
static int
treebuilder_add_subelement(elementtreestate *st, PyObject *element,
PyObject *child)
{ … }
LOCAL(int)
treebuilder_append_event(TreeBuilderObject *self, PyObject *action,
PyObject *node)
{ … }
LOCAL(PyObject*)
treebuilder_handle_start(TreeBuilderObject* self, PyObject* tag,
PyObject* attrib)
{ … }
LOCAL(PyObject*)
treebuilder_handle_data(TreeBuilderObject* self, PyObject* data)
{ … }
LOCAL(PyObject*)
treebuilder_handle_end(TreeBuilderObject* self, PyObject* tag)
{ … }
LOCAL(PyObject*)
treebuilder_handle_comment(TreeBuilderObject* self, PyObject* text)
{ … }
LOCAL(PyObject*)
treebuilder_handle_pi(TreeBuilderObject* self, PyObject* target, PyObject* text)
{ … }
LOCAL(PyObject*)
treebuilder_handle_start_ns(TreeBuilderObject* self, PyObject* prefix, PyObject* uri)
{ … }
LOCAL(PyObject*)
treebuilder_handle_end_ns(TreeBuilderObject* self, PyObject* prefix)
{ … }
static PyObject *
_elementtree_TreeBuilder_data(TreeBuilderObject *self, PyObject *data)
{ … }
static PyObject *
_elementtree_TreeBuilder_end(TreeBuilderObject *self, PyObject *tag)
{ … }
static PyObject *
_elementtree_TreeBuilder_comment(TreeBuilderObject *self, PyObject *text)
{ … }
static PyObject *
_elementtree_TreeBuilder_pi_impl(TreeBuilderObject *self, PyObject *target,
PyObject *text)
{ … }
LOCAL(PyObject*)
treebuilder_done(TreeBuilderObject* self)
{ … }
static PyObject *
_elementtree_TreeBuilder_close_impl(TreeBuilderObject *self)
{ … }
static PyObject *
_elementtree_TreeBuilder_start_impl(TreeBuilderObject *self, PyObject *tag,
PyObject *attrs)
{ … }
#define EXPAT(st, func) …
static XML_Memory_Handling_Suite ExpatMemoryHandler = …;
XMLParserObject;
LOCAL(PyObject*)
makeuniversal(XMLParserObject* self, const char* string)
{ … }
static void
expat_set_error(elementtreestate *st, enum XML_Error error_code,
Py_ssize_t line, Py_ssize_t column, const char *message)
{ … }
static void
expat_default_handler(XMLParserObject* self, const XML_Char* data_in,
int data_len)
{ … }
static void
expat_start_handler(XMLParserObject* self, const XML_Char* tag_in,
const XML_Char **attrib_in)
{ … }
static void
expat_data_handler(XMLParserObject* self, const XML_Char* data_in,
int data_len)
{ … }
static void
expat_end_handler(XMLParserObject* self, const XML_Char* tag_in)
{ … }
static void
expat_start_ns_handler(XMLParserObject* self, const XML_Char* prefix_in,
const XML_Char *uri_in)
{ … }
static void
expat_end_ns_handler(XMLParserObject* self, const XML_Char* prefix_in)
{ … }
static void
expat_comment_handler(XMLParserObject* self, const XML_Char* comment_in)
{ … }
static void
expat_start_doctype_handler(XMLParserObject *self,
const XML_Char *doctype_name,
const XML_Char *sysid,
const XML_Char *pubid,
int has_internal_subset)
{ … }
static void
expat_pi_handler(XMLParserObject* self, const XML_Char* target_in,
const XML_Char* data_in)
{ … }
static PyObject *
xmlparser_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ … }
static int
ignore_attribute_error(PyObject *value)
{ … }
static int
_elementtree_XMLParser___init___impl(XMLParserObject *self, PyObject *target,
const char *encoding)
{ … }
static int
xmlparser_gc_traverse(XMLParserObject *self, visitproc visit, void *arg)
{ … }
static int
xmlparser_gc_clear(XMLParserObject *self)
{ … }
static void
xmlparser_dealloc(XMLParserObject* self)
{ … }
Py_LOCAL_INLINE(int)
_check_xmlparser(XMLParserObject* self)
{ … }
LOCAL(PyObject*)
expat_parse(elementtreestate *st, XMLParserObject *self, const char *data,
int data_len, int final)
{ … }
static PyObject *
_elementtree_XMLParser_close_impl(XMLParserObject *self)
{ … }
static PyObject *
_elementtree_XMLParser_flush_impl(XMLParserObject *self)
{ … }
static PyObject *
_elementtree_XMLParser_feed(XMLParserObject *self, PyObject *data)
{ … }
static PyObject *
_elementtree_XMLParser__parse_whole(XMLParserObject *self, PyObject *file)
{ … }
static PyObject *
_elementtree_XMLParser__setevents_impl(XMLParserObject *self,
PyObject *events_queue,
PyObject *events_to_report)
{ … }
static PyMemberDef xmlparser_members[] = …;
static PyObject*
xmlparser_version_getter(XMLParserObject *self, void *closure)
{ … }
static PyGetSetDef xmlparser_getsetlist[] = …;
#define clinic_state …
#include "clinic/_elementtree.c.h"
#undef clinic_state
static PyMethodDef element_methods[] = …;
static struct PyMemberDef element_members[] = …;
static PyGetSetDef element_getsetlist[] = …;
static PyType_Slot element_slots[] = …;
static PyType_Spec element_spec = …;
static PyMethodDef treebuilder_methods[] = …;
static PyType_Slot treebuilder_slots[] = …;
static PyType_Spec treebuilder_spec = …;
static PyMethodDef xmlparser_methods[] = …;
static PyType_Slot xmlparser_slots[] = …;
static PyType_Spec xmlparser_spec = …;
static PyMethodDef _functions[] = …;
#define CREATE_TYPE(module, type, spec) …
static int
module_exec(PyObject *m)
{ … }
static struct PyModuleDef_Slot elementtree_slots[] = …;
static struct PyModuleDef elementtreemodule = …;
PyMODINIT_FUNC
PyInit__elementtree(void)
{ … }