blob: c62a64179bec134e5966f0a19f75609ed20cfe65 [file] [log] [blame]
Brett Cannonf2de1fc2014-08-22 11:45:03 -04001/*[clinic input]
2preserve
3[clinic start generated code]*/
4
5PyDoc_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 \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +020017 {"encode", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteCodec_encode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteCodec_encode__doc__},
Brett Cannonf2de1fc2014-08-22 11:45:03 -040018
19static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -040020_multibytecodec_MultibyteCodec_encode_impl(MultibyteCodecObject *self,
21 PyObject *input,
22 const char *errors);
Brett Cannonf2de1fc2014-08-22 11:45:03 -040023
24static PyObject *
Serhiy Storchakaa5552f02017-12-15 13:11:11 +020025_multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
Brett Cannonf2de1fc2014-08-22 11:45:03 -040026{
27 PyObject *return_value = NULL;
Serhiy Storchaka9171a8b2016-08-14 10:52:18 +030028 static const char * const _keywords[] = {"input", "errors", NULL};
29 static _PyArg_Parser _parser = {"O|z:encode", _keywords, 0};
Brett Cannonf2de1fc2014-08-22 11:45:03 -040030 PyObject *input;
31 const char *errors = NULL;
32
Victor Stinner3e1fad62017-01-17 01:29:01 +010033 if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030034 &input, &errors)) {
Brett Cannonf2de1fc2014-08-22 11:45:03 -040035 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030036 }
Brett Cannonf2de1fc2014-08-22 11:45:03 -040037 return_value = _multibytecodec_MultibyteCodec_encode_impl(self, input, errors);
38
39exit:
40 return return_value;
41}
42
43PyDoc_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 \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +020055 {"decode", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteCodec_decode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteCodec_decode__doc__},
Brett Cannonf2de1fc2014-08-22 11:45:03 -040056
57static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -040058_multibytecodec_MultibyteCodec_decode_impl(MultibyteCodecObject *self,
59 Py_buffer *input,
60 const char *errors);
Brett Cannonf2de1fc2014-08-22 11:45:03 -040061
62static PyObject *
Serhiy Storchakaa5552f02017-12-15 13:11:11 +020063_multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
Brett Cannonf2de1fc2014-08-22 11:45:03 -040064{
65 PyObject *return_value = NULL;
Serhiy Storchaka9171a8b2016-08-14 10:52:18 +030066 static const char * const _keywords[] = {"input", "errors", NULL};
67 static _PyArg_Parser _parser = {"y*|z:decode", _keywords, 0};
Brett Cannonf2de1fc2014-08-22 11:45:03 -040068 Py_buffer input = {NULL, NULL};
69 const char *errors = NULL;
70
Victor Stinner3e1fad62017-01-17 01:29:01 +010071 if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030072 &input, &errors)) {
Brett Cannonf2de1fc2014-08-22 11:45:03 -040073 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030074 }
Brett Cannonf2de1fc2014-08-22 11:45:03 -040075 return_value = _multibytecodec_MultibyteCodec_decode_impl(self, &input, errors);
76
77exit:
78 /* Cleanup for input */
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030079 if (input.obj) {
Brett Cannonf2de1fc2014-08-22 11:45:03 -040080 PyBuffer_Release(&input);
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030081 }
Brett Cannonf2de1fc2014-08-22 11:45:03 -040082
83 return return_value;
84}
85
86PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_encode__doc__,
Serhiy Storchaka8b2e8b62015-05-30 11:30:39 +030087"encode($self, /, input, final=False)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -050088"--\n"
89"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -040090
91#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_ENCODE_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +020092 {"encode", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteIncrementalEncoder_encode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalEncoder_encode__doc__},
Brett Cannonf2de1fc2014-08-22 11:45:03 -040093
94static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -040095_multibytecodec_MultibyteIncrementalEncoder_encode_impl(MultibyteIncrementalEncoderObject *self,
96 PyObject *input,
97 int final);
Brett Cannonf2de1fc2014-08-22 11:45:03 -040098
99static PyObject *
Serhiy Storchakaa5552f02017-12-15 13:11:11 +0200100_multibytecodec_MultibyteIncrementalEncoder_encode(MultibyteIncrementalEncoderObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400101{
102 PyObject *return_value = NULL;
Serhiy Storchaka9171a8b2016-08-14 10:52:18 +0300103 static const char * const _keywords[] = {"input", "final", NULL};
104 static _PyArg_Parser _parser = {"O|i:encode", _keywords, 0};
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400105 PyObject *input;
106 int final = 0;
107
Victor Stinner3e1fad62017-01-17 01:29:01 +0100108 if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300109 &input, &final)) {
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400110 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300111 }
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400112 return_value = _multibytecodec_MultibyteIncrementalEncoder_encode_impl(self, input, final);
113
114exit:
115 return return_value;
116}
117
Christopher Thorneac22f6a2018-11-01 10:48:49 +0000118PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_getstate__doc__,
119"getstate($self, /)\n"
120"--\n"
121"\n");
122
123#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_GETSTATE_METHODDEF \
124 {"getstate", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_getstate__doc__},
125
126static PyObject *
127_multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEncoderObject *self);
128
129static PyObject *
130_multibytecodec_MultibyteIncrementalEncoder_getstate(MultibyteIncrementalEncoderObject *self, PyObject *Py_UNUSED(ignored))
131{
132 return _multibytecodec_MultibyteIncrementalEncoder_getstate_impl(self);
133}
134
135PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_setstate__doc__,
136"setstate($self, state, /)\n"
137"--\n"
138"\n");
139
140#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_SETSTATE_METHODDEF \
141 {"setstate", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalEncoder_setstate__doc__},
142
143static PyObject *
144_multibytecodec_MultibyteIncrementalEncoder_setstate_impl(MultibyteIncrementalEncoderObject *self,
145 PyLongObject *statelong);
146
147static PyObject *
148_multibytecodec_MultibyteIncrementalEncoder_setstate(MultibyteIncrementalEncoderObject *self, PyObject *arg)
149{
150 PyObject *return_value = NULL;
151 PyLongObject *statelong;
152
Serhiy Storchaka32d96a22018-12-25 13:23:47 +0200153 if (!PyLong_Check(arg)) {
Serhiy Storchaka4fa95912019-01-11 16:01:14 +0200154 _PyArg_BadArgument("setstate", 0, "int", arg);
Christopher Thorneac22f6a2018-11-01 10:48:49 +0000155 goto exit;
156 }
Serhiy Storchaka32d96a22018-12-25 13:23:47 +0200157 statelong = (PyLongObject *)arg;
Christopher Thorneac22f6a2018-11-01 10:48:49 +0000158 return_value = _multibytecodec_MultibyteIncrementalEncoder_setstate_impl(self, statelong);
159
160exit:
161 return return_value;
162}
163
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400164PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_reset__doc__,
165"reset($self, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500166"--\n"
167"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400168
169#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_RESET_METHODDEF \
170 {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_reset__doc__},
171
172static PyObject *
173_multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncoderObject *self);
174
175static PyObject *
176_multibytecodec_MultibyteIncrementalEncoder_reset(MultibyteIncrementalEncoderObject *self, PyObject *Py_UNUSED(ignored))
177{
178 return _multibytecodec_MultibyteIncrementalEncoder_reset_impl(self);
179}
180
181PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_decode__doc__,
Serhiy Storchaka8b2e8b62015-05-30 11:30:39 +0300182"decode($self, /, input, final=False)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500183"--\n"
184"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400185
186#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_DECODE_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200187 {"decode", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteIncrementalDecoder_decode, METH_FASTCALL|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalDecoder_decode__doc__},
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400188
189static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -0400190_multibytecodec_MultibyteIncrementalDecoder_decode_impl(MultibyteIncrementalDecoderObject *self,
191 Py_buffer *input,
192 int final);
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400193
194static PyObject *
Serhiy Storchakaa5552f02017-12-15 13:11:11 +0200195_multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400196{
197 PyObject *return_value = NULL;
Serhiy Storchaka9171a8b2016-08-14 10:52:18 +0300198 static const char * const _keywords[] = {"input", "final", NULL};
199 static _PyArg_Parser _parser = {"y*|i:decode", _keywords, 0};
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400200 Py_buffer input = {NULL, NULL};
201 int final = 0;
202
Victor Stinner3e1fad62017-01-17 01:29:01 +0100203 if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300204 &input, &final)) {
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400205 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300206 }
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400207 return_value = _multibytecodec_MultibyteIncrementalDecoder_decode_impl(self, &input, final);
208
209exit:
210 /* Cleanup for input */
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300211 if (input.obj) {
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400212 PyBuffer_Release(&input);
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300213 }
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400214
215 return return_value;
216}
217
Christopher Thorneac22f6a2018-11-01 10:48:49 +0000218PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_getstate__doc__,
219"getstate($self, /)\n"
220"--\n"
221"\n");
222
223#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_GETSTATE_METHODDEF \
224 {"getstate", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_getstate, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_getstate__doc__},
225
226static PyObject *
227_multibytecodec_MultibyteIncrementalDecoder_getstate_impl(MultibyteIncrementalDecoderObject *self);
228
229static PyObject *
230_multibytecodec_MultibyteIncrementalDecoder_getstate(MultibyteIncrementalDecoderObject *self, PyObject *Py_UNUSED(ignored))
231{
232 return _multibytecodec_MultibyteIncrementalDecoder_getstate_impl(self);
233}
234
235PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_setstate__doc__,
236"setstate($self, state, /)\n"
237"--\n"
238"\n");
239
240#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_SETSTATE_METHODDEF \
241 {"setstate", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_setstate, METH_O, _multibytecodec_MultibyteIncrementalDecoder_setstate__doc__},
242
243static PyObject *
244_multibytecodec_MultibyteIncrementalDecoder_setstate_impl(MultibyteIncrementalDecoderObject *self,
245 PyObject *state);
246
247static PyObject *
248_multibytecodec_MultibyteIncrementalDecoder_setstate(MultibyteIncrementalDecoderObject *self, PyObject *arg)
249{
250 PyObject *return_value = NULL;
251 PyObject *state;
252
Serhiy Storchaka32d96a22018-12-25 13:23:47 +0200253 if (!PyTuple_Check(arg)) {
Serhiy Storchaka4fa95912019-01-11 16:01:14 +0200254 _PyArg_BadArgument("setstate", 0, "tuple", arg);
Christopher Thorneac22f6a2018-11-01 10:48:49 +0000255 goto exit;
256 }
Serhiy Storchaka32d96a22018-12-25 13:23:47 +0200257 state = arg;
Christopher Thorneac22f6a2018-11-01 10:48:49 +0000258 return_value = _multibytecodec_MultibyteIncrementalDecoder_setstate_impl(self, state);
259
260exit:
261 return return_value;
262}
263
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400264PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_reset__doc__,
265"reset($self, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500266"--\n"
267"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400268
269#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_RESET_METHODDEF \
270 {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_reset__doc__},
271
272static PyObject *
273_multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecoderObject *self);
274
275static PyObject *
276_multibytecodec_MultibyteIncrementalDecoder_reset(MultibyteIncrementalDecoderObject *self, PyObject *Py_UNUSED(ignored))
277{
278 return _multibytecodec_MultibyteIncrementalDecoder_reset_impl(self);
279}
280
281PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_read__doc__,
282"read($self, sizeobj=None, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500283"--\n"
284"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400285
286#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READ_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200287 {"read", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteStreamReader_read, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_read__doc__},
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400288
289static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -0400290_multibytecodec_MultibyteStreamReader_read_impl(MultibyteStreamReaderObject *self,
291 PyObject *sizeobj);
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400292
293static PyObject *
Serhiy Storchakaa5552f02017-12-15 13:11:11 +0200294_multibytecodec_MultibyteStreamReader_read(MultibyteStreamReaderObject *self, PyObject *const *args, Py_ssize_t nargs)
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400295{
296 PyObject *return_value = NULL;
297 PyObject *sizeobj = Py_None;
298
Serhiy Storchaka2a39d252019-01-11 18:01:42 +0200299 if (!_PyArg_CheckPositional("read", nargs, 0, 1)) {
Victor Stinner0c4a8282017-01-17 02:21:47 +0100300 goto exit;
301 }
Serhiy Storchaka2a39d252019-01-11 18:01:42 +0200302 if (nargs < 1) {
303 goto skip_optional;
304 }
305 sizeobj = args[0];
306skip_optional:
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400307 return_value = _multibytecodec_MultibyteStreamReader_read_impl(self, sizeobj);
308
309exit:
310 return return_value;
311}
312
313PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readline__doc__,
314"readline($self, sizeobj=None, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500315"--\n"
316"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400317
318#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINE_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200319 {"readline", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteStreamReader_readline, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readline__doc__},
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400320
321static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -0400322_multibytecodec_MultibyteStreamReader_readline_impl(MultibyteStreamReaderObject *self,
323 PyObject *sizeobj);
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400324
325static PyObject *
Serhiy Storchakaa5552f02017-12-15 13:11:11 +0200326_multibytecodec_MultibyteStreamReader_readline(MultibyteStreamReaderObject *self, PyObject *const *args, Py_ssize_t nargs)
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400327{
328 PyObject *return_value = NULL;
329 PyObject *sizeobj = Py_None;
330
Serhiy Storchaka2a39d252019-01-11 18:01:42 +0200331 if (!_PyArg_CheckPositional("readline", nargs, 0, 1)) {
Victor Stinner0c4a8282017-01-17 02:21:47 +0100332 goto exit;
333 }
Serhiy Storchaka2a39d252019-01-11 18:01:42 +0200334 if (nargs < 1) {
335 goto skip_optional;
336 }
337 sizeobj = args[0];
338skip_optional:
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400339 return_value = _multibytecodec_MultibyteStreamReader_readline_impl(self, sizeobj);
340
341exit:
342 return return_value;
343}
344
345PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readlines__doc__,
346"readlines($self, sizehintobj=None, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500347"--\n"
348"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400349
350#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINES_METHODDEF \
Serhiy Storchaka4a934d42018-11-27 11:27:36 +0200351 {"readlines", (PyCFunction)(void(*)(void))_multibytecodec_MultibyteStreamReader_readlines, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readlines__doc__},
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400352
353static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -0400354_multibytecodec_MultibyteStreamReader_readlines_impl(MultibyteStreamReaderObject *self,
355 PyObject *sizehintobj);
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400356
357static PyObject *
Serhiy Storchakaa5552f02017-12-15 13:11:11 +0200358_multibytecodec_MultibyteStreamReader_readlines(MultibyteStreamReaderObject *self, PyObject *const *args, Py_ssize_t nargs)
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400359{
360 PyObject *return_value = NULL;
361 PyObject *sizehintobj = Py_None;
362
Serhiy Storchaka2a39d252019-01-11 18:01:42 +0200363 if (!_PyArg_CheckPositional("readlines", nargs, 0, 1)) {
Victor Stinner0c4a8282017-01-17 02:21:47 +0100364 goto exit;
365 }
Serhiy Storchaka2a39d252019-01-11 18:01:42 +0200366 if (nargs < 1) {
367 goto skip_optional;
368 }
369 sizehintobj = args[0];
370skip_optional:
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400371 return_value = _multibytecodec_MultibyteStreamReader_readlines_impl(self, sizehintobj);
372
373exit:
374 return return_value;
375}
376
377PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_reset__doc__,
378"reset($self, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500379"--\n"
380"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400381
382#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_RESET_METHODDEF \
383 {"reset", (PyCFunction)_multibytecodec_MultibyteStreamReader_reset, METH_NOARGS, _multibytecodec_MultibyteStreamReader_reset__doc__},
384
385static PyObject *
386_multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *self);
387
388static PyObject *
389_multibytecodec_MultibyteStreamReader_reset(MultibyteStreamReaderObject *self, PyObject *Py_UNUSED(ignored))
390{
391 return _multibytecodec_MultibyteStreamReader_reset_impl(self);
392}
393
394PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_write__doc__,
395"write($self, strobj, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500396"--\n"
397"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400398
399#define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITE_METHODDEF \
400 {"write", (PyCFunction)_multibytecodec_MultibyteStreamWriter_write, METH_O, _multibytecodec_MultibyteStreamWriter_write__doc__},
401
402PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_writelines__doc__,
403"writelines($self, lines, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500404"--\n"
405"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400406
407#define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITELINES_METHODDEF \
408 {"writelines", (PyCFunction)_multibytecodec_MultibyteStreamWriter_writelines, METH_O, _multibytecodec_MultibyteStreamWriter_writelines__doc__},
409
410PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_reset__doc__,
411"reset($self, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500412"--\n"
413"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400414
415#define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_RESET_METHODDEF \
416 {"reset", (PyCFunction)_multibytecodec_MultibyteStreamWriter_reset, METH_NOARGS, _multibytecodec_MultibyteStreamWriter_reset__doc__},
417
418static PyObject *
419_multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *self);
420
421static PyObject *
422_multibytecodec_MultibyteStreamWriter_reset(MultibyteStreamWriterObject *self, PyObject *Py_UNUSED(ignored))
423{
424 return _multibytecodec_MultibyteStreamWriter_reset_impl(self);
425}
426
427PyDoc_STRVAR(_multibytecodec___create_codec__doc__,
428"__create_codec($module, arg, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500429"--\n"
430"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400431
432#define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \
433 {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
Serhiy Storchaka2a39d252019-01-11 18:01:42 +0200434/*[clinic end generated code: output=bcd6311010557faf input=a9049054013a1b77]*/