Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 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)_multibytecodec_MultibyteCodec_encode, METH_VARARGS|METH_KEYWORDS, _multibytecodec_MultibyteCodec_encode__doc__}, |
| 18 | |
| 19 | static PyObject * |
Larry Hastings | 89964c4 | 2015-04-14 18:07:59 -0400 | [diff] [blame] | 20 | _multibytecodec_MultibyteCodec_encode_impl(MultibyteCodecObject *self, |
| 21 | PyObject *input, |
| 22 | const char *errors); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 23 | |
| 24 | static 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 | |
| 38 | exit: |
| 39 | return return_value; |
| 40 | } |
| 41 | |
| 42 | PyDoc_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 | |
| 56 | static PyObject * |
Larry Hastings | 89964c4 | 2015-04-14 18:07:59 -0400 | [diff] [blame] | 57 | _multibytecodec_MultibyteCodec_decode_impl(MultibyteCodecObject *self, |
| 58 | Py_buffer *input, |
| 59 | const char *errors); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 60 | |
| 61 | static 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 | |
| 75 | exit: |
| 76 | /* Cleanup for input */ |
| 77 | if (input.obj) |
| 78 | PyBuffer_Release(&input); |
| 79 | |
| 80 | return return_value; |
| 81 | } |
| 82 | |
| 83 | PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_encode__doc__, |
| 84 | "encode($self, /, input, final=0)\n" |
Zachary Ware | 8ef887c | 2015-04-13 18:22:35 -0500 | [diff] [blame] | 85 | "--\n" |
| 86 | "\n"); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 87 | |
| 88 | #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_ENCODE_METHODDEF \ |
| 89 | {"encode", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_encode, METH_VARARGS|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalEncoder_encode__doc__}, |
| 90 | |
| 91 | static PyObject * |
Larry Hastings | 89964c4 | 2015-04-14 18:07:59 -0400 | [diff] [blame] | 92 | _multibytecodec_MultibyteIncrementalEncoder_encode_impl(MultibyteIncrementalEncoderObject *self, |
| 93 | PyObject *input, |
| 94 | int final); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 95 | |
| 96 | static 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 | |
| 110 | exit: |
| 111 | return return_value; |
| 112 | } |
| 113 | |
| 114 | PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalEncoder_reset__doc__, |
| 115 | "reset($self, /)\n" |
Zachary Ware | 8ef887c | 2015-04-13 18:22:35 -0500 | [diff] [blame] | 116 | "--\n" |
| 117 | "\n"); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 118 | |
| 119 | #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALENCODER_RESET_METHODDEF \ |
| 120 | {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalEncoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalEncoder_reset__doc__}, |
| 121 | |
| 122 | static PyObject * |
| 123 | _multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncoderObject *self); |
| 124 | |
| 125 | static PyObject * |
| 126 | _multibytecodec_MultibyteIncrementalEncoder_reset(MultibyteIncrementalEncoderObject *self, PyObject *Py_UNUSED(ignored)) |
| 127 | { |
| 128 | return _multibytecodec_MultibyteIncrementalEncoder_reset_impl(self); |
| 129 | } |
| 130 | |
| 131 | PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_decode__doc__, |
| 132 | "decode($self, /, input, final=0)\n" |
Zachary Ware | 8ef887c | 2015-04-13 18:22:35 -0500 | [diff] [blame] | 133 | "--\n" |
| 134 | "\n"); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 135 | |
| 136 | #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_DECODE_METHODDEF \ |
| 137 | {"decode", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_decode, METH_VARARGS|METH_KEYWORDS, _multibytecodec_MultibyteIncrementalDecoder_decode__doc__}, |
| 138 | |
| 139 | static PyObject * |
Larry Hastings | 89964c4 | 2015-04-14 18:07:59 -0400 | [diff] [blame] | 140 | _multibytecodec_MultibyteIncrementalDecoder_decode_impl(MultibyteIncrementalDecoderObject *self, |
| 141 | Py_buffer *input, |
| 142 | int final); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 143 | |
| 144 | static 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 | |
| 158 | exit: |
| 159 | /* Cleanup for input */ |
| 160 | if (input.obj) |
| 161 | PyBuffer_Release(&input); |
| 162 | |
| 163 | return return_value; |
| 164 | } |
| 165 | |
| 166 | PyDoc_STRVAR(_multibytecodec_MultibyteIncrementalDecoder_reset__doc__, |
| 167 | "reset($self, /)\n" |
Zachary Ware | 8ef887c | 2015-04-13 18:22:35 -0500 | [diff] [blame] | 168 | "--\n" |
| 169 | "\n"); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 170 | |
| 171 | #define _MULTIBYTECODEC_MULTIBYTEINCREMENTALDECODER_RESET_METHODDEF \ |
| 172 | {"reset", (PyCFunction)_multibytecodec_MultibyteIncrementalDecoder_reset, METH_NOARGS, _multibytecodec_MultibyteIncrementalDecoder_reset__doc__}, |
| 173 | |
| 174 | static PyObject * |
| 175 | _multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecoderObject *self); |
| 176 | |
| 177 | static PyObject * |
| 178 | _multibytecodec_MultibyteIncrementalDecoder_reset(MultibyteIncrementalDecoderObject *self, PyObject *Py_UNUSED(ignored)) |
| 179 | { |
| 180 | return _multibytecodec_MultibyteIncrementalDecoder_reset_impl(self); |
| 181 | } |
| 182 | |
| 183 | PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_read__doc__, |
| 184 | "read($self, sizeobj=None, /)\n" |
Zachary Ware | 8ef887c | 2015-04-13 18:22:35 -0500 | [diff] [blame] | 185 | "--\n" |
| 186 | "\n"); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 187 | |
| 188 | #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READ_METHODDEF \ |
| 189 | {"read", (PyCFunction)_multibytecodec_MultibyteStreamReader_read, METH_VARARGS, _multibytecodec_MultibyteStreamReader_read__doc__}, |
| 190 | |
| 191 | static PyObject * |
Larry Hastings | 89964c4 | 2015-04-14 18:07:59 -0400 | [diff] [blame] | 192 | _multibytecodec_MultibyteStreamReader_read_impl(MultibyteStreamReaderObject *self, |
| 193 | PyObject *sizeobj); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 194 | |
| 195 | static 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 | |
| 207 | exit: |
| 208 | return return_value; |
| 209 | } |
| 210 | |
| 211 | PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readline__doc__, |
| 212 | "readline($self, sizeobj=None, /)\n" |
Zachary Ware | 8ef887c | 2015-04-13 18:22:35 -0500 | [diff] [blame] | 213 | "--\n" |
| 214 | "\n"); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 215 | |
| 216 | #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINE_METHODDEF \ |
| 217 | {"readline", (PyCFunction)_multibytecodec_MultibyteStreamReader_readline, METH_VARARGS, _multibytecodec_MultibyteStreamReader_readline__doc__}, |
| 218 | |
| 219 | static PyObject * |
Larry Hastings | 89964c4 | 2015-04-14 18:07:59 -0400 | [diff] [blame] | 220 | _multibytecodec_MultibyteStreamReader_readline_impl(MultibyteStreamReaderObject *self, |
| 221 | PyObject *sizeobj); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 222 | |
| 223 | static 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 | |
| 235 | exit: |
| 236 | return return_value; |
| 237 | } |
| 238 | |
| 239 | PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readlines__doc__, |
| 240 | "readlines($self, sizehintobj=None, /)\n" |
Zachary Ware | 8ef887c | 2015-04-13 18:22:35 -0500 | [diff] [blame] | 241 | "--\n" |
| 242 | "\n"); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 243 | |
| 244 | #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINES_METHODDEF \ |
| 245 | {"readlines", (PyCFunction)_multibytecodec_MultibyteStreamReader_readlines, METH_VARARGS, _multibytecodec_MultibyteStreamReader_readlines__doc__}, |
| 246 | |
| 247 | static PyObject * |
Larry Hastings | 89964c4 | 2015-04-14 18:07:59 -0400 | [diff] [blame] | 248 | _multibytecodec_MultibyteStreamReader_readlines_impl(MultibyteStreamReaderObject *self, |
| 249 | PyObject *sizehintobj); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 250 | |
| 251 | static 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 | |
| 263 | exit: |
| 264 | return return_value; |
| 265 | } |
| 266 | |
| 267 | PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_reset__doc__, |
| 268 | "reset($self, /)\n" |
Zachary Ware | 8ef887c | 2015-04-13 18:22:35 -0500 | [diff] [blame] | 269 | "--\n" |
| 270 | "\n"); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 271 | |
| 272 | #define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_RESET_METHODDEF \ |
| 273 | {"reset", (PyCFunction)_multibytecodec_MultibyteStreamReader_reset, METH_NOARGS, _multibytecodec_MultibyteStreamReader_reset__doc__}, |
| 274 | |
| 275 | static PyObject * |
| 276 | _multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *self); |
| 277 | |
| 278 | static PyObject * |
| 279 | _multibytecodec_MultibyteStreamReader_reset(MultibyteStreamReaderObject *self, PyObject *Py_UNUSED(ignored)) |
| 280 | { |
| 281 | return _multibytecodec_MultibyteStreamReader_reset_impl(self); |
| 282 | } |
| 283 | |
| 284 | PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_write__doc__, |
| 285 | "write($self, strobj, /)\n" |
Zachary Ware | 8ef887c | 2015-04-13 18:22:35 -0500 | [diff] [blame] | 286 | "--\n" |
| 287 | "\n"); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 288 | |
| 289 | #define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITE_METHODDEF \ |
| 290 | {"write", (PyCFunction)_multibytecodec_MultibyteStreamWriter_write, METH_O, _multibytecodec_MultibyteStreamWriter_write__doc__}, |
| 291 | |
| 292 | PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_writelines__doc__, |
| 293 | "writelines($self, lines, /)\n" |
Zachary Ware | 8ef887c | 2015-04-13 18:22:35 -0500 | [diff] [blame] | 294 | "--\n" |
| 295 | "\n"); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 296 | |
| 297 | #define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_WRITELINES_METHODDEF \ |
| 298 | {"writelines", (PyCFunction)_multibytecodec_MultibyteStreamWriter_writelines, METH_O, _multibytecodec_MultibyteStreamWriter_writelines__doc__}, |
| 299 | |
| 300 | PyDoc_STRVAR(_multibytecodec_MultibyteStreamWriter_reset__doc__, |
| 301 | "reset($self, /)\n" |
Zachary Ware | 8ef887c | 2015-04-13 18:22:35 -0500 | [diff] [blame] | 302 | "--\n" |
| 303 | "\n"); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 304 | |
| 305 | #define _MULTIBYTECODEC_MULTIBYTESTREAMWRITER_RESET_METHODDEF \ |
| 306 | {"reset", (PyCFunction)_multibytecodec_MultibyteStreamWriter_reset, METH_NOARGS, _multibytecodec_MultibyteStreamWriter_reset__doc__}, |
| 307 | |
| 308 | static PyObject * |
| 309 | _multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *self); |
| 310 | |
| 311 | static PyObject * |
| 312 | _multibytecodec_MultibyteStreamWriter_reset(MultibyteStreamWriterObject *self, PyObject *Py_UNUSED(ignored)) |
| 313 | { |
| 314 | return _multibytecodec_MultibyteStreamWriter_reset_impl(self); |
| 315 | } |
| 316 | |
| 317 | PyDoc_STRVAR(_multibytecodec___create_codec__doc__, |
| 318 | "__create_codec($module, arg, /)\n" |
Zachary Ware | 8ef887c | 2015-04-13 18:22:35 -0500 | [diff] [blame] | 319 | "--\n" |
| 320 | "\n"); |
Brett Cannon | f2de1fc | 2014-08-22 11:45:03 -0400 | [diff] [blame] | 321 | |
| 322 | #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \ |
| 323 | {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, |
Larry Hastings | 89964c4 | 2015-04-14 18:07:59 -0400 | [diff] [blame] | 324 | /*[clinic end generated code: output=0fe582cb941024c1 input=a9049054013a1b77]*/ |