@plone/volto 14.0.0 → 14.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/locales/ca/LC_MESSAGES/volto.po +12 -2
  3. package/locales/ca.json +1 -1
  4. package/locales/de/LC_MESSAGES/volto.po +12 -2
  5. package/locales/de.json +1 -1
  6. package/locales/en/LC_MESSAGES/volto.po +12 -2
  7. package/locales/en.json +1 -1
  8. package/locales/es/LC_MESSAGES/volto.po +12 -2
  9. package/locales/es.json +1 -1
  10. package/locales/eu/LC_MESSAGES/volto.po +12 -2
  11. package/locales/eu.json +1 -1
  12. package/locales/fr/LC_MESSAGES/volto.po +12 -2
  13. package/locales/fr.json +1 -1
  14. package/locales/it/LC_MESSAGES/volto.po +12 -2
  15. package/locales/it.json +1 -1
  16. package/locales/ja/LC_MESSAGES/volto.po +12 -2
  17. package/locales/ja.json +1 -1
  18. package/locales/nl/LC_MESSAGES/volto.po +12 -2
  19. package/locales/nl.json +1 -1
  20. package/locales/pt/LC_MESSAGES/volto.po +12 -2
  21. package/locales/pt.json +1 -1
  22. package/locales/pt_BR/LC_MESSAGES/volto.po +12 -2
  23. package/locales/pt_BR.json +1 -1
  24. package/locales/ro/LC_MESSAGES/volto.po +12 -2
  25. package/locales/ro.json +1 -1
  26. package/locales/volto.pot +12 -2
  27. package/package.json +2 -1
  28. package/public/icon.svg +13 -0
  29. package/src/actions/vocabularies/vocabularies.js +15 -3
  30. package/src/components/index.js +1 -0
  31. package/src/components/manage/Blocks/HeroImageLeft/Edit.jsx +1 -1
  32. package/src/components/manage/Blocks/Listing/getAsyncData.js +1 -1
  33. package/src/components/manage/Blocks/Text/Edit.jsx +19 -0
  34. package/src/components/manage/Form/Form.jsx +11 -1
  35. package/src/components/manage/Form/UndoToolbar.jsx +78 -0
  36. package/src/components/manage/Widgets/AlignWidget.stories.jsx +5 -21
  37. package/src/components/manage/Widgets/ArrayWidget.jsx +83 -101
  38. package/src/components/manage/Widgets/ArrayWidget.stories.jsx +29 -64
  39. package/src/components/manage/Widgets/CheckboxWidget.stories.jsx +5 -22
  40. package/src/components/manage/Widgets/DatetimeWidget.jsx +65 -74
  41. package/src/components/manage/Widgets/DatetimeWidget.stories.jsx +7 -23
  42. package/src/components/manage/Widgets/DatetimeWidget.test.jsx +17 -15
  43. package/src/components/manage/Widgets/EmailWidget.stories.jsx +5 -22
  44. package/src/components/manage/Widgets/FileWidget.stories.jsx +5 -22
  45. package/src/components/manage/Widgets/NumberWidget.stories.jsx +5 -23
  46. package/src/components/manage/Widgets/ObjectBrowserWidget.stories.js +24 -32
  47. package/src/components/manage/Widgets/ObjectListWidget.stories.js +44 -44
  48. package/src/components/manage/Widgets/ObjectWidget.stories.jsx +13 -28
  49. package/src/components/manage/Widgets/PasswordWidget.stories.jsx +5 -22
  50. package/src/components/manage/Widgets/QueryWidget.jsx +2 -2
  51. package/src/components/manage/Widgets/QueryWidget.stories.jsx +1637 -22
  52. package/src/components/manage/Widgets/SelectAutoComplete.jsx +79 -48
  53. package/src/components/manage/Widgets/SelectAutoComplete.test.jsx +16 -0
  54. package/src/components/manage/Widgets/SelectAutocompleteWidget.stories.jsx +161 -0
  55. package/src/components/manage/Widgets/SelectUtils.js +90 -30
  56. package/src/components/manage/Widgets/SelectUtils.test.jsx +76 -1
  57. package/src/components/manage/Widgets/SelectWidget.jsx +26 -37
  58. package/src/components/manage/Widgets/SelectWidget.stories.jsx +96 -28
  59. package/src/components/manage/Widgets/TextWidget.stories.jsx +5 -22
  60. package/src/components/manage/Widgets/TextareaWidget.stories.jsx +5 -22
  61. package/src/components/manage/Widgets/TokenWidget.jsx +19 -17
  62. package/src/components/manage/Widgets/TokenWidget.stories.jsx +141 -0
  63. package/src/components/manage/Widgets/UrlWidget.stories.jsx +5 -21
  64. package/src/components/manage/Widgets/VocabularyTermsWidget.stories.js +27 -64
  65. package/src/components/manage/Widgets/WysiwygWidget.stories.jsx +5 -22
  66. package/src/components/manage/Widgets/story.jsx +38 -0
  67. package/src/components/theme/ContactForm/ContactForm.jsx +1 -0
  68. package/src/components/theme/ContactForm/ContactForm.stories.jsx +126 -0
  69. package/src/components/theme/CorsError/CorsError.jsx +2 -2
  70. package/src/config/Loadables.jsx +2 -0
  71. package/src/config/index.js +1 -0
  72. package/src/helpers/Html/Html.jsx +2 -12
  73. package/src/helpers/UndoManager/useUndoManager.js +102 -0
  74. package/src/helpers/index.js +1 -0
  75. package/src/middleware/Api.test.js +57 -6
  76. package/src/middleware/api.js +34 -13
  77. package/src/reducers/vocabularies/vocabularies.js +13 -2
  78. package/src/store.js +1 -1
  79. package/src/storybook.jsx +55 -0
  80. package/theme/themes/pastanaga/extras/time-picker-overrides.less +1 -1
  81. package/include/python3.8/Python-ast.h +0 -715
  82. package/include/python3.8/Python.h +0 -160
  83. package/include/python3.8/abstract.h +0 -844
  84. package/include/python3.8/asdl.h +0 -46
  85. package/include/python3.8/ast.h +0 -37
  86. package/include/python3.8/bitset.h +0 -23
  87. package/include/python3.8/bltinmodule.h +0 -14
  88. package/include/python3.8/boolobject.h +0 -34
  89. package/include/python3.8/bytearrayobject.h +0 -62
  90. package/include/python3.8/bytes_methods.h +0 -69
  91. package/include/python3.8/bytesobject.h +0 -224
  92. package/include/python3.8/cellobject.h +0 -29
  93. package/include/python3.8/ceval.h +0 -231
  94. package/include/python3.8/classobject.h +0 -59
  95. package/include/python3.8/code.h +0 -180
  96. package/include/python3.8/codecs.h +0 -240
  97. package/include/python3.8/compile.h +0 -106
  98. package/include/python3.8/complexobject.h +0 -69
  99. package/include/python3.8/context.h +0 -84
  100. package/include/python3.8/cpython/abstract.h +0 -319
  101. package/include/python3.8/cpython/dictobject.h +0 -94
  102. package/include/python3.8/cpython/fileobject.h +0 -24
  103. package/include/python3.8/cpython/initconfig.h +0 -434
  104. package/include/python3.8/cpython/interpreteridobject.h +0 -19
  105. package/include/python3.8/cpython/object.h +0 -470
  106. package/include/python3.8/cpython/objimpl.h +0 -113
  107. package/include/python3.8/cpython/pyerrors.h +0 -188
  108. package/include/python3.8/cpython/pylifecycle.h +0 -78
  109. package/include/python3.8/cpython/pymem.h +0 -108
  110. package/include/python3.8/cpython/pystate.h +0 -252
  111. package/include/python3.8/cpython/sysmodule.h +0 -21
  112. package/include/python3.8/cpython/traceback.h +0 -22
  113. package/include/python3.8/cpython/tupleobject.h +0 -36
  114. package/include/python3.8/cpython/unicodeobject.h +0 -1239
  115. package/include/python3.8/datetime.h +0 -259
  116. package/include/python3.8/descrobject.h +0 -108
  117. package/include/python3.8/dictobject.h +0 -94
  118. package/include/python3.8/dtoa.h +0 -19
  119. package/include/python3.8/dynamic_annotations.h +0 -499
  120. package/include/python3.8/enumobject.h +0 -17
  121. package/include/python3.8/errcode.h +0 -38
  122. package/include/python3.8/eval.h +0 -37
  123. package/include/python3.8/fileobject.h +0 -49
  124. package/include/python3.8/fileutils.h +0 -185
  125. package/include/python3.8/floatobject.h +0 -130
  126. package/include/python3.8/frameobject.h +0 -92
  127. package/include/python3.8/funcobject.h +0 -104
  128. package/include/python3.8/genobject.h +0 -109
  129. package/include/python3.8/graminit.h +0 -94
  130. package/include/python3.8/grammar.h +0 -77
  131. package/include/python3.8/import.h +0 -149
  132. package/include/python3.8/internal/pycore_accu.h +0 -39
  133. package/include/python3.8/internal/pycore_atomic.h +0 -558
  134. package/include/python3.8/internal/pycore_ceval.h +0 -37
  135. package/include/python3.8/internal/pycore_code.h +0 -27
  136. package/include/python3.8/internal/pycore_condvar.h +0 -95
  137. package/include/python3.8/internal/pycore_context.h +0 -42
  138. package/include/python3.8/internal/pycore_fileutils.h +0 -54
  139. package/include/python3.8/internal/pycore_getopt.h +0 -22
  140. package/include/python3.8/internal/pycore_gil.h +0 -50
  141. package/include/python3.8/internal/pycore_hamt.h +0 -116
  142. package/include/python3.8/internal/pycore_initconfig.h +0 -166
  143. package/include/python3.8/internal/pycore_object.h +0 -81
  144. package/include/python3.8/internal/pycore_pathconfig.h +0 -75
  145. package/include/python3.8/internal/pycore_pyerrors.h +0 -62
  146. package/include/python3.8/internal/pycore_pyhash.h +0 -10
  147. package/include/python3.8/internal/pycore_pylifecycle.h +0 -118
  148. package/include/python3.8/internal/pycore_pymem.h +0 -212
  149. package/include/python3.8/internal/pycore_pystate.h +0 -326
  150. package/include/python3.8/internal/pycore_traceback.h +0 -96
  151. package/include/python3.8/internal/pycore_tupleobject.h +0 -19
  152. package/include/python3.8/internal/pycore_warnings.h +0 -25
  153. package/include/python3.8/interpreteridobject.h +0 -17
  154. package/include/python3.8/intrcheck.h +0 -33
  155. package/include/python3.8/iterobject.h +0 -25
  156. package/include/python3.8/listobject.h +0 -81
  157. package/include/python3.8/longintrepr.h +0 -99
  158. package/include/python3.8/longobject.h +0 -242
  159. package/include/python3.8/marshal.h +0 -28
  160. package/include/python3.8/memoryobject.h +0 -72
  161. package/include/python3.8/methodobject.h +0 -131
  162. package/include/python3.8/modsupport.h +0 -248
  163. package/include/python3.8/moduleobject.h +0 -90
  164. package/include/python3.8/namespaceobject.h +0 -19
  165. package/include/python3.8/node.h +0 -48
  166. package/include/python3.8/object.h +0 -753
  167. package/include/python3.8/objimpl.h +0 -284
  168. package/include/python3.8/odictobject.h +0 -43
  169. package/include/python3.8/opcode.h +0 -148
  170. package/include/python3.8/osdefs.h +0 -51
  171. package/include/python3.8/osmodule.h +0 -17
  172. package/include/python3.8/parsetok.h +0 -110
  173. package/include/python3.8/patchlevel.h +0 -35
  174. package/include/python3.8/picklebufobject.h +0 -31
  175. package/include/python3.8/py_curses.h +0 -100
  176. package/include/python3.8/pyarena.h +0 -64
  177. package/include/python3.8/pycapsule.h +0 -59
  178. package/include/python3.8/pyconfig.h +0 -1665
  179. package/include/python3.8/pyctype.h +0 -39
  180. package/include/python3.8/pydebug.h +0 -40
  181. package/include/python3.8/pydtrace.h +0 -59
  182. package/include/python3.8/pydtrace_probes.h +0 -228
  183. package/include/python3.8/pyerrors.h +0 -335
  184. package/include/python3.8/pyexpat.h +0 -55
  185. package/include/python3.8/pyfpe.h +0 -12
  186. package/include/python3.8/pyhash.h +0 -145
  187. package/include/python3.8/pylifecycle.h +0 -75
  188. package/include/python3.8/pymacconfig.h +0 -102
  189. package/include/python3.8/pymacro.h +0 -106
  190. package/include/python3.8/pymath.h +0 -230
  191. package/include/python3.8/pymem.h +0 -150
  192. package/include/python3.8/pyport.h +0 -850
  193. package/include/python3.8/pystate.h +0 -136
  194. package/include/python3.8/pystrcmp.h +0 -23
  195. package/include/python3.8/pystrhex.h +0 -22
  196. package/include/python3.8/pystrtod.h +0 -45
  197. package/include/python3.8/pythonrun.h +0 -210
  198. package/include/python3.8/pythread.h +0 -161
  199. package/include/python3.8/pytime.h +0 -246
  200. package/include/python3.8/rangeobject.h +0 -27
  201. package/include/python3.8/setobject.h +0 -108
  202. package/include/python3.8/sliceobject.h +0 -65
  203. package/include/python3.8/structmember.h +0 -74
  204. package/include/python3.8/structseq.h +0 -49
  205. package/include/python3.8/symtable.h +0 -123
  206. package/include/python3.8/sysmodule.h +0 -41
  207. package/include/python3.8/token.h +0 -92
  208. package/include/python3.8/traceback.h +0 -28
  209. package/include/python3.8/tracemalloc.h +0 -38
  210. package/include/python3.8/tupleobject.h +0 -48
  211. package/include/python3.8/typeslots.h +0 -85
  212. package/include/python3.8/ucnhash.h +0 -36
  213. package/include/python3.8/unicodeobject.h +0 -1044
  214. package/include/python3.8/warnings.h +0 -67
  215. package/include/python3.8/weakrefobject.h +0 -86
  216. package/src/components/theme/ContactForm/ContactForm.stories.mdx +0 -39
