1/*[clinic input] 2preserve 3[clinic start generated code]*/ 4 5PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__, 6"Parse($self, data, isfinal=False, /)\n" 7"--\n" 8"\n" 9"Parse XML data.\n" 10"\n" 11"`isfinal\' should be true at end of input."); 12 13#define PYEXPAT_XMLPARSER_PARSE_METHODDEF \ 14 {"Parse", (PyCFunction)pyexpat_xmlparser_Parse, METH_VARARGS, pyexpat_xmlparser_Parse__doc__}, 15 16static PyObject * 17pyexpat_xmlparser_Parse_impl(xmlparseobject *self, PyObject *data, 18 int isfinal); 19 20static PyObject * 21pyexpat_xmlparser_Parse(xmlparseobject *self, PyObject *args) 22{ 23 PyObject *return_value = NULL; 24 PyObject *data; 25 int isfinal = 0; 26 27 if (!PyArg_ParseTuple(args, "O|i:Parse", 28 &data, &isfinal)) { 29 goto exit; 30 } 31 return_value = pyexpat_xmlparser_Parse_impl(self, data, isfinal); 32 33exit: 34 return return_value; 35} 36 37PyDoc_STRVAR(pyexpat_xmlparser_ParseFile__doc__, 38"ParseFile($self, file, /)\n" 39"--\n" 40"\n" 41"Parse XML data from file-like object."); 42 43#define PYEXPAT_XMLPARSER_PARSEFILE_METHODDEF \ 44 {"ParseFile", (PyCFunction)pyexpat_xmlparser_ParseFile, METH_O, pyexpat_xmlparser_ParseFile__doc__}, 45 46PyDoc_STRVAR(pyexpat_xmlparser_SetBase__doc__, 47"SetBase($self, base, /)\n" 48"--\n" 49"\n" 50"Set the base URL for the parser."); 51 52#define PYEXPAT_XMLPARSER_SETBASE_METHODDEF \ 53 {"SetBase", (PyCFunction)pyexpat_xmlparser_SetBase, METH_O, pyexpat_xmlparser_SetBase__doc__}, 54 55static PyObject * 56pyexpat_xmlparser_SetBase_impl(xmlparseobject *self, const char *base); 57 58static PyObject * 59pyexpat_xmlparser_SetBase(xmlparseobject *self, PyObject *arg) 60{ 61 PyObject *return_value = NULL; 62 const char *base; 63 64 if (!PyArg_Parse(arg, "s:SetBase", &base)) { 65 goto exit; 66 } 67 return_value = pyexpat_xmlparser_SetBase_impl(self, base); 68 69exit: 70 return return_value; 71} 72 73PyDoc_STRVAR(pyexpat_xmlparser_GetBase__doc__, 74"GetBase($self, /)\n" 75"--\n" 76"\n" 77"Return base URL string for the parser."); 78 79#define PYEXPAT_XMLPARSER_GETBASE_METHODDEF \ 80 {"GetBase", (PyCFunction)pyexpat_xmlparser_GetBase, METH_NOARGS, pyexpat_xmlparser_GetBase__doc__}, 81 82static PyObject * 83pyexpat_xmlparser_GetBase_impl(xmlparseobject *self); 84 85static PyObject * 86pyexpat_xmlparser_GetBase(xmlparseobject *self, PyObject *Py_UNUSED(ignored)) 87{ 88 return pyexpat_xmlparser_GetBase_impl(self); 89} 90 91PyDoc_STRVAR(pyexpat_xmlparser_GetInputContext__doc__, 92"GetInputContext($self, /)\n" 93"--\n" 94"\n" 95"Return the untranslated text of the input that caused the current event.\n" 96"\n" 97"If the event was generated by a large amount of text (such as a start tag\n" 98"for an element with many attributes), not all of the text may be available."); 99 100#define PYEXPAT_XMLPARSER_GETINPUTCONTEXT_METHODDEF \ 101 {"GetInputContext", (PyCFunction)pyexpat_xmlparser_GetInputContext, METH_NOARGS, pyexpat_xmlparser_GetInputContext__doc__}, 102 103static PyObject * 104pyexpat_xmlparser_GetInputContext_impl(xmlparseobject *self); 105 106static PyObject * 107pyexpat_xmlparser_GetInputContext(xmlparseobject *self, PyObject *Py_UNUSED(ignored)) 108{ 109 return pyexpat_xmlparser_GetInputContext_impl(self); 110} 111 112PyDoc_STRVAR(pyexpat_xmlparser_ExternalEntityParserCreate__doc__, 113"ExternalEntityParserCreate($self, context, encoding=None, /)\n" 114"--\n" 115"\n" 116"Create a parser for parsing an external entity based on the information passed to the ExternalEntityRefHandler."); 117 118#define PYEXPAT_XMLPARSER_EXTERNALENTITYPARSERCREATE_METHODDEF \ 119 {"ExternalEntityParserCreate", (PyCFunction)pyexpat_xmlparser_ExternalEntityParserCreate, METH_VARARGS, pyexpat_xmlparser_ExternalEntityParserCreate__doc__}, 120 121static PyObject * 122pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self, 123 const char *context, 124 const char *encoding); 125 126static PyObject * 127pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args) 128{ 129 PyObject *return_value = NULL; 130 const char *context; 131 const char *encoding = NULL; 132 133 if (!PyArg_ParseTuple(args, "z|s:ExternalEntityParserCreate", 134 &context, &encoding)) { 135 goto exit; 136 } 137 return_value = pyexpat_xmlparser_ExternalEntityParserCreate_impl(self, context, encoding); 138 139exit: 140 return return_value; 141} 142 143PyDoc_STRVAR(pyexpat_xmlparser_SetParamEntityParsing__doc__, 144"SetParamEntityParsing($self, flag, /)\n" 145"--\n" 146"\n" 147"Controls parsing of parameter entities (including the external DTD subset).\n" 148"\n" 149"Possible flag values are XML_PARAM_ENTITY_PARSING_NEVER,\n" 150"XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE and\n" 151"XML_PARAM_ENTITY_PARSING_ALWAYS. Returns true if setting the flag\n" 152"was successful."); 153 154#define PYEXPAT_XMLPARSER_SETPARAMENTITYPARSING_METHODDEF \ 155 {"SetParamEntityParsing", (PyCFunction)pyexpat_xmlparser_SetParamEntityParsing, METH_O, pyexpat_xmlparser_SetParamEntityParsing__doc__}, 156 157static PyObject * 158pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag); 159 160static PyObject * 161pyexpat_xmlparser_SetParamEntityParsing(xmlparseobject *self, PyObject *arg) 162{ 163 PyObject *return_value = NULL; 164 int flag; 165 166 if (!PyArg_Parse(arg, "i:SetParamEntityParsing", &flag)) { 167 goto exit; 168 } 169 return_value = pyexpat_xmlparser_SetParamEntityParsing_impl(self, flag); 170 171exit: 172 return return_value; 173} 174 175#if (XML_COMBINED_VERSION >= 19505) 176 177PyDoc_STRVAR(pyexpat_xmlparser_UseForeignDTD__doc__, 178"UseForeignDTD($self, flag=True, /)\n" 179"--\n" 180"\n" 181"Allows the application to provide an artificial external subset if one is not specified as part of the document instance.\n" 182"\n" 183"This readily allows the use of a \'default\' document type controlled by the\n" 184"application, while still getting the advantage of providing document type\n" 185"information to the parser. \'flag\' defaults to True if not provided."); 186 187#define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF \ 188 {"UseForeignDTD", (PyCFunction)pyexpat_xmlparser_UseForeignDTD, METH_VARARGS, pyexpat_xmlparser_UseForeignDTD__doc__}, 189 190static PyObject * 191pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, int flag); 192 193static PyObject * 194pyexpat_xmlparser_UseForeignDTD(xmlparseobject *self, PyObject *args) 195{ 196 PyObject *return_value = NULL; 197 int flag = 1; 198 199 if (!PyArg_ParseTuple(args, "|p:UseForeignDTD", 200 &flag)) { 201 goto exit; 202 } 203 return_value = pyexpat_xmlparser_UseForeignDTD_impl(self, flag); 204 205exit: 206 return return_value; 207} 208 209#endif /* (XML_COMBINED_VERSION >= 19505) */ 210 211PyDoc_STRVAR(pyexpat_xmlparser___dir____doc__, 212"__dir__($self, /)\n" 213"--\n" 214"\n"); 215 216#define PYEXPAT_XMLPARSER___DIR___METHODDEF \ 217 {"__dir__", (PyCFunction)pyexpat_xmlparser___dir__, METH_NOARGS, pyexpat_xmlparser___dir____doc__}, 218 219static PyObject * 220pyexpat_xmlparser___dir___impl(xmlparseobject *self); 221 222static PyObject * 223pyexpat_xmlparser___dir__(xmlparseobject *self, PyObject *Py_UNUSED(ignored)) 224{ 225 return pyexpat_xmlparser___dir___impl(self); 226} 227 228PyDoc_STRVAR(pyexpat_ParserCreate__doc__, 229"ParserCreate($module, /, encoding=None, namespace_separator=None,\n" 230" intern=None)\n" 231"--\n" 232"\n" 233"Return a new XML parser object."); 234 235#define PYEXPAT_PARSERCREATE_METHODDEF \ 236 {"ParserCreate", (PyCFunction)pyexpat_ParserCreate, METH_FASTCALL, pyexpat_ParserCreate__doc__}, 237 238static PyObject * 239pyexpat_ParserCreate_impl(PyObject *module, const char *encoding, 240 const char *namespace_separator, PyObject *intern); 241 242static PyObject * 243pyexpat_ParserCreate(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) 244{ 245 PyObject *return_value = NULL; 246 static const char * const _keywords[] = {"encoding", "namespace_separator", "intern", NULL}; 247 static _PyArg_Parser _parser = {"|zzO:ParserCreate", _keywords, 0}; 248 const char *encoding = NULL; 249 const char *namespace_separator = NULL; 250 PyObject *intern = NULL; 251 252 if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser, 253 &encoding, &namespace_separator, &intern)) { 254 goto exit; 255 } 256 return_value = pyexpat_ParserCreate_impl(module, encoding, namespace_separator, intern); 257 258exit: 259 return return_value; 260} 261 262PyDoc_STRVAR(pyexpat_ErrorString__doc__, 263"ErrorString($module, code, /)\n" 264"--\n" 265"\n" 266"Returns string error for given number."); 267 268#define PYEXPAT_ERRORSTRING_METHODDEF \ 269 {"ErrorString", (PyCFunction)pyexpat_ErrorString, METH_O, pyexpat_ErrorString__doc__}, 270 271static PyObject * 272pyexpat_ErrorString_impl(PyObject *module, long code); 273 274static PyObject * 275pyexpat_ErrorString(PyObject *module, PyObject *arg) 276{ 277 PyObject *return_value = NULL; 278 long code; 279 280 if (!PyArg_Parse(arg, "l:ErrorString", &code)) { 281 goto exit; 282 } 283 return_value = pyexpat_ErrorString_impl(module, code); 284 285exit: 286 return return_value; 287} 288 289#ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF 290 #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF 291#endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ 292/*[clinic end generated code: output=e889f7c6af6cc42f input=a9049054013a1b77]*/ 293