@@ -35,34 +35,6 @@ PyAPI_FUNC(int) PyCodec_Unregister(
3535 PyObject * search_function
3636 );
3737
38- /* Codec registry lookup API.
39-
40- Looks up the given encoding and returns a CodecInfo object with
41- function attributes which implement the different aspects of
42- processing the encoding.
43-
44- The encoding string is looked up converted to all lower-case
45- characters. This makes encodings looked up through this mechanism
46- effectively case-insensitive.
47-
48- If no codec is found, a KeyError is set and NULL returned.
49-
50- As side effect, this tries to load the encodings package, if not
51- yet done. This is part of the lazy load strategy for the encodings
52- package.
53-
54- */
55-
56- #ifndef Py_LIMITED_API
57- PyAPI_FUNC (PyObject * ) _PyCodec_Lookup (
58- const char * encoding
59- );
60-
61- PyAPI_FUNC (int ) _PyCodec_Forget (
62- const char * encoding
63- );
64- #endif
65-
6638/* Codec registry encoding check API.
6739
6840 Returns 1/0 depending on whether there is a registered codec for
@@ -106,102 +78,58 @@ PyAPI_FUNC(PyObject *) PyCodec_Decode(
10678 const char * errors
10779 );
10880
109- #ifndef Py_LIMITED_API
110- /* Text codec specific encoding and decoding API.
111-
112- Checks the encoding against a list of codecs which do not
113- implement a str<->bytes encoding before attempting the
114- operation.
81+ // --- Codec Lookup APIs --------------------------------------------------
11582
116- Please note that these APIs are internal and should not
117- be used in Python C extensions.
118-
119- XXX (ncoghlan): should we make these, or something like them, public
120- in Python 3.5+?
83+ /* Codec registry lookup API.
12184
122- */
123- PyAPI_FUNC (PyObject * ) _PyCodec_LookupTextEncoding (
124- const char * encoding ,
125- const char * alternate_command
126- );
85+ Looks up the given encoding and returns a CodecInfo object with
86+ function attributes which implement the different aspects of
87+ processing the encoding.
12788
128- PyAPI_FUNC (PyObject * ) _PyCodec_EncodeText (
129- PyObject * object ,
130- const char * encoding ,
131- const char * errors
132- );
89+ The encoding string is looked up converted to all lower-case
90+ characters. This makes encodings looked up through this mechanism
91+ effectively case-insensitive.
13392
134- PyAPI_FUNC (PyObject * ) _PyCodec_DecodeText (
135- PyObject * object ,
136- const char * encoding ,
137- const char * errors
138- );
93+ If no codec is found, a KeyError is set and NULL returned.
13994
140- /* These two aren't actually text encoding specific, but _io.TextIOWrapper
141- * is the only current API consumer.
95+ As side effect, this tries to load the encodings package, if not
96+ yet done. This is part of the lazy load strategy for the encodings
97+ package.
14298 */
143- PyAPI_FUNC (PyObject * ) _PyCodecInfo_GetIncrementalDecoder (
144- PyObject * codec_info ,
145- const char * errors
146- );
147-
148- PyAPI_FUNC (PyObject * ) _PyCodecInfo_GetIncrementalEncoder (
149- PyObject * codec_info ,
150- const char * errors
151- );
152- #endif
153-
154-
155-
156- /* --- Codec Lookup APIs --------------------------------------------------
157-
158- All APIs return a codec object with incremented refcount and are
159- based on _PyCodec_Lookup(). The same comments w/r to the encoding
160- name also apply to these APIs.
161-
162- */
16399
164100/* Get an encoder function for the given encoding. */
165101
166- PyAPI_FUNC (PyObject * ) PyCodec_Encoder (
167- const char * encoding
168- );
102+ PyAPI_FUNC (PyObject * ) PyCodec_Encoder (const char * encoding );
169103
170104/* Get a decoder function for the given encoding. */
171105
172- PyAPI_FUNC (PyObject * ) PyCodec_Decoder (
173- const char * encoding
174- );
106+ PyAPI_FUNC (PyObject * ) PyCodec_Decoder (const char * encoding );
175107
176108/* Get an IncrementalEncoder object for the given encoding. */
177109
178110PyAPI_FUNC (PyObject * ) PyCodec_IncrementalEncoder (
179- const char * encoding ,
180- const char * errors
181- );
111+ const char * encoding ,
112+ const char * errors );
182113
183114/* Get an IncrementalDecoder object function for the given encoding. */
184115
185116PyAPI_FUNC (PyObject * ) PyCodec_IncrementalDecoder (
186- const char * encoding ,
187- const char * errors
188- );
117+ const char * encoding ,
118+ const char * errors );
189119
190120/* Get a StreamReader factory function for the given encoding. */
191121
192122PyAPI_FUNC (PyObject * ) PyCodec_StreamReader (
193- const char * encoding ,
194- PyObject * stream ,
195- const char * errors
196- );
123+ const char * encoding ,
124+ PyObject * stream ,
125+ const char * errors );
197126
198127/* Get a StreamWriter factory function for the given encoding. */
199128
200129PyAPI_FUNC (PyObject * ) PyCodec_StreamWriter (
201- const char * encoding ,
202- PyObject * stream ,
203- const char * errors
204- );
130+ const char * encoding ,
131+ PyObject * stream ,
132+ const char * errors );
205133
206134/* Unicode encoding error handling callback registry API */
207135
0 commit comments