blob: d2bad32908e8c0f654b8377bfbb90e0810119356 [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
32 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
33 "O|z:encode", _keywords,
34 &input, &errors))
35 goto exit;
36 return_value = _multibytecodec_MultibyteCodec_encode_impl(self, input, errors);
37
38exit:
39 return return_value;
40}
41
42PyDoc_STRVAR(_multibytecodec_MultibyteCodec_decode__doc__,
43"decode($self, /, input, errors=None)\n"
44"--\n"
45"\n"
46"Decodes \'input\'.\n"
47"\n"
48"\'errors\' may be given to set a different error handling scheme. Default is\n"
49"\'strict\' meaning that encoding errors raise a UnicodeDecodeError. Other possible\n"
50"values are \'ignore\' and \'replace\' as well as any other name registered with\n"
51"codecs.register_error that is able to handle UnicodeDecodeErrors.\"");
52
53#define _MULTIBYTECODEC_MULTIBYTECODEC_DECODE_METHODDEF \
54 {"decode", (PyCFunction)_multibytecodec_MultibyteCodec_decode, METH_VARARGS|METH_KEYWORDS, _multibytecodec_MultibyteCodec_decode__doc__},
55
56static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -040057_multibytecodec_MultibyteCodec_decode_impl(MultibyteCodecObject *self,
58 Py_buffer *input,
59 const char *errors);
Brett Cannonf2de1fc2014-08-22 11:45:03 -040060
61static PyObject *
62_multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *args, PyObject *kwargs)
63{
64 PyObject *return_value = NULL;
65 static char *_keywords[] = {"input", "errors", NULL};
66 Py_buffer input = {NULL, NULL};
67 const char *errors = NULL;
68
69 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
70 "y*|z:decode", _keywords,
71 &input, &errors))
72 goto exit;
73 return_value = _multibytecodec_MultibyteCodec_decode_impl(self, &input, errors);
74
75exit:
76 /* Cleanup for input */
77 if (input.obj)
78 PyBuffer_Release(&input);
79
80 return return_value;
81}
82
83PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_encode__doc__,
84"encode($self, /, input, final=0)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -050085"--\n"
86"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -040087
88#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_ENCODE_METHODDEF \
89 {"encode", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_encode, METH_VARARGS|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalEncoder_encode__doc__},
90
91static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -040092_multibytecodec_MultibyteIncrementalEncoder_encode_impl(MultibyteIncrementalEncoderObject *self,
93 PyObject *input,
94 int final);
Brett Cannonf2de1fc2014-08-22 11:45:03 -040095
96static PyObject *
97_multibytecodec_MultibyteIncrementalEncoder_encode(MultibyteIncrementalEncoderObject *self, PyObject *args, PyObject *kwargs)
98{
99 PyObject *return_value = NULL;
100 static char *_keywords[] = {"input", "final", NULL};
101 PyObject *input;
102 int final = 0;
103
104 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
105 "O|i:encode", _keywords,
106 &input, &final))
107 goto exit;
108 return_value = _multibytecodec_MultibyteIncrementalEncoder_encode_impl(self, input, final);
109
110exit:
111 return return_value;
112}
113
114PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_reset__doc__,
115"reset($self, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500116"--\n"
117"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400118
119#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_RESET_METHODDEF \
120 {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_reset__doc__},
121
122static PyObject *
123_multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncoderObject *self);
124
125static PyObject *
126_multibytecodec_MultibyteIncrementalEncoder_reset(MultibyteIncrementalEncoderObject *self, PyObject *Py_UNUSED(ignored))
127{
128 return _multibytecodec_MultibyteIncrementalEncoder_reset_impl(self);
129}
130
131PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_decode__doc__,
132"decode($self, /, input, final=0)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500133"--\n"
134"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400135
136#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_DECODE_METHODDEF \
137 {"decode", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_decode, METH_VARARGS|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalDecoder_decode__doc__},
138
139static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -0400140_multibytecodec_MultibyteIncrementalDecoder_decode_impl(MultibyteIncrementalDecoderObject *self,
141 Py_buffer *input,
142 int final);
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400143
144static PyObject *
145_multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderObject *self, PyObject *args, PyObject *kwargs)
146{
147 PyObject *return_value = NULL;
148 static char *_keywords[] = {"input", "final", NULL};
149 Py_buffer input = {NULL, NULL};
150 int final = 0;
151
152 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
153 "y*|i:decode", _keywords,
154 &input, &final))
155 goto exit;
156 return_value = _multibytecodec_MultibyteIncrementalDecoder_decode_impl(self, &input, final);
157
158exit:
159 /* Cleanup for input */
160 if (input.obj)
161 PyBuffer_Release(&input);
162
163 return return_value;
164}
165
166PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_reset__doc__,
167"reset($self, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500168"--\n"
169"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400170
171#define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_RESET_METHODDEF \
172 {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_reset__doc__},
173
174static PyObject *
175_multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecoderObject *self);
176
177static PyObject *
178_multibytecodec_MultibyteIncrementalDecoder_reset(MultibyteIncrementalDecoderObject *self, PyObject *Py_UNUSED(ignored))
179{
180 return _multibytecodec_MultibyteIncrementalDecoder_reset_impl(self);
181}
182
183PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_read__doc__,
184"read($self, sizeobj=None, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500185"--\n"
186"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400187
188#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READ_METHODDEF \
189 {"read", (PyCFunction)_multibytecodec_MultibyteStreamReader_read, METH_VARARGS, _multibytecodec_MultibyteStreamReader_read__doc__},
190
191static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -0400192_multibytecodec_MultibyteStreamReader_read_impl(MultibyteStreamReaderObject *self,
193 PyObject *sizeobj);
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400194
195static PyObject *
196_multibytecodec_MultibyteStreamReader_read(MultibyteStreamReaderObject *self, PyObject *args)
197{
198 PyObject *return_value = NULL;
199 PyObject *sizeobj = Py_None;
200
201 if (!PyArg_UnpackTuple(args, "read",
202 0, 1,
203 &sizeobj))
204 goto exit;
205 return_value = _multibytecodec_MultibyteStreamReader_read_impl(self, sizeobj);
206
207exit:
208 return return_value;
209}
210
211PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readline__doc__,
212"readline($self, sizeobj=None, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500213"--\n"
214"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400215
216#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINE_METHODDEF \
217 {"readline", (PyCFunction)_multibytecodec_MultibyteStreamReader_readline, METH_VARARGS, _multibytecodec_MultibyteStreamReader_readline__doc__},
218
219static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -0400220_multibytecodec_MultibyteStreamReader_readline_impl(MultibyteStreamReaderObject *self,
221 PyObject *sizeobj);
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400222
223static PyObject *
224_multibytecodec_MultibyteStreamReader_readline(MultibyteStreamReaderObject *self, PyObject *args)
225{
226 PyObject *return_value = NULL;
227 PyObject *sizeobj = Py_None;
228
229 if (!PyArg_UnpackTuple(args, "readline",
230 0, 1,
231 &sizeobj))
232 goto exit;
233 return_value = _multibytecodec_MultibyteStreamReader_readline_impl(self, sizeobj);
234
235exit:
236 return return_value;
237}
238
239PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readlines__doc__,
240"readlines($self, sizehintobj=None, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500241"--\n"
242"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400243
244#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINES_METHODDEF \
245 {"readlines", (PyCFunction)_multibytecodec_MultibyteStreamReader_readlines, METH_VARARGS, _multibytecodec_MultibyteStreamReader_readlines__doc__},
246
247static PyObject *
Larry Hastings89964c42015-04-14 18:07:59 -0400248_multibytecodec_MultibyteStreamReader_readlines_impl(MultibyteStreamReaderObject *self,
249 PyObject *sizehintobj);
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400250
251static PyObject *
252_multibytecodec_MultibyteStreamReader_readlines(MultibyteStreamReaderObject *self, PyObject *args)
253{
254 PyObject *return_value = NULL;
255 PyObject *sizehintobj = Py_None;
256
257 if (!PyArg_UnpackTuple(args, "readlines",
258 0, 1,
259 &sizehintobj))
260 goto exit;
261 return_value = _multibytecodec_MultibyteStreamReader_readlines_impl(self, sizehintobj);
262
263exit:
264 return return_value;
265}
266
267PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_reset__doc__,
268"reset($self, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500269"--\n"
270"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400271
272#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_RESET_METHODDEF \
273 {"reset", (PyCFunction)_multibytecodec_MultibyteStreamReader_reset, METH_NOARGS, _multibytecodec_MultibyteStreamReader_reset__doc__},
274
275static PyObject *
276_multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *self);
277
278static PyObject *
279_multibytecodec_MultibyteStreamReader_reset(MultibyteStreamReaderObject *self, PyObject *Py_UNUSED(ignored))
280{
281 return _multibytecodec_MultibyteStreamReader_reset_impl(self);
282}
283
284PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_write__doc__,
285"write($self, strobj, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500286"--\n"
287"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400288
289#define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITE_METHODDEF \
290 {"write", (PyCFunction)_multibytecodec_MultibyteStreamWriter_write, METH_O, _multibytecodec_MultibyteStreamWriter_write__doc__},
291
292PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_writelines__doc__,
293"writelines($self, lines, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500294"--\n"
295"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400296
297#define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITELINES_METHODDEF \
298 {"writelines", (PyCFunction)_multibytecodec_MultibyteStreamWriter_writelines, METH_O, _multibytecodec_MultibyteStreamWriter_writelines__doc__},
299
300PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_reset__doc__,
301"reset($self, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500302"--\n"
303"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400304
305#define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_RESET_METHODDEF \
306 {"reset", (PyCFunction)_multibytecodec_MultibyteStreamWriter_reset, METH_NOARGS, _multibytecodec_MultibyteStreamWriter_reset__doc__},
307
308static PyObject *
309_multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *self);
310
311static PyObject *
312_multibytecodec_MultibyteStreamWriter_reset(MultibyteStreamWriterObject *self, PyObject *Py_UNUSED(ignored))
313{
314 return _multibytecodec_MultibyteStreamWriter_reset_impl(self);
315}
316
317PyDoc_STRVAR(_multibytecodec___create_codec__doc__,
318"__create_codec($module, arg, /)\n"
Zachary Ware8ef887c2015-04-13 18:22:35 -0500319"--\n"
320"\n");
Brett Cannonf2de1fc2014-08-22 11:45:03 -0400321
322#define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \
323 {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
Larry Hastings89964c42015-04-14 18:07:59 -0400324/*[clinic end generated code: output=0fe582cb941024c1 input=a9049054013a1b77]*/