Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9fd115cb
Commit
9fd115cb
authored
Nov 02, 2005
by
Walter Dörwald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace cleanup.
parent
cf486383
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
27 deletions
+27
-27
Modules/_codecsmodule.c
Modules/_codecsmodule.c
+27
-27
No files found.
Modules/_codecsmodule.c
View file @
9fd115cb
...
...
@@ -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 @@ PyObject *codec_register(PyObject *self, PyObject *args)
if
(
PyCodec_Register
(
search_function
))
goto
onError
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -100,7 +100,7 @@ codec_encode(PyObject *self, PyObject *args)
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 @@ codec_decode(PyObject *self, PyObject *args)
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 @@ PyObject *codec_tuple(PyObject *unicode,
int
len
)
{
PyObject
*
v
,
*
w
;
if
(
unicode
==
NULL
)
return
NULL
;
v
=
PyTuple_New
(
2
);
...
...
@@ -197,11 +197,11 @@ escape_decode(PyObject *self,
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 @@ unicode_internal_decode(PyObject *self,
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 @@ utf_7_decode(PyObject *self,
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 @@ utf_16_le_decode(PyObject *self,
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 @@ utf_16_be_decode(PyObject *self,
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 @@ unicode_escape_decode(PyObject *self,
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 @@ raw_unicode_escape_decode(PyObject *self,
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 @@ latin_1_decode(PyObject *self,
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 @@ ascii_decode(PyObject *self,
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 @@ charmap_decode(PyObject *self,
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 @@ mbcs_decode(PyObject *self,
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 @@ unicode_internal_encode(PyObject *self,
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 @@ utf_8_encode(PyObject *self,
/* 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 @@ unicode_escape_encode(PyObject *self,
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 @@ raw_unicode_escape_encode(PyObject *self,
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 @@ latin_1_encode(PyObject *self,
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 @@ ascii_encode(PyObject *self,
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 @@ charmap_encode(PyObject *self,
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 @@ mbcs_encode(PyObject *self,
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
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment