Home | History | Annotate | Download | only in clinic
      1 /*[clinic input]
      2 preserve
      3 [clinic start generated code]*/
      4 
      5 PyDoc_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_FASTCALL, pyexpat_xmlparser_Parse__doc__},
     15 
     16 static PyObject *
     17 pyexpat_xmlparser_Parse_impl(xmlparseobject *self, PyObject *data,
     18                              int isfinal);
     19 
     20 static PyObject *
     21 pyexpat_xmlparser_Parse(xmlparseobject *self, PyObject *const *args, Py_ssize_t nargs)
     22 {
     23     PyObject *return_value = NULL;
     24     PyObject *data;
     25     int isfinal = 0;
     26 
     27     if (!_PyArg_ParseStack(args, nargs, "O|i:Parse",
     28         &data, &isfinal)) {
     29         goto exit;
     30     }
     31     return_value = pyexpat_xmlparser_Parse_impl(self, data, isfinal);
     32 
     33 exit:
     34     return return_value;
     35 }
     36 
     37 PyDoc_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 
     46 PyDoc_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 
     55 static PyObject *
     56 pyexpat_xmlparser_SetBase_impl(xmlparseobject *self, const char *base);
     57 
     58 static PyObject *
     59 pyexpat_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 
     69 exit:
     70     return return_value;
     71 }
     72 
     73 PyDoc_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 
     82 static PyObject *
     83 pyexpat_xmlparser_GetBase_impl(xmlparseobject *self);
     84 
     85 static PyObject *
     86 pyexpat_xmlparser_GetBase(xmlparseobject *self, PyObject *Py_UNUSED(ignored))
     87 {
     88     return pyexpat_xmlparser_GetBase_impl(self);
     89 }
     90 
     91 PyDoc_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 
    103 static PyObject *
    104 pyexpat_xmlparser_GetInputContext_impl(xmlparseobject *self);
    105 
    106 static PyObject *
    107 pyexpat_xmlparser_GetInputContext(xmlparseobject *self, PyObject *Py_UNUSED(ignored))
    108 {
    109     return pyexpat_xmlparser_GetInputContext_impl(self);
    110 }
    111 
    112 PyDoc_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_FASTCALL, pyexpat_xmlparser_ExternalEntityParserCreate__doc__},
    120 
    121 static PyObject *
    122 pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self,
    123                                                   const char *context,
    124                                                   const char *encoding);
    125 
    126 static PyObject *
    127 pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyObject *const *args, Py_ssize_t nargs)
    128 {
    129     PyObject *return_value = NULL;
    130     const char *context;
    131     const char *encoding = NULL;
    132 
    133     if (!_PyArg_ParseStack(args, nargs, "z|s:ExternalEntityParserCreate",
    134         &context, &encoding)) {
    135         goto exit;
    136     }
    137     return_value = pyexpat_xmlparser_ExternalEntityParserCreate_impl(self, context, encoding);
    138 
    139 exit:
    140     return return_value;
    141 }
    142 
    143 PyDoc_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 
    157 static PyObject *
    158 pyexpat_xmlparser_SetParamEntityParsing_impl(xmlparseobject *self, int flag);
    159 
    160 static PyObject *
    161 pyexpat_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 
    171 exit:
    172     return return_value;
    173 }
    174 
    175 #if (XML_COMBINED_VERSION >= 19505)
    176 
    177 PyDoc_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_FASTCALL, pyexpat_xmlparser_UseForeignDTD__doc__},
    189 
    190 static PyObject *
    191 pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, int flag);
    192 
    193 static PyObject *
    194 pyexpat_xmlparser_UseForeignDTD(xmlparseobject *self, PyObject *const *args, Py_ssize_t nargs)
    195 {
    196     PyObject *return_value = NULL;
    197     int flag = 1;
    198 
    199     if (!_PyArg_ParseStack(args, nargs, "|p:UseForeignDTD",
    200         &flag)) {
    201         goto exit;
    202     }
    203     return_value = pyexpat_xmlparser_UseForeignDTD_impl(self, flag);
    204 
    205 exit:
    206     return return_value;
    207 }
    208 
    209 #endif /* (XML_COMBINED_VERSION >= 19505) */
    210 
    211 PyDoc_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 
    219 static PyObject *
    220 pyexpat_xmlparser___dir___impl(xmlparseobject *self);
    221 
    222 static PyObject *
    223 pyexpat_xmlparser___dir__(xmlparseobject *self, PyObject *Py_UNUSED(ignored))
    224 {
    225     return pyexpat_xmlparser___dir___impl(self);
    226 }
    227 
    228 PyDoc_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|METH_KEYWORDS, pyexpat_ParserCreate__doc__},
    237 
    238 static PyObject *
    239 pyexpat_ParserCreate_impl(PyObject *module, const char *encoding,
    240                           const char *namespace_separator, PyObject *intern);
    241 
    242 static PyObject *
    243 pyexpat_ParserCreate(PyObject *module, PyObject *const *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_ParseStackAndKeywords(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 
    258 exit:
    259     return return_value;
    260 }
    261 
    262 PyDoc_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 
    271 static PyObject *
    272 pyexpat_ErrorString_impl(PyObject *module, long code);
    273 
    274 static PyObject *
    275 pyexpat_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 
    285 exit:
    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=34d02345deee104c input=a9049054013a1b77]*/
    293