Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
36242fd8
Commit
36242fd8
authored
Jul 01, 2019
by
Victor Stinner
Committed by
GitHub
Jul 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-36763: Add PyConfig_SetWideStringList() (GH-14444)
parent
e21b45a8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
1 deletion
+29
-1
Doc/c-api/init_config.rst
Doc/c-api/init_config.rst
+7
-0
Include/cpython/initconfig.h
Include/cpython/initconfig.h
+3
-0
Misc/NEWS.d/next/C API/2019-06-28-15-49-16.bpo-36763.zrmgki.rst
...EWS.d/next/C API/2019-06-28-15-49-16.bpo-36763.zrmgki.rst
+1
-0
Python/initconfig.c
Python/initconfig.c
+18
-1
No files found.
Doc/c-api/init_config.rst
View file @
36242fd8
...
...
@@ -25,6 +25,7 @@ Functions:
* :c:func:`PyConfig_SetBytesArgv`
* :c:func:`PyConfig_SetBytesString`
* :c:func:`PyConfig_SetString`
* :c:func:`PyConfig_SetWideStringList`
* :c:func:`PyPreConfig_InitIsolatedConfig`
* :c:func:`PyPreConfig_InitPythonConfig`
* :c:func:`PyStatus_Error`
...
...
@@ -368,6 +369,12 @@ PyConfig
Preinitialize Python if needed.
.. c:function:: PyStatus PyConfig_SetWideStringList(PyConfig *config, PyWideStringList *list, Py_ssize_t length, wchar_t **items)
Set the list of wide strings *list* to *length* and *items*.
Preinitialize Python if needed.
.. c:function:: PyStatus PyConfig_Read(PyConfig *config)
Read all Python configuration.
...
...
Include/cpython/initconfig.h
View file @
36242fd8
...
...
@@ -422,6 +422,9 @@ PyAPI_FUNC(PyStatus) PyConfig_SetBytesArgv(
PyAPI_FUNC
(
PyStatus
)
PyConfig_SetArgv
(
PyConfig
*
config
,
Py_ssize_t
argc
,
wchar_t
*
const
*
argv
);
PyAPI_FUNC
(
PyStatus
)
PyConfig_SetWideStringList
(
PyConfig
*
config
,
PyWideStringList
*
list
,
Py_ssize_t
length
,
wchar_t
**
items
);
#ifdef __cplusplus
}
...
...
Misc/NEWS.d/next/C API/2019-06-28-15-49-16.bpo-36763.zrmgki.rst
0 → 100644
View file @
36242fd8
Add :func:`PyConfig_SetWideStringList` function.
Python/initconfig.c
View file @
36242fd8
...
...
@@ -732,7 +732,7 @@ _PyConfig_Copy(PyConfig *config, const PyConfig *config2)
} while (0)
#define COPY_WSTRLIST(LIST) \
do { \
if (_PyWideStringList_Copy(&config->LIST, &config2->LIST) < 0
) { \
if (_PyWideStringList_Copy(&config->LIST, &config2->LIST) < 0) { \
return _PyStatus_NO_MEMORY(); \
} \
} while (0)
...
...
@@ -2324,6 +2324,23 @@ PyConfig_SetArgv(PyConfig *config, Py_ssize_t argc, wchar_t * const *argv)
}
PyStatus
PyConfig_SetWideStringList
(
PyConfig
*
config
,
PyWideStringList
*
list
,
Py_ssize_t
length
,
wchar_t
**
items
)
{
PyStatus
status
=
_Py_PreInitializeFromConfig
(
config
,
NULL
);
if
(
_PyStatus_EXCEPTION
(
status
))
{
return
status
;
}
PyWideStringList
list2
=
{.
length
=
length
,
.
items
=
items
};
if
(
_PyWideStringList_Copy
(
list
,
&
list2
)
<
0
)
{
return
_PyStatus_NO_MEMORY
();
}
return
_PyStatus_OK
();
}
/* Read the configuration into PyConfig from:
* Command line arguments
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment