blob: 8a47ff88a68ef85ba3f9966eca36534dc62abeed [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 \
17 {"encode", (PyCFunction)_multibytecodec_MultibyteCodec_encode, METH_VARARGS|METH_KEYWORDS, _multibytecodec_MultibyteCodec_encode__doc__},
18
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 *
25_multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject *args, PyObject *kwargs)
26{
27 PyObject *return_value = NULL;
28 static char *_keywords[] = {"input", "errors", NULL};
29 PyObject *input;
30 const char *errors = NULL;
31
Serhiy Storchaka247789c2015-04-24 00:40:51 +030032 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|z:encode", _keywords,
Brett Cannonf2de1fc2014-08-22 11:45:03 -040033 &input, &errors))
34 goto exit;
35 return_value = _multibytecodec_MultibyteCodec_encode_impl(self, input, errors);
36
37exit:
38 return return_value;
39}
40
41PyDoc_STRVAR(_multibytecodec_MultibyteCodec_decode__doc__,
42"decode($self, /, input, errors=None)\n"
43"--\n"
44"\n"
45"Decodes \'input\'.\n"
46"\n"
47"\'errors\' may be given to set a different error handling scheme. Default is\n"
48"\'strict\' meaning that encoding errors raise a UnicodeDecodeError. Other possible\n"
49"values are \'ignore\' and \'replace\' as well as any other name registered with\n"
50"codecs.register_error that is able to handle UnicodeDecodeErrors.\"");
51
52#define _MULTIBYTECODEC_MULTIBYTECODEC_DECODE_METHODDEF \
53 {"decode", (PyCFunction)_multibytecodec_MultibyteCodec_decode, METH_VARARGS|METH_KEYWORDS, _multibytecodec_MultibyteCodec_decode__doc__},
54
55static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -040056_multibytecodec_MultibyteCodec_decode_impl(MultibyteCodecObject *self,
57 Py_buffer *input,
58 const char *errors);
Brett Cannonf2de1fc2014-08-22 11:45:03 -040059
60static PyObject *
61_multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *args, PyObject *kwargs)
62{
63 PyObject *return_value = NULL;
64 static char *_keywords[] = {"input", "errors", NULL};
65 Py_buffer input = {NULL, NULL};
66 const char *errors = NULL;
67
Serhiy Storchaka247789c2015-04-24 00:40:51 +030068 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|z:decode", _keywords,
Brett Cannonf2de1fc2014-08-22 11:45:03 -040069 &input, &errors))
70 goto exit;
71 return_value = _multibytecodec_MultibyteCodec_decode_impl(self, &input, errors);
72
73exit:
74 /* Cleanup for input */
75 if (input.obj)
76 PyBuffer_Release(&input);
77
78 return return_value;
79}
80
81PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_encode__doc__,
Serhiy Storchaka8b2e8b62015-05-30 11:30:39 +030082"encode($self, /, input, final=False)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -050083"--\n"
84"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -040085
86#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_ENCODE_METHODDEF \
87 {"encode", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_encode, METH_VARARGS|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalEncoder_encode__doc__},
88
89static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -040090_multibytecodec_MultibyteIncrementalEncoder_encode_impl(MultibyteIncrementalEncoderObject *self,
91 PyObject *input,
92 int final);
Brett Cannonf2de1fc2014-08-22 11:45:03 -040093
94static PyObject *
95_multibytecodec_MultibyteIncrementalEncoder_encode(MultibyteIncrementalEncoderObject *self, PyObject *args, PyObject *kwargs)
96{
97 PyObject *return_value = NULL;
98 static char *_keywords[] = {"input", "final", NULL};
99 PyObject *input;
100 int final = 0;
101
Serhiy Storchaka247789c2015-04-24 00:40:51 +0300102 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:encode", _keywords,
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400103 &input, &final))
104 goto exit;
105 return_value = _multibytecodec_MultibyteIncrementalEncoder_encode_impl(self, input, final);
106
107exit:
108 return return_value;
109}
110
111PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_reset__doc__,
112"reset($self, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500113"--\n"
114"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400115
116#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_RESET_METHODDEF \
117 {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_reset__doc__},
118
119static PyObject *
120_multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncoderObject *self);
121
122static PyObject *
123_multibytecodec_MultibyteIncrementalEncoder_reset(MultibyteIncrementalEncoderObject *self, PyObject *Py_UNUSED(ignored))
124{
125 return _multibytecodec_MultibyteIncrementalEncoder_reset_impl(self);
126}
127
128PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_decode__doc__,
Serhiy Storchaka8b2e8b62015-05-30 11:30:39 +0300129"decode($self, /, input, final=False)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500130"--\n"
131"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400132
133#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_DECODE_METHODDEF \
134 {"decode", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_decode, METH_VARARGS|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalDecoder_decode__doc__},
135
136static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -0400137_multibytecodec_MultibyteIncrementalDecoder_decode_impl(MultibyteIncrementalDecoderObject *self,
138 Py_buffer *input,
139 int final);
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400140
141static PyObject *
142_multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderObject *self, PyObject *args, PyObject *kwargs)
143{
144 PyObject *return_value = NULL;
145 static char *_keywords[] = {"input", "final", NULL};
146 Py_buffer input = {NULL, NULL};
147 int final = 0;
148
Serhiy Storchaka247789c2015-04-24 00:40:51 +0300149 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "y*|i:decode", _keywords,
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400150 &input, &final))
151 goto exit;
152 return_value = _multibytecodec_MultibyteIncrementalDecoder_decode_impl(self, &input, final);
153
154exit:
155 /* Cleanup for input */
156 if (input.obj)
157 PyBuffer_Release(&input);
158
159 return return_value;
160}
161
162PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_reset__doc__,
163"reset($self, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500164"--\n"
165"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400166
167#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_RESET_METHODDEF \
168 {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_reset__doc__},
169
170static PyObject *
171_multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecoderObject *self);
172
173static PyObject *
174_multibytecodec_MultibyteIncrementalDecoder_reset(MultibyteIncrementalDecoderObject *self, PyObject *Py_UNUSED(ignored))
175{
176 return _multibytecodec_MultibyteIncrementalDecoder_reset_impl(self);
177}
178
179PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_read__doc__,
180"read($self, sizeobj=None, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500181"--\n"
182"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400183
184#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READ_METHODDEF \
185 {"read", (PyCFunction)_multibytecodec_MultibyteStreamReader_read, METH_VARARGS, _multibytecodec_MultibyteStreamReader_read__doc__},
186
187static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -0400188_multibytecodec_MultibyteStreamReader_read_impl(MultibyteStreamReaderObject *self,
189 PyObject *sizeobj);
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400190
191static PyObject *
192_multibytecodec_MultibyteStreamReader_read(MultibyteStreamReaderObject *self, PyObject *args)
193{
194 PyObject *return_value = NULL;
195 PyObject *sizeobj = Py_None;
196
197 if (!PyArg_UnpackTuple(args, "read",
198 0, 1,
199 &sizeobj))
200 goto exit;
201 return_value = _multibytecodec_MultibyteStreamReader_read_impl(self, sizeobj);
202
203exit:
204 return return_value;
205}
206
207PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readline__doc__,
208"readline($self, sizeobj=None, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500209"--\n"
210"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400211
212#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINE_METHODDEF \
213 {"readline", (PyCFunction)_multibytecodec_MultibyteStreamReader_readline, METH_VARARGS, _multibytecodec_MultibyteStreamReader_readline__doc__},
214
215static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -0400216_multibytecodec_MultibyteStreamReader_readline_impl(MultibyteStreamReaderObject *self,
217 PyObject *sizeobj);
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400218
219static PyObject *
220_multibytecodec_MultibyteStreamReader_readline(MultibyteStreamReaderObject *self, PyObject *args)
221{
222 PyObject *return_value = NULL;
223 PyObject *sizeobj = Py_None;
224
225 if (!PyArg_UnpackTuple(args, "readline",
226 0, 1,
227 &sizeobj))
228 goto exit;
229 return_value = _multibytecodec_MultibyteStreamReader_readline_impl(self, sizeobj);
230
231exit:
232 return return_value;
233}
234
235PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readlines__doc__,
236"readlines($self, sizehintobj=None, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500237"--\n"
238"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400239
240#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINES_METHODDEF \
241 {"readlines", (PyCFunction)_multibytecodec_MultibyteStreamReader_readlines, METH_VARARGS, _multibytecodec_MultibyteStreamReader_readlines__doc__},
242
243static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -0400244_multibytecodec_MultibyteStreamReader_readlines_impl(MultibyteStreamReaderObject *self,
245 PyObject *sizehintobj);
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400246
247static PyObject *
248_multibytecodec_MultibyteStreamReader_readlines(MultibyteStreamReaderObject *self, PyObject *args)
249{
250 PyObject *return_value = NULL;
251 PyObject *sizehintobj = Py_None;
252
253 if (!PyArg_UnpackTuple(args, "readlines",
254 0, 1,
255 &sizehintobj))
256 goto exit;
257 return_value = _multibytecodec_MultibyteStreamReader_readlines_impl(self, sizehintobj);
258
259exit:
260 return return_value;
261}
262
263PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_reset__doc__,
264"reset($self, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500265"--\n"
266"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400267
268#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_RESET_METHODDEF \
269 {"reset", (PyCFunction)_multibytecodec_MultibyteStreamReader_reset, METH_NOARGS, _multibytecodec_MultibyteStreamReader_reset__doc__},
270
271static PyObject *
272_multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *self);
273
274static PyObject *
275_multibytecodec_MultibyteStreamReader_reset(MultibyteStreamReaderObject *self, PyObject *Py_UNUSED(ignored))
276{
277 return _multibytecodec_MultibyteStreamReader_reset_impl(self);
278}
279
280PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_write__doc__,
281"write($self, strobj, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500282"--\n"
283"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400284
285#define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITE_METHODDEF \
286 {"write", (PyCFunction)_multibytecodec_MultibyteStreamWriter_write, METH_O, _multibytecodec_MultibyteStreamWriter_write__doc__},
287
288PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_writelines__doc__,
289"writelines($self, lines, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500290"--\n"
291"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400292
293#define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITELINES_METHODDEF \
294 {"writelines", (PyCFunction)_multibytecodec_MultibyteStreamWriter_writelines, METH_O, _multibytecodec_MultibyteStreamWriter_writelines__doc__},
295
296PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_reset__doc__,
297"reset($self, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500298"--\n"
299"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400300
301#define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_RESET_METHODDEF \
302 {"reset", (PyCFunction)_multibytecodec_MultibyteStreamWriter_reset, METH_NOARGS, _multibytecodec_MultibyteStreamWriter_reset__doc__},
303
304static PyObject *
305_multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *self);
306
307static PyObject *
308_multibytecodec_MultibyteStreamWriter_reset(MultibyteStreamWriterObject *self, PyObject *Py_UNUSED(ignored))
309{
310 return _multibytecodec_MultibyteStreamWriter_reset_impl(self);
311}
312
313PyDoc_STRVAR(_multibytecodec___create_codec__doc__,
314"__create_codec($module, arg, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500315"--\n"
316"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400317
318#define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \
319 {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
Serhiy Storchaka8b2e8b62015-05-30 11:30:39 +0300320/*[clinic end generated code: output=eebb21e18c3043d1 input=a9049054013a1b77]*/