-
-
Notifications
You must be signed in to change notification settings - Fork 30.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove private _PyCodec_Lookup() function (#106269)
Remove the following private functions of the C API: * _PyCodecInfo_GetIncrementalDecoder() * _PyCodecInfo_GetIncrementalEncoder() * _PyCodec_DecodeText() * _PyCodec_EncodeText() * _PyCodec_Forget() * _PyCodec_Lookup() * _PyCodec_LookupTextEncoding() Move these functions to a new pycore_codecs.h internal header file. These functions are no longer exported.
- Loading branch information
Showing
9 changed files
with
87 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#ifndef Py_INTERNAL_CODECS_H | ||
#define Py_INTERNAL_CODECS_H | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
extern PyObject* _PyCodec_Lookup(const char *encoding); | ||
|
||
extern int _PyCodec_Forget(const char *encoding); | ||
|
||
/* Text codec specific encoding and decoding API. | ||
Checks the encoding against a list of codecs which do not | ||
implement a str<->bytes encoding before attempting the | ||
operation. | ||
Please note that these APIs are internal and should not | ||
be used in Python C extensions. | ||
XXX (ncoghlan): should we make these, or something like them, public | ||
in Python 3.5+? | ||
*/ | ||
extern PyObject* _PyCodec_LookupTextEncoding( | ||
const char *encoding, | ||
const char *alternate_command); | ||
|
||
extern PyObject* _PyCodec_EncodeText( | ||
PyObject *object, | ||
const char *encoding, | ||
const char *errors); | ||
|
||
extern PyObject* _PyCodec_DecodeText( | ||
PyObject *object, | ||
const char *encoding, | ||
const char *errors); | ||
|
||
/* These two aren't actually text encoding specific, but _io.TextIOWrapper | ||
* is the only current API consumer. | ||
*/ | ||
extern PyObject* _PyCodecInfo_GetIncrementalDecoder( | ||
PyObject *codec_info, | ||
const char *errors); | ||
|
||
extern PyObject* _PyCodecInfo_GetIncrementalEncoder( | ||
PyObject *codec_info, | ||
const char *errors); | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif /* !Py_INTERNAL_CODECS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters