@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,231 +0,0 @@
1
- #ifndef Py_CEVAL_H
2
- #define Py_CEVAL_H
3
- #ifdef __cplusplus
4
- extern "C" {
5
- #endif
6
-
7
-
8
- /* Interface to random parts in ceval.c */
9
-
10
- /* PyEval_CallObjectWithKeywords(), PyEval_CallObject(), PyEval_CallFunction
11
- * and PyEval_CallMethod are kept for backward compatibility: PyObject_Call(),
12
- * PyObject_CallFunction() and PyObject_CallMethod() are recommended to call
13
- * a callable object.
14
- */
15
-
16
- PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
17
- PyObject *callable,
18
- PyObject *args,
19
- PyObject *kwargs);
20
-
21
- /* Inline this */
22
- #define PyEval_CallObject(callable, arg) \
23
- PyEval_CallObjectWithKeywords(callable, arg, (PyObject *)NULL)
24
-
25
- PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *callable,
26
- const char *format, ...);
27
- PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj,
28
- const char *name,
29
- const char *format, ...);
30
-
31
- #ifndef Py_LIMITED_API
32
- PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
33
- PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
34
- PyAPI_FUNC(void) _PyEval_SetCoroutineOriginTrackingDepth(int new_depth);
35
- PyAPI_FUNC(int) _PyEval_GetCoroutineOriginTrackingDepth(void);
36
- PyAPI_FUNC(void) _PyEval_SetAsyncGenFirstiter(PyObject *);
37
- PyAPI_FUNC(PyObject *) _PyEval_GetAsyncGenFirstiter(void);
38
- PyAPI_FUNC(void) _PyEval_SetAsyncGenFinalizer(PyObject *);
39
- PyAPI_FUNC(PyObject *) _PyEval_GetAsyncGenFinalizer(void);
40
- #endif
41
-
42
- struct _frame; /* Avoid including frameobject.h */
43
-
44
- PyAPI_FUNC(PyObject *) PyEval_GetBuiltins(void);
45
- PyAPI_FUNC(PyObject *) PyEval_GetGlobals(void);
46
- PyAPI_FUNC(PyObject *) PyEval_GetLocals(void);
47
- PyAPI_FUNC(struct _frame *) PyEval_GetFrame(void);
48
-
49
- #ifndef Py_LIMITED_API
50
- /* Helper to look up a builtin object */
51
- PyAPI_FUNC(PyObject *) _PyEval_GetBuiltinId(_Py_Identifier *);
52
- /* Look at the current frame's (if any) code's co_flags, and turn on
53
- the corresponding compiler flags in cf->cf_flags. Return 1 if any
54
- flag was set, else return 0. */
55
- PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf);
56
- #endif
57
-
58
- PyAPI_FUNC(int) Py_AddPendingCall(int (*func)(void *), void *arg);
59
- PyAPI_FUNC(int) Py_MakePendingCalls(void);
60
-
61
- /* Protection against deeply nested recursive calls
62
-
63
- In Python 3.0, this protection has two levels:
64
- * normal anti-recursion protection is triggered when the recursion level
65
- exceeds the current recursion limit. It raises a RecursionError, and sets
66
- the "overflowed" flag in the thread state structure. This flag
67
- temporarily *disables* the normal protection; this allows cleanup code
68
- to potentially outgrow the recursion limit while processing the
69
- RecursionError.
70
- * "last chance" anti-recursion protection is triggered when the recursion
71
- level exceeds "current recursion limit + 50". By construction, this
72
- protection can only be triggered when the "overflowed" flag is set. It
73
- means the cleanup code has itself gone into an infinite loop, or the
74
- RecursionError has been mistakingly ignored. When this protection is
75
- triggered, the interpreter aborts with a Fatal Error.
76
-
77
- In addition, the "overflowed" flag is automatically reset when the
78
- recursion level drops below "current recursion limit - 50". This heuristic
79
- is meant to ensure that the normal anti-recursion protection doesn't get
80
- disabled too long.
81
-
82
- Please note: this scheme has its own limitations. See:
83
- http://mail.python.org/pipermail/python-dev/2008-August/082106.html
84
- for some observations.
85
- */
86
- PyAPI_FUNC(void) Py_SetRecursionLimit(int);
87
- PyAPI_FUNC(int) Py_GetRecursionLimit(void);
88
-
89
- #define Py_EnterRecursiveCall(where) \
90
- (_Py_MakeRecCheck(PyThreadState_GET()->recursion_depth) && \
91
- _Py_CheckRecursiveCall(where))
92
- #define Py_LeaveRecursiveCall() \
93
- do{ if(_Py_MakeEndRecCheck(PyThreadState_GET()->recursion_depth)) \
94
- PyThreadState_GET()->overflowed = 0; \
95
- } while(0)
96
- PyAPI_FUNC(int) _Py_CheckRecursiveCall(const char *where);
97
-
98
- /* Due to the macros in which it's used, _Py_CheckRecursionLimit is in
99
- the stable ABI. It should be removed therefrom when possible.
100
- */
101
- PyAPI_DATA(int) _Py_CheckRecursionLimit;
102
-
103
- #ifdef USE_STACKCHECK
104
- /* With USE_STACKCHECK, trigger stack checks in _Py_CheckRecursiveCall()
105
- on every 64th call to Py_EnterRecursiveCall.
106
- */
107
- # define _Py_MakeRecCheck(x) \
108
- (++(x) > _Py_CheckRecursionLimit || \
109
- ++(PyThreadState_GET()->stackcheck_counter) > 64)
110
- #else
111
- # define _Py_MakeRecCheck(x) (++(x) > _Py_CheckRecursionLimit)
112
- #endif
113
-
114
- /* Compute the "lower-water mark" for a recursion limit. When
115
- * Py_LeaveRecursiveCall() is called with a recursion depth below this mark,
116
- * the overflowed flag is reset to 0. */
117
- #define _Py_RecursionLimitLowerWaterMark(limit) \
118
- (((limit) > 200) \
119
- ? ((limit) - 50) \
120
- : (3 * ((limit) >> 2)))
121
-
122
- #define _Py_MakeEndRecCheck(x) \
123
- (--(x) < _Py_RecursionLimitLowerWaterMark(_Py_CheckRecursionLimit))
124
-
125
- #define Py_ALLOW_RECURSION \
126
- do { unsigned char _old = PyThreadState_GET()->recursion_critical;\
127
- PyThreadState_GET()->recursion_critical = 1;
128
-
129
- #define Py_END_ALLOW_RECURSION \
130
- PyThreadState_GET()->recursion_critical = _old; \
131
- } while(0);
132
-
133
- PyAPI_FUNC(const char *) PyEval_GetFuncName(PyObject *);
134
- PyAPI_FUNC(const char *) PyEval_GetFuncDesc(PyObject *);
135
-
136
- PyAPI_FUNC(PyObject *) PyEval_EvalFrame(struct _frame *);
137
- PyAPI_FUNC(PyObject *) PyEval_EvalFrameEx(struct _frame *f, int exc);
138
- #ifndef Py_LIMITED_API
139
- PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(struct _frame *f, int exc);
140
- #endif
141
-
142
- /* Interface for threads.
143
-
144
- A module that plans to do a blocking system call (or something else
145
- that lasts a long time and doesn't touch Python data) can allow other
146
- threads to run as follows:
147
-
148
- ...preparations here...
149
- Py_BEGIN_ALLOW_THREADS
150
- ...blocking system call here...
151
- Py_END_ALLOW_THREADS
152
- ...interpret result here...
153
-
154
- The Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS pair expands to a
155
- {}-surrounded block.
156
- To leave the block in the middle (e.g., with return), you must insert
157
- a line containing Py_BLOCK_THREADS before the return, e.g.
158
-
159
- if (...premature_exit...) {
160
- Py_BLOCK_THREADS
161
- PyErr_SetFromErrno(PyExc_OSError);
162
- return NULL;
163
- }
164
-
165
- An alternative is:
166
-
167
- Py_BLOCK_THREADS
168
- if (...premature_exit...) {
169
- PyErr_SetFromErrno(PyExc_OSError);
170
- return NULL;
171
- }
172
- Py_UNBLOCK_THREADS
173
-
174
- For convenience, that the value of 'errno' is restored across
175
- Py_END_ALLOW_THREADS and Py_BLOCK_THREADS.
176
-
177
- WARNING: NEVER NEST CALLS TO Py_BEGIN_ALLOW_THREADS AND
178
- Py_END_ALLOW_THREADS!!!
179
-
180
- The function PyEval_InitThreads() should be called only from
181
- init_thread() in "_threadmodule.c".
182
-
183
- Note that not yet all candidates have been converted to use this
184
- mechanism!
185
- */
186
-
187
- PyAPI_FUNC(PyThreadState *) PyEval_SaveThread(void);
188
- PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState *);
189
-
190
- PyAPI_FUNC(int) PyEval_ThreadsInitialized(void);
191
- PyAPI_FUNC(void) PyEval_InitThreads(void);
192
- Py_DEPRECATED(3.2) PyAPI_FUNC(void) PyEval_AcquireLock(void);
193
- /* Py_DEPRECATED(3.2) */ PyAPI_FUNC(void) PyEval_ReleaseLock(void);
194
- PyAPI_FUNC(void) PyEval_AcquireThread(PyThreadState *tstate);
195
- PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate);
196
-
197
- #ifndef Py_LIMITED_API
198
- PyAPI_FUNC(void) _PyEval_SetSwitchInterval(unsigned long microseconds);
199
- PyAPI_FUNC(unsigned long) _PyEval_GetSwitchInterval(void);
200
- #endif
201
-
202
- #ifndef Py_LIMITED_API
203
- PyAPI_FUNC(Py_ssize_t) _PyEval_RequestCodeExtraIndex(freefunc);
204
- #endif
205
-
206
- #define Py_BEGIN_ALLOW_THREADS { \
207
- PyThreadState *_save; \
208
- _save = PyEval_SaveThread();
209
- #define Py_BLOCK_THREADS PyEval_RestoreThread(_save);
210
- #define Py_UNBLOCK_THREADS _save = PyEval_SaveThread();
211
- #define Py_END_ALLOW_THREADS PyEval_RestoreThread(_save); \
212
- }
213
-
214
- #ifndef Py_LIMITED_API
215
- PyAPI_FUNC(int) _PyEval_SliceIndex(PyObject *, Py_ssize_t *);
216
- PyAPI_FUNC(int) _PyEval_SliceIndexNotNone(PyObject *, Py_ssize_t *);
217
- #endif
218
-
219
- /* Masks and values used by FORMAT_VALUE opcode. */
220
- #define FVC_MASK 0x3
221
- #define FVC_NONE 0x0
222
- #define FVC_STR 0x1
223
- #define FVC_REPR 0x2
224
- #define FVC_ASCII 0x3
225
- #define FVS_MASK 0x4
226
- #define FVS_HAVE_SPEC 0x4
227
-
228
- #ifdef __cplusplus
229
- }
230
- #endif
231
- #endif /* !Py_CEVAL_H */
@@ -1,59 +0,0 @@
1
- /* Former class object interface -- now only bound methods are here */
2
-
3
- /* Revealing some structures (not for general use) */
4
-
5
- #ifndef Py_LIMITED_API
6
- #ifndef Py_CLASSOBJECT_H
7
- #define Py_CLASSOBJECT_H
8
- #ifdef __cplusplus
9
- extern "C" {
10
- #endif
11
-
12
- typedef struct {
13
- PyObject_HEAD
14
- PyObject *im_func; /* The callable object implementing the method */
15
- PyObject *im_self; /* The instance it is bound to */
16
- PyObject *im_weakreflist; /* List of weak references */
17
- vectorcallfunc vectorcall;
18
- } PyMethodObject;
19
-
20
- PyAPI_DATA(PyTypeObject) PyMethod_Type;
21
-
22
- #define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type)
23
-
24
- PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *);
25
-
26
- PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
27
- PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
28
-
29
- /* Macros for direct access to these values. Type checks are *not*
30
- done, so use with care. */
31
- #define PyMethod_GET_FUNCTION(meth) \
32
- (((PyMethodObject *)meth) -> im_func)
33
- #define PyMethod_GET_SELF(meth) \
34
- (((PyMethodObject *)meth) -> im_self)
35
-
36
- PyAPI_FUNC(int) PyMethod_ClearFreeList(void);
37
-
38
- typedef struct {
39
- PyObject_HEAD
40
- PyObject *func;
41
- } PyInstanceMethodObject;
42
-
43
- PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type;
44
-
45
- #define PyInstanceMethod_Check(op) ((op)->ob_type == &PyInstanceMethod_Type)
46
-
47
- PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *);
48
- PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);
49
-
50
- /* Macros for direct access to these values. Type checks are *not*
51
- done, so use with care. */
52
- #define PyInstanceMethod_GET_FUNCTION(meth) \
53
- (((PyInstanceMethodObject *)meth) -> func)
54
-
55
- #ifdef __cplusplus
56
- }
57
- #endif
58
- #endif /* !Py_CLASSOBJECT_H */
59
- #endif /* Py_LIMITED_API */
@@ -1,180 +0,0 @@
1
- /* Definitions for bytecode */
2
-
3
- #ifndef Py_LIMITED_API
4
- #ifndef Py_CODE_H
5
- #define Py_CODE_H
6
- #ifdef __cplusplus
7
- extern "C" {
8
- #endif
9
-
10
- typedef uint16_t _Py_CODEUNIT;
11
-
12
- #ifdef WORDS_BIGENDIAN
13
- # define _Py_OPCODE(word) ((word) >> 8)
14
- # define _Py_OPARG(word) ((word) & 255)
15
- #else
16
- # define _Py_OPCODE(word) ((word) & 255)
17
- # define _Py_OPARG(word) ((word) >> 8)
18
- #endif
19
-
20
- typedef struct _PyOpcache _PyOpcache;
21
-
22
- /* Bytecode object */
23
- typedef struct {
24
- PyObject_HEAD
25
- int co_argcount; /* #arguments, except *args */
26
- int co_posonlyargcount; /* #positional only arguments */
27
- int co_kwonlyargcount; /* #keyword only arguments */
28
- int co_nlocals; /* #local variables */
29
- int co_stacksize; /* #entries needed for evaluation stack */
30
- int co_flags; /* CO_..., see below */
31
- int co_firstlineno; /* first source line number */
32
- PyObject *co_code; /* instruction opcodes */
33
- PyObject *co_consts; /* list (constants used) */
34
- PyObject *co_names; /* list of strings (names used) */
35
- PyObject *co_varnames; /* tuple of strings (local variable names) */
36
- PyObject *co_freevars; /* tuple of strings (free variable names) */
37
- PyObject *co_cellvars; /* tuple of strings (cell variable names) */
38
- /* The rest aren't used in either hash or comparisons, except for co_name,
39
- used in both. This is done to preserve the name and line number
40
- for tracebacks and debuggers; otherwise, constant de-duplication
41
- would collapse identical functions/lambdas defined on different lines.
42
- */
43
- Py_ssize_t *co_cell2arg; /* Maps cell vars which are arguments. */
44
- PyObject *co_filename; /* unicode (where it was loaded from) */
45
- PyObject *co_name; /* unicode (name, for reference) */
46
- PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) See
47
- Objects/lnotab_notes.txt for details. */
48
- void *co_zombieframe; /* for optimization only (see frameobject.c) */
49
- PyObject *co_weakreflist; /* to support weakrefs to code objects */
50
- /* Scratch space for extra data relating to the code object.
51
- Type is a void* to keep the format private in codeobject.c to force
52
- people to go through the proper APIs. */
53
- void *co_extra;
54
-
55
- /* Per opcodes just-in-time cache
56
- *
57
- * To reduce cache size, we use indirect mapping from opcode index to
58
- * cache object:
59
- * cache = co_opcache[co_opcache_map[next_instr - first_instr] - 1]
60
- */
61
-
62
- // co_opcache_map is indexed by (next_instr - first_instr).
63
- // * 0 means there is no cache for this opcode.
64
- // * n > 0 means there is cache in co_opcache[n-1].
65
- unsigned char *co_opcache_map;
66
- _PyOpcache *co_opcache;
67
- int co_opcache_flag; // used to determine when create a cache.
68
- unsigned char co_opcache_size; // length of co_opcache.
69
- } PyCodeObject;
70
-
71
- /* Masks for co_flags above */
72
- #define CO_OPTIMIZED 0x0001
73
- #define CO_NEWLOCALS 0x0002
74
- #define CO_VARARGS 0x0004
75
- #define CO_VARKEYWORDS 0x0008
76
- #define CO_NESTED 0x0010
77
- #define CO_GENERATOR 0x0020
78
- /* The CO_NOFREE flag is set if there are no free or cell variables.
79
- This information is redundant, but it allows a single flag test
80
- to determine whether there is any extra work to be done when the
81
- call frame it setup.
82
- */
83
- #define CO_NOFREE 0x0040
84
-
85
- /* The CO_COROUTINE flag is set for coroutine functions (defined with
86
- ``async def`` keywords) */
87
- #define CO_COROUTINE 0x0080
88
- #define CO_ITERABLE_COROUTINE 0x0100
89
- #define CO_ASYNC_GENERATOR 0x0200
90
-
91
- /* bpo-39562: These constant values are changed in Python 3.9
92
- to prevent collision with compiler flags. CO_FUTURE_ and PyCF_
93
- constants must be kept unique. PyCF_ constants can use bits from
94
- 0x0100 to 0x10000. CO_FUTURE_ constants use bits starting at 0x20000. */
95
- #define CO_FUTURE_DIVISION 0x20000
96
- #define CO_FUTURE_ABSOLUTE_IMPORT 0x40000 /* do absolute imports by default */
97
- #define CO_FUTURE_WITH_STATEMENT 0x80000
98
- #define CO_FUTURE_PRINT_FUNCTION 0x100000
99
- #define CO_FUTURE_UNICODE_LITERALS 0x200000
100
-
101
- #define CO_FUTURE_BARRY_AS_BDFL 0x400000
102
- #define CO_FUTURE_GENERATOR_STOP 0x800000
103
- #define CO_FUTURE_ANNOTATIONS 0x1000000
104
-
105
- /* This value is found in the co_cell2arg array when the associated cell
106
- variable does not correspond to an argument. */
107
- #define CO_CELL_NOT_AN_ARG (-1)
108
-
109
- /* This should be defined if a future statement modifies the syntax.
110
- For example, when a keyword is added.
111
- */
112
- #define PY_PARSER_REQUIRES_FUTURE_KEYWORD
113
-
114
- #define CO_MAXBLOCKS 20 /* Max static block nesting within a function */
115
-
116
- PyAPI_DATA(PyTypeObject) PyCode_Type;
117
-
118
- #define PyCode_Check(op) (Py_TYPE(op) == &PyCode_Type)
119
- #define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars))
120
-
121
- /* Public interface */
122
- PyAPI_FUNC(PyCodeObject *) PyCode_New(
123
- int, int, int, int, int, PyObject *, PyObject *,
124
- PyObject *, PyObject *, PyObject *, PyObject *,
125
- PyObject *, PyObject *, int, PyObject *);
126
-
127
- PyAPI_FUNC(PyCodeObject *) PyCode_NewWithPosOnlyArgs(
128
- int, int, int, int, int, int, PyObject *, PyObject *,
129
- PyObject *, PyObject *, PyObject *, PyObject *,
130
- PyObject *, PyObject *, int, PyObject *);
131
- /* same as struct above */
132
-
133
- /* Creates a new empty code object with the specified source location. */
134
- PyAPI_FUNC(PyCodeObject *)
135
- PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno);
136
-
137
- /* Return the line number associated with the specified bytecode index
138
- in this code object. If you just need the line number of a frame,
139
- use PyFrame_GetLineNumber() instead. */
140
- PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int);
141
-
142
- /* for internal use only */
143
- typedef struct _addr_pair {
144
- int ap_lower;
145
- int ap_upper;
146
- } PyAddrPair;
147
-
148
- #ifndef Py_LIMITED_API
149
- /* Update *bounds to describe the first and one-past-the-last instructions in the
150
- same line as lasti. Return the number of that line.
151
- */
152
- PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co,
153
- int lasti, PyAddrPair *bounds);
154
-
155
- /* Create a comparable key used to compare constants taking in account the
156
- * object type. It is used to make sure types are not coerced (e.g., float and
157
- * complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms
158
- *
159
- * Return (type(obj), obj, ...): a tuple with variable size (at least 2 items)
160
- * depending on the type and the value. The type is the first item to not
161
- * compare bytes and str which can raise a BytesWarning exception. */
162
- PyAPI_FUNC(PyObject*) _PyCode_ConstantKey(PyObject *obj);
163
- #endif
164
-
165
- PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts,
166
- PyObject *names, PyObject *lnotab);
167
-
168
-
169
- #ifndef Py_LIMITED_API
170
- PyAPI_FUNC(int) _PyCode_GetExtra(PyObject *code, Py_ssize_t index,
171
- void **extra);
172
- PyAPI_FUNC(int) _PyCode_SetExtra(PyObject *code, Py_ssize_t index,
173
- void *extra);
174
- #endif
175
-
176
- #ifdef __cplusplus
177
- }
178
- #endif
179
- #endif /* !Py_CODE_H */
180
- #endif /* Py_LIMITED_API */