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