Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7)

Delta Between Two Patch Sets: Modules/clinic/_codecsmodule.c.h

Issue 20173: Derby #4: Convert 53 sites to Argument Clinic across 5 files
Left Patch Set: Created 5 years ago
Right Patch Set: Created 4 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | Modules/_codecsmodule.c » ('j') | Modules/_codecsmodule.c » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /*[clinic input] 1 /*[clinic input]
2 preserve 2 preserve
3 [clinic start generated code]*/ 3 [clinic start generated code]*/
4 4
5 PyDoc_STRVAR(_codecs_register__doc__, 5 PyDoc_STRVAR(_codecs_register__doc__,
6 "register($module, search_function, /)\n" 6 "register($module, search_function, /)\n"
7 "--\n" 7 "--\n"
8 "\n" 8 "\n"
9 "Register a codec search function.\n" 9 "Register a codec search function.\n"
10 "\n" 10 "\n"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 "encoding defaults to the default encoding. errors may be given to set a\n" 52 "encoding defaults to the default encoding. errors may be given to set a\n"
53 "different error handling scheme. Default is \'strict\' meaning that encoding\n " 53 "different error handling scheme. Default is \'strict\' meaning that encoding\n "
54 "errors raise a ValueError. Other possible values are \'ignore\', \'replace\'\n " 54 "errors raise a ValueError. Other possible values are \'ignore\', \'replace\'\n "
55 "and \'xmlcharrefreplace\' as well as any other name registered with\n" 55 "and \'xmlcharrefreplace\' as well as any other name registered with\n"
56 "codecs.register_error that can handle ValueErrors."); 56 "codecs.register_error that can handle ValueErrors.");
57 57
58 #define _CODECS_ENCODE_METHODDEF \ 58 #define _CODECS_ENCODE_METHODDEF \
59 {"encode", (PyCFunction)_codecs_encode, METH_VARARGS|METH_KEYWORDS, _codecs_ encode__doc__}, 59 {"encode", (PyCFunction)_codecs_encode, METH_VARARGS|METH_KEYWORDS, _codecs_ encode__doc__},
60 60
61 static PyObject * 61 static PyObject *
62 _codecs_encode_impl(PyModuleDef *module, PyObject *obj, const char *encoding, co nst char *errors); 62 _codecs_encode_impl(PyModuleDef *module, PyObject *obj, const char *encoding,
63 const char *errors);
63 64
64 static PyObject * 65 static PyObject *
65 _codecs_encode(PyModuleDef *module, PyObject *args, PyObject *kwargs) 66 _codecs_encode(PyModuleDef *module, PyObject *args, PyObject *kwargs)
66 { 67 {
67 PyObject *return_value = NULL; 68 PyObject *return_value = NULL;
68 static char *_keywords[] = {"obj", "encoding", "errors", NULL}; 69 static char *_keywords[] = {"obj", "encoding", "errors", NULL};
69 PyObject *obj; 70 PyObject *obj;
70 const char *encoding = NULL; 71 const char *encoding = NULL;
71 const char *errors = NULL; 72 const char *errors = NULL;
72 73
73 if (!PyArg_ParseTupleAndKeywords(args, kwargs, 74 if (!PyArg_ParseTupleAndKeywords(args, kwargs,
74 "O|ss:encode", _keywords, 75 "O|ss:encode", _keywords,
75 &obj, &encoding, &errors)) 76 &obj, &encoding, &errors))
76 goto exit; 77 goto exit;
77 return_value = _codecs_encode_impl(module, obj, encoding, errors); 78 return_value = _codecs_encode_impl(module, obj, encoding, errors);
78 79
79 exit: 80 exit:
80 return return_value; 81 return return_value;
81 } 82 }
82 83
83 PyDoc_STRVAR(_codecs_decode__doc__, 84 PyDoc_STRVAR(_codecs_decode__doc__,
84 "decode($module, /, obj, encoding=\'utf-8\', errors=\'strict\')\n" 85 "decode($module, /, obj, encoding=\'utf-8\', errors=\'strict\')\n"
85 "--\n" 86 "--\n"
86 "\n" 87 "\n"
87 "Decodes obj using the codec registered for encoding.\n" 88 "Decodes obj using the codec registered for encoding.\n"
88 "\n" 89 "\n"
89 "encoding defaults to the default encoding. errors may be given to set a\n" 90 "encoding defaults to the default encoding. errors may be given to set a\n"
90 "different error handling scheme. Default is \'strict\' meaning that encoding\n " 91 "different error handling scheme. Default is \'strict\' meaning that encoding\n "
91 "errors raise a ValueError. Other possible values are \'ignore\' and \'replace\ '\n" 92 "errors raise a ValueError. Other possible values are \'ignore\' and \'replace\ '\n"
92 "as well as any other name registered with codecs.register_error that is able\n" 93 "as well as any other name registered with codecs.register_error that is able\n"
93 "to handle ValueErrors."); 94 "to handle ValueErrors.");
94 95
95 #define _CODECS_DECODE_METHODDEF \ 96 #define _CODECS_DECODE_METHODDEF \
96 {"decode", (PyCFunction)_codecs_decode, METH_VARARGS|METH_KEYWORDS, _codecs_ decode__doc__}, 97 {"decode", (PyCFunction)_codecs_decode, METH_VARARGS|METH_KEYWORDS, _codecs_ decode__doc__},
97 98
98 static PyObject * 99 static PyObject *
99 _codecs_decode_impl(PyModuleDef *module, PyObject *obj, const char *encoding, co nst char *errors); 100 _codecs_decode_impl(PyModuleDef *module, PyObject *obj, const char *encoding,
101 const char *errors);
100 102
101 static PyObject * 103 static PyObject *
102 _codecs_decode(PyModuleDef *module, PyObject *args, PyObject *kwargs) 104 _codecs_decode(PyModuleDef *module, PyObject *args, PyObject *kwargs)
103 { 105 {
104 PyObject *return_value = NULL; 106 PyObject *return_value = NULL;
105 static char *_keywords[] = {"obj", "encoding", "errors", NULL}; 107 static char *_keywords[] = {"obj", "encoding", "errors", NULL};
106 PyObject *obj; 108 PyObject *obj;
107 const char *encoding = NULL; 109 const char *encoding = NULL;
108 const char *errors = NULL; 110 const char *errors = NULL;
109 111
(...skipping 30 matching lines...) Expand all
140 &encoding)) 142 &encoding))
141 goto exit; 143 goto exit;
142 return_value = _codecs__forget_codec_impl(module, encoding); 144 return_value = _codecs__forget_codec_impl(module, encoding);
143 145
144 exit: 146 exit:
145 return return_value; 147 return return_value;
146 } 148 }
147 149
148 PyDoc_STRVAR(_codecs_escape_decode__doc__, 150 PyDoc_STRVAR(_codecs_escape_decode__doc__,
149 "escape_decode($module, data, errors=None, /)\n" 151 "escape_decode($module, data, errors=None, /)\n"
150 "--"); 152 "--\n"
153 "\n");
151 154
152 #define _CODECS_ESCAPE_DECODE_METHODDEF \ 155 #define _CODECS_ESCAPE_DECODE_METHODDEF \
153 {"escape_decode", (PyCFunction)_codecs_escape_decode, METH_VARARGS, _codecs_ escape_decode__doc__}, 156 {"escape_decode", (PyCFunction)_codecs_escape_decode, METH_VARARGS, _codecs_ escape_decode__doc__},
154 157
155 static PyObject * 158 static PyObject *
156 _codecs_escape_decode_impl(PyModuleDef *module, Py_buffer *data, const char *err ors); 159 _codecs_escape_decode_impl(PyModuleDef *module, Py_buffer *data,
160 const char *errors);
157 161
158 static PyObject * 162 static PyObject *
159 _codecs_escape_decode(PyModuleDef *module, PyObject *args) 163 _codecs_escape_decode(PyModuleDef *module, PyObject *args)
160 { 164 {
161 PyObject *return_value = NULL; 165 PyObject *return_value = NULL;
162 Py_buffer data = {NULL, NULL}; 166 Py_buffer data = {NULL, NULL};
163 const char *errors = NULL; 167 const char *errors = NULL;
164 168
165 if (!PyArg_ParseTuple(args, 169 if (!PyArg_ParseTuple(args,
166 "s*|z:escape_decode", 170 "s*|z:escape_decode",
167 &data, &errors)) 171 &data, &errors))
168 goto exit; 172 goto exit;
169 return_value = _codecs_escape_decode_impl(module, &data, errors); 173 return_value = _codecs_escape_decode_impl(module, &data, errors);
170 174
171 exit: 175 exit:
172 /* Cleanup for data */ 176 /* Cleanup for data */
173 if (data.obj) 177 if (data.obj)
174 PyBuffer_Release(&data); 178 PyBuffer_Release(&data);
175 179
176 return return_value; 180 return return_value;
177 } 181 }
178 182
179 PyDoc_STRVAR(_codecs_escape_encode__doc__, 183 PyDoc_STRVAR(_codecs_escape_encode__doc__,
180 "escape_encode($module, data, errors=None, /)\n" 184 "escape_encode($module, data, errors=None, /)\n"
181 "--"); 185 "--\n"
186 "\n");
182 187
183 #define _CODECS_ESCAPE_ENCODE_METHODDEF \ 188 #define _CODECS_ESCAPE_ENCODE_METHODDEF \
184 {"escape_encode", (PyCFunction)_codecs_escape_encode, METH_VARARGS, _codecs_ escape_encode__doc__}, 189 {"escape_encode", (PyCFunction)_codecs_escape_encode, METH_VARARGS, _codecs_ escape_encode__doc__},
185 190
186 static PyObject * 191 static PyObject *
187 _codecs_escape_encode_impl(PyModuleDef *module, PyObject *data, const char *erro rs); 192 _codecs_escape_encode_impl(PyModuleDef *module, PyObject *data,
193 const char *errors);
188 194
189 static PyObject * 195 static PyObject *
190 _codecs_escape_encode(PyModuleDef *module, PyObject *args) 196 _codecs_escape_encode(PyModuleDef *module, PyObject *args)
191 { 197 {
192 PyObject *return_value = NULL; 198 PyObject *return_value = NULL;
193 PyObject *data; 199 PyObject *data;
194 const char *errors = NULL; 200 const char *errors = NULL;
195 201
196 if (!PyArg_ParseTuple(args, 202 if (!PyArg_ParseTuple(args,
197 "O!|z:escape_encode", 203 "O!|z:escape_encode",
198 &PyBytes_Type, &data, &errors)) 204 &PyBytes_Type, &data, &errors))
199 goto exit; 205 goto exit;
200 return_value = _codecs_escape_encode_impl(module, data, errors); 206 return_value = _codecs_escape_encode_impl(module, data, errors);
201 207
202 exit: 208 exit:
203 return return_value; 209 return return_value;
204 } 210 }
205 211
206 PyDoc_STRVAR(_codecs_unicode_internal_decode__doc__, 212 PyDoc_STRVAR(_codecs_unicode_internal_decode__doc__,
207 "unicode_internal_decode($module, obj, errors=None, /)\n" 213 "unicode_internal_decode($module, obj, errors=None, /)\n"
208 "--"); 214 "--\n"
215 "\n");
209 216
210 #define _CODECS_UNICODE_INTERNAL_DECODE_METHODDEF \ 217 #define _CODECS_UNICODE_INTERNAL_DECODE_METHODDEF \
211 {"unicode_internal_decode", (PyCFunction)_codecs_unicode_internal_decode, ME TH_VARARGS, _codecs_unicode_internal_decode__doc__}, 218 {"unicode_internal_decode", (PyCFunction)_codecs_unicode_internal_decode, ME TH_VARARGS, _codecs_unicode_internal_decode__doc__},
212 219
213 static PyObject * 220 static PyObject *
214 _codecs_unicode_internal_decode_impl(PyModuleDef *module, PyObject *obj, const c har *errors); 221 _codecs_unicode_internal_decode_impl(PyModuleDef *module, PyObject *obj,
222 const char *errors);
215 223
216 static PyObject * 224 static PyObject *
217 _codecs_unicode_internal_decode(PyModuleDef *module, PyObject *args) 225 _codecs_unicode_internal_decode(PyModuleDef *module, PyObject *args)
218 { 226 {
219 PyObject *return_value = NULL; 227 PyObject *return_value = NULL;
220 PyObject *obj; 228 PyObject *obj;
221 const char *errors = NULL; 229 const char *errors = NULL;
222 230
223 if (!PyArg_ParseTuple(args, 231 if (!PyArg_ParseTuple(args,
224 "O|z:unicode_internal_decode", 232 "O|z:unicode_internal_decode",
225 &obj, &errors)) 233 &obj, &errors))
226 goto exit; 234 goto exit;
227 return_value = _codecs_unicode_internal_decode_impl(module, obj, errors); 235 return_value = _codecs_unicode_internal_decode_impl(module, obj, errors);
228 236
229 exit: 237 exit:
230 return return_value; 238 return return_value;
231 } 239 }
232 240
233 PyDoc_STRVAR(_codecs_utf_7_decode__doc__, 241 PyDoc_STRVAR(_codecs_utf_7_decode__doc__,
234 "utf_7_decode($module, data, errors=None, final=False, /)\n" 242 "utf_7_decode($module, data, errors=None, final=False, /)\n"
235 "--"); 243 "--\n"
244 "\n");
236 245
237 #define _CODECS_UTF_7_DECODE_METHODDEF \ 246 #define _CODECS_UTF_7_DECODE_METHODDEF \
238 {"utf_7_decode", (PyCFunction)_codecs_utf_7_decode, METH_VARARGS, _codecs_ut f_7_decode__doc__}, 247 {"utf_7_decode", (PyCFunction)_codecs_utf_7_decode, METH_VARARGS, _codecs_ut f_7_decode__doc__},
239 248
240 static PyObject * 249 static PyObject *
241 _codecs_utf_7_decode_impl(PyModuleDef *module, Py_buffer *data, const char *erro rs, int final); 250 _codecs_utf_7_decode_impl(PyModuleDef *module, Py_buffer *data,
251 const char *errors, int final);
242 252
243 static PyObject * 253 static PyObject *
244 _codecs_utf_7_decode(PyModuleDef *module, PyObject *args) 254 _codecs_utf_7_decode(PyModuleDef *module, PyObject *args)
245 { 255 {
246 PyObject *return_value = NULL; 256 PyObject *return_value = NULL;
247 Py_buffer data = {NULL, NULL}; 257 Py_buffer data = {NULL, NULL};
248 const char *errors = NULL; 258 const char *errors = NULL;
249 int final = 0; 259 int final = 0;
250 260
251 if (!PyArg_ParseTuple(args, 261 if (!PyArg_ParseTuple(args,
252 "y*|zi:utf_7_decode", 262 "y*|zi:utf_7_decode",
253 &data, &errors, &final)) 263 &data, &errors, &final))
254 goto exit; 264 goto exit;
255 return_value = _codecs_utf_7_decode_impl(module, &data, errors, final); 265 return_value = _codecs_utf_7_decode_impl(module, &data, errors, final);
256 266
257 exit: 267 exit:
258 /* Cleanup for data */ 268 /* Cleanup for data */
259 if (data.obj) 269 if (data.obj)
260 PyBuffer_Release(&data); 270 PyBuffer_Release(&data);
261 271
262 return return_value; 272 return return_value;
263 } 273 }
264 274
265 PyDoc_STRVAR(_codecs_utf_8_decode__doc__, 275 PyDoc_STRVAR(_codecs_utf_8_decode__doc__,
266 "utf_8_decode($module, data, errors=None, final=False, /)\n" 276 "utf_8_decode($module, data, errors=None, final=False, /)\n"
267 "--"); 277 "--\n"
278 "\n");
268 279
269 #define _CODECS_UTF_8_DECODE_METHODDEF \ 280 #define _CODECS_UTF_8_DECODE_METHODDEF \
270 {"utf_8_decode", (PyCFunction)_codecs_utf_8_decode, METH_VARARGS, _codecs_ut f_8_decode__doc__}, 281 {"utf_8_decode", (PyCFunction)_codecs_utf_8_decode, METH_VARARGS, _codecs_ut f_8_decode__doc__},
271 282
272 static PyObject * 283 static PyObject *
273 _codecs_utf_8_decode_impl(PyModuleDef *module, Py_buffer *data, const char *erro rs, int final); 284 _codecs_utf_8_decode_impl(PyModuleDef *module, Py_buffer *data,
285 const char *errors, int final);
274 286
275 static PyObject * 287 static PyObject *
276 _codecs_utf_8_decode(PyModuleDef *module, PyObject *args) 288 _codecs_utf_8_decode(PyModuleDef *module, PyObject *args)
277 { 289 {
278 PyObject *return_value = NULL; 290 PyObject *return_value = NULL;
279 Py_buffer data = {NULL, NULL}; 291 Py_buffer data = {NULL, NULL};
280 const char *errors = NULL; 292 const char *errors = NULL;
281 int final = 0; 293 int final = 0;
282 294
283 if (!PyArg_ParseTuple(args, 295 if (!PyArg_ParseTuple(args,
284 "y*|zi:utf_8_decode", 296 "y*|zi:utf_8_decode",
285 &data, &errors, &final)) 297 &data, &errors, &final))
286 goto exit; 298 goto exit;
287 return_value = _codecs_utf_8_decode_impl(module, &data, errors, final); 299 return_value = _codecs_utf_8_decode_impl(module, &data, errors, final);
288 300
289 exit: 301 exit:
290 /* Cleanup for data */ 302 /* Cleanup for data */
291 if (data.obj) 303 if (data.obj)
292 PyBuffer_Release(&data); 304 PyBuffer_Release(&data);
293 305
294 return return_value; 306 return return_value;
295 } 307 }
296 308
297 PyDoc_STRVAR(_codecs_utf_16_decode__doc__, 309 PyDoc_STRVAR(_codecs_utf_16_decode__doc__,
298 "utf_16_decode($module, data, errors=None, final=False, /)\n" 310 "utf_16_decode($module, data, errors=None, final=False, /)\n"
299 "--"); 311 "--\n"
312 "\n");
300 313
301 #define _CODECS_UTF_16_DECODE_METHODDEF \ 314 #define _CODECS_UTF_16_DECODE_METHODDEF \
302 {"utf_16_decode", (PyCFunction)_codecs_utf_16_decode, METH_VARARGS, _codecs_ utf_16_decode__doc__}, 315 {"utf_16_decode", (PyCFunction)_codecs_utf_16_decode, METH_VARARGS, _codecs_ utf_16_decode__doc__},
303 316
304 static PyObject * 317 static PyObject *
305 _codecs_utf_16_decode_impl(PyModuleDef *module, Py_buffer *data, const char *err ors, int final); 318 _codecs_utf_16_decode_impl(PyModuleDef *module, Py_buffer *data,
319 const char *errors, int final);
306 320
307 static PyObject * 321 static PyObject *
308 _codecs_utf_16_decode(PyModuleDef *module, PyObject *args) 322 _codecs_utf_16_decode(PyModuleDef *module, PyObject *args)
309 { 323 {
310 PyObject *return_value = NULL; 324 PyObject *return_value = NULL;
311 Py_buffer data = {NULL, NULL}; 325 Py_buffer data = {NULL, NULL};
312 const char *errors = NULL; 326 const char *errors = NULL;
313 int final = 0; 327 int final = 0;
314 328
315 if (!PyArg_ParseTuple(args, 329 if (!PyArg_ParseTuple(args,
316 "y*|zi:utf_16_decode", 330 "y*|zi:utf_16_decode",
317 &data, &errors, &final)) 331 &data, &errors, &final))
318 goto exit; 332 goto exit;
319 return_value = _codecs_utf_16_decode_impl(module, &data, errors, final); 333 return_value = _codecs_utf_16_decode_impl(module, &data, errors, final);
320 334
321 exit: 335 exit:
322 /* Cleanup for data */ 336 /* Cleanup for data */
323 if (data.obj) 337 if (data.obj)
324 PyBuffer_Release(&data); 338 PyBuffer_Release(&data);
325 339
326 return return_value; 340 return return_value;
327 } 341 }
328 342
329 PyDoc_STRVAR(_codecs_utf_16_le_decode__doc__, 343 PyDoc_STRVAR(_codecs_utf_16_le_decode__doc__,
330 "utf_16_le_decode($module, data, errors=None, final=False, /)\n" 344 "utf_16_le_decode($module, data, errors=None, final=False, /)\n"
331 "--"); 345 "--\n"
346 "\n");
332 347
333 #define _CODECS_UTF_16_LE_DECODE_METHODDEF \ 348 #define _CODECS_UTF_16_LE_DECODE_METHODDEF \
334 {"utf_16_le_decode", (PyCFunction)_codecs_utf_16_le_decode, METH_VARARGS, _c odecs_utf_16_le_decode__doc__}, 349 {"utf_16_le_decode", (PyCFunction)_codecs_utf_16_le_decode, METH_VARARGS, _c odecs_utf_16_le_decode__doc__},
335 350
336 static PyObject * 351 static PyObject *
337 _codecs_utf_16_le_decode_impl(PyModuleDef *module, Py_buffer *data, const char * errors, int final); 352 _codecs_utf_16_le_decode_impl(PyModuleDef *module, Py_buffer *data,
353 const char *errors, int final);
338 354
339 static PyObject * 355 static PyObject *
340 _codecs_utf_16_le_decode(PyModuleDef *module, PyObject *args) 356 _codecs_utf_16_le_decode(PyModuleDef *module, PyObject *args)
341 { 357 {
342 PyObject *return_value = NULL; 358 PyObject *return_value = NULL;
343 Py_buffer data = {NULL, NULL}; 359 Py_buffer data = {NULL, NULL};
344 const char *errors = NULL; 360 const char *errors = NULL;
345 int final = 0; 361 int final = 0;
346 362
347 if (!PyArg_ParseTuple(args, 363 if (!PyArg_ParseTuple(args,
348 "y*|zi:utf_16_le_decode", 364 "y*|zi:utf_16_le_decode",
349 &data, &errors, &final)) 365 &data, &errors, &final))
350 goto exit; 366 goto exit;
351 return_value = _codecs_utf_16_le_decode_impl(module, &data, errors, final); 367 return_value = _codecs_utf_16_le_decode_impl(module, &data, errors, final);
352 368
353 exit: 369 exit:
354 /* Cleanup for data */ 370 /* Cleanup for data */
355 if (data.obj) 371 if (data.obj)
356 PyBuffer_Release(&data); 372 PyBuffer_Release(&data);
357 373
358 return return_value; 374 return return_value;
359 } 375 }
360 376
361 PyDoc_STRVAR(_codecs_utf_16_be_decode__doc__, 377 PyDoc_STRVAR(_codecs_utf_16_be_decode__doc__,
362 "utf_16_be_decode($module, data, errors=None, final=False, /)\n" 378 "utf_16_be_decode($module, data, errors=None, final=False, /)\n"
363 "--"); 379 "--\n"
380 "\n");
364 381
365 #define _CODECS_UTF_16_BE_DECODE_METHODDEF \ 382 #define _CODECS_UTF_16_BE_DECODE_METHODDEF \
366 {"utf_16_be_decode", (PyCFunction)_codecs_utf_16_be_decode, METH_VARARGS, _c odecs_utf_16_be_decode__doc__}, 383 {"utf_16_be_decode", (PyCFunction)_codecs_utf_16_be_decode, METH_VARARGS, _c odecs_utf_16_be_decode__doc__},
367 384
368 static PyObject * 385 static PyObject *
369 _codecs_utf_16_be_decode_impl(PyModuleDef *module, Py_buffer *data, const char * errors, int final); 386 _codecs_utf_16_be_decode_impl(PyModuleDef *module, Py_buffer *data,
387 const char *errors, int final);
370 388
371 static PyObject * 389 static PyObject *
372 _codecs_utf_16_be_decode(PyModuleDef *module, PyObject *args) 390 _codecs_utf_16_be_decode(PyModuleDef *module, PyObject *args)
373 { 391 {
374 PyObject *return_value = NULL; 392 PyObject *return_value = NULL;
375 Py_buffer data = {NULL, NULL}; 393 Py_buffer data = {NULL, NULL};
376 const char *errors = NULL; 394 const char *errors = NULL;
377 int final = 0; 395 int final = 0;
378 396
379 if (!PyArg_ParseTuple(args, 397 if (!PyArg_ParseTuple(args,
380 "y*|zi:utf_16_be_decode", 398 "y*|zi:utf_16_be_decode",
381 &data, &errors, &final)) 399 &data, &errors, &final))
382 goto exit; 400 goto exit;
383 return_value = _codecs_utf_16_be_decode_impl(module, &data, errors, final); 401 return_value = _codecs_utf_16_be_decode_impl(module, &data, errors, final);
384 402
385 exit: 403 exit:
386 /* Cleanup for data */ 404 /* Cleanup for data */
387 if (data.obj) 405 if (data.obj)
388 PyBuffer_Release(&data); 406 PyBuffer_Release(&data);
389 407
390 return return_value; 408 return return_value;
391 } 409 }
392 410
393 PyDoc_STRVAR(_codecs_utf_16_ex_decode__doc__, 411 PyDoc_STRVAR(_codecs_utf_16_ex_decode__doc__,
394 "utf_16_ex_decode($module, data, errors=None, byteorder=0, final=False,\n" 412 "utf_16_ex_decode($module, data, errors=None, byteorder=0, final=False,\n"
395 " /)\n" 413 " /)\n"
396 "--"); 414 "--\n"
415 "\n");
397 416
398 #define _CODECS_UTF_16_EX_DECODE_METHODDEF \ 417 #define _CODECS_UTF_16_EX_DECODE_METHODDEF \
399 {"utf_16_ex_decode", (PyCFunction)_codecs_utf_16_ex_decode, METH_VARARGS, _c odecs_utf_16_ex_decode__doc__}, 418 {"utf_16_ex_decode", (PyCFunction)_codecs_utf_16_ex_decode, METH_VARARGS, _c odecs_utf_16_ex_decode__doc__},
400 419
401 static PyObject * 420 static PyObject *
402 _codecs_utf_16_ex_decode_impl(PyModuleDef *module, Py_buffer *data, const char * errors, int byteorder, int final); 421 _codecs_utf_16_ex_decode_impl(PyModuleDef *module, Py_buffer *data,
422 const char *errors, int byteorder, int final);
403 423
404 static PyObject * 424 static PyObject *
405 _codecs_utf_16_ex_decode(PyModuleDef *module, PyObject *args) 425 _codecs_utf_16_ex_decode(PyModuleDef *module, PyObject *args)
406 { 426 {
407 PyObject *return_value = NULL; 427 PyObject *return_value = NULL;
408 Py_buffer data = {NULL, NULL}; 428 Py_buffer data = {NULL, NULL};
409 const char *errors = NULL; 429 const char *errors = NULL;
410 int byteorder = 0; 430 int byteorder = 0;
411 int final = 0; 431 int final = 0;
412 432
413 if (!PyArg_ParseTuple(args, 433 if (!PyArg_ParseTuple(args,
414 "y*|zii:utf_16_ex_decode", 434 "y*|zii:utf_16_ex_decode",
415 &data, &errors, &byteorder, &final)) 435 &data, &errors, &byteorder, &final))
416 goto exit; 436 goto exit;
417 return_value = _codecs_utf_16_ex_decode_impl(module, &data, errors, byteorde r, final); 437 return_value = _codecs_utf_16_ex_decode_impl(module, &data, errors, byteorde r, final);
418 438
419 exit: 439 exit:
420 /* Cleanup for data */ 440 /* Cleanup for data */
421 if (data.obj) 441 if (data.obj)
422 PyBuffer_Release(&data); 442 PyBuffer_Release(&data);
423 443
424 return return_value; 444 return return_value;
425 } 445 }
426 446
427 PyDoc_STRVAR(_codecs_utf_32_decode__doc__, 447 PyDoc_STRVAR(_codecs_utf_32_decode__doc__,
428 "utf_32_decode($module, data, errors=None, final=False, /)\n" 448 "utf_32_decode($module, data, errors=None, final=False, /)\n"
429 "--"); 449 "--\n"
450 "\n");
430 451
431 #define _CODECS_UTF_32_DECODE_METHODDEF \ 452 #define _CODECS_UTF_32_DECODE_METHODDEF \
432 {"utf_32_decode", (PyCFunction)_codecs_utf_32_decode, METH_VARARGS, _codecs_ utf_32_decode__doc__}, 453 {"utf_32_decode", (PyCFunction)_codecs_utf_32_decode, METH_VARARGS, _codecs_ utf_32_decode__doc__},
433 454
434 static PyObject * 455 static PyObject *
435 _codecs_utf_32_decode_impl(PyModuleDef *module, Py_buffer *data, const char *err ors, int final); 456 _codecs_utf_32_decode_impl(PyModuleDef *module, Py_buffer *data,
457 const char *errors, int final);
436 458
437 static PyObject * 459 static PyObject *
438 _codecs_utf_32_decode(PyModuleDef *module, PyObject *args) 460 _codecs_utf_32_decode(PyModuleDef *module, PyObject *args)
439 { 461 {
440 PyObject *return_value = NULL; 462 PyObject *return_value = NULL;
441 Py_buffer data = {NULL, NULL}; 463 Py_buffer data = {NULL, NULL};
442 const char *errors = NULL; 464 const char *errors = NULL;
443 int final = 0; 465 int final = 0;
444 466
445 if (!PyArg_ParseTuple(args, 467 if (!PyArg_ParseTuple(args,
446 "y*|zi:utf_32_decode", 468 "y*|zi:utf_32_decode",
447 &data, &errors, &final)) 469 &data, &errors, &final))
448 goto exit; 470 goto exit;
449 return_value = _codecs_utf_32_decode_impl(module, &data, errors, final); 471 return_value = _codecs_utf_32_decode_impl(module, &data, errors, final);
450 472
451 exit: 473 exit:
452 /* Cleanup for data */ 474 /* Cleanup for data */
453 if (data.obj) 475 if (data.obj)
454 PyBuffer_Release(&data); 476 PyBuffer_Release(&data);
455 477
456 return return_value; 478 return return_value;
457 } 479 }
458 480
459 PyDoc_STRVAR(_codecs_utf_32_le_decode__doc__, 481 PyDoc_STRVAR(_codecs_utf_32_le_decode__doc__,
460 "utf_32_le_decode($module, data, errors=None, final=False, /)\n" 482 "utf_32_le_decode($module, data, errors=None, final=False, /)\n"
461 "--"); 483 "--\n"
484 "\n");
462 485
463 #define _CODECS_UTF_32_LE_DECODE_METHODDEF \ 486 #define _CODECS_UTF_32_LE_DECODE_METHODDEF \
464 {"utf_32_le_decode", (PyCFunction)_codecs_utf_32_le_decode, METH_VARARGS, _c odecs_utf_32_le_decode__doc__}, 487 {"utf_32_le_decode", (PyCFunction)_codecs_utf_32_le_decode, METH_VARARGS, _c odecs_utf_32_le_decode__doc__},
465 488
466 static PyObject * 489 static PyObject *
467 _codecs_utf_32_le_decode_impl(PyModuleDef *module, Py_buffer *data, const char * errors, int final); 490 _codecs_utf_32_le_decode_impl(PyModuleDef *module, Py_buffer *data,
491 const char *errors, int final);
468 492
469 static PyObject * 493 static PyObject *
470 _codecs_utf_32_le_decode(PyModuleDef *module, PyObject *args) 494 _codecs_utf_32_le_decode(PyModuleDef *module, PyObject *args)
471 { 495 {
472 PyObject *return_value = NULL; 496 PyObject *return_value = NULL;
473 Py_buffer data = {NULL, NULL}; 497 Py_buffer data = {NULL, NULL};
474 const char *errors = NULL; 498 const char *errors = NULL;
475 int final = 0; 499 int final = 0;
476 500
477 if (!PyArg_ParseTuple(args, 501 if (!PyArg_ParseTuple(args,
478 "y*|zi:utf_32_le_decode", 502 "y*|zi:utf_32_le_decode",
479 &data, &errors, &final)) 503 &data, &errors, &final))
480 goto exit; 504 goto exit;
481 return_value = _codecs_utf_32_le_decode_impl(module, &data, errors, final); 505 return_value = _codecs_utf_32_le_decode_impl(module, &data, errors, final);
482 506
483 exit: 507 exit:
484 /* Cleanup for data */ 508 /* Cleanup for data */
485 if (data.obj) 509 if (data.obj)
486 PyBuffer_Release(&data); 510 PyBuffer_Release(&data);
487 511
488 return return_value; 512 return return_value;
489 } 513 }
490 514
491 PyDoc_STRVAR(_codecs_utf_32_be_decode__doc__, 515 PyDoc_STRVAR(_codecs_utf_32_be_decode__doc__,
492 "utf_32_be_decode($module, data, errors=None, final=False, /)\n" 516 "utf_32_be_decode($module, data, errors=None, final=False, /)\n"
493 "--"); 517 "--\n"
518 "\n");
494 519
495 #define _CODECS_UTF_32_BE_DECODE_METHODDEF \ 520 #define _CODECS_UTF_32_BE_DECODE_METHODDEF \
496 {"utf_32_be_decode", (PyCFunction)_codecs_utf_32_be_decode, METH_VARARGS, _c odecs_utf_32_be_decode__doc__}, 521 {"utf_32_be_decode", (PyCFunction)_codecs_utf_32_be_decode, METH_VARARGS, _c odecs_utf_32_be_decode__doc__},
497 522
498 static PyObject * 523 static PyObject *
499 _codecs_utf_32_be_decode_impl(PyModuleDef *module, Py_buffer *data, const char * errors, int final); 524 _codecs_utf_32_be_decode_impl(PyModuleDef *module, Py_buffer *data,
525 const char *errors, int final);
500 526
501 static PyObject * 527 static PyObject *
502 _codecs_utf_32_be_decode(PyModuleDef *module, PyObject *args) 528 _codecs_utf_32_be_decode(PyModuleDef *module, PyObject *args)
503 { 529 {
504 PyObject *return_value = NULL; 530 PyObject *return_value = NULL;
505 Py_buffer data = {NULL, NULL}; 531 Py_buffer data = {NULL, NULL};
506 const char *errors = NULL; 532 const char *errors = NULL;
507 int final = 0; 533 int final = 0;
508 534
509 if (!PyArg_ParseTuple(args, 535 if (!PyArg_ParseTuple(args,
510 "y*|zi:utf_32_be_decode", 536 "y*|zi:utf_32_be_decode",
511 &data, &errors, &final)) 537 &data, &errors, &final))
512 goto exit; 538 goto exit;
513 return_value = _codecs_utf_32_be_decode_impl(module, &data, errors, final); 539 return_value = _codecs_utf_32_be_decode_impl(module, &data, errors, final);
514 540
515 exit: 541 exit:
516 /* Cleanup for data */ 542 /* Cleanup for data */
517 if (data.obj) 543 if (data.obj)
518 PyBuffer_Release(&data); 544 PyBuffer_Release(&data);
519 545
520 return return_value; 546 return return_value;
521 } 547 }
522 548
523 PyDoc_STRVAR(_codecs_utf_32_ex_decode__doc__, 549 PyDoc_STRVAR(_codecs_utf_32_ex_decode__doc__,
524 "utf_32_ex_decode($module, data, errors=None, byteorder=0, final=False,\n" 550 "utf_32_ex_decode($module, data, errors=None, byteorder=0, final=False,\n"
525 " /)\n" 551 " /)\n"
526 "--"); 552 "--\n"
553 "\n");
527 554
528 #define _CODECS_UTF_32_EX_DECODE_METHODDEF \ 555 #define _CODECS_UTF_32_EX_DECODE_METHODDEF \
529 {"utf_32_ex_decode", (PyCFunction)_codecs_utf_32_ex_decode, METH_VARARGS, _c odecs_utf_32_ex_decode__doc__}, 556 {"utf_32_ex_decode", (PyCFunction)_codecs_utf_32_ex_decode, METH_VARARGS, _c odecs_utf_32_ex_decode__doc__},
530 557
531 static PyObject * 558 static PyObject *
532 _codecs_utf_32_ex_decode_impl(PyModuleDef *module, Py_buffer *data, const char * errors, int byteorder, int final); 559 _codecs_utf_32_ex_decode_impl(PyModuleDef *module, Py_buffer *data,
560 const char *errors, int byteorder, int final);
533 561
534 static PyObject * 562 static PyObject *
535 _codecs_utf_32_ex_decode(PyModuleDef *module, PyObject *args) 563 _codecs_utf_32_ex_decode(PyModuleDef *module, PyObject *args)
536 { 564 {
537 PyObject *return_value = NULL; 565 PyObject *return_value = NULL;
538 Py_buffer data = {NULL, NULL}; 566 Py_buffer data = {NULL, NULL};
539 const char *errors = NULL; 567 const char *errors = NULL;
540 int byteorder = 0; 568 int byteorder = 0;
541 int final = 0; 569 int final = 0;
542 570
543 if (!PyArg_ParseTuple(args, 571 if (!PyArg_ParseTuple(args,
544 "y*|zii:utf_32_ex_decode", 572 "y*|zii:utf_32_ex_decode",
545 &data, &errors, &byteorder, &final)) 573 &data, &errors, &byteorder, &final))
546 goto exit; 574 goto exit;
547 return_value = _codecs_utf_32_ex_decode_impl(module, &data, errors, byteorde r, final); 575 return_value = _codecs_utf_32_ex_decode_impl(module, &data, errors, byteorde r, final);
548 576
549 exit: 577 exit:
550 /* Cleanup for data */ 578 /* Cleanup for data */
551 if (data.obj) 579 if (data.obj)
552 PyBuffer_Release(&data); 580 PyBuffer_Release(&data);
553 581
554 return return_value; 582 return return_value;
555 } 583 }
556 584
557 PyDoc_STRVAR(_codecs_unicode_escape_decode__doc__, 585 PyDoc_STRVAR(_codecs_unicode_escape_decode__doc__,
558 "unicode_escape_decode($module, data, errors=None, /)\n" 586 "unicode_escape_decode($module, data, errors=None, /)\n"
559 "--"); 587 "--\n"
588 "\n");
560 589
561 #define _CODECS_UNICODE_ESCAPE_DECODE_METHODDEF \ 590 #define _CODECS_UNICODE_ESCAPE_DECODE_METHODDEF \
562 {"unicode_escape_decode", (PyCFunction)_codecs_unicode_escape_decode, METH_V ARARGS, _codecs_unicode_escape_decode__doc__}, 591 {"unicode_escape_decode", (PyCFunction)_codecs_unicode_escape_decode, METH_V ARARGS, _codecs_unicode_escape_decode__doc__},
563 592
564 static PyObject * 593 static PyObject *
565 _codecs_unicode_escape_decode_impl(PyModuleDef *module, Py_buffer *data, const c har *errors); 594 _codecs_unicode_escape_decode_impl(PyModuleDef *module, Py_buffer *data,
595 const char *errors);
566 596
567 static PyObject * 597 static PyObject *
568 _codecs_unicode_escape_decode(PyModuleDef *module, PyObject *args) 598 _codecs_unicode_escape_decode(PyModuleDef *module, PyObject *args)
569 { 599 {
570 PyObject *return_value = NULL; 600 PyObject *return_value = NULL;
571 Py_buffer data = {NULL, NULL}; 601 Py_buffer data = {NULL, NULL};
572 const char *errors = NULL; 602 const char *errors = NULL;
573 603
574 if (!PyArg_ParseTuple(args, 604 if (!PyArg_ParseTuple(args,
575 "s*|z:unicode_escape_decode", 605 "s*|z:unicode_escape_decode",
576 &data, &errors)) 606 &data, &errors))
577 goto exit; 607 goto exit;
578 return_value = _codecs_unicode_escape_decode_impl(module, &data, errors); 608 return_value = _codecs_unicode_escape_decode_impl(module, &data, errors);
579 609
580 exit: 610 exit:
581 /* Cleanup for data */ 611 /* Cleanup for data */
582 if (data.obj) 612 if (data.obj)
583 PyBuffer_Release(&data); 613 PyBuffer_Release(&data);
584 614
585 return return_value; 615 return return_value;
586 } 616 }
587 617
588 PyDoc_STRVAR(_codecs_raw_unicode_escape_decode__doc__, 618 PyDoc_STRVAR(_codecs_raw_unicode_escape_decode__doc__,
589 "raw_unicode_escape_decode($module, data, errors=None, /)\n" 619 "raw_unicode_escape_decode($module, data, errors=None, /)\n"
590 "--"); 620 "--\n"
621 "\n");
591 622
592 #define _CODECS_RAW_UNICODE_ESCAPE_DECODE_METHODDEF \ 623 #define _CODECS_RAW_UNICODE_ESCAPE_DECODE_METHODDEF \
593 {"raw_unicode_escape_decode", (PyCFunction)_codecs_raw_unicode_escape_decode , METH_VARARGS, _codecs_raw_unicode_escape_decode__doc__}, 624 {"raw_unicode_escape_decode", (PyCFunction)_codecs_raw_unicode_escape_decode , METH_VARARGS, _codecs_raw_unicode_escape_decode__doc__},
594 625
595 static PyObject * 626 static PyObject *
596 _codecs_raw_unicode_escape_decode_impl(PyModuleDef *module, Py_buffer *data, con st char *errors); 627 _codecs_raw_unicode_escape_decode_impl(PyModuleDef *module, Py_buffer *data,
628 const char *errors);
597 629
598 static PyObject * 630 static PyObject *
599 _codecs_raw_unicode_escape_decode(PyModuleDef *module, PyObject *args) 631 _codecs_raw_unicode_escape_decode(PyModuleDef *module, PyObject *args)
600 { 632 {
601 PyObject *return_value = NULL; 633 PyObject *return_value = NULL;
602 Py_buffer data = {NULL, NULL}; 634 Py_buffer data = {NULL, NULL};
603 const char *errors = NULL; 635 const char *errors = NULL;
604 636
605 if (!PyArg_ParseTuple(args, 637 if (!PyArg_ParseTuple(args,
606 "s*|z:raw_unicode_escape_decode", 638 "s*|z:raw_unicode_escape_decode",
607 &data, &errors)) 639 &data, &errors))
608 goto exit; 640 goto exit;
609 return_value = _codecs_raw_unicode_escape_decode_impl(module, &data, errors) ; 641 return_value = _codecs_raw_unicode_escape_decode_impl(module, &data, errors) ;
610 642
611 exit: 643 exit:
612 /* Cleanup for data */ 644 /* Cleanup for data */
613 if (data.obj) 645 if (data.obj)
614 PyBuffer_Release(&data); 646 PyBuffer_Release(&data);
615 647
616 return return_value; 648 return return_value;
617 } 649 }
618 650
619 PyDoc_STRVAR(_codecs_latin_1_decode__doc__, 651 PyDoc_STRVAR(_codecs_latin_1_decode__doc__,
620 "latin_1_decode($module, data, errors=None, /)\n" 652 "latin_1_decode($module, data, errors=None, /)\n"
621 "--"); 653 "--\n"
654 "\n");
622 655
623 #define _CODECS_LATIN_1_DECODE_METHODDEF \ 656 #define _CODECS_LATIN_1_DECODE_METHODDEF \
624 {"latin_1_decode", (PyCFunction)_codecs_latin_1_decode, METH_VARARGS, _codec s_latin_1_decode__doc__}, 657 {"latin_1_decode", (PyCFunction)_codecs_latin_1_decode, METH_VARARGS, _codec s_latin_1_decode__doc__},
625 658
626 static PyObject * 659 static PyObject *
627 _codecs_latin_1_decode_impl(PyModuleDef *module, Py_buffer *data, const char *er rors); 660 _codecs_latin_1_decode_impl(PyModuleDef *module, Py_buffer *data,
661 const char *errors);
628 662
629 static PyObject * 663 static PyObject *
630 _codecs_latin_1_decode(PyModuleDef *module, PyObject *args) 664 _codecs_latin_1_decode(PyModuleDef *module, PyObject *args)
631 { 665 {
632 PyObject *return_value = NULL; 666 PyObject *return_value = NULL;
633 Py_buffer data = {NULL, NULL}; 667 Py_buffer data = {NULL, NULL};
634 const char *errors = NULL; 668 const char *errors = NULL;
635 669
636 if (!PyArg_ParseTuple(args, 670 if (!PyArg_ParseTuple(args,
637 "y*|z:latin_1_decode", 671 "y*|z:latin_1_decode",
638 &data, &errors)) 672 &data, &errors))
639 goto exit; 673 goto exit;
640 return_value = _codecs_latin_1_decode_impl(module, &data, errors); 674 return_value = _codecs_latin_1_decode_impl(module, &data, errors);
641 675
642 exit: 676 exit:
643 /* Cleanup for data */ 677 /* Cleanup for data */
644 if (data.obj) 678 if (data.obj)
645 PyBuffer_Release(&data); 679 PyBuffer_Release(&data);
646 680
647 return return_value; 681 return return_value;
648 } 682 }
649 683
650 PyDoc_STRVAR(_codecs_ascii_decode__doc__, 684 PyDoc_STRVAR(_codecs_ascii_decode__doc__,
651 "ascii_decode($module, data, errors=None, /)\n" 685 "ascii_decode($module, data, errors=None, /)\n"
652 "--"); 686 "--\n"
687 "\n");
653 688
654 #define _CODECS_ASCII_DECODE_METHODDEF \ 689 #define _CODECS_ASCII_DECODE_METHODDEF \
655 {"ascii_decode", (PyCFunction)_codecs_ascii_decode, METH_VARARGS, _codecs_as cii_decode__doc__}, 690 {"ascii_decode", (PyCFunction)_codecs_ascii_decode, METH_VARARGS, _codecs_as cii_decode__doc__},
656 691
657 static PyObject * 692 static PyObject *
658 _codecs_ascii_decode_impl(PyModuleDef *module, Py_buffer *data, const char *erro rs); 693 _codecs_ascii_decode_impl(PyModuleDef *module, Py_buffer *data,
694 const char *errors);
659 695
660 static PyObject * 696 static PyObject *
661 _codecs_ascii_decode(PyModuleDef *module, PyObject *args) 697 _codecs_ascii_decode(PyModuleDef *module, PyObject *args)
662 { 698 {
663 PyObject *return_value = NULL; 699 PyObject *return_value = NULL;
664 Py_buffer data = {NULL, NULL}; 700 Py_buffer data = {NULL, NULL};
665 const char *errors = NULL; 701 const char *errors = NULL;
666 702
667 if (!PyArg_ParseTuple(args, 703 if (!PyArg_ParseTuple(args,
668 "y*|z:ascii_decode", 704 "y*|z:ascii_decode",
669 &data, &errors)) 705 &data, &errors))
670 goto exit; 706 goto exit;
671 return_value = _codecs_ascii_decode_impl(module, &data, errors); 707 return_value = _codecs_ascii_decode_impl(module, &data, errors);
672 708
673 exit: 709 exit:
674 /* Cleanup for data */ 710 /* Cleanup for data */
675 if (data.obj) 711 if (data.obj)
676 PyBuffer_Release(&data); 712 PyBuffer_Release(&data);
677 713
678 return return_value; 714 return return_value;
679 } 715 }
680 716
681 PyDoc_STRVAR(_codecs_charmap_decode__doc__, 717 PyDoc_STRVAR(_codecs_charmap_decode__doc__,
682 "charmap_decode($module, data, errors=None, mapping=None, /)\n" 718 "charmap_decode($module, data, errors=None, mapping=None, /)\n"
683 "--"); 719 "--\n"
720 "\n");
684 721
685 #define _CODECS_CHARMAP_DECODE_METHODDEF \ 722 #define _CODECS_CHARMAP_DECODE_METHODDEF \
686 {"charmap_decode", (PyCFunction)_codecs_charmap_decode, METH_VARARGS, _codec s_charmap_decode__doc__}, 723 {"charmap_decode", (PyCFunction)_codecs_charmap_decode, METH_VARARGS, _codec s_charmap_decode__doc__},
687 724
688 static PyObject * 725 static PyObject *
689 _codecs_charmap_decode_impl(PyModuleDef *module, Py_buffer *data, const char *er rors, PyObject *mapping); 726 _codecs_charmap_decode_impl(PyModuleDef *module, Py_buffer *data,
727 const char *errors, PyObject *mapping);
690 728
691 static PyObject * 729 static PyObject *
692 _codecs_charmap_decode(PyModuleDef *module, PyObject *args) 730 _codecs_charmap_decode(PyModuleDef *module, PyObject *args)
693 { 731 {
694 PyObject *return_value = NULL; 732 PyObject *return_value = NULL;
695 Py_buffer data = {NULL, NULL}; 733 Py_buffer data = {NULL, NULL};
696 const char *errors = NULL; 734 const char *errors = NULL;
697 PyObject *mapping = NULL; 735 PyObject *mapping = NULL;
698 736
699 if (!PyArg_ParseTuple(args, 737 if (!PyArg_ParseTuple(args,
700 "y*|zO:charmap_decode", 738 "y*|zO:charmap_decode",
701 &data, &errors, &mapping)) 739 &data, &errors, &mapping))
702 goto exit; 740 goto exit;
703 return_value = _codecs_charmap_decode_impl(module, &data, errors, mapping); 741 return_value = _codecs_charmap_decode_impl(module, &data, errors, mapping);
704 742
705 exit: 743 exit:
706 /* Cleanup for data */ 744 /* Cleanup for data */
707 if (data.obj) 745 if (data.obj)
708 PyBuffer_Release(&data); 746 PyBuffer_Release(&data);
709 747
710 return return_value; 748 return return_value;
711 } 749 }
712 750
713 #if defined(HAVE_MBCS) 751 #if defined(HAVE_MBCS)
714 752
715 PyDoc_STRVAR(_codecs_mbcs_decode__doc__, 753 PyDoc_STRVAR(_codecs_mbcs_decode__doc__,
716 "mbcs_decode($module, data, errors=None, final=False, /)\n" 754 "mbcs_decode($module, data, errors=None, final=False, /)\n"
717 "--"); 755 "--\n"
756 "\n");
718 757
719 #define _CODECS_MBCS_DECODE_METHODDEF \ 758 #define _CODECS_MBCS_DECODE_METHODDEF \
720 {"mbcs_decode", (PyCFunction)_codecs_mbcs_decode, METH_VARARGS, _codecs_mbcs _decode__doc__}, 759 {"mbcs_decode", (PyCFunction)_codecs_mbcs_decode, METH_VARARGS, _codecs_mbcs _decode__doc__},
721 760
722 static PyObject * 761 static PyObject *
723 _codecs_mbcs_decode_impl(PyModuleDef *module, Py_buffer *data, const char *error s, int final); 762 _codecs_mbcs_decode_impl(PyModuleDef *module, Py_buffer *data,
763 const char *errors, int final);
724 764
725 static PyObject * 765 static PyObject *
726 _codecs_mbcs_decode(PyModuleDef *module, PyObject *args) 766 _codecs_mbcs_decode(PyModuleDef *module, PyObject *args)
727 { 767 {
728 PyObject *return_value = NULL; 768 PyObject *return_value = NULL;
729 Py_buffer data = {NULL, NULL}; 769 Py_buffer data = {NULL, NULL};
730 const char *errors = NULL; 770 const char *errors = NULL;
731 int final = 0; 771 int final = 0;
732 772
733 if (!PyArg_ParseTuple(args, 773 if (!PyArg_ParseTuple(args,
734 "y*|zi:mbcs_decode", 774 "y*|zi:mbcs_decode",
735 &data, &errors, &final)) 775 &data, &errors, &final))
736 goto exit; 776 goto exit;
737 return_value = _codecs_mbcs_decode_impl(module, &data, errors, final); 777 return_value = _codecs_mbcs_decode_impl(module, &data, errors, final);
738 778
739 exit: 779 exit:
740 /* Cleanup for data */ 780 /* Cleanup for data */
741 if (data.obj) 781 if (data.obj)
742 PyBuffer_Release(&data); 782 PyBuffer_Release(&data);
743 783
744 return return_value; 784 return return_value;
745 } 785 }
746 786
747 #endif /* defined(HAVE_MBCS) */ 787 #endif /* defined(HAVE_MBCS) */
748 788
749 #if defined(HAVE_MBCS) 789 #if defined(HAVE_MBCS)
750 790
751 PyDoc_STRVAR(_codecs_code_page_decode__doc__, 791 PyDoc_STRVAR(_codecs_code_page_decode__doc__,
752 "code_page_decode($module, codepage, data, errors=None, final=False, /)\n" 792 "code_page_decode($module, codepage, data, errors=None, final=False, /)\n"
753 "--"); 793 "--\n"
794 "\n");
754 795
755 #define _CODECS_CODE_PAGE_DECODE_METHODDEF \ 796 #define _CODECS_CODE_PAGE_DECODE_METHODDEF \
756 {"code_page_decode", (PyCFunction)_codecs_code_page_decode, METH_VARARGS, _c odecs_code_page_decode__doc__}, 797 {"code_page_decode", (PyCFunction)_codecs_code_page_decode, METH_VARARGS, _c odecs_code_page_decode__doc__},
757 798
758 static PyObject * 799 static PyObject *
759 _codecs_code_page_decode_impl(PyModuleDef *module, int codepage, Py_buffer *data , const char *errors, int final); 800 _codecs_code_page_decode_impl(PyModuleDef *module, int codepage,
801 Py_buffer *data, const char *errors, int final);
760 802
761 static PyObject * 803 static PyObject *
762 _codecs_code_page_decode(PyModuleDef *module, PyObject *args) 804 _codecs_code_page_decode(PyModuleDef *module, PyObject *args)
763 { 805 {
764 PyObject *return_value = NULL; 806 PyObject *return_value = NULL;
765 int codepage; 807 int codepage;
766 Py_buffer data = {NULL, NULL}; 808 Py_buffer data = {NULL, NULL};
767 const char *errors = NULL; 809 const char *errors = NULL;
768 int final = 0; 810 int final = 0;
769 811
770 if (!PyArg_ParseTuple(args, 812 if (!PyArg_ParseTuple(args,
771 "iy*|zi:code_page_decode", 813 "iy*|zi:code_page_decode",
772 &codepage, &data, &errors, &final)) 814 &codepage, &data, &errors, &final))
773 goto exit; 815 goto exit;
774 return_value = _codecs_code_page_decode_impl(module, codepage, &data, errors , final); 816 return_value = _codecs_code_page_decode_impl(module, codepage, &data, errors , final);
775 817
776 exit: 818 exit:
777 /* Cleanup for data */ 819 /* Cleanup for data */
778 if (data.obj) 820 if (data.obj)
779 PyBuffer_Release(&data); 821 PyBuffer_Release(&data);
780 822
781 return return_value; 823 return return_value;
782 } 824 }
783 825
784 #endif /* defined(HAVE_MBCS) */ 826 #endif /* defined(HAVE_MBCS) */
785 827
786 PyDoc_STRVAR(_codecs_readbuffer_encode__doc__, 828 PyDoc_STRVAR(_codecs_readbuffer_encode__doc__,
787 "readbuffer_encode($module, data, errors=None, /)\n" 829 "readbuffer_encode($module, data, errors=None, /)\n"
788 "--"); 830 "--\n"
831 "\n");
789 832
790 #define _CODECS_READBUFFER_ENCODE_METHODDEF \ 833 #define _CODECS_READBUFFER_ENCODE_METHODDEF \
791 {"readbuffer_encode", (PyCFunction)_codecs_readbuffer_encode, METH_VARARGS, _codecs_readbuffer_encode__doc__}, 834 {"readbuffer_encode", (PyCFunction)_codecs_readbuffer_encode, METH_VARARGS, _codecs_readbuffer_encode__doc__},
792 835
793 static PyObject * 836 static PyObject *
794 _codecs_readbuffer_encode_impl(PyModuleDef *module, Py_buffer *data, const char *errors); 837 _codecs_readbuffer_encode_impl(PyModuleDef *module, Py_buffer *data,
838 const char *errors);
795 839
796 static PyObject * 840 static PyObject *
797 _codecs_readbuffer_encode(PyModuleDef *module, PyObject *args) 841 _codecs_readbuffer_encode(PyModuleDef *module, PyObject *args)
798 { 842 {
799 PyObject *return_value = NULL; 843 PyObject *return_value = NULL;
800 Py_buffer data = {NULL, NULL}; 844 Py_buffer data = {NULL, NULL};
801 const char *errors = NULL; 845 const char *errors = NULL;
802 846
803 if (!PyArg_ParseTuple(args, 847 if (!PyArg_ParseTuple(args,
804 "s*|z:readbuffer_encode", 848 "s*|z:readbuffer_encode",
805 &data, &errors)) 849 &data, &errors))
806 goto exit; 850 goto exit;
807 return_value = _codecs_readbuffer_encode_impl(module, &data, errors); 851 return_value = _codecs_readbuffer_encode_impl(module, &data, errors);
808 852
809 exit: 853 exit:
810 /* Cleanup for data */ 854 /* Cleanup for data */
811 if (data.obj) 855 if (data.obj)
812 PyBuffer_Release(&data); 856 PyBuffer_Release(&data);
813 857
814 return return_value; 858 return return_value;
815 } 859 }
816 860
817 PyDoc_STRVAR(_codecs_unicode_internal_encode__doc__, 861 PyDoc_STRVAR(_codecs_unicode_internal_encode__doc__,
818 "unicode_internal_encode($module, obj, errors=None, /)\n" 862 "unicode_internal_encode($module, obj, errors=None, /)\n"
819 "--"); 863 "--\n"
864 "\n");
820 865
821 #define _CODECS_UNICODE_INTERNAL_ENCODE_METHODDEF \ 866 #define _CODECS_UNICODE_INTERNAL_ENCODE_METHODDEF \
822 {"unicode_internal_encode", (PyCFunction)_codecs_unicode_internal_encode, ME TH_VARARGS, _codecs_unicode_internal_encode__doc__}, 867 {"unicode_internal_encode", (PyCFunction)_codecs_unicode_internal_encode, ME TH_VARARGS, _codecs_unicode_internal_encode__doc__},
823 868
824 static PyObject * 869 static PyObject *
825 _codecs_unicode_internal_encode_impl(PyModuleDef *module, PyObject *obj, const c har *errors); 870 _codecs_unicode_internal_encode_impl(PyModuleDef *module, PyObject *obj,
871 const char *errors);
826 872
827 static PyObject * 873 static PyObject *
828 _codecs_unicode_internal_encode(PyModuleDef *module, PyObject *args) 874 _codecs_unicode_internal_encode(PyModuleDef *module, PyObject *args)
829 { 875 {
830 PyObject *return_value = NULL; 876 PyObject *return_value = NULL;
831 PyObject *obj; 877 PyObject *obj;
832 const char *errors = NULL; 878 const char *errors = NULL;
833 879
834 if (!PyArg_ParseTuple(args, 880 if (!PyArg_ParseTuple(args,
835 "O|z:unicode_internal_encode", 881 "O|z:unicode_internal_encode",
836 &obj, &errors)) 882 &obj, &errors))
837 goto exit; 883 goto exit;
838 return_value = _codecs_unicode_internal_encode_impl(module, obj, errors); 884 return_value = _codecs_unicode_internal_encode_impl(module, obj, errors);
839 885
840 exit: 886 exit:
841 return return_value; 887 return return_value;
842 } 888 }
843 889
844 PyDoc_STRVAR(_codecs_utf_7_encode__doc__, 890 PyDoc_STRVAR(_codecs_utf_7_encode__doc__,
845 "utf_7_encode($module, str, errors=None, /)\n" 891 "utf_7_encode($module, str, errors=None, /)\n"
846 "--"); 892 "--\n"
893 "\n");
847 894
848 #define _CODECS_UTF_7_ENCODE_METHODDEF \ 895 #define _CODECS_UTF_7_ENCODE_METHODDEF \
849 {"utf_7_encode", (PyCFunction)_codecs_utf_7_encode, METH_VARARGS, _codecs_ut f_7_encode__doc__}, 896 {"utf_7_encode", (PyCFunction)_codecs_utf_7_encode, METH_VARARGS, _codecs_ut f_7_encode__doc__},
850 897
851 static PyObject * 898 static PyObject *
852 _codecs_utf_7_encode_impl(PyModuleDef *module, PyObject *str, const char *errors ); 899 _codecs_utf_7_encode_impl(PyModuleDef *module, PyObject *str,
900 const char *errors);
853 901
854 static PyObject * 902 static PyObject *
855 _codecs_utf_7_encode(PyModuleDef *module, PyObject *args) 903 _codecs_utf_7_encode(PyModuleDef *module, PyObject *args)
856 { 904 {
857 PyObject *return_value = NULL; 905 PyObject *return_value = NULL;
858 PyObject *str; 906 PyObject *str;
859 const char *errors = NULL; 907 const char *errors = NULL;
860 908
861 if (!PyArg_ParseTuple(args, 909 if (!PyArg_ParseTuple(args,
862 "O|z:utf_7_encode", 910 "O|z:utf_7_encode",
863 &str, &errors)) 911 &str, &errors))
864 goto exit; 912 goto exit;
865 return_value = _codecs_utf_7_encode_impl(module, str, errors); 913 return_value = _codecs_utf_7_encode_impl(module, str, errors);
866 914
867 exit: 915 exit:
868 return return_value; 916 return return_value;
869 } 917 }
870 918
871 PyDoc_STRVAR(_codecs_utf_8_encode__doc__, 919 PyDoc_STRVAR(_codecs_utf_8_encode__doc__,
872 "utf_8_encode($module, str, errors=None, /)\n" 920 "utf_8_encode($module, str, errors=None, /)\n"
873 "--"); 921 "--\n"
922 "\n");
874 923
875 #define _CODECS_UTF_8_ENCODE_METHODDEF \ 924 #define _CODECS_UTF_8_ENCODE_METHODDEF \
876 {"utf_8_encode", (PyCFunction)_codecs_utf_8_encode, METH_VARARGS, _codecs_ut f_8_encode__doc__}, 925 {"utf_8_encode", (PyCFunction)_codecs_utf_8_encode, METH_VARARGS, _codecs_ut f_8_encode__doc__},
877 926
878 static PyObject * 927 static PyObject *
879 _codecs_utf_8_encode_impl(PyModuleDef *module, PyObject *str, const char *errors ); 928 _codecs_utf_8_encode_impl(PyModuleDef *module, PyObject *str,
929 const char *errors);
880 930
881 static PyObject * 931 static PyObject *
882 _codecs_utf_8_encode(PyModuleDef *module, PyObject *args) 932 _codecs_utf_8_encode(PyModuleDef *module, PyObject *args)
883 { 933 {
884 PyObject *return_value = NULL; 934 PyObject *return_value = NULL;
885 PyObject *str; 935 PyObject *str;
886 const char *errors = NULL; 936 const char *errors = NULL;
887 937
888 if (!PyArg_ParseTuple(args, 938 if (!PyArg_ParseTuple(args,
889 "O|z:utf_8_encode", 939 "O|z:utf_8_encode",
890 &str, &errors)) 940 &str, &errors))
891 goto exit; 941 goto exit;
892 return_value = _codecs_utf_8_encode_impl(module, str, errors); 942 return_value = _codecs_utf_8_encode_impl(module, str, errors);
893 943
894 exit: 944 exit:
895 return return_value; 945 return return_value;
896 } 946 }
897 947
898 PyDoc_STRVAR(_codecs_utf_16_encode__doc__, 948 PyDoc_STRVAR(_codecs_utf_16_encode__doc__,
899 "utf_16_encode($module, str, errors=None, byteorder=0, /)\n" 949 "utf_16_encode($module, str, errors=None, byteorder=0, /)\n"
900 "--"); 950 "--\n"
951 "\n");
901 952
902 #define _CODECS_UTF_16_ENCODE_METHODDEF \ 953 #define _CODECS_UTF_16_ENCODE_METHODDEF \
903 {"utf_16_encode", (PyCFunction)_codecs_utf_16_encode, METH_VARARGS, _codecs_ utf_16_encode__doc__}, 954 {"utf_16_encode", (PyCFunction)_codecs_utf_16_encode, METH_VARARGS, _codecs_ utf_16_encode__doc__},
904 955
905 static PyObject * 956 static PyObject *
906 _codecs_utf_16_encode_impl(PyModuleDef *module, PyObject *str, const char *error s, int byteorder); 957 _codecs_utf_16_encode_impl(PyModuleDef *module, PyObject *str,
958 const char *errors, int byteorder);
907 959
908 static PyObject * 960 static PyObject *
909 _codecs_utf_16_encode(PyModuleDef *module, PyObject *args) 961 _codecs_utf_16_encode(PyModuleDef *module, PyObject *args)
910 { 962 {
911 PyObject *return_value = NULL; 963 PyObject *return_value = NULL;
912 PyObject *str; 964 PyObject *str;
913 const char *errors = NULL; 965 const char *errors = NULL;
914 int byteorder = 0; 966 int byteorder = 0;
915 967
916 if (!PyArg_ParseTuple(args, 968 if (!PyArg_ParseTuple(args,
917 "O|zi:utf_16_encode", 969 "O|zi:utf_16_encode",
918 &str, &errors, &byteorder)) 970 &str, &errors, &byteorder))
919 goto exit; 971 goto exit;
920 return_value = _codecs_utf_16_encode_impl(module, str, errors, byteorder); 972 return_value = _codecs_utf_16_encode_impl(module, str, errors, byteorder);
921 973
922 exit: 974 exit:
923 return return_value; 975 return return_value;
924 } 976 }
925 977
926 PyDoc_STRVAR(_codecs_utf_16_le_encode__doc__, 978 PyDoc_STRVAR(_codecs_utf_16_le_encode__doc__,
927 "utf_16_le_encode($module, str, errors=None, /)\n" 979 "utf_16_le_encode($module, str, errors=None, /)\n"
928 "--"); 980 "--\n"
981 "\n");
929 982
930 #define _CODECS_UTF_16_LE_ENCODE_METHODDEF \ 983 #define _CODECS_UTF_16_LE_ENCODE_METHODDEF \
931 {"utf_16_le_encode", (PyCFunction)_codecs_utf_16_le_encode, METH_VARARGS, _c odecs_utf_16_le_encode__doc__}, 984 {"utf_16_le_encode", (PyCFunction)_codecs_utf_16_le_encode, METH_VARARGS, _c odecs_utf_16_le_encode__doc__},
932 985
933 static PyObject * 986 static PyObject *
934 _codecs_utf_16_le_encode_impl(PyModuleDef *module, PyObject *str, const char *er rors); 987 _codecs_utf_16_le_encode_impl(PyModuleDef *module, PyObject *str,
988 const char *errors);
935 989
936 static PyObject * 990 static PyObject *
937 _codecs_utf_16_le_encode(PyModuleDef *module, PyObject *args) 991 _codecs_utf_16_le_encode(PyModuleDef *module, PyObject *args)
938 { 992 {
939 PyObject *return_value = NULL; 993 PyObject *return_value = NULL;
940 PyObject *str; 994 PyObject *str;
941 const char *errors = NULL; 995 const char *errors = NULL;
942 996
943 if (!PyArg_ParseTuple(args, 997 if (!PyArg_ParseTuple(args,
944 "O|z:utf_16_le_encode", 998 "O|z:utf_16_le_encode",
945 &str, &errors)) 999 &str, &errors))
946 goto exit; 1000 goto exit;
947 return_value = _codecs_utf_16_le_encode_impl(module, str, errors); 1001 return_value = _codecs_utf_16_le_encode_impl(module, str, errors);
948 1002
949 exit: 1003 exit:
950 return return_value; 1004 return return_value;
951 } 1005 }
952 1006
953 PyDoc_STRVAR(_codecs_utf_16_be_encode__doc__, 1007 PyDoc_STRVAR(_codecs_utf_16_be_encode__doc__,
954 "utf_16_be_encode($module, str, errors=None, /)\n" 1008 "utf_16_be_encode($module, str, errors=None, /)\n"
955 "--"); 1009 "--\n"
1010 "\n");
956 1011
957 #define _CODECS_UTF_16_BE_ENCODE_METHODDEF \ 1012 #define _CODECS_UTF_16_BE_ENCODE_METHODDEF \
958 {"utf_16_be_encode", (PyCFunction)_codecs_utf_16_be_encode, METH_VARARGS, _c odecs_utf_16_be_encode__doc__}, 1013 {"utf_16_be_encode", (PyCFunction)_codecs_utf_16_be_encode, METH_VARARGS, _c odecs_utf_16_be_encode__doc__},
959 1014
960 static PyObject * 1015 static PyObject *
961 _codecs_utf_16_be_encode_impl(PyModuleDef *module, PyObject *str, const char *er rors); 1016 _codecs_utf_16_be_encode_impl(PyModuleDef *module, PyObject *str,
1017 const char *errors);
962 1018
963 static PyObject * 1019 static PyObject *
964 _codecs_utf_16_be_encode(PyModuleDef *module, PyObject *args) 1020 _codecs_utf_16_be_encode(PyModuleDef *module, PyObject *args)
965 { 1021 {
966 PyObject *return_value = NULL; 1022 PyObject *return_value = NULL;
967 PyObject *str; 1023 PyObject *str;
968 const char *errors = NULL; 1024 const char *errors = NULL;
969 1025
970 if (!PyArg_ParseTuple(args, 1026 if (!PyArg_ParseTuple(args,
971 "O|z:utf_16_be_encode", 1027 "O|z:utf_16_be_encode",
972 &str, &errors)) 1028 &str, &errors))
973 goto exit; 1029 goto exit;
974 return_value = _codecs_utf_16_be_encode_impl(module, str, errors); 1030 return_value = _codecs_utf_16_be_encode_impl(module, str, errors);
975 1031
976 exit: 1032 exit:
977 return return_value; 1033 return return_value;
978 } 1034 }
979 1035
980 PyDoc_STRVAR(_codecs_utf_32_encode__doc__, 1036 PyDoc_STRVAR(_codecs_utf_32_encode__doc__,
981 "utf_32_encode($module, str, errors=None, byteorder=0, /)\n" 1037 "utf_32_encode($module, str, errors=None, byteorder=0, /)\n"
982 "--"); 1038 "--\n"
1039 "\n");
983 1040
984 #define _CODECS_UTF_32_ENCODE_METHODDEF \ 1041 #define _CODECS_UTF_32_ENCODE_METHODDEF \
985 {"utf_32_encode", (PyCFunction)_codecs_utf_32_encode, METH_VARARGS, _codecs_ utf_32_encode__doc__}, 1042 {"utf_32_encode", (PyCFunction)_codecs_utf_32_encode, METH_VARARGS, _codecs_ utf_32_encode__doc__},
986 1043
987 static PyObject * 1044 static PyObject *
988 _codecs_utf_32_encode_impl(PyModuleDef *module, PyObject *str, const char *error s, int byteorder); 1045 _codecs_utf_32_encode_impl(PyModuleDef *module, PyObject *str,
1046 const char *errors, int byteorder);
989 1047
990 static PyObject * 1048 static PyObject *
991 _codecs_utf_32_encode(PyModuleDef *module, PyObject *args) 1049 _codecs_utf_32_encode(PyModuleDef *module, PyObject *args)
992 { 1050 {
993 PyObject *return_value = NULL; 1051 PyObject *return_value = NULL;
994 PyObject *str; 1052 PyObject *str;
995 const char *errors = NULL; 1053 const char *errors = NULL;
996 int byteorder = 0; 1054 int byteorder = 0;
997 1055
998 if (!PyArg_ParseTuple(args, 1056 if (!PyArg_ParseTuple(args,
999 "O|zi:utf_32_encode", 1057 "O|zi:utf_32_encode",
1000 &str, &errors, &byteorder)) 1058 &str, &errors, &byteorder))
1001 goto exit; 1059 goto exit;
1002 return_value = _codecs_utf_32_encode_impl(module, str, errors, byteorder); 1060 return_value = _codecs_utf_32_encode_impl(module, str, errors, byteorder);
1003 1061
1004 exit: 1062 exit:
1005 return return_value; 1063 return return_value;
1006 } 1064 }
1007 1065
1008 PyDoc_STRVAR(_codecs_utf_32_le_encode__doc__, 1066 PyDoc_STRVAR(_codecs_utf_32_le_encode__doc__,
1009 "utf_32_le_encode($module, str, errors=None, /)\n" 1067 "utf_32_le_encode($module, str, errors=None, /)\n"
1010 "--"); 1068 "--\n"
1069 "\n");
1011 1070
1012 #define _CODECS_UTF_32_LE_ENCODE_METHODDEF \ 1071 #define _CODECS_UTF_32_LE_ENCODE_METHODDEF \
1013 {"utf_32_le_encode", (PyCFunction)_codecs_utf_32_le_encode, METH_VARARGS, _c odecs_utf_32_le_encode__doc__}, 1072 {"utf_32_le_encode", (PyCFunction)_codecs_utf_32_le_encode, METH_VARARGS, _c odecs_utf_32_le_encode__doc__},
1014 1073
1015 static PyObject * 1074 static PyObject *
1016 _codecs_utf_32_le_encode_impl(PyModuleDef *module, PyObject *str, const char *er rors); 1075 _codecs_utf_32_le_encode_impl(PyModuleDef *module, PyObject *str,
1076 const char *errors);
1017 1077
1018 static PyObject * 1078 static PyObject *
1019 _codecs_utf_32_le_encode(PyModuleDef *module, PyObject *args) 1079 _codecs_utf_32_le_encode(PyModuleDef *module, PyObject *args)
1020 { 1080 {
1021 PyObject *return_value = NULL; 1081 PyObject *return_value = NULL;
1022 PyObject *str; 1082 PyObject *str;
1023 const char *errors = NULL; 1083 const char *errors = NULL;
1024 1084
1025 if (!PyArg_ParseTuple(args, 1085 if (!PyArg_ParseTuple(args,
1026 "O|z:utf_32_le_encode", 1086 "O|z:utf_32_le_encode",
1027 &str, &errors)) 1087 &str, &errors))
1028 goto exit; 1088 goto exit;
1029 return_value = _codecs_utf_32_le_encode_impl(module, str, errors); 1089 return_value = _codecs_utf_32_le_encode_impl(module, str, errors);
1030 1090
1031 exit: 1091 exit:
1032 return return_value; 1092 return return_value;
1033 } 1093 }
1034 1094
1035 PyDoc_STRVAR(_codecs_utf_32_be_encode__doc__, 1095 PyDoc_STRVAR(_codecs_utf_32_be_encode__doc__,
1036 "utf_32_be_encode($module, str, errors=None, /)\n" 1096 "utf_32_be_encode($module, str, errors=None, /)\n"
1037 "--"); 1097 "--\n"
1098 "\n");
1038 1099
1039 #define _CODECS_UTF_32_BE_ENCODE_METHODDEF \ 1100 #define _CODECS_UTF_32_BE_ENCODE_METHODDEF \
1040 {"utf_32_be_encode", (PyCFunction)_codecs_utf_32_be_encode, METH_VARARGS, _c odecs_utf_32_be_encode__doc__}, 1101 {"utf_32_be_encode", (PyCFunction)_codecs_utf_32_be_encode, METH_VARARGS, _c odecs_utf_32_be_encode__doc__},
1041 1102
1042 static PyObject * 1103 static PyObject *
1043 _codecs_utf_32_be_encode_impl(PyModuleDef *module, PyObject *str, const char *er rors); 1104 _codecs_utf_32_be_encode_impl(PyModuleDef *module, PyObject *str,
1105 const char *errors);
1044 1106
1045 static PyObject * 1107 static PyObject *
1046 _codecs_utf_32_be_encode(PyModuleDef *module, PyObject *args) 1108 _codecs_utf_32_be_encode(PyModuleDef *module, PyObject *args)
1047 { 1109 {
1048 PyObject *return_value = NULL; 1110 PyObject *return_value = NULL;
1049 PyObject *str; 1111 PyObject *str;
1050 const char *errors = NULL; 1112 const char *errors = NULL;
1051 1113
1052 if (!PyArg_ParseTuple(args, 1114 if (!PyArg_ParseTuple(args,
1053 "O|z:utf_32_be_encode", 1115 "O|z:utf_32_be_encode",
1054 &str, &errors)) 1116 &str, &errors))
1055 goto exit; 1117 goto exit;
1056 return_value = _codecs_utf_32_be_encode_impl(module, str, errors); 1118 return_value = _codecs_utf_32_be_encode_impl(module, str, errors);
1057 1119
1058 exit: 1120 exit:
1059 return return_value; 1121 return return_value;
1060 } 1122 }
1061 1123
1062 PyDoc_STRVAR(_codecs_unicode_escape_encode__doc__, 1124 PyDoc_STRVAR(_codecs_unicode_escape_encode__doc__,
1063 "unicode_escape_encode($module, str, errors=None, /)\n" 1125 "unicode_escape_encode($module, str, errors=None, /)\n"
1064 "--"); 1126 "--\n"
1127 "\n");
1065 1128
1066 #define _CODECS_UNICODE_ESCAPE_ENCODE_METHODDEF \ 1129 #define _CODECS_UNICODE_ESCAPE_ENCODE_METHODDEF \
1067 {"unicode_escape_encode", (PyCFunction)_codecs_unicode_escape_encode, METH_V ARARGS, _codecs_unicode_escape_encode__doc__}, 1130 {"unicode_escape_encode", (PyCFunction)_codecs_unicode_escape_encode, METH_V ARARGS, _codecs_unicode_escape_encode__doc__},
1068 1131
1069 static PyObject * 1132 static PyObject *
1070 _codecs_unicode_escape_encode_impl(PyModuleDef *module, PyObject *str, const cha r *errors); 1133 _codecs_unicode_escape_encode_impl(PyModuleDef *module, PyObject *str,
1134 const char *errors);
1071 1135
1072 static PyObject * 1136 static PyObject *
1073 _codecs_unicode_escape_encode(PyModuleDef *module, PyObject *args) 1137 _codecs_unicode_escape_encode(PyModuleDef *module, PyObject *args)
1074 { 1138 {
1075 PyObject *return_value = NULL; 1139 PyObject *return_value = NULL;
1076 PyObject *str; 1140 PyObject *str;
1077 const char *errors = NULL; 1141 const char *errors = NULL;
1078 1142
1079 if (!PyArg_ParseTuple(args, 1143 if (!PyArg_ParseTuple(args,
1080 "O|z:unicode_escape_encode", 1144 "O|z:unicode_escape_encode",
1081 &str, &errors)) 1145 &str, &errors))
1082 goto exit; 1146 goto exit;
1083 return_value = _codecs_unicode_escape_encode_impl(module, str, errors); 1147 return_value = _codecs_unicode_escape_encode_impl(module, str, errors);
1084 1148
1085 exit: 1149 exit:
1086 return return_value; 1150 return return_value;
1087 } 1151 }
1088 1152
1089 PyDoc_STRVAR(_codecs_raw_unicode_escape_encode__doc__, 1153 PyDoc_STRVAR(_codecs_raw_unicode_escape_encode__doc__,
1090 "raw_unicode_escape_encode($module, str, errors=None, /)\n" 1154 "raw_unicode_escape_encode($module, str, errors=None, /)\n"
1091 "--"); 1155 "--\n"
1156 "\n");
1092 1157
1093 #define _CODECS_RAW_UNICODE_ESCAPE_ENCODE_METHODDEF \ 1158 #define _CODECS_RAW_UNICODE_ESCAPE_ENCODE_METHODDEF \
1094 {"raw_unicode_escape_encode", (PyCFunction)_codecs_raw_unicode_escape_encode , METH_VARARGS, _codecs_raw_unicode_escape_encode__doc__}, 1159 {"raw_unicode_escape_encode", (PyCFunction)_codecs_raw_unicode_escape_encode , METH_VARARGS, _codecs_raw_unicode_escape_encode__doc__},
1095 1160
1096 static PyObject * 1161 static PyObject *
1097 _codecs_raw_unicode_escape_encode_impl(PyModuleDef *module, PyObject *str, const char *errors); 1162 _codecs_raw_unicode_escape_encode_impl(PyModuleDef *module, PyObject *str,
1163 const char *errors);
1098 1164
1099 static PyObject * 1165 static PyObject *
1100 _codecs_raw_unicode_escape_encode(PyModuleDef *module, PyObject *args) 1166 _codecs_raw_unicode_escape_encode(PyModuleDef *module, PyObject *args)
1101 { 1167 {
1102 PyObject *return_value = NULL; 1168 PyObject *return_value = NULL;
1103 PyObject *str; 1169 PyObject *str;
1104 const char *errors = NULL; 1170 const char *errors = NULL;
1105 1171
1106 if (!PyArg_ParseTuple(args, 1172 if (!PyArg_ParseTuple(args,
1107 "O|z:raw_unicode_escape_encode", 1173 "O|z:raw_unicode_escape_encode",
1108 &str, &errors)) 1174 &str, &errors))
1109 goto exit; 1175 goto exit;
1110 return_value = _codecs_raw_unicode_escape_encode_impl(module, str, errors); 1176 return_value = _codecs_raw_unicode_escape_encode_impl(module, str, errors);
1111 1177
1112 exit: 1178 exit:
1113 return return_value; 1179 return return_value;
1114 } 1180 }
1115 1181
1116 PyDoc_STRVAR(_codecs_latin_1_encode__doc__, 1182 PyDoc_STRVAR(_codecs_latin_1_encode__doc__,
1117 "latin_1_encode($module, str, errors=None, /)\n" 1183 "latin_1_encode($module, str, errors=None, /)\n"
1118 "--"); 1184 "--\n"
1185 "\n");
1119 1186
1120 #define _CODECS_LATIN_1_ENCODE_METHODDEF \ 1187 #define _CODECS_LATIN_1_ENCODE_METHODDEF \
1121 {"latin_1_encode", (PyCFunction)_codecs_latin_1_encode, METH_VARARGS, _codec s_latin_1_encode__doc__}, 1188 {"latin_1_encode", (PyCFunction)_codecs_latin_1_encode, METH_VARARGS, _codec s_latin_1_encode__doc__},
1122 1189
1123 static PyObject * 1190 static PyObject *
1124 _codecs_latin_1_encode_impl(PyModuleDef *module, PyObject *str, const char *erro rs); 1191 _codecs_latin_1_encode_impl(PyModuleDef *module, PyObject *str,
1192 const char *errors);
1125 1193
1126 static PyObject * 1194 static PyObject *
1127 _codecs_latin_1_encode(PyModuleDef *module, PyObject *args) 1195 _codecs_latin_1_encode(PyModuleDef *module, PyObject *args)
1128 { 1196 {
1129 PyObject *return_value = NULL; 1197 PyObject *return_value = NULL;
1130 PyObject *str; 1198 PyObject *str;
1131 const char *errors = NULL; 1199 const char *errors = NULL;
1132 1200
1133 if (!PyArg_ParseTuple(args, 1201 if (!PyArg_ParseTuple(args,
1134 "O|z:latin_1_encode", 1202 "O|z:latin_1_encode",
1135 &str, &errors)) 1203 &str, &errors))
1136 goto exit; 1204 goto exit;
1137 return_value = _codecs_latin_1_encode_impl(module, str, errors); 1205 return_value = _codecs_latin_1_encode_impl(module, str, errors);
1138 1206
1139 exit: 1207 exit:
1140 return return_value; 1208 return return_value;
1141 } 1209 }
1142 1210
1143 PyDoc_STRVAR(_codecs_ascii_encode__doc__, 1211 PyDoc_STRVAR(_codecs_ascii_encode__doc__,
1144 "ascii_encode($module, str, errors=None, /)\n" 1212 "ascii_encode($module, str, errors=None, /)\n"
1145 "--"); 1213 "--\n"
1214 "\n");
1146 1215
1147 #define _CODECS_ASCII_ENCODE_METHODDEF \ 1216 #define _CODECS_ASCII_ENCODE_METHODDEF \
1148 {"ascii_encode", (PyCFunction)_codecs_ascii_encode, METH_VARARGS, _codecs_as cii_encode__doc__}, 1217 {"ascii_encode", (PyCFunction)_codecs_ascii_encode, METH_VARARGS, _codecs_as cii_encode__doc__},
1149 1218
1150 static PyObject * 1219 static PyObject *
1151 _codecs_ascii_encode_impl(PyModuleDef *module, PyObject *str, const char *errors ); 1220 _codecs_ascii_encode_impl(PyModuleDef *module, PyObject *str,
1221 const char *errors);
1152 1222
1153 static PyObject * 1223 static PyObject *
1154 _codecs_ascii_encode(PyModuleDef *module, PyObject *args) 1224 _codecs_ascii_encode(PyModuleDef *module, PyObject *args)
1155 { 1225 {
1156 PyObject *return_value = NULL; 1226 PyObject *return_value = NULL;
1157 PyObject *str; 1227 PyObject *str;
1158 const char *errors = NULL; 1228 const char *errors = NULL;
1159 1229
1160 if (!PyArg_ParseTuple(args, 1230 if (!PyArg_ParseTuple(args,
1161 "O|z:ascii_encode", 1231 "O|z:ascii_encode",
1162 &str, &errors)) 1232 &str, &errors))
1163 goto exit; 1233 goto exit;
1164 return_value = _codecs_ascii_encode_impl(module, str, errors); 1234 return_value = _codecs_ascii_encode_impl(module, str, errors);
1165 1235
1166 exit: 1236 exit:
1167 return return_value; 1237 return return_value;
1168 } 1238 }
1169 1239
1170 PyDoc_STRVAR(_codecs_charmap_encode__doc__, 1240 PyDoc_STRVAR(_codecs_charmap_encode__doc__,
1171 "charmap_encode($module, str, errors=None, mapping=None, /)\n" 1241 "charmap_encode($module, str, errors=None, mapping=None, /)\n"
1172 "--"); 1242 "--\n"
1243 "\n");
1173 1244
1174 #define _CODECS_CHARMAP_ENCODE_METHODDEF \ 1245 #define _CODECS_CHARMAP_ENCODE_METHODDEF \
1175 {"charmap_encode", (PyCFunction)_codecs_charmap_encode, METH_VARARGS, _codec s_charmap_encode__doc__}, 1246 {"charmap_encode", (PyCFunction)_codecs_charmap_encode, METH_VARARGS, _codec s_charmap_encode__doc__},
1176 1247
1177 static PyObject * 1248 static PyObject *
1178 _codecs_charmap_encode_impl(PyModuleDef *module, PyObject *str, const char *erro rs, PyObject *mapping); 1249 _codecs_charmap_encode_impl(PyModuleDef *module, PyObject *str,
1250 const char *errors, PyObject *mapping);
1179 1251
1180 static PyObject * 1252 static PyObject *
1181 _codecs_charmap_encode(PyModuleDef *module, PyObject *args) 1253 _codecs_charmap_encode(PyModuleDef *module, PyObject *args)
1182 { 1254 {
1183 PyObject *return_value = NULL; 1255 PyObject *return_value = NULL;
1184 PyObject *str; 1256 PyObject *str;
1185 const char *errors = NULL; 1257 const char *errors = NULL;
1186 PyObject *mapping = NULL; 1258 PyObject *mapping = NULL;
1187 1259
1188 if (!PyArg_ParseTuple(args, 1260 if (!PyArg_ParseTuple(args,
1189 "O|zO:charmap_encode", 1261 "O|zO:charmap_encode",
1190 &str, &errors, &mapping)) 1262 &str, &errors, &mapping))
1191 goto exit; 1263 goto exit;
1192 return_value = _codecs_charmap_encode_impl(module, str, errors, mapping); 1264 return_value = _codecs_charmap_encode_impl(module, str, errors, mapping);
1193 1265
1194 exit: 1266 exit:
1195 return return_value; 1267 return return_value;
1196 } 1268 }
1197 1269
1198 PyDoc_STRVAR(_codecs_charmap_build__doc__, 1270 PyDoc_STRVAR(_codecs_charmap_build__doc__,
1199 "charmap_build($module, map, /)\n" 1271 "charmap_build($module, map, /)\n"
1200 "--"); 1272 "--\n"
1273 "\n");
1201 1274
1202 #define _CODECS_CHARMAP_BUILD_METHODDEF \ 1275 #define _CODECS_CHARMAP_BUILD_METHODDEF \
1203 {"charmap_build", (PyCFunction)_codecs_charmap_build, METH_O, _codecs_charma p_build__doc__}, 1276 {"charmap_build", (PyCFunction)_codecs_charmap_build, METH_O, _codecs_charma p_build__doc__},
1204 1277
1205 static PyObject * 1278 static PyObject *
1206 _codecs_charmap_build_impl(PyModuleDef *module, PyObject *map); 1279 _codecs_charmap_build_impl(PyModuleDef *module, PyObject *map);
1207 1280
1208 static PyObject * 1281 static PyObject *
1209 _codecs_charmap_build(PyModuleDef *module, PyObject *arg) 1282 _codecs_charmap_build(PyModuleDef *module, PyObject *arg)
1210 { 1283 {
1211 PyObject *return_value = NULL; 1284 PyObject *return_value = NULL;
1212 PyObject *map; 1285 PyObject *map;
1213 1286
1214 if (!PyArg_Parse(arg, 1287 if (!PyArg_Parse(arg,
1215 "U:charmap_build", 1288 "U:charmap_build",
1216 &map)) 1289 &map))
1217 goto exit; 1290 goto exit;
1218 return_value = _codecs_charmap_build_impl(module, map); 1291 return_value = _codecs_charmap_build_impl(module, map);
1219 1292
1220 exit: 1293 exit:
1221 return return_value; 1294 return return_value;
1222 } 1295 }
1223 1296
1224 #if defined(HAVE_MBCS) 1297 #if defined(HAVE_MBCS)
1225 1298
1226 PyDoc_STRVAR(_codecs_mbcs_encode__doc__, 1299 PyDoc_STRVAR(_codecs_mbcs_encode__doc__,
1227 "mbcs_encode($module, str, errors=None, /)\n" 1300 "mbcs_encode($module, str, errors=None, /)\n"
1228 "--"); 1301 "--\n"
1302 "\n");
1229 1303
1230 #define _CODECS_MBCS_ENCODE_METHODDEF \ 1304 #define _CODECS_MBCS_ENCODE_METHODDEF \
1231 {"mbcs_encode", (PyCFunction)_codecs_mbcs_encode, METH_VARARGS, _codecs_mbcs _encode__doc__}, 1305 {"mbcs_encode", (PyCFunction)_codecs_mbcs_encode, METH_VARARGS, _codecs_mbcs _encode__doc__},
1232 1306
1233 static PyObject * 1307 static PyObject *
1234 _codecs_mbcs_encode_impl(PyModuleDef *module, PyObject *str, const char *errors) ; 1308 _codecs_mbcs_encode_impl(PyModuleDef *module, PyObject *str,
1309 const char *errors);
1235 1310
1236 static PyObject * 1311 static PyObject *
1237 _codecs_mbcs_encode(PyModuleDef *module, PyObject *args) 1312 _codecs_mbcs_encode(PyModuleDef *module, PyObject *args)
1238 { 1313 {
1239 PyObject *return_value = NULL; 1314 PyObject *return_value = NULL;
1240 PyObject *str; 1315 PyObject *str;
1241 const char *errors = NULL; 1316 const char *errors = NULL;
1242 1317
1243 if (!PyArg_ParseTuple(args, 1318 if (!PyArg_ParseTuple(args,
1244 "O|z:mbcs_encode", 1319 "O|z:mbcs_encode",
1245 &str, &errors)) 1320 &str, &errors))
1246 goto exit; 1321 goto exit;
1247 return_value = _codecs_mbcs_encode_impl(module, str, errors); 1322 return_value = _codecs_mbcs_encode_impl(module, str, errors);
1248 1323
1249 exit: 1324 exit:
1250 return return_value; 1325 return return_value;
1251 } 1326 }
1252 1327
1253 #endif /* defined(HAVE_MBCS) */ 1328 #endif /* defined(HAVE_MBCS) */
1254 1329
1255 #if defined(HAVE_MBCS) 1330 #if defined(HAVE_MBCS)
1256 1331
1257 PyDoc_STRVAR(_codecs_code_page_encode__doc__, 1332 PyDoc_STRVAR(_codecs_code_page_encode__doc__,
1258 "code_page_encode($module, code_page, str, errors=None, /)\n" 1333 "code_page_encode($module, code_page, str, errors=None, /)\n"
1259 "--"); 1334 "--\n"
1335 "\n");
1260 1336
1261 #define _CODECS_CODE_PAGE_ENCODE_METHODDEF \ 1337 #define _CODECS_CODE_PAGE_ENCODE_METHODDEF \
1262 {"code_page_encode", (PyCFunction)_codecs_code_page_encode, METH_VARARGS, _c odecs_code_page_encode__doc__}, 1338 {"code_page_encode", (PyCFunction)_codecs_code_page_encode, METH_VARARGS, _c odecs_code_page_encode__doc__},
1263 1339
1264 static PyObject * 1340 static PyObject *
1265 _codecs_code_page_encode_impl(PyModuleDef *module, int code_page, PyObject *str, const char *errors); 1341 _codecs_code_page_encode_impl(PyModuleDef *module, int code_page,
1342 PyObject *str, const char *errors);
1266 1343
1267 static PyObject * 1344 static PyObject *
1268 _codecs_code_page_encode(PyModuleDef *module, PyObject *args) 1345 _codecs_code_page_encode(PyModuleDef *module, PyObject *args)
1269 { 1346 {
1270 PyObject *return_value = NULL; 1347 PyObject *return_value = NULL;
1271 int code_page; 1348 int code_page;
1272 PyObject *str; 1349 PyObject *str;
1273 const char *errors = NULL; 1350 const char *errors = NULL;
1274 1351
1275 if (!PyArg_ParseTuple(args, 1352 if (!PyArg_ParseTuple(args,
(...skipping 15 matching lines...) Expand all
1291 "Register the specified error handler under the name errors.\n" 1368 "Register the specified error handler under the name errors.\n"
1292 "\n" 1369 "\n"
1293 "handler must be a callable object, that will be called with an exception\n" 1370 "handler must be a callable object, that will be called with an exception\n"
1294 "instance containing information about the location of the encoding/decoding\n" 1371 "instance containing information about the location of the encoding/decoding\n"
1295 "error and must return a (replacement, new position) tuple."); 1372 "error and must return a (replacement, new position) tuple.");
1296 1373
1297 #define _CODECS_REGISTER_ERROR_METHODDEF \ 1374 #define _CODECS_REGISTER_ERROR_METHODDEF \
1298 {"register_error", (PyCFunction)_codecs_register_error, METH_VARARGS, _codec s_register_error__doc__}, 1375 {"register_error", (PyCFunction)_codecs_register_error, METH_VARARGS, _codec s_register_error__doc__},
1299 1376
1300 static PyObject * 1377 static PyObject *
1301 _codecs_register_error_impl(PyModuleDef *module, const char *errors, PyObject *h andler); 1378 _codecs_register_error_impl(PyModuleDef *module, const char *errors,
1379 PyObject *handler);
1302 1380
1303 static PyObject * 1381 static PyObject *
1304 _codecs_register_error(PyModuleDef *module, PyObject *args) 1382 _codecs_register_error(PyModuleDef *module, PyObject *args)
1305 { 1383 {
1306 PyObject *return_value = NULL; 1384 PyObject *return_value = NULL;
1307 const char *errors; 1385 const char *errors;
1308 PyObject *handler; 1386 PyObject *handler;
1309 1387
1310 if (!PyArg_ParseTuple(args, 1388 if (!PyArg_ParseTuple(args,
1311 "sO:register_error", 1389 "sO:register_error",
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 #define _CODECS_CODE_PAGE_DECODE_METHODDEF 1434 #define _CODECS_CODE_PAGE_DECODE_METHODDEF
1357 #endif /* !defined(_CODECS_CODE_PAGE_DECODE_METHODDEF) */ 1435 #endif /* !defined(_CODECS_CODE_PAGE_DECODE_METHODDEF) */
1358 1436
1359 #ifndef _CODECS_MBCS_ENCODE_METHODDEF 1437 #ifndef _CODECS_MBCS_ENCODE_METHODDEF
1360 #define _CODECS_MBCS_ENCODE_METHODDEF 1438 #define _CODECS_MBCS_ENCODE_METHODDEF
1361 #endif /* !defined(_CODECS_MBCS_ENCODE_METHODDEF) */ 1439 #endif /* !defined(_CODECS_MBCS_ENCODE_METHODDEF) */
1362 1440
1363 #ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF 1441 #ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF
1364 #define _CODECS_CODE_PAGE_ENCODE_METHODDEF 1442 #define _CODECS_CODE_PAGE_ENCODE_METHODDEF
1365 #endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */ 1443 #endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */
1366 /*[clinic end generated code: output=a9c144503febd177 input=a9049054013a1b77]*/ 1444 /*[clinic end generated code: output=182050dde4b7f95a input=a9049054013a1b77]*/
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+