bpo-46303: Move fileutils.h private functions to internal C API (GH-30484)

Move almost all private functions of Include/cpython/fileutils.h to
the internal C API Include/internal/pycore_fileutils.h.

Only keep _Py_fopen_obj() in Include/cpython/fileutils.h, since it's
used by _testcapi which must not use the internal C API.

Move EncodeLocaleEx() and DecodeLocaleEx() functions from _testcapi
to _testinternalcapi, since the C API moved to the internal C API.
This commit is contained in:
Victor Stinner 2022-01-11 11:56:16 +01:00 committed by GitHub
parent fc75bfb8be
commit ea1a54506b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 289 additions and 258 deletions

View file

@ -85,6 +85,10 @@ Local naming conventions:
*/
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
#ifdef __APPLE__
// Issue #35569: Expose RFC 3542 socket options.
#define __APPLE_USE_RFC_3542 1
@ -103,6 +107,7 @@ Local naming conventions:
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "pycore_fileutils.h" // _Py_set_inheritable()
#include "structmember.h" // PyMemberDef
#ifdef _Py_MEMORY_SANITIZER