1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4 
5 PyDoc_STRVAR(_multibytecodec_MultibyteCodec_encode__doc__,
6 "encode($self, /, input, errors=None)\n"
7 "--\n"
8 "\n"
9 "Return an encoded string version of `input\'.\n"
10 "\n"
11 "\'errors\' may be given to set a different error handling scheme. Default is\n"
12 "\'strict\' meaning that encoding errors raise a UnicodeEncodeError. Other possible\n"
13 "values are \'ignore\', \'replace\' and \'xmlcharrefreplace\' as well as any other name\n"
14 "registered with codecs.register_error that can handle UnicodeEncodeErrors.");
15 
16 #define _MULTIBYTECODEC_MULTIBYTECODEC_ENCODE_METHODDEF    \
17     {"encode", (PyCFunction)_multibytecodec_MultibyteCodec_encode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteCodec_encode__doc__},
18 
19 static PyObject *
20 _multibytecodec_MultibyteCodec_encode_impl(MultibyteCodecObject *self,
21                                            PyObject *input,
22                                            const char *errors);
23 
24 static PyObject *
_multibytecodec_MultibyteCodec_encode(MultibyteCodecObject * self,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)25 _multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
26 {
27     PyObject *return_value = NULL;
28     static const char * const _keywords[] = {"input", "errors", NULL};
29     static _PyArg_Parser _parser = {"O|z:encode", _keywords, 0};
30     PyObject *input;
31     const char *errors = NULL;
32 
33     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
34         &input, &errors)) {
35         goto exit;
36     }
37     return_value = _multibytecodec_MultibyteCodec_encode_impl(self, input, errors);
38 
39 exit:
40     return return_value;
41 }
42 
43 PyDoc_STRVAR(_multibytecodec_MultibyteCodec_decode__doc__,
44 "decode($self, /, input, errors=None)\n"
45 "--\n"
46 "\n"
47 "Decodes \'input\'.\n"
48 "\n"
49 "\'errors\' may be given to set a different error handling scheme. Default is\n"
50 "\'strict\' meaning that encoding errors raise a UnicodeDecodeError. Other possible\n"
51 "values are \'ignore\' and \'replace\' as well as any other name registered with\n"
52 "codecs.register_error that is able to handle UnicodeDecodeErrors.\"");
53 
54 #define _MULTIBYTECODEC_MULTIBYTECODEC_DECODE_METHODDEF    \
55     {"decode", (PyCFunction)_multibytecodec_MultibyteCodec_decode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteCodec_decode__doc__},
56 
57 static PyObject *
58 _multibytecodec_MultibyteCodec_decode_impl(MultibyteCodecObject *self,
59                                            Py_buffer *input,
60                                            const char *errors);
61 
62 static PyObject *
_multibytecodec_MultibyteCodec_decode(MultibyteCodecObject * self,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)63 _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
64 {
65     PyObject *return_value = NULL;
66     static const char * const _keywords[] = {"input", "errors", NULL};
67     static _PyArg_Parser _parser = {"y*|z:decode", _keywords, 0};
68     Py_buffer input = {NULL, NULL};
69     const char *errors = NULL;
70 
71     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
72         &input, &errors)) {
73         goto exit;
74     }
75     return_value = _multibytecodec_MultibyteCodec_decode_impl(self, &input, errors);
76 
77 exit:
78     /* Cleanup for input */
79     if (input.obj) {
80        PyBuffer_Release(&input);
81     }
82 
83     return return_value;
84 }
85 
86 PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_encode__doc__,
87 "encode($self, /, input, final=False)\n"
88 "--\n"
89 "\n");
90 
91 #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_ENCODE_METHODDEF    \
92     {"encode", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_encode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalEncoder_encode__doc__},
93 
94 static PyObject *
95 _multibytecodec_MultibyteIncrementalEncoder_encode_impl(MultibyteIncrementalEncoderObject *self,
96                                                         PyObject *input,
97                                                         int final);
98 
99 static PyObject *
_multibytecodec_MultibyteIncrementalEncoder_encode(MultibyteIncrementalEncoderObject * self,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)100 _multibytecodec_MultibyteIncrementalEncoder_encode(MultibyteIncrementalEncoderObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
101 {
102     PyObject *return_value = NULL;
103     static const char * const _keywords[] = {"input", "final", NULL};
104     static _PyArg_Parser _parser = {"O|i:encode", _keywords, 0};
105     PyObject *input;
106     int final = 0;
107 
108     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
109         &input, &final)) {
110         goto exit;
111     }
112     return_value = _multibytecodec_MultibyteIncrementalEncoder_encode_impl(self, input, final);
113 
114 exit:
115     return return_value;
116 }
117 
118 PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_reset__doc__,
119 "reset($self, /)\n"
120 "--\n"
121 "\n");
122 
123 #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_RESET_METHODDEF    \
124     {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_reset__doc__},
125 
126 static PyObject *
127 _multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncoderObject *self);
128 
129 static PyObject *
_multibytecodec_MultibyteIncrementalEncoder_reset(MultibyteIncrementalEncoderObject * self,PyObject * Py_UNUSED (ignored))130 _multibytecodec_MultibyteIncrementalEncoder_reset(MultibyteIncrementalEncoderObject *self, PyObject *Py_UNUSED(ignored))
131 {
132     return _multibytecodec_MultibyteIncrementalEncoder_reset_impl(self);
133 }
134 
135 PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_decode__doc__,
136 "decode($self, /, input, final=False)\n"
137 "--\n"
138 "\n");
139 
140 #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_DECODE_METHODDEF    \
141     {"decode", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_decode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalDecoder_decode__doc__},
142 
143 static PyObject *
144 _multibytecodec_MultibyteIncrementalDecoder_decode_impl(MultibyteIncrementalDecoderObject *self,
145                                                         Py_buffer *input,
146                                                         int final);
147 
148 static PyObject *
_multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderObject * self,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)149 _multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
150 {
151     PyObject *return_value = NULL;
152     static const char * const _keywords[] = {"input", "final", NULL};
153     static _PyArg_Parser _parser = {"y*|i:decode", _keywords, 0};
154     Py_buffer input = {NULL, NULL};
155     int final = 0;
156 
157     if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
158         &input, &final)) {
159         goto exit;
160     }
161     return_value = _multibytecodec_MultibyteIncrementalDecoder_decode_impl(self, &input, final);
162 
163 exit:
164     /* Cleanup for input */
165     if (input.obj) {
166        PyBuffer_Release(&input);
167     }
168 
169     return return_value;
170 }
171 
172 PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_reset__doc__,
173 "reset($self, /)\n"
174 "--\n"
175 "\n");
176 
177 #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_RESET_METHODDEF    \
178     {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_reset__doc__},
179 
180 static PyObject *
181 _multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecoderObject *self);
182 
183 static PyObject *
_multibytecodec_MultibyteIncrementalDecoder_reset(MultibyteIncrementalDecoderObject * self,PyObject * Py_UNUSED (ignored))184 _multibytecodec_MultibyteIncrementalDecoder_reset(MultibyteIncrementalDecoderObject *self, PyObject *Py_UNUSED(ignored))
185 {
186     return _multibytecodec_MultibyteIncrementalDecoder_reset_impl(self);
187 }
188 
189 PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_read__doc__,
190 "read($self, sizeobj=None, /)\n"
191 "--\n"
192 "\n");
193 
194 #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READ_METHODDEF    \
195     {"read", (PyCFunction)_multibytecodec_MultibyteStreamReader_read, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_read__doc__},
196 
197 static PyObject *
198 _multibytecodec_MultibyteStreamReader_read_impl(MultibyteStreamReaderObject *self,
199                                                 PyObject *sizeobj);
200 
201 static PyObject *
_multibytecodec_MultibyteStreamReader_read(MultibyteStreamReaderObject * self,PyObject * const * args,Py_ssize_t nargs)202 _multibytecodec_MultibyteStreamReader_read(MultibyteStreamReaderObject *self, PyObject *const *args, Py_ssize_t nargs)
203 {
204     PyObject *return_value = NULL;
205     PyObject *sizeobj = Py_None;
206 
207     if (!_PyArg_UnpackStack(args, nargs, "read",
208         0, 1,
209         &sizeobj)) {
210         goto exit;
211     }
212     return_value = _multibytecodec_MultibyteStreamReader_read_impl(self, sizeobj);
213 
214 exit:
215     return return_value;
216 }
217 
218 PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readline__doc__,
219 "readline($self, sizeobj=None, /)\n"
220 "--\n"
221 "\n");
222 
223 #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINE_METHODDEF    \
224     {"readline", (PyCFunction)_multibytecodec_MultibyteStreamReader_readline, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readline__doc__},
225 
226 static PyObject *
227 _multibytecodec_MultibyteStreamReader_readline_impl(MultibyteStreamReaderObject *self,
228                                                     PyObject *sizeobj);
229 
230 static PyObject *
_multibytecodec_MultibyteStreamReader_readline(MultibyteStreamReaderObject * self,PyObject * const * args,Py_ssize_t nargs)231 _multibytecodec_MultibyteStreamReader_readline(MultibyteStreamReaderObject *self, PyObject *const *args, Py_ssize_t nargs)
232 {
233     PyObject *return_value = NULL;
234     PyObject *sizeobj = Py_None;
235 
236     if (!_PyArg_UnpackStack(args, nargs, "readline",
237         0, 1,
238         &sizeobj)) {
239         goto exit;
240     }
241     return_value = _multibytecodec_MultibyteStreamReader_readline_impl(self, sizeobj);
242 
243 exit:
244     return return_value;
245 }
246 
247 PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readlines__doc__,
248 "readlines($self, sizehintobj=None, /)\n"
249 "--\n"
250 "\n");
251 
252 #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINES_METHODDEF    \
253     {"readlines", (PyCFunction)_multibytecodec_MultibyteStreamReader_readlines, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readlines__doc__},
254 
255 static PyObject *
256 _multibytecodec_MultibyteStreamReader_readlines_impl(MultibyteStreamReaderObject *self,
257                                                      PyObject *sizehintobj);
258 
259 static PyObject *
_multibytecodec_MultibyteStreamReader_readlines(MultibyteStreamReaderObject * self,PyObject * const * args,Py_ssize_t nargs)260 _multibytecodec_MultibyteStreamReader_readlines(MultibyteStreamReaderObject *self, PyObject *const *args, Py_ssize_t nargs)
261 {
262     PyObject *return_value = NULL;
263     PyObject *sizehintobj = Py_None;
264 
265     if (!_PyArg_UnpackStack(args, nargs, "readlines",
266         0, 1,
267         &sizehintobj)) {
268         goto exit;
269     }
270     return_value = _multibytecodec_MultibyteStreamReader_readlines_impl(self, sizehintobj);
271 
272 exit:
273     return return_value;
274 }
275 
276 PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_reset__doc__,
277 "reset($self, /)\n"
278 "--\n"
279 "\n");
280 
281 #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_RESET_METHODDEF    \
282     {"reset", (PyCFunction)_multibytecodec_MultibyteStreamReader_reset, METH_NOARGS, _multibytecodec_MultibyteStreamReader_reset__doc__},
283 
284 static PyObject *
285 _multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *self);
286 
287 static PyObject *
_multibytecodec_MultibyteStreamReader_reset(MultibyteStreamReaderObject * self,PyObject * Py_UNUSED (ignored))288 _multibytecodec_MultibyteStreamReader_reset(MultibyteStreamReaderObject *self, PyObject *Py_UNUSED(ignored))
289 {
290     return _multibytecodec_MultibyteStreamReader_reset_impl(self);
291 }
292 
293 PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_write__doc__,
294 "write($self, strobj, /)\n"
295 "--\n"
296 "\n");
297 
298 #define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITE_METHODDEF    \
299     {"write", (PyCFunction)_multibytecodec_MultibyteStreamWriter_write, METH_O, _multibytecodec_MultibyteStreamWriter_write__doc__},
300 
301 PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_writelines__doc__,
302 "writelines($self, lines, /)\n"
303 "--\n"
304 "\n");
305 
306 #define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITELINES_METHODDEF    \
307     {"writelines", (PyCFunction)_multibytecodec_MultibyteStreamWriter_writelines, METH_O, _multibytecodec_MultibyteStreamWriter_writelines__doc__},
308 
309 PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_reset__doc__,
310 "reset($self, /)\n"
311 "--\n"
312 "\n");
313 
314 #define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_RESET_METHODDEF    \
315     {"reset", (PyCFunction)_multibytecodec_MultibyteStreamWriter_reset, METH_NOARGS, _multibytecodec_MultibyteStreamWriter_reset__doc__},
316 
317 static PyObject *
318 _multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *self);
319 
320 static PyObject *
_multibytecodec_MultibyteStreamWriter_reset(MultibyteStreamWriterObject * self,PyObject * Py_UNUSED (ignored))321 _multibytecodec_MultibyteStreamWriter_reset(MultibyteStreamWriterObject *self, PyObject *Py_UNUSED(ignored))
322 {
323     return _multibytecodec_MultibyteStreamWriter_reset_impl(self);
324 }
325 
326 PyDoc_STRVAR(_multibytecodec___create_codec__doc__,
327 "__create_codec($module, arg, /)\n"
328 "--\n"
329 "\n");
330 
331 #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF    \
332     {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
333 /*[clinic end generated code: output=680f59f4cfe63c25 input=a9049054013a1b77]*/
334