summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-09-30 22:46:42 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2019-09-30 22:46:42 (GMT)
commitbdace21b769998396d0ccc8da99a8ca9b507bfdf (patch)
treede149589d8dd498ddf3574e9d9551951d3f7e79b /Doc/c-api
parent92ca515ee1efbdc51678e12d105ad642c9b9cc13 (diff)
downloadcpython-bdace21b769998396d0ccc8da99a8ca9b507bfdf.zip
cpython-bdace21b769998396d0ccc8da99a8ca9b507bfdf.tar.gz
cpython-bdace21b769998396d0ccc8da99a8ca9b507bfdf.tar.bz2
bpo-38304: Remove PyConfig.struct_size (GH-16500)
For now, we'll rely on the fact that the config structures aren't covered by the stable ABI. We may revisit this in the future if we further explore the idea of offering a stable embedding API.
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/init_config.rst39
1 files changed, 3 insertions, 36 deletions
diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst
index 4c77d5d..15b8b94 100644
--- a/Doc/c-api/init_config.rst
+++ b/Doc/c-api/init_config.rst
@@ -194,25 +194,18 @@ PyPreConfig
* Configure the LC_CTYPE locale
* Set the UTF-8 mode
- The :c:member:`struct_size` field must be explicitly initialized to
- ``sizeof(PyPreConfig)``.
-
Function to initialize a preconfiguration:
- .. c:function:: PyStatus PyPreConfig_InitIsolatedConfig(PyPreConfig *preconfig)
+ .. c:function:: void PyPreConfig_InitIsolatedConfig(PyPreConfig *preconfig)
Initialize the preconfiguration with :ref:`Python Configuration
<init-python-config>`.
- .. c:function:: PyStatus PyPreConfig_InitPythonConfig(PyPreConfig *preconfig)
+ .. c:function:: void PyPreConfig_InitPythonConfig(PyPreConfig *preconfig)
Initialize the preconfiguration with :ref:`Isolated Configuration
<init-isolated-conf>`.
- The caller of these functions is responsible to handle exceptions (error or
- exit) using :c:func:`PyStatus_Exception` and
- :c:func:`Py_ExitStatusException`.
-
Structure fields:
.. c:member:: int allocator
@@ -274,13 +267,6 @@ PyPreConfig
same way the regular Python parses command line arguments: see
:ref:`Command Line Arguments <using-on-cmdline>`.
- .. c:member:: size_t struct_size
-
- Size of the structure in bytes: must be initialized to
- ``sizeof(PyPreConfig)``.
-
- Field used for API and ABI compatibility.
-
.. c:member:: int use_environment
See :c:member:`PyConfig.use_environment`.
@@ -332,12 +318,7 @@ Example using the preinitialization to enable the UTF-8 Mode::
PyStatus status;
PyPreConfig preconfig;
- preconfig.struct_size = sizeof(PyPreConfig);
-
- status = PyPreConfig_InitPythonConfig(&preconfig);
- if (PyStatus_Exception(status)) {
- Py_ExitStatusException(status);
- }
+ PyPreConfig_InitPythonConfig(&preconfig);
preconfig.utf8_mode = 1;
@@ -360,9 +341,6 @@ PyConfig
Structure containing most parameters to configure Python.
- The :c:member:`struct_size` field must be explicitly initialized to
- ``sizeof(PyConfig)``.
-
Structure methods:
.. c:function:: PyStatus PyConfig_InitPythonConfig(PyConfig *config)
@@ -679,13 +657,6 @@ PyConfig
Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and
:data:`sys.stderr`.
- .. c:member:: size_t struct_size
-
- Size of the structure in bytes: must be initialized to
- ``sizeof(PyConfig)``.
-
- Field used for API and ABI compatibility.
-
.. c:member:: int tracemalloc
If non-zero, call :func:`tracemalloc.start` at startup.
@@ -754,7 +725,6 @@ Example setting the program name::
{
PyStatus status;
PyConfig config;
- config.struct_size = sizeof(PyConfig);
status = PyConfig_InitPythonConfig(&config);
if (PyStatus_Exception(status)) {
@@ -787,7 +757,6 @@ configuration, and then override some parameters::
{
PyStatus status;
PyConfig config;
- config.struct_size = sizeof(PyConfig);
status = PyConfig_InitPythonConfig(&config);
if (PyStatus_Exception(status)) {
@@ -875,7 +844,6 @@ Example of customized Python always running in isolated mode::
{
PyStatus status;
PyConfig config;
- config.struct_size = sizeof(PyConfig);
status = PyConfig_InitPythonConfig(&config);
if (PyStatus_Exception(status)) {
@@ -1067,7 +1035,6 @@ phases::
{
PyStatus status;
PyConfig config;
- config.struct_size = sizeof(PyConfig);
status = PyConfig_InitPythonConfig(&config);
if (PyStatus_Exception(status)) {