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