@@ -1,136 +0,0 @@
1
- /* Thread and interpreter state structures and their interfaces */
2
-
3
-
4
- #ifndef Py_PYSTATE_H
5
- #define Py_PYSTATE_H
6
- #ifdef __cplusplus
7
- extern "C" {
8
- #endif
9
-
10
- #include "pythread.h"
11
-
12
- /* This limitation is for performance and simplicity. If needed it can be
13
- removed (with effort). */
14
- #define MAX_CO_EXTRA_USERS 255
15
-
16
- /* Forward declarations for PyFrameObject, PyThreadState
17
- and PyInterpreterState */
18
- struct _frame;
19
- struct _ts;
20
- struct _is;
21
-
22
- /* struct _ts is defined in cpython/pystate.h */
23
- typedef struct _ts PyThreadState;
24
- /* struct _is is defined in internal/pycore_pystate.h */
25
- typedef struct _is PyInterpreterState;
26
-
27
- PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void);
28
- PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *);
29
- PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *);
30
-
31
- #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03080000
32
- /* New in 3.8 */
33
- PyAPI_FUNC(PyObject *) PyInterpreterState_GetDict(PyInterpreterState *);
34
- #endif
35
-
36
- #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
37
- /* New in 3.7 */
38
- PyAPI_FUNC(int64_t) PyInterpreterState_GetID(PyInterpreterState *);
39
- #endif
40
- #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
41
-
42
- /* State unique per thread */
43
-
44
- /* New in 3.3 */
45
- PyAPI_FUNC(int) PyState_AddModule(PyObject*, struct PyModuleDef*);
46
- PyAPI_FUNC(int) PyState_RemoveModule(struct PyModuleDef*);
47
- #endif
48
- PyAPI_FUNC(PyObject*) PyState_FindModule(struct PyModuleDef*);
49
-
50
- PyAPI_FUNC(PyThreadState *) PyThreadState_New(PyInterpreterState *);
51
- PyAPI_FUNC(void) PyThreadState_Clear(PyThreadState *);
52
- PyAPI_FUNC(void) PyThreadState_Delete(PyThreadState *);
53
- PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void);
54
-
55
- /* Get the current thread state.
56
-
57
- When the current thread state is NULL, this issues a fatal error (so that
58
- the caller needn't check for NULL).
59
-
60
- The caller must hold the GIL.
61
-
62
- See also PyThreadState_GET() and _PyThreadState_GET(). */
63
- PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void);
64
-
65
- /* Get the current Python thread state.
66
-
67
- Macro using PyThreadState_Get() or _PyThreadState_GET() depending if
68
- pycore_pystate.h is included or not (this header redefines the macro).
69
-
70
- If PyThreadState_Get() is used, issue a fatal error if the current thread
71
- state is NULL.
72
-
73
- See also PyThreadState_Get() and _PyThreadState_GET(). */
74
- #define PyThreadState_GET() PyThreadState_Get()
75
-
76
- PyAPI_FUNC(PyThreadState *) PyThreadState_Swap(PyThreadState *);
77
- PyAPI_FUNC(PyObject *) PyThreadState_GetDict(void);
78
- PyAPI_FUNC(int) PyThreadState_SetAsyncExc(unsigned long, PyObject *);
79
-
80
- typedef
81
- enum {PyGILState_LOCKED, PyGILState_UNLOCKED}
82
- PyGILState_STATE;
83
-
84
-
85
- /* Ensure that the current thread is ready to call the Python
86
- C API, regardless of the current state of Python, or of its
87
- thread lock. This may be called as many times as desired
88
- by a thread so long as each call is matched with a call to
89
- PyGILState_Release(). In general, other thread-state APIs may
90
- be used between _Ensure() and _Release() calls, so long as the
91
- thread-state is restored to its previous state before the Release().
92
- For example, normal use of the Py_BEGIN_ALLOW_THREADS/
93
- Py_END_ALLOW_THREADS macros are acceptable.
94
-
95
- The return value is an opaque "handle" to the thread state when
96
- PyGILState_Ensure() was called, and must be passed to
97
- PyGILState_Release() to ensure Python is left in the same state. Even
98
- though recursive calls are allowed, these handles can *not* be shared -
99
- each unique call to PyGILState_Ensure must save the handle for its
100
- call to PyGILState_Release.
101
-
102
- When the function returns, the current thread will hold the GIL.
103
-
104
- Failure is a fatal error.
105
- */
106
- PyAPI_FUNC(PyGILState_STATE) PyGILState_Ensure(void);
107
-
108
- /* Release any resources previously acquired. After this call, Python's
109
- state will be the same as it was prior to the corresponding
110
- PyGILState_Ensure() call (but generally this state will be unknown to
111
- the caller, hence the use of the GILState API.)
112
-
113
- Every call to PyGILState_Ensure must be matched by a call to
114
- PyGILState_Release on the same thread.
115
- */
116
- PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE);
117
-
118
- /* Helper/diagnostic function - get the current thread state for
119
- this thread. May return NULL if no GILState API has been used
120
- on the current thread. Note that the main thread always has such a
121
- thread-state, even if no auto-thread-state call has been made
122
- on the main thread.
123
- */
124
- PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void);
125
-
126
-
127
- #ifndef Py_LIMITED_API
128
- # define Py_CPYTHON_PYSTATE_H
129
- # include "cpython/pystate.h"
130
- # undef Py_CPYTHON_PYSTATE_H
131
- #endif
132
-
133
- #ifdef __cplusplus
134
- }
135
- #endif
136
- #endif /* !Py_PYSTATE_H */
@@ -1,23 +0,0 @@
1
- #ifndef Py_STRCMP_H
2
- #define Py_STRCMP_H
3
-
4
- #ifdef __cplusplus
5
- extern "C" {
6
- #endif
7
-
8
- PyAPI_FUNC(int) PyOS_mystrnicmp(const char *, const char *, Py_ssize_t);
9
- PyAPI_FUNC(int) PyOS_mystricmp(const char *, const char *);
10
-
11
- #ifdef MS_WINDOWS
12
- #define PyOS_strnicmp strnicmp
13
- #define PyOS_stricmp stricmp
14
- #else
15
- #define PyOS_strnicmp PyOS_mystrnicmp
16
- #define PyOS_stricmp PyOS_mystricmp
17
- #endif
18
-
19
- #ifdef __cplusplus
20
- }
21
- #endif
22
-
23
- #endif /* !Py_STRCMP_H */
@@ -1,22 +0,0 @@
1
- #ifndef Py_STRHEX_H
2
- #define Py_STRHEX_H
3
-
4
- #ifdef __cplusplus
5
- extern "C" {
6
- #endif
7
-
8
- #ifndef Py_LIMITED_API
9
- /* Returns a str() containing the hex representation of argbuf. */
10
- PyAPI_FUNC(PyObject*) _Py_strhex(const char* argbuf, const Py_ssize_t arglen);
11
- /* Returns a bytes() containing the ASCII hex representation of argbuf. */
12
- PyAPI_FUNC(PyObject*) _Py_strhex_bytes(const char* argbuf, const Py_ssize_t arglen);
13
- /* These variants include support for a separator between every N bytes: */
14
- PyAPI_FUNC(PyObject*) _Py_strhex_with_sep(const char* argbuf, const Py_ssize_t arglen, const PyObject* sep, const int bytes_per_group);
15
- PyAPI_FUNC(PyObject*) _Py_strhex_bytes_with_sep(const char* argbuf, const Py_ssize_t arglen, const PyObject* sep, const int bytes_per_group);
16
- #endif /* !Py_LIMITED_API */
17
-
18
- #ifdef __cplusplus
19
- }
20
- #endif
21
-
22
- #endif /* !Py_STRHEX_H */
@@ -1,45 +0,0 @@
1
- #ifndef Py_STRTOD_H
2
- #define Py_STRTOD_H
3
-
4
- #ifdef __cplusplus
5
- extern "C" {
6
- #endif
7
-
8
-
9
- PyAPI_FUNC(double) PyOS_string_to_double(const char *str,
10
- char **endptr,
11
- PyObject *overflow_exception);
12
-
13
- /* The caller is responsible for calling PyMem_Free to free the buffer
14
- that's is returned. */
15
- PyAPI_FUNC(char *) PyOS_double_to_string(double val,
16
- char format_code,
17
- int precision,
18
- int flags,
19
- int *type);
20
-
21
- #ifndef Py_LIMITED_API
22
- PyAPI_FUNC(PyObject *) _Py_string_to_number_with_underscores(
23
- const char *str, Py_ssize_t len, const char *what, PyObject *obj, void *arg,
24
- PyObject *(*innerfunc)(const char *, Py_ssize_t, void *));
25
-
26
- PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr);
27
- #endif
28
-
29
-
30
- /* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */
31
- #define Py_DTSF_SIGN 0x01 /* always add the sign */
32
- #define Py_DTSF_ADD_DOT_0 0x02 /* if the result is an integer add ".0" */
33
- #define Py_DTSF_ALT 0x04 /* "alternate" formatting. it's format_code
34
- specific */
35
-
36
- /* PyOS_double_to_string's "type", if non-NULL, will be set to one of: */
37
- #define Py_DTST_FINITE 0
38
- #define Py_DTST_INFINITE 1
39
- #define Py_DTST_NAN 2
40
-
41
- #ifdef __cplusplus
42
- }
43
- #endif
44
-
45
- #endif /* !Py_STRTOD_H */
@@ -1,210 +0,0 @@
1
-
2
- /* Interfaces to parse and execute pieces of python code */
3
-
4
- #ifndef Py_PYTHONRUN_H
5
- #define Py_PYTHONRUN_H
6
- #ifdef __cplusplus
7
- extern "C" {
8
- #endif
9
-
10
- #ifndef Py_LIMITED_API
11
- PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
12
- PyAPI_FUNC(int) PyRun_AnyFileExFlags(
13
- FILE *fp,
14
- const char *filename, /* decoded from the filesystem encoding */
15
- int closeit,
16
- PyCompilerFlags *flags);
17
- PyAPI_FUNC(int) PyRun_SimpleFileExFlags(
18
- FILE *fp,
19
- const char *filename, /* decoded from the filesystem encoding */
20
- int closeit,
21
- PyCompilerFlags *flags);
22
- PyAPI_FUNC(int) PyRun_InteractiveOneFlags(
23
- FILE *fp,
24
- const char *filename, /* decoded from the filesystem encoding */
25
- PyCompilerFlags *flags);
26
- PyAPI_FUNC(int) PyRun_InteractiveOneObject(
27
- FILE *fp,
28
- PyObject *filename,
29
- PyCompilerFlags *flags);
30
- PyAPI_FUNC(int) PyRun_InteractiveLoopFlags(
31
- FILE *fp,
32
- const char *filename, /* decoded from the filesystem encoding */
33
- PyCompilerFlags *flags);
34
-
35
- PyAPI_FUNC(struct _mod *) PyParser_ASTFromString(
36
- const char *s,
37
- const char *filename, /* decoded from the filesystem encoding */
38
- int start,
39
- PyCompilerFlags *flags,
40
- PyArena *arena);
41
- PyAPI_FUNC(struct _mod *) PyParser_ASTFromStringObject(
42
- const char *s,
43
- PyObject *filename,
44
- int start,
45
- PyCompilerFlags *flags,
46
- PyArena *arena);
47
- PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(
48
- FILE *fp,
49
- const char *filename, /* decoded from the filesystem encoding */
50
- const char* enc,
51
- int start,
52
- const char *ps1,
53
- const char *ps2,
54
- PyCompilerFlags *flags,
55
- int *errcode,
56
- PyArena *arena);
57
- PyAPI_FUNC(struct _mod *) PyParser_ASTFromFileObject(
58
- FILE *fp,
59
- PyObject *filename,
60
- const char* enc,
61
- int start,
62
- const char *ps1,
63
- const char *ps2,
64
- PyCompilerFlags *flags,
65
- int *errcode,
66
- PyArena *arena);
67
- #endif
68
-
69
- #ifndef PyParser_SimpleParseString
70
- #define PyParser_SimpleParseString(S, B) \
71
- PyParser_SimpleParseStringFlags(S, B, 0)
72
- #define PyParser_SimpleParseFile(FP, S, B) \
73
- PyParser_SimpleParseFileFlags(FP, S, B, 0)
74
- #endif
75
- PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlags(const char *, int,
76
- int);
77
- #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
78
- PyAPI_FUNC(struct _node *) PyParser_SimpleParseStringFlagsFilename(const char *,
79
- const char *,
80
- int, int);
81
- #endif
82
- PyAPI_FUNC(struct _node *) PyParser_SimpleParseFileFlags(FILE *, const char *,
83
- int, int);
84
-
85
- #ifndef Py_LIMITED_API
86
- PyAPI_FUNC(PyObject *) PyRun_StringFlags(const char *, int, PyObject *,
87
- PyObject *, PyCompilerFlags *);
88
-
89
- PyAPI_FUNC(PyObject *) PyRun_FileExFlags(
90
- FILE *fp,
91
- const char *filename, /* decoded from the filesystem encoding */
92
- int start,
93
- PyObject *globals,
94
- PyObject *locals,
95
- int closeit,
96
- PyCompilerFlags *flags);
97
- #endif
98
-
99
- #ifdef Py_LIMITED_API
100
- PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int);
101
- #else
102
- #define Py_CompileString(str, p, s) Py_CompileStringExFlags(str, p, s, NULL, -1)
103
- #define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags(str, p, s, f, -1)
104
- PyAPI_FUNC(PyObject *) Py_CompileStringExFlags(
105
- const char *str,
106
- const char *filename, /* decoded from the filesystem encoding */
107
- int start,
108
- PyCompilerFlags *flags,
109
- int optimize);
110
- PyAPI_FUNC(PyObject *) Py_CompileStringObject(
111
- const char *str,
112
- PyObject *filename, int start,
113
- PyCompilerFlags *flags,
114
- int optimize);
115
- #endif
116
- PyAPI_FUNC(struct symtable *) Py_SymtableString(
117
- const char *str,
118
- const char *filename, /* decoded from the filesystem encoding */
119
- int start);
120
- #ifndef Py_LIMITED_API
121
- PyAPI_FUNC(const char *) _Py_SourceAsString(
122
- PyObject *cmd,
123
- const char *funcname,
124
- const char *what,
125
- PyCompilerFlags *cf,
126
- PyObject **cmd_copy);
127
-
128
- PyAPI_FUNC(struct symtable *) Py_SymtableStringObject(
129
- const char *str,
130
- PyObject *filename,
131
- int start);
132
-
133
- PyAPI_FUNC(struct symtable *) _Py_SymtableStringObjectFlags(
134
- const char *str,
135
- PyObject *filename,
136
- int start,
137
- PyCompilerFlags *flags);
138
- #endif
139
-
140
- PyAPI_FUNC(void) PyErr_Print(void);
141
- PyAPI_FUNC(void) PyErr_PrintEx(int);
142
- PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *);
143
-
144
- #ifndef Py_LIMITED_API
145
- /* A function flavor is also exported by libpython. It is required when
146
- libpython is accessed directly rather than using header files which defines
147
- macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to
148
- export functions in pythonXX.dll. */
149
- PyAPI_FUNC(PyObject *) PyRun_String(const char *str, int s, PyObject *g, PyObject *l);
150
- PyAPI_FUNC(int) PyRun_AnyFile(FILE *fp, const char *name);
151
- PyAPI_FUNC(int) PyRun_AnyFileEx(FILE *fp, const char *name, int closeit);
152
- PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
153
- PyAPI_FUNC(int) PyRun_SimpleString(const char *s);
154
- PyAPI_FUNC(int) PyRun_SimpleFile(FILE *f, const char *p);
155
- PyAPI_FUNC(int) PyRun_SimpleFileEx(FILE *f, const char *p, int c);
156
- PyAPI_FUNC(int) PyRun_InteractiveOne(FILE *f, const char *p);
157
- PyAPI_FUNC(int) PyRun_InteractiveLoop(FILE *f, const char *p);
158
- PyAPI_FUNC(PyObject *) PyRun_File(FILE *fp, const char *p, int s, PyObject *g, PyObject *l);
159
- PyAPI_FUNC(PyObject *) PyRun_FileEx(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, int c);
160
- PyAPI_FUNC(PyObject *) PyRun_FileFlags(FILE *fp, const char *p, int s, PyObject *g, PyObject *l, PyCompilerFlags *flags);
161
-
162
- /* Use macros for a bunch of old variants */
163
- #define PyRun_String(str, s, g, l) PyRun_StringFlags(str, s, g, l, NULL)
164
- #define PyRun_AnyFile(fp, name) PyRun_AnyFileExFlags(fp, name, 0, NULL)
165
- #define PyRun_AnyFileEx(fp, name, closeit) \
166
- PyRun_AnyFileExFlags(fp, name, closeit, NULL)
167
- #define PyRun_AnyFileFlags(fp, name, flags) \
168
- PyRun_AnyFileExFlags(fp, name, 0, flags)
169
- #define PyRun_SimpleString(s) PyRun_SimpleStringFlags(s, NULL)
170
- #define PyRun_SimpleFile(f, p) PyRun_SimpleFileExFlags(f, p, 0, NULL)
171
- #define PyRun_SimpleFileEx(f, p, c) PyRun_SimpleFileExFlags(f, p, c, NULL)
172
- #define PyRun_InteractiveOne(f, p) PyRun_InteractiveOneFlags(f, p, NULL)
173
- #define PyRun_InteractiveLoop(f, p) PyRun_InteractiveLoopFlags(f, p, NULL)
174
- #define PyRun_File(fp, p, s, g, l) \
175
- PyRun_FileExFlags(fp, p, s, g, l, 0, NULL)
176
- #define PyRun_FileEx(fp, p, s, g, l, c) \
177
- PyRun_FileExFlags(fp, p, s, g, l, c, NULL)
178
- #define PyRun_FileFlags(fp, p, s, g, l, flags) \
179
- PyRun_FileExFlags(fp, p, s, g, l, 0, flags)
180
- #endif
181
-
182
- /* Stuff with no proper home (yet) */
183
- #ifndef Py_LIMITED_API
184
- PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *);
185
- #endif
186
- PyAPI_DATA(int) (*PyOS_InputHook)(void);
187
- PyAPI_DATA(char) *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *);
188
- #ifndef Py_LIMITED_API
189
- PyAPI_DATA(PyThreadState*) _PyOS_ReadlineTState;
190
- #endif
191
-
192
- /* Stack size, in "pointers" (so we get extra safety margins
193
- on 64-bit platforms). On a 32-bit platform, this translates
194
- to an 8k margin. */
195
- #define PYOS_STACK_MARGIN 2048
196
-
197
- #if defined(WIN32) && !defined(MS_WIN64) && !defined(_M_ARM) && defined(_MSC_VER) && _MSC_VER >= 1300
198
- /* Enable stack checking under Microsoft C */
199
- #define USE_STACKCHECK
200
- #endif
201
-
202
- #ifdef USE_STACKCHECK
203
- /* Check that we aren't overflowing our stack */
204
- PyAPI_FUNC(int) PyOS_CheckStack(void);
205
- #endif
206
-
207
- #ifdef __cplusplus
208
- }
209
- #endif
210
- #endif /* !Py_PYTHONRUN_H */
@@ -1,161 +0,0 @@
1
-
2
- #ifndef Py_PYTHREAD_H
3
- #define Py_PYTHREAD_H
4
-
5
- typedef void *PyThread_type_lock;
6
- typedef void *PyThread_type_sema;
7
-
8
- #ifdef __cplusplus
9
- extern "C" {
10
- #endif
11
-
12
- /* Return status codes for Python lock acquisition. Chosen for maximum
13
- * backwards compatibility, ie failure -> 0, success -> 1. */
14
- typedef enum PyLockStatus {
15
- PY_LOCK_FAILURE = 0,
16
- PY_LOCK_ACQUIRED = 1,
17
- PY_LOCK_INTR
18
- } PyLockStatus;
19
-
20
- #ifndef Py_LIMITED_API
21
- #define PYTHREAD_INVALID_THREAD_ID ((unsigned long)-1)
22
- #endif
23
-
24
- PyAPI_FUNC(void) PyThread_init_thread(void);
25
- PyAPI_FUNC(unsigned long) PyThread_start_new_thread(void (*)(void *), void *);
26
- PyAPI_FUNC(void) _Py_NO_RETURN PyThread_exit_thread(void);
27
- PyAPI_FUNC(unsigned long) PyThread_get_thread_ident(void);
28
-
29
- #if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(_WIN32) || defined(_AIX)
30
- #define PY_HAVE_THREAD_NATIVE_ID
31
- PyAPI_FUNC(unsigned long) PyThread_get_thread_native_id(void);
32
- #endif
33
-
34
- PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void);
35
- PyAPI_FUNC(void) PyThread_free_lock(PyThread_type_lock);
36
- PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock, int);
37
- #define WAIT_LOCK 1
38
- #define NOWAIT_LOCK 0
39
-
40
- /* PY_TIMEOUT_T is the integral type used to specify timeouts when waiting
41
- on a lock (see PyThread_acquire_lock_timed() below).
42
- PY_TIMEOUT_MAX is the highest usable value (in microseconds) of that
43
- type, and depends on the system threading API.
44
-
45
- NOTE: this isn't the same value as `_thread.TIMEOUT_MAX`. The _thread
46
- module exposes a higher-level API, with timeouts expressed in seconds
47
- and floating-point numbers allowed.
48
- */
49
- #define PY_TIMEOUT_T long long
50
-
51
- #if defined(_POSIX_THREADS)
52
- /* PyThread_acquire_lock_timed() uses _PyTime_FromNanoseconds(us * 1000),
53
- convert microseconds to nanoseconds. */
54
- # define PY_TIMEOUT_MAX (PY_LLONG_MAX / 1000)
55
- #elif defined (NT_THREADS)
56
- /* In the NT API, the timeout is a DWORD and is expressed in milliseconds */
57
- # if 0xFFFFFFFFLL * 1000 < PY_LLONG_MAX
58
- # define PY_TIMEOUT_MAX (0xFFFFFFFFLL * 1000)
59
- # else
60
- # define PY_TIMEOUT_MAX PY_LLONG_MAX
61
- # endif
62
- #else
63
- # define PY_TIMEOUT_MAX PY_LLONG_MAX
64
- #endif
65
-
66
-
67
- /* If microseconds == 0, the call is non-blocking: it returns immediately
68
- even when the lock can't be acquired.
69
- If microseconds > 0, the call waits up to the specified duration.
70
- If microseconds < 0, the call waits until success (or abnormal failure)
71
-
72
- microseconds must be less than PY_TIMEOUT_MAX. Behaviour otherwise is
73
- undefined.
74
-
75
- If intr_flag is true and the acquire is interrupted by a signal, then the
76
- call will return PY_LOCK_INTR. The caller may reattempt to acquire the
77
- lock.
78
- */
79
- PyAPI_FUNC(PyLockStatus) PyThread_acquire_lock_timed(PyThread_type_lock,
80
- PY_TIMEOUT_T microseconds,
81
- int intr_flag);
82
-
83
- PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock);
84
-
85
- PyAPI_FUNC(size_t) PyThread_get_stacksize(void);
86
- PyAPI_FUNC(int) PyThread_set_stacksize(size_t);
87
-
88
- #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
89
- PyAPI_FUNC(PyObject*) PyThread_GetInfo(void);
90
- #endif
91
-
92
-
93
- /* Thread Local Storage (TLS) API
94
- TLS API is DEPRECATED. Use Thread Specific Storage (TSS) API.
95
-
96
- The existing TLS API has used int to represent TLS keys across all
97
- platforms, but it is not POSIX-compliant. Therefore, the new TSS API uses
98
- opaque data type to represent TSS keys to be compatible (see PEP 539).
99
- */
100
- Py_DEPRECATED(3.7) PyAPI_FUNC(int) PyThread_create_key(void);
101
- Py_DEPRECATED(3.7) PyAPI_FUNC(void) PyThread_delete_key(int key);
102
- Py_DEPRECATED(3.7) PyAPI_FUNC(int) PyThread_set_key_value(int key,
103
- void *value);
104
- Py_DEPRECATED(3.7) PyAPI_FUNC(void *) PyThread_get_key_value(int key);
105
- Py_DEPRECATED(3.7) PyAPI_FUNC(void) PyThread_delete_key_value(int key);
106
-
107
- /* Cleanup after a fork */
108
- Py_DEPRECATED(3.7) PyAPI_FUNC(void) PyThread_ReInitTLS(void);
109
-
110
-
111
- #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
112
- /* New in 3.7 */
113
- /* Thread Specific Storage (TSS) API */
114
-
115
- typedef struct _Py_tss_t Py_tss_t; /* opaque */
116
-
117
- #ifndef Py_LIMITED_API
118
- #if defined(_POSIX_THREADS)
119
- /* Darwin needs pthread.h to know type name the pthread_key_t. */
120
- # include <pthread.h>
121
- # define NATIVE_TSS_KEY_T pthread_key_t
122
- #elif defined(NT_THREADS)
123
- /* In Windows, native TSS key type is DWORD,
124
- but hardcode the unsigned long to avoid errors for include directive.
125
- */
126
- # define NATIVE_TSS_KEY_T unsigned long
127
- #else
128
- # error "Require native threads. See https://bugs.python.org/issue31370"
129
- #endif
130
-
131
- /* When Py_LIMITED_API is not defined, the type layout of Py_tss_t is
132
- exposed to allow static allocation in the API clients. Even in this case,
133
- you must handle TSS keys through API functions due to compatibility.
134
- */
135
- struct _Py_tss_t {
136
- int _is_initialized;
137
- NATIVE_TSS_KEY_T _key;
138
- };
139
-
140
- #undef NATIVE_TSS_KEY_T
141
-
142
- /* When static allocation, you must initialize with Py_tss_NEEDS_INIT. */
143
- #define Py_tss_NEEDS_INIT {0}
144
- #endif /* !Py_LIMITED_API */
145
-
146
- PyAPI_FUNC(Py_tss_t *) PyThread_tss_alloc(void);
147
- PyAPI_FUNC(void) PyThread_tss_free(Py_tss_t *key);
148
-
149
- /* The parameter key must not be NULL. */
150
- PyAPI_FUNC(int) PyThread_tss_is_created(Py_tss_t *key);
151
- PyAPI_FUNC(int) PyThread_tss_create(Py_tss_t *key);
152
- PyAPI_FUNC(void) PyThread_tss_delete(Py_tss_t *key);
153
- PyAPI_FUNC(int) PyThread_tss_set(Py_tss_t *key, void *value);
154
- PyAPI_FUNC(void *) PyThread_tss_get(Py_tss_t *key);
155
- #endif /* New in 3.7 */
156
-
157
- #ifdef __cplusplus
158
- }
159
- #endif
160
-
161
- #endif /* !Py_PYTHREAD_H */