Line data Source code
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_CAST(_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 *
25 1234960 : _multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
26 : {
27 1234960 : PyObject *return_value = NULL;
28 : static const char * const _keywords[] = {"input", "errors", NULL};
29 : static _PyArg_Parser _parser = {NULL, _keywords, "encode", 0};
30 : PyObject *argsbuf[2];
31 1234960 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
32 : PyObject *input;
33 1234960 : const char *errors = NULL;
34 :
35 1234960 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
36 1234960 : if (!args) {
37 24 : goto exit;
38 : }
39 1234930 : input = args[0];
40 1234930 : if (!noptargs) {
41 186077 : goto skip_optional_pos;
42 : }
43 1048860 : if (args[1] == Py_None) {
44 0 : errors = NULL;
45 : }
46 1048860 : else if (PyUnicode_Check(args[1])) {
47 : Py_ssize_t errors_length;
48 1048860 : errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
49 1048860 : if (errors == NULL) {
50 0 : goto exit;
51 : }
52 1048860 : if (strlen(errors) != (size_t)errors_length) {
53 0 : PyErr_SetString(PyExc_ValueError, "embedded null character");
54 0 : goto exit;
55 : }
56 : }
57 : else {
58 0 : _PyArg_BadArgument("encode", "argument 'errors'", "str or None", args[1]);
59 0 : goto exit;
60 : }
61 1234930 : skip_optional_pos:
62 1234930 : return_value = _multibytecodec_MultibyteCodec_encode_impl(self, input, errors);
63 :
64 1234960 : exit:
65 1234960 : return return_value;
66 : }
67 :
68 : PyDoc_STRVAR(_multibytecodec_MultibyteCodec_decode__doc__,
69 : "decode($self, /, input, errors=None)\n"
70 : "--\n"
71 : "\n"
72 : "Decodes \'input\'.\n"
73 : "\n"
74 : "\'errors\' may be given to set a different error handling scheme. Default is\n"
75 : "\'strict\' meaning that encoding errors raise a UnicodeDecodeError. Other possible\n"
76 : "values are \'ignore\' and \'replace\' as well as any other name registered with\n"
77 : "codecs.register_error that is able to handle UnicodeDecodeErrors.\"");
78 :
79 : #define _MULTIBYTECODEC_MULTIBYTECODEC_DECODE_METHODDEF \
80 : {"decode", _PyCFunction_CAST(_multibytecodec_MultibyteCodec_decode), METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteCodec_decode__doc__},
81 :
82 : static PyObject *
83 : _multibytecodec_MultibyteCodec_decode_impl(MultibyteCodecObject *self,
84 : Py_buffer *input,
85 : const char *errors);
86 :
87 : static PyObject *
88 186096 : _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
89 : {
90 186096 : PyObject *return_value = NULL;
91 : static const char * const _keywords[] = {"input", "errors", NULL};
92 : static _PyArg_Parser _parser = {NULL, _keywords, "decode", 0};
93 : PyObject *argsbuf[2];
94 186096 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
95 186096 : Py_buffer input = {NULL, NULL};
96 186096 : const char *errors = NULL;
97 :
98 186096 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
99 186096 : if (!args) {
100 24 : goto exit;
101 : }
102 186072 : if (PyObject_GetBuffer(args[0], &input, PyBUF_SIMPLE) != 0) {
103 48 : goto exit;
104 : }
105 186024 : if (!PyBuffer_IsContiguous(&input, 'C')) {
106 0 : _PyArg_BadArgument("decode", "argument 'input'", "contiguous buffer", args[0]);
107 0 : goto exit;
108 : }
109 186024 : if (!noptargs) {
110 185810 : goto skip_optional_pos;
111 : }
112 214 : if (args[1] == Py_None) {
113 0 : errors = NULL;
114 : }
115 214 : else if (PyUnicode_Check(args[1])) {
116 : Py_ssize_t errors_length;
117 214 : errors = PyUnicode_AsUTF8AndSize(args[1], &errors_length);
118 214 : if (errors == NULL) {
119 0 : goto exit;
120 : }
121 214 : if (strlen(errors) != (size_t)errors_length) {
122 0 : PyErr_SetString(PyExc_ValueError, "embedded null character");
123 0 : goto exit;
124 : }
125 : }
126 : else {
127 0 : _PyArg_BadArgument("decode", "argument 'errors'", "str or None", args[1]);
128 0 : goto exit;
129 : }
130 186024 : skip_optional_pos:
131 186024 : return_value = _multibytecodec_MultibyteCodec_decode_impl(self, &input, errors);
132 :
133 186096 : exit:
134 : /* Cleanup for input */
135 186096 : if (input.obj) {
136 186024 : PyBuffer_Release(&input);
137 : }
138 :
139 186096 : return return_value;
140 : }
141 :
142 : PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_encode__doc__,
143 : "encode($self, /, input, final=False)\n"
144 : "--\n"
145 : "\n");
146 :
147 : #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_ENCODE_METHODDEF \
148 : {"encode", _PyCFunction_CAST(_multibytecodec_MultibyteIncrementalEncoder_encode), METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalEncoder_encode__doc__},
149 :
150 : static PyObject *
151 : _multibytecodec_MultibyteIncrementalEncoder_encode_impl(MultibyteIncrementalEncoderObject *self,
152 : PyObject *input,
153 : int final);
154 :
155 : static PyObject *
156 27427 : _multibytecodec_MultibyteIncrementalEncoder_encode(MultibyteIncrementalEncoderObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
157 : {
158 27427 : PyObject *return_value = NULL;
159 : static const char * const _keywords[] = {"input", "final", NULL};
160 : static _PyArg_Parser _parser = {NULL, _keywords, "encode", 0};
161 : PyObject *argsbuf[2];
162 27427 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
163 : PyObject *input;
164 27427 : int final = 0;
165 :
166 27427 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
167 27427 : if (!args) {
168 0 : goto exit;
169 : }
170 27427 : input = args[0];
171 27427 : if (!noptargs) {
172 27070 : goto skip_optional_pos;
173 : }
174 357 : final = _PyLong_AsInt(args[1]);
175 357 : if (final == -1 && PyErr_Occurred()) {
176 0 : goto exit;
177 : }
178 357 : skip_optional_pos:
179 27427 : return_value = _multibytecodec_MultibyteIncrementalEncoder_encode_impl(self, input, final);
180 :
181 27427 : exit:
182 27427 : return return_value;
183 : }
184 :
185 : PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_getstate__doc__,
186 : "getstate($self, /)\n"
187 : "--\n"
188 : "\n");
189 :
190 : #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_GETSTATE_METHODDEF \
191 : {"getstate", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_getstate__doc__},
192 :
193 : static PyObject *
194 : _multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEncoderObject *self);
195 :
196 : static PyObject *
197 177 : _multibytecodec_MultibyteIncrementalEncoder_getstate(MultibyteIncrementalEncoderObject *self, PyObject *Py_UNUSED(ignored))
198 : {
199 177 : return _multibytecodec_MultibyteIncrementalEncoder_getstate_impl(self);
200 : }
201 :
202 : PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_setstate__doc__,
203 : "setstate($self, state, /)\n"
204 : "--\n"
205 : "\n");
206 :
207 : #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_SETSTATE_METHODDEF \
208 : {"setstate", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalEncoder_setstate__doc__},
209 :
210 : static PyObject *
211 : _multibytecodec_MultibyteIncrementalEncoder_setstate_impl(MultibyteIncrementalEncoderObject *self,
212 : PyLongObject *statelong);
213 :
214 : static PyObject *
215 177 : _multibytecodec_MultibyteIncrementalEncoder_setstate(MultibyteIncrementalEncoderObject *self, PyObject *arg)
216 : {
217 177 : PyObject *return_value = NULL;
218 : PyLongObject *statelong;
219 :
220 177 : if (!PyLong_Check(arg)) {
221 0 : _PyArg_BadArgument("setstate", "argument", "int", arg);
222 0 : goto exit;
223 : }
224 177 : statelong = (PyLongObject *)arg;
225 177 : return_value = _multibytecodec_MultibyteIncrementalEncoder_setstate_impl(self, statelong);
226 :
227 177 : exit:
228 177 : return return_value;
229 : }
230 :
231 : PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_reset__doc__,
232 : "reset($self, /)\n"
233 : "--\n"
234 : "\n");
235 :
236 : #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_RESET_METHODDEF \
237 : {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_reset__doc__},
238 :
239 : static PyObject *
240 : _multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncoderObject *self);
241 :
242 : static PyObject *
243 24 : _multibytecodec_MultibyteIncrementalEncoder_reset(MultibyteIncrementalEncoderObject *self, PyObject *Py_UNUSED(ignored))
244 : {
245 24 : return _multibytecodec_MultibyteIncrementalEncoder_reset_impl(self);
246 : }
247 :
248 : PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_decode__doc__,
249 : "decode($self, /, input, final=False)\n"
250 : "--\n"
251 : "\n");
252 :
253 : #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_DECODE_METHODDEF \
254 : {"decode", _PyCFunction_CAST(_multibytecodec_MultibyteIncrementalDecoder_decode), METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalDecoder_decode__doc__},
255 :
256 : static PyObject *
257 : _multibytecodec_MultibyteIncrementalDecoder_decode_impl(MultibyteIncrementalDecoderObject *self,
258 : Py_buffer *input,
259 : int final);
260 :
261 : static PyObject *
262 47813 : _multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
263 : {
264 47813 : PyObject *return_value = NULL;
265 : static const char * const _keywords[] = {"input", "final", NULL};
266 : static _PyArg_Parser _parser = {NULL, _keywords, "decode", 0};
267 : PyObject *argsbuf[2];
268 47813 : Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
269 47813 : Py_buffer input = {NULL, NULL};
270 47813 : int final = 0;
271 :
272 47813 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
273 47813 : if (!args) {
274 0 : goto exit;
275 : }
276 47813 : if (PyObject_GetBuffer(args[0], &input, PyBUF_SIMPLE) != 0) {
277 24 : goto exit;
278 : }
279 47789 : if (!PyBuffer_IsContiguous(&input, 'C')) {
280 0 : _PyArg_BadArgument("decode", "argument 'input'", "contiguous buffer", args[0]);
281 0 : goto exit;
282 : }
283 47789 : if (!noptargs) {
284 47489 : goto skip_optional_pos;
285 : }
286 300 : final = _PyLong_AsInt(args[1]);
287 300 : if (final == -1 && PyErr_Occurred()) {
288 0 : goto exit;
289 : }
290 300 : skip_optional_pos:
291 47789 : return_value = _multibytecodec_MultibyteIncrementalDecoder_decode_impl(self, &input, final);
292 :
293 47813 : exit:
294 : /* Cleanup for input */
295 47813 : if (input.obj) {
296 47789 : PyBuffer_Release(&input);
297 : }
298 :
299 47813 : return return_value;
300 : }
301 :
302 : PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_getstate__doc__,
303 : "getstate($self, /)\n"
304 : "--\n"
305 : "\n");
306 :
307 : #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_GETSTATE_METHODDEF \
308 : {"getstate", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_getstate__doc__},
309 :
310 : static PyObject *
311 : _multibytecodec_MultibyteIncrementalDecoder_getstate_impl(MultibyteIncrementalDecoderObject *self);
312 :
313 : static PyObject *
314 329 : _multibytecodec_MultibyteIncrementalDecoder_getstate(MultibyteIncrementalDecoderObject *self, PyObject *Py_UNUSED(ignored))
315 : {
316 329 : return _multibytecodec_MultibyteIncrementalDecoder_getstate_impl(self);
317 : }
318 :
319 : PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_setstate__doc__,
320 : "setstate($self, state, /)\n"
321 : "--\n"
322 : "\n");
323 :
324 : #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_SETSTATE_METHODDEF \
325 : {"setstate", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalDecoder_setstate__doc__},
326 :
327 : static PyObject *
328 : _multibytecodec_MultibyteIncrementalDecoder_setstate_impl(MultibyteIncrementalDecoderObject *self,
329 : PyObject *state);
330 :
331 : static PyObject *
332 306 : _multibytecodec_MultibyteIncrementalDecoder_setstate(MultibyteIncrementalDecoderObject *self, PyObject *arg)
333 : {
334 306 : PyObject *return_value = NULL;
335 : PyObject *state;
336 :
337 306 : if (!PyTuple_Check(arg)) {
338 1 : _PyArg_BadArgument("setstate", "argument", "tuple", arg);
339 1 : goto exit;
340 : }
341 305 : state = arg;
342 305 : return_value = _multibytecodec_MultibyteIncrementalDecoder_setstate_impl(self, state);
343 :
344 306 : exit:
345 306 : return return_value;
346 : }
347 :
348 : PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_reset__doc__,
349 : "reset($self, /)\n"
350 : "--\n"
351 : "\n");
352 :
353 : #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_RESET_METHODDEF \
354 : {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_reset__doc__},
355 :
356 : static PyObject *
357 : _multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecoderObject *self);
358 :
359 : static PyObject *
360 4 : _multibytecodec_MultibyteIncrementalDecoder_reset(MultibyteIncrementalDecoderObject *self, PyObject *Py_UNUSED(ignored))
361 : {
362 4 : return _multibytecodec_MultibyteIncrementalDecoder_reset_impl(self);
363 : }
364 :
365 : PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_read__doc__,
366 : "read($self, sizeobj=None, /)\n"
367 : "--\n"
368 : "\n");
369 :
370 : #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READ_METHODDEF \
371 : {"read", _PyCFunction_CAST(_multibytecodec_MultibyteStreamReader_read), METH_FASTCALL, _multibytecodec_MultibyteStreamReader_read__doc__},
372 :
373 : static PyObject *
374 : _multibytecodec_MultibyteStreamReader_read_impl(MultibyteStreamReaderObject *self,
375 : PyObject *sizeobj);
376 :
377 : static PyObject *
378 42296 : _multibytecodec_MultibyteStreamReader_read(MultibyteStreamReaderObject *self, PyObject *const *args, Py_ssize_t nargs)
379 : {
380 42296 : PyObject *return_value = NULL;
381 42296 : PyObject *sizeobj = Py_None;
382 :
383 42296 : if (!_PyArg_CheckPositional("read", nargs, 0, 1)) {
384 0 : goto exit;
385 : }
386 42296 : if (nargs < 1) {
387 264 : goto skip_optional;
388 : }
389 42032 : sizeobj = args[0];
390 42296 : skip_optional:
391 42296 : return_value = _multibytecodec_MultibyteStreamReader_read_impl(self, sizeobj);
392 :
393 42296 : exit:
394 42296 : return return_value;
395 : }
396 :
397 : PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readline__doc__,
398 : "readline($self, sizeobj=None, /)\n"
399 : "--\n"
400 : "\n");
401 :
402 : #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINE_METHODDEF \
403 : {"readline", _PyCFunction_CAST(_multibytecodec_MultibyteStreamReader_readline), METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readline__doc__},
404 :
405 : static PyObject *
406 : _multibytecodec_MultibyteStreamReader_readline_impl(MultibyteStreamReaderObject *self,
407 : PyObject *sizeobj);
408 :
409 : static PyObject *
410 44831 : _multibytecodec_MultibyteStreamReader_readline(MultibyteStreamReaderObject *self, PyObject *const *args, Py_ssize_t nargs)
411 : {
412 44831 : PyObject *return_value = NULL;
413 44831 : PyObject *sizeobj = Py_None;
414 :
415 44831 : if (!_PyArg_CheckPositional("readline", nargs, 0, 1)) {
416 0 : goto exit;
417 : }
418 44831 : if (nargs < 1) {
419 0 : goto skip_optional;
420 : }
421 44831 : sizeobj = args[0];
422 44831 : skip_optional:
423 44831 : return_value = _multibytecodec_MultibyteStreamReader_readline_impl(self, sizeobj);
424 :
425 44831 : exit:
426 44831 : return return_value;
427 : }
428 :
429 : PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readlines__doc__,
430 : "readlines($self, sizehintobj=None, /)\n"
431 : "--\n"
432 : "\n");
433 :
434 : #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINES_METHODDEF \
435 : {"readlines", _PyCFunction_CAST(_multibytecodec_MultibyteStreamReader_readlines), METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readlines__doc__},
436 :
437 : static PyObject *
438 : _multibytecodec_MultibyteStreamReader_readlines_impl(MultibyteStreamReaderObject *self,
439 : PyObject *sizehintobj);
440 :
441 : static PyObject *
442 42031 : _multibytecodec_MultibyteStreamReader_readlines(MultibyteStreamReaderObject *self, PyObject *const *args, Py_ssize_t nargs)
443 : {
444 42031 : PyObject *return_value = NULL;
445 42031 : PyObject *sizehintobj = Py_None;
446 :
447 42031 : if (!_PyArg_CheckPositional("readlines", nargs, 0, 1)) {
448 0 : goto exit;
449 : }
450 42031 : if (nargs < 1) {
451 0 : goto skip_optional;
452 : }
453 42031 : sizehintobj = args[0];
454 42031 : skip_optional:
455 42031 : return_value = _multibytecodec_MultibyteStreamReader_readlines_impl(self, sizehintobj);
456 :
457 42031 : exit:
458 42031 : return return_value;
459 : }
460 :
461 : PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_reset__doc__,
462 : "reset($self, /)\n"
463 : "--\n"
464 : "\n");
465 :
466 : #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_RESET_METHODDEF \
467 : {"reset", (PyCFunction)_multibytecodec_MultibyteStreamReader_reset, METH_NOARGS, _multibytecodec_MultibyteStreamReader_reset__doc__},
468 :
469 : static PyObject *
470 : _multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *self);
471 :
472 : static PyObject *
473 120 : _multibytecodec_MultibyteStreamReader_reset(MultibyteStreamReaderObject *self, PyObject *Py_UNUSED(ignored))
474 : {
475 120 : return _multibytecodec_MultibyteStreamReader_reset_impl(self);
476 : }
477 :
478 : PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_write__doc__,
479 : "write($self, strobj, /)\n"
480 : "--\n"
481 : "\n");
482 :
483 : #define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITE_METHODDEF \
484 : {"write", _PyCFunction_CAST(_multibytecodec_MultibyteStreamWriter_write), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteStreamWriter_write__doc__},
485 :
486 : static PyObject *
487 : _multibytecodec_MultibyteStreamWriter_write_impl(MultibyteStreamWriterObject *self,
488 : PyTypeObject *cls,
489 : PyObject *strobj);
490 :
491 : static PyObject *
492 55150 : _multibytecodec_MultibyteStreamWriter_write(MultibyteStreamWriterObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
493 : {
494 55150 : PyObject *return_value = NULL;
495 : static const char * const _keywords[] = {"", NULL};
496 : static _PyArg_Parser _parser = {NULL, _keywords, "write", 0};
497 : PyObject *argsbuf[1];
498 : PyObject *strobj;
499 :
500 55150 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
501 55150 : if (!args) {
502 0 : goto exit;
503 : }
504 55150 : strobj = args[0];
505 55150 : return_value = _multibytecodec_MultibyteStreamWriter_write_impl(self, cls, strobj);
506 :
507 55150 : exit:
508 55150 : return return_value;
509 : }
510 :
511 : PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_writelines__doc__,
512 : "writelines($self, lines, /)\n"
513 : "--\n"
514 : "\n");
515 :
516 : #define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITELINES_METHODDEF \
517 : {"writelines", _PyCFunction_CAST(_multibytecodec_MultibyteStreamWriter_writelines), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteStreamWriter_writelines__doc__},
518 :
519 : static PyObject *
520 : _multibytecodec_MultibyteStreamWriter_writelines_impl(MultibyteStreamWriterObject *self,
521 : PyTypeObject *cls,
522 : PyObject *lines);
523 :
524 : static PyObject *
525 722 : _multibytecodec_MultibyteStreamWriter_writelines(MultibyteStreamWriterObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
526 : {
527 722 : PyObject *return_value = NULL;
528 : static const char * const _keywords[] = {"", NULL};
529 : static _PyArg_Parser _parser = {NULL, _keywords, "writelines", 0};
530 : PyObject *argsbuf[1];
531 : PyObject *lines;
532 :
533 722 : args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
534 722 : if (!args) {
535 0 : goto exit;
536 : }
537 722 : lines = args[0];
538 722 : return_value = _multibytecodec_MultibyteStreamWriter_writelines_impl(self, cls, lines);
539 :
540 722 : exit:
541 722 : return return_value;
542 : }
543 :
544 : PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_reset__doc__,
545 : "reset($self, /)\n"
546 : "--\n"
547 : "\n");
548 :
549 : #define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_RESET_METHODDEF \
550 : {"reset", _PyCFunction_CAST(_multibytecodec_MultibyteStreamWriter_reset), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteStreamWriter_reset__doc__},
551 :
552 : static PyObject *
553 : _multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *self,
554 : PyTypeObject *cls);
555 :
556 : static PyObject *
557 19 : _multibytecodec_MultibyteStreamWriter_reset(MultibyteStreamWriterObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
558 : {
559 19 : if (nargs) {
560 0 : PyErr_SetString(PyExc_TypeError, "reset() takes no arguments");
561 0 : return NULL;
562 : }
563 19 : return _multibytecodec_MultibyteStreamWriter_reset_impl(self, cls);
564 : }
565 :
566 : PyDoc_STRVAR(_multibytecodec___create_codec__doc__,
567 : "__create_codec($module, arg, /)\n"
568 : "--\n"
569 : "\n");
570 :
571 : #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \
572 : {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
573 : /*[clinic end generated code: output=9e4e3da5ca3c8288 input=a9049054013a1b77]*/
|