summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-03-01 16:52:56 (GMT)
committerGitHub <noreply@github.com>2019-03-01 16:52:56 (GMT)
commit91b9ecf82c3287b45f39158c5134a87414ff26bc (patch)
tree0b5f267a09b1300eca85d7480d200609aadba746 /Include
parentc991f2415d4eef663039a83125aa6aad81672680 (diff)
downloadcpython-91b9ecf82c3287b45f39158c5134a87414ff26bc.zip
cpython-91b9ecf82c3287b45f39158c5134a87414ff26bc.tar.gz
cpython-91b9ecf82c3287b45f39158c5134a87414ff26bc.tar.bz2
bpo-36142: Add preconfig.c (GH-12128)
* Add _PyArgv_Decode() function * Move _Py_ClearFileSystemEncoding() and _Py_SetFileSystemEncoding() to preconfig.c.
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/coreconfig.h9
-rw-r--r--Include/internal/pycore_coreconfig.h11
-rw-r--r--Include/internal/pycore_fileutils.h2
3 files changed, 15 insertions, 7 deletions
diff --git a/Include/cpython/coreconfig.h b/Include/cpython/coreconfig.h
index 8109d4a..e3ebf73 100644
--- a/Include/cpython/coreconfig.h
+++ b/Include/cpython/coreconfig.h
@@ -5,7 +5,7 @@
extern "C" {
#endif
-/* _PyArgv */
+/* --- _PyArgv ---------------------------------------------------- */
typedef struct {
int argc;
@@ -15,7 +15,7 @@ typedef struct {
} _PyArgv;
-/* _PyInitError */
+/* --- _PyInitError ----------------------------------------------- */
typedef struct {
const char *prefix;
@@ -46,7 +46,7 @@ typedef struct {
#define _Py_INIT_FAILED(err) \
(err.msg != NULL || err.exitcode != -1)
-/* _PyCoreConfig */
+/* --- _PyCoreConfig ---------------------------------------------- */
typedef struct {
/* Install signal handlers? Yes by default. */
@@ -364,7 +364,8 @@ typedef struct {
/* Note: _PyCoreConfig_INIT sets other fields to 0/NULL */
-/* Functions used for testing */
+/* --- Function used for testing ---------------------------------- */
+
PyAPI_FUNC(PyObject *) _Py_GetGlobalVariablesAsDict(void);
PyAPI_FUNC(PyObject *) _PyCoreConfig_AsDict(const _PyCoreConfig *config);
diff --git a/Include/internal/pycore_coreconfig.h b/Include/internal/pycore_coreconfig.h
index ebb0a9e..9f3a4c7 100644
--- a/Include/internal/pycore_coreconfig.h
+++ b/Include/internal/pycore_coreconfig.h
@@ -8,7 +8,7 @@ extern "C" {
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_BUILTIN defined"
#endif
-/* _Py_wstrlist */
+/* --- _Py_wstrlist ----------------------------------------------- */
PyAPI_FUNC(void) _Py_wstrlist_clear(
int len,
@@ -24,12 +24,17 @@ PyAPI_FUNC(PyObject*) _Py_wstrlist_as_pylist(
int len,
wchar_t **list);
-/* Py_GetArgcArgv() helpers */
+/* --- _PyArgv ---------------------------------------------------- */
+
+PyAPI_FUNC(_PyInitError) _PyArgv_Decode(const _PyArgv *args,
+ wchar_t*** argv_p);
+
+/* --- Py_GetArgcArgv() helpers ----------------------------------- */
PyAPI_FUNC(void) _Py_ClearArgcArgv(void);
PyAPI_FUNC(int) _Py_SetArgcArgv(int argc, wchar_t * const *argv);
-/* _PyCoreConfig */
+/* --- _PyCoreConfig ---------------------------------------------- */
PyAPI_FUNC(_PyInitError) _PyCoreConfig_Read(_PyCoreConfig *config);
PyAPI_FUNC(void) _PyCoreConfig_Clear(_PyCoreConfig *);
diff --git a/Include/internal/pycore_fileutils.h b/Include/internal/pycore_fileutils.h
index 2500665..23ae201 100644
--- a/Include/internal/pycore_fileutils.h
+++ b/Include/internal/pycore_fileutils.h
@@ -10,6 +10,8 @@ extern "C" {
#include <locale.h> /* struct lconv */
+PyAPI_DATA(int) _Py_HasFileSystemDefaultEncodeErrors;
+
PyAPI_FUNC(int) _Py_DecodeUTF8Ex(
const char *arg,
Py_ssize_t arglen,