Mercurial > cpython-lru_cache-weakref
diff Modules/_codecsmodule.c @ 35825:cc17a582518a legacy-trunk
Whitespace cleanup.
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Wed, 02 Nov 2005 08:30:08 +0000 |
| parents | 6b8c55877755 |
| children | 7fdc639bc5b4 |
line wrap: on
line diff
--- a/Modules/_codecsmodule.c Wed Nov 02 05:54:27 2005 +0000 +++ b/Modules/_codecsmodule.c Wed Nov 02 08:30:08 2005 +0000 @@ -14,10 +14,10 @@ The builtin Unicode codecs use the following interface: - <encoding>_encode(Unicode_object[,errors='strict']) -> + <encoding>_encode(Unicode_object[,errors='strict']) -> (string object, bytes consumed) - <encoding>_decode(char_buffer_obj[,errors='strict']) -> + <encoding>_decode(char_buffer_obj[,errors='strict']) -> (Unicode object, bytes consumed) <encoding>_encode() interfaces also accept non-Unicode object as @@ -56,7 +56,7 @@ if (PyCodec_Register(search_function)) goto onError; - + Py_INCREF(Py_None); return Py_None; @@ -100,7 +100,7 @@ const char *encoding = NULL; const char *errors = NULL; PyObject *v; - + if (!PyArg_ParseTuple(args, "O|ss:encode", &v, &encoding, &errors)) return NULL; @@ -140,7 +140,7 @@ const char *encoding = NULL; const char *errors = NULL; PyObject *v; - + if (!PyArg_ParseTuple(args, "O|ss:decode", &v, &encoding, &errors)) return NULL; @@ -171,7 +171,7 @@ int len) { PyObject *v,*w; - + if (unicode == NULL) return NULL; v = PyTuple_New(2); @@ -197,11 +197,11 @@ const char *errors = NULL; const char *data; int size; - + if (!PyArg_ParseTuple(args, "s#|z:escape_decode", &data, &size, &errors)) return NULL; - return codec_tuple(PyString_DecodeEscape(data, size, errors, 0, NULL), + return codec_tuple(PyString_DecodeEscape(data, size, errors, 0, NULL), size); } @@ -242,7 +242,7 @@ const char *errors = NULL; const char *data; int size; - + if (!PyArg_ParseTuple(args, "O|z:unicode_internal_decode", &obj, &errors)) return NULL; @@ -267,7 +267,7 @@ const char *data; int size; const char *errors = NULL; - + if (!PyArg_ParseTuple(args, "t#|z:utf_7_decode", &data, &size, &errors)) return NULL; @@ -333,7 +333,7 @@ int final = 0; int consumed; PyObject *decoded = NULL; - + if (!PyArg_ParseTuple(args, "t#|zi:utf_16_le_decode", &data, &size, &errors, &final)) return NULL; @@ -357,7 +357,7 @@ int final = 0; int consumed; PyObject *decoded = NULL; - + if (!PyArg_ParseTuple(args, "t#|zi:utf_16_be_decode", &data, &size, &errors, &final)) return NULL; @@ -410,7 +410,7 @@ const char *data; int size; const char *errors = NULL; - + if (!PyArg_ParseTuple(args, "t#|z:unicode_escape_decode", &data, &size, &errors)) return NULL; @@ -426,7 +426,7 @@ const char *data; int size; const char *errors = NULL; - + if (!PyArg_ParseTuple(args, "t#|z:raw_unicode_escape_decode", &data, &size, &errors)) return NULL; @@ -442,7 +442,7 @@ const char *data; int size; const char *errors = NULL; - + if (!PyArg_ParseTuple(args, "t#|z:latin_1_decode", &data, &size, &errors)) return NULL; @@ -458,7 +458,7 @@ const char *data; int size; const char *errors = NULL; - + if (!PyArg_ParseTuple(args, "t#|z:ascii_decode", &data, &size, &errors)) return NULL; @@ -475,7 +475,7 @@ int size; const char *errors = NULL; PyObject *mapping = NULL; - + if (!PyArg_ParseTuple(args, "t#|zO:charmap_decode", &data, &size, &errors, &mapping)) return NULL; @@ -495,7 +495,7 @@ const char *data; int size; const char *errors = NULL; - + if (!PyArg_ParseTuple(args, "t#|z:mbcs_decode", &data, &size, &errors)) return NULL; @@ -548,7 +548,7 @@ const char *errors = NULL; const char *data; int size; - + if (!PyArg_ParseTuple(args, "O|z:unicode_internal_encode", &obj, &errors)) return NULL; @@ -616,7 +616,7 @@ /* This version provides access to the byteorder parameter of the builtin UTF-16 codecs as optional third argument. It defaults to 0 which means: use the native byte order and prepend the data with a - BOM mark. + BOM mark. */ @@ -704,7 +704,7 @@ str = PyUnicode_FromObject(str); if (str == NULL) return NULL; - v = codec_tuple(PyUnicode_EncodeUnicodeEscape(PyUnicode_AS_UNICODE(str), + v = codec_tuple(PyUnicode_EncodeUnicodeEscape(PyUnicode_AS_UNICODE(str), PyUnicode_GET_SIZE(str)), PyUnicode_GET_SIZE(str)); Py_DECREF(str); @@ -726,7 +726,7 @@ if (str == NULL) return NULL; v = codec_tuple(PyUnicode_EncodeRawUnicodeEscape( - PyUnicode_AS_UNICODE(str), + PyUnicode_AS_UNICODE(str), PyUnicode_GET_SIZE(str)), PyUnicode_GET_SIZE(str)); Py_DECREF(str); @@ -748,7 +748,7 @@ if (str == NULL) return NULL; v = codec_tuple(PyUnicode_EncodeLatin1( - PyUnicode_AS_UNICODE(str), + PyUnicode_AS_UNICODE(str), PyUnicode_GET_SIZE(str), errors), PyUnicode_GET_SIZE(str)); @@ -771,7 +771,7 @@ if (str == NULL) return NULL; v = codec_tuple(PyUnicode_EncodeASCII( - PyUnicode_AS_UNICODE(str), + PyUnicode_AS_UNICODE(str), PyUnicode_GET_SIZE(str), errors), PyUnicode_GET_SIZE(str)); @@ -797,9 +797,9 @@ if (str == NULL) return NULL; v = codec_tuple(PyUnicode_EncodeCharmap( - PyUnicode_AS_UNICODE(str), + PyUnicode_AS_UNICODE(str), PyUnicode_GET_SIZE(str), - mapping, + mapping, errors), PyUnicode_GET_SIZE(str)); Py_DECREF(str); @@ -823,7 +823,7 @@ if (str == NULL) return NULL; v = codec_tuple(PyUnicode_EncodeMBCS( - PyUnicode_AS_UNICODE(str), + PyUnicode_AS_UNICODE(str), PyUnicode_GET_SIZE(str), errors), PyUnicode_GET_SIZE(str));
