@plone/volto 14.0.2 → 14.2.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 (218) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +24 -3
  3. package/locales/ca/LC_MESSAGES/volto.po +12 -2
  4. package/locales/ca.json +1 -1
  5. package/locales/de/LC_MESSAGES/volto.po +12 -2
  6. package/locales/de.json +1 -1
  7. package/locales/en/LC_MESSAGES/volto.po +12 -2
  8. package/locales/en.json +1 -1
  9. package/locales/es/LC_MESSAGES/volto.po +12 -2
  10. package/locales/es.json +1 -1
  11. package/locales/eu/LC_MESSAGES/volto.po +12 -2
  12. package/locales/eu.json +1 -1
  13. package/locales/fr/LC_MESSAGES/volto.po +12 -2
  14. package/locales/fr.json +1 -1
  15. package/locales/it/LC_MESSAGES/volto.po +12 -2
  16. package/locales/it.json +1 -1
  17. package/locales/ja/LC_MESSAGES/volto.po +12 -2
  18. package/locales/ja.json +1 -1
  19. package/locales/nl/LC_MESSAGES/volto.po +12 -2
  20. package/locales/nl.json +1 -1
  21. package/locales/pt/LC_MESSAGES/volto.po +12 -2
  22. package/locales/pt.json +1 -1
  23. package/locales/pt_BR/LC_MESSAGES/volto.po +12 -2
  24. package/locales/pt_BR.json +1 -1
  25. package/locales/ro/LC_MESSAGES/volto.po +12 -2
  26. package/locales/ro.json +1 -1
  27. package/locales/volto.pot +12 -2
  28. package/package.json +3 -2
  29. package/src/actions/vocabularies/vocabularies.js +15 -3
  30. package/src/components/index.js +1 -0
  31. package/src/components/manage/Add/Add.jsx +1 -0
  32. package/src/components/manage/Blocks/HeroImageLeft/Edit.jsx +1 -1
  33. package/src/components/manage/Blocks/Listing/getAsyncData.js +1 -1
  34. package/src/components/manage/Blocks/Text/Edit.jsx +19 -0
  35. package/src/components/manage/Edit/Edit.jsx +1 -0
  36. package/src/components/manage/Form/Form.jsx +32 -6
  37. package/src/components/manage/Form/UndoToolbar.jsx +78 -0
  38. package/src/components/manage/Multilingual/TranslationObject.jsx +1 -0
  39. package/src/components/manage/Widgets/AlignWidget.stories.jsx +5 -21
  40. package/src/components/manage/Widgets/ArrayWidget.jsx +88 -88
  41. package/src/components/manage/Widgets/ArrayWidget.stories.jsx +37 -64
  42. package/src/components/manage/Widgets/CheckboxWidget.stories.jsx +5 -22
  43. package/src/components/manage/Widgets/DatetimeWidget.jsx +65 -74
  44. package/src/components/manage/Widgets/DatetimeWidget.stories.jsx +7 -23
  45. package/src/components/manage/Widgets/DatetimeWidget.test.jsx +17 -15
  46. package/src/components/manage/Widgets/EmailWidget.stories.jsx +5 -22
  47. package/src/components/manage/Widgets/FileWidget.stories.jsx +5 -22
  48. package/src/components/manage/Widgets/NumberWidget.stories.jsx +5 -23
  49. package/src/components/manage/Widgets/ObjectBrowserWidget.stories.js +24 -32
  50. package/src/components/manage/Widgets/ObjectListWidget.stories.js +44 -44
  51. package/src/components/manage/Widgets/ObjectWidget.stories.jsx +13 -28
  52. package/src/components/manage/Widgets/PasswordWidget.stories.jsx +5 -22
  53. package/src/components/manage/Widgets/QueryWidget.jsx +2 -2
  54. package/src/components/manage/Widgets/QueryWidget.stories.jsx +1637 -22
  55. package/src/components/manage/Widgets/SelectAutoComplete.jsx +79 -48
  56. package/src/components/manage/Widgets/SelectAutoComplete.test.jsx +16 -0
  57. package/src/components/manage/Widgets/SelectAutocompleteWidget.stories.jsx +161 -0
  58. package/src/components/manage/Widgets/SelectUtils.js +90 -30
  59. package/src/components/manage/Widgets/SelectUtils.test.jsx +76 -1
  60. package/src/components/manage/Widgets/SelectWidget.jsx +26 -37
  61. package/src/components/manage/Widgets/SelectWidget.stories.jsx +96 -28
  62. package/src/components/manage/Widgets/TextWidget.stories.jsx +5 -22
  63. package/src/components/manage/Widgets/TextareaWidget.stories.jsx +5 -22
  64. package/src/components/manage/Widgets/TokenWidget.jsx +19 -17
  65. package/src/components/manage/Widgets/TokenWidget.stories.jsx +141 -0
  66. package/src/components/manage/Widgets/UrlWidget.stories.jsx +5 -21
  67. package/src/components/manage/Widgets/VocabularyTermsWidget.stories.js +27 -64
  68. package/src/components/manage/Widgets/WysiwygWidget.stories.jsx +5 -22
  69. package/src/components/manage/Widgets/story.jsx +38 -0
  70. package/src/components/theme/ContactForm/ContactForm.jsx +1 -0
  71. package/src/components/theme/ContactForm/ContactForm.stories.jsx +126 -0
  72. package/src/components/theme/CorsError/CorsError.jsx +2 -2
  73. package/src/components/theme/Navigation/NavItem.jsx +3 -1
  74. package/src/config/Blocks.jsx +8 -1
  75. package/src/config/Loadables.jsx +2 -0
  76. package/src/config/index.js +3 -0
  77. package/src/helpers/UndoManager/useUndoManager.js +102 -0
  78. package/src/helpers/index.js +1 -0
  79. package/src/reducers/vocabularies/vocabularies.js +13 -2
  80. package/src/store.js +1 -1
  81. package/src/storybook.jsx +55 -0
  82. package/theme/themes/pastanaga/extras/time-picker-overrides.less +1 -1
  83. package/include/python3.8/Python-ast.h +0 -715
  84. package/include/python3.8/Python.h +0 -160
  85. package/include/python3.8/abstract.h +0 -844
  86. package/include/python3.8/asdl.h +0 -46
  87. package/include/python3.8/ast.h +0 -37
  88. package/include/python3.8/bitset.h +0 -23
  89. package/include/python3.8/bltinmodule.h +0 -14
  90. package/include/python3.8/boolobject.h +0 -34
  91. package/include/python3.8/bytearrayobject.h +0 -62
  92. package/include/python3.8/bytes_methods.h +0 -69
  93. package/include/python3.8/bytesobject.h +0 -224
  94. package/include/python3.8/cellobject.h +0 -29
  95. package/include/python3.8/ceval.h +0 -231
  96. package/include/python3.8/classobject.h +0 -59
  97. package/include/python3.8/code.h +0 -180
  98. package/include/python3.8/codecs.h +0 -240
  99. package/include/python3.8/compile.h +0 -106
  100. package/include/python3.8/complexobject.h +0 -69
  101. package/include/python3.8/context.h +0 -84
  102. package/include/python3.8/cpython/abstract.h +0 -319
  103. package/include/python3.8/cpython/dictobject.h +0 -94
  104. package/include/python3.8/cpython/fileobject.h +0 -24
  105. package/include/python3.8/cpython/initconfig.h +0 -434
  106. package/include/python3.8/cpython/interpreteridobject.h +0 -19
  107. package/include/python3.8/cpython/object.h +0 -470
  108. package/include/python3.8/cpython/objimpl.h +0 -113
  109. package/include/python3.8/cpython/pyerrors.h +0 -188
  110. package/include/python3.8/cpython/pylifecycle.h +0 -78
  111. package/include/python3.8/cpython/pymem.h +0 -108
  112. package/include/python3.8/cpython/pystate.h +0 -252
  113. package/include/python3.8/cpython/sysmodule.h +0 -21
  114. package/include/python3.8/cpython/traceback.h +0 -22
  115. package/include/python3.8/cpython/tupleobject.h +0 -36
  116. package/include/python3.8/cpython/unicodeobject.h +0 -1239
  117. package/include/python3.8/datetime.h +0 -259
  118. package/include/python3.8/descrobject.h +0 -108
  119. package/include/python3.8/dictobject.h +0 -94
  120. package/include/python3.8/dtoa.h +0 -19
  121. package/include/python3.8/dynamic_annotations.h +0 -499
  122. package/include/python3.8/enumobject.h +0 -17
  123. package/include/python3.8/errcode.h +0 -38
  124. package/include/python3.8/eval.h +0 -37
  125. package/include/python3.8/fileobject.h +0 -49
  126. package/include/python3.8/fileutils.h +0 -185
  127. package/include/python3.8/floatobject.h +0 -130
  128. package/include/python3.8/frameobject.h +0 -92
  129. package/include/python3.8/funcobject.h +0 -104
  130. package/include/python3.8/genobject.h +0 -109
  131. package/include/python3.8/graminit.h +0 -94
  132. package/include/python3.8/grammar.h +0 -77
  133. package/include/python3.8/import.h +0 -149
  134. package/include/python3.8/internal/pycore_accu.h +0 -39
  135. package/include/python3.8/internal/pycore_atomic.h +0 -558
  136. package/include/python3.8/internal/pycore_ceval.h +0 -37
  137. package/include/python3.8/internal/pycore_code.h +0 -27
  138. package/include/python3.8/internal/pycore_condvar.h +0 -95
  139. package/include/python3.8/internal/pycore_context.h +0 -42
  140. package/include/python3.8/internal/pycore_fileutils.h +0 -54
  141. package/include/python3.8/internal/pycore_getopt.h +0 -22
  142. package/include/python3.8/internal/pycore_gil.h +0 -50
  143. package/include/python3.8/internal/pycore_hamt.h +0 -116
  144. package/include/python3.8/internal/pycore_initconfig.h +0 -166
  145. package/include/python3.8/internal/pycore_object.h +0 -81
  146. package/include/python3.8/internal/pycore_pathconfig.h +0 -75
  147. package/include/python3.8/internal/pycore_pyerrors.h +0 -62
  148. package/include/python3.8/internal/pycore_pyhash.h +0 -10
  149. package/include/python3.8/internal/pycore_pylifecycle.h +0 -118
  150. package/include/python3.8/internal/pycore_pymem.h +0 -212
  151. package/include/python3.8/internal/pycore_pystate.h +0 -326
  152. package/include/python3.8/internal/pycore_traceback.h +0 -96
  153. package/include/python3.8/internal/pycore_tupleobject.h +0 -19
  154. package/include/python3.8/internal/pycore_warnings.h +0 -25
  155. package/include/python3.8/interpreteridobject.h +0 -17
  156. package/include/python3.8/intrcheck.h +0 -33
  157. package/include/python3.8/iterobject.h +0 -25
  158. package/include/python3.8/listobject.h +0 -81
  159. package/include/python3.8/longintrepr.h +0 -99
  160. package/include/python3.8/longobject.h +0 -242
  161. package/include/python3.8/marshal.h +0 -28
  162. package/include/python3.8/memoryobject.h +0 -72
  163. package/include/python3.8/methodobject.h +0 -131
  164. package/include/python3.8/modsupport.h +0 -248
  165. package/include/python3.8/moduleobject.h +0 -90
  166. package/include/python3.8/namespaceobject.h +0 -19
  167. package/include/python3.8/node.h +0 -48
  168. package/include/python3.8/object.h +0 -753
  169. package/include/python3.8/objimpl.h +0 -284
  170. package/include/python3.8/odictobject.h +0 -43
  171. package/include/python3.8/opcode.h +0 -148
  172. package/include/python3.8/osdefs.h +0 -51
  173. package/include/python3.8/osmodule.h +0 -17
  174. package/include/python3.8/parsetok.h +0 -110
  175. package/include/python3.8/patchlevel.h +0 -35
  176. package/include/python3.8/picklebufobject.h +0 -31
  177. package/include/python3.8/py_curses.h +0 -100
  178. package/include/python3.8/pyarena.h +0 -64
  179. package/include/python3.8/pycapsule.h +0 -59
  180. package/include/python3.8/pyconfig.h +0 -1665
  181. package/include/python3.8/pyctype.h +0 -39
  182. package/include/python3.8/pydebug.h +0 -40
  183. package/include/python3.8/pydtrace.h +0 -59
  184. package/include/python3.8/pydtrace_probes.h +0 -228
  185. package/include/python3.8/pyerrors.h +0 -335
  186. package/include/python3.8/pyexpat.h +0 -55
  187. package/include/python3.8/pyfpe.h +0 -12
  188. package/include/python3.8/pyhash.h +0 -145
  189. package/include/python3.8/pylifecycle.h +0 -75
  190. package/include/python3.8/pymacconfig.h +0 -102
  191. package/include/python3.8/pymacro.h +0 -106
  192. package/include/python3.8/pymath.h +0 -230
  193. package/include/python3.8/pymem.h +0 -150
  194. package/include/python3.8/pyport.h +0 -850
  195. package/include/python3.8/pystate.h +0 -136
  196. package/include/python3.8/pystrcmp.h +0 -23
  197. package/include/python3.8/pystrhex.h +0 -22
  198. package/include/python3.8/pystrtod.h +0 -45
  199. package/include/python3.8/pythonrun.h +0 -210
  200. package/include/python3.8/pythread.h +0 -161
  201. package/include/python3.8/pytime.h +0 -246
  202. package/include/python3.8/rangeobject.h +0 -27
  203. package/include/python3.8/setobject.h +0 -108
  204. package/include/python3.8/sliceobject.h +0 -65
  205. package/include/python3.8/structmember.h +0 -74
  206. package/include/python3.8/structseq.h +0 -49
  207. package/include/python3.8/symtable.h +0 -123
  208. package/include/python3.8/sysmodule.h +0 -41
  209. package/include/python3.8/token.h +0 -92
  210. package/include/python3.8/traceback.h +0 -28
  211. package/include/python3.8/tracemalloc.h +0 -38
  212. package/include/python3.8/tupleobject.h +0 -48
  213. package/include/python3.8/typeslots.h +0 -85
  214. package/include/python3.8/ucnhash.h +0 -36
  215. package/include/python3.8/unicodeobject.h +0 -1044
  216. package/include/python3.8/warnings.h +0 -67
  217. package/include/python3.8/weakrefobject.h +0 -86
  218. package/src/components/theme/ContactForm/ContactForm.stories.mdx +0 -39
@@ -1,284 +0,0 @@
1
- /* The PyObject_ memory family: high-level object memory interfaces.
2
- See pymem.h for the low-level PyMem_ family.
3
- */
4
-
5
- #ifndef Py_OBJIMPL_H
6
- #define Py_OBJIMPL_H
7
-
8
- #include "pymem.h"
9
-
10
- #ifdef __cplusplus
11
- extern "C" {
12
- #endif
13
-
14
- /* BEWARE:
15
-
16
- Each interface exports both functions and macros. Extension modules should
17
- use the functions, to ensure binary compatibility across Python versions.
18
- Because the Python implementation is free to change internal details, and
19
- the macros may (or may not) expose details for speed, if you do use the
20
- macros you must recompile your extensions with each Python release.
21
-
22
- Never mix calls to PyObject_ memory functions with calls to the platform
23
- malloc/realloc/ calloc/free, or with calls to PyMem_.
24
- */
25
-
26
- /*
27
- Functions and macros for modules that implement new object types.
28
-
29
- - PyObject_New(type, typeobj) allocates memory for a new object of the given
30
- type, and initializes part of it. 'type' must be the C structure type used
31
- to represent the object, and 'typeobj' the address of the corresponding
32
- type object. Reference count and type pointer are filled in; the rest of
33
- the bytes of the object are *undefined*! The resulting expression type is
34
- 'type *'. The size of the object is determined by the tp_basicsize field
35
- of the type object.
36
-
37
- - PyObject_NewVar(type, typeobj, n) is similar but allocates a variable-size
38
- object with room for n items. In addition to the refcount and type pointer
39
- fields, this also fills in the ob_size field.
40
-
41
- - PyObject_Del(op) releases the memory allocated for an object. It does not
42
- run a destructor -- it only frees the memory. PyObject_Free is identical.
43
-
44
- - PyObject_Init(op, typeobj) and PyObject_InitVar(op, typeobj, n) don't
45
- allocate memory. Instead of a 'type' parameter, they take a pointer to a
46
- new object (allocated by an arbitrary allocator), and initialize its object
47
- header fields.
48
-
49
- Note that objects created with PyObject_{New, NewVar} are allocated using the
50
- specialized Python allocator (implemented in obmalloc.c), if WITH_PYMALLOC is
51
- enabled. In addition, a special debugging allocator is used if PYMALLOC_DEBUG
52
- is also #defined.
53
-
54
- In case a specific form of memory management is needed (for example, if you
55
- must use the platform malloc heap(s), or shared memory, or C++ local storage or
56
- operator new), you must first allocate the object with your custom allocator,
57
- then pass its pointer to PyObject_{Init, InitVar} for filling in its Python-
58
- specific fields: reference count, type pointer, possibly others. You should
59
- be aware that Python has no control over these objects because they don't
60
- cooperate with the Python memory manager. Such objects may not be eligible
61
- for automatic garbage collection and you have to make sure that they are
62
- released accordingly whenever their destructor gets called (cf. the specific
63
- form of memory management you're using).
64
-
65
- Unless you have specific memory management requirements, use
66
- PyObject_{New, NewVar, Del}.
67
- */
68
-
69
- /*
70
- * Raw object memory interface
71
- * ===========================
72
- */
73
-
74
- /* Functions to call the same malloc/realloc/free as used by Python's
75
- object allocator. If WITH_PYMALLOC is enabled, these may differ from
76
- the platform malloc/realloc/free. The Python object allocator is
77
- designed for fast, cache-conscious allocation of many "small" objects,
78
- and with low hidden memory overhead.
79
-
80
- PyObject_Malloc(0) returns a unique non-NULL pointer if possible.
81
-
82
- PyObject_Realloc(NULL, n) acts like PyObject_Malloc(n).
83
- PyObject_Realloc(p != NULL, 0) does not return NULL, or free the memory
84
- at p.
85
-
86
- Returned pointers must be checked for NULL explicitly; no action is
87
- performed on failure other than to return NULL (no warning it printed, no
88
- exception is set, etc).
89
-
90
- For allocating objects, use PyObject_{New, NewVar} instead whenever
91
- possible. The PyObject_{Malloc, Realloc, Free} family is exposed
92
- so that you can exploit Python's small-block allocator for non-object
93
- uses. If you must use these routines to allocate object memory, make sure
94
- the object gets initialized via PyObject_{Init, InitVar} after obtaining
95
- the raw memory.
96
- */
97
- PyAPI_FUNC(void *) PyObject_Malloc(size_t size);
98
- #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
99
- PyAPI_FUNC(void *) PyObject_Calloc(size_t nelem, size_t elsize);
100
- #endif
101
- PyAPI_FUNC(void *) PyObject_Realloc(void *ptr, size_t new_size);
102
- PyAPI_FUNC(void) PyObject_Free(void *ptr);
103
-
104
-
105
- /* Macros */
106
- #define PyObject_MALLOC PyObject_Malloc
107
- #define PyObject_REALLOC PyObject_Realloc
108
- #define PyObject_FREE PyObject_Free
109
- #define PyObject_Del PyObject_Free
110
- #define PyObject_DEL PyObject_Free
111
-
112
-
113
- /*
114
- * Generic object allocator interface
115
- * ==================================
116
- */
117
-
118
- /* Functions */
119
- PyAPI_FUNC(PyObject *) PyObject_Init(PyObject *, PyTypeObject *);
120
- PyAPI_FUNC(PyVarObject *) PyObject_InitVar(PyVarObject *,
121
- PyTypeObject *, Py_ssize_t);
122
- PyAPI_FUNC(PyObject *) _PyObject_New(PyTypeObject *);
123
- PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t);
124
-
125
- #define PyObject_New(type, typeobj) \
126
- ( (type *) _PyObject_New(typeobj) )
127
- #define PyObject_NewVar(type, typeobj, n) \
128
- ( (type *) _PyObject_NewVar((typeobj), (n)) )
129
-
130
- /* Inline functions trading binary compatibility for speed:
131
- PyObject_INIT() is the fast version of PyObject_Init(), and
132
- PyObject_INIT_VAR() is the fast version of PyObject_InitVar.
133
- See also pymem.h.
134
-
135
- These inline functions expect non-NULL object pointers. */
136
- static inline PyObject*
137
- _PyObject_INIT(PyObject *op, PyTypeObject *typeobj)
138
- {
139
- assert(op != NULL);
140
- Py_TYPE(op) = typeobj;
141
- if (PyType_GetFlags(typeobj) & Py_TPFLAGS_HEAPTYPE) {
142
- Py_INCREF(typeobj);
143
- }
144
- _Py_NewReference(op);
145
- return op;
146
- }
147
-
148
- #define PyObject_INIT(op, typeobj) \
149
- _PyObject_INIT(_PyObject_CAST(op), (typeobj))
150
-
151
- static inline PyVarObject*
152
- _PyObject_INIT_VAR(PyVarObject *op, PyTypeObject *typeobj, Py_ssize_t size)
153
- {
154
- assert(op != NULL);
155
- Py_SIZE(op) = size;
156
- PyObject_INIT((PyObject *)op, typeobj);
157
- return op;
158
- }
159
-
160
- #define PyObject_INIT_VAR(op, typeobj, size) \
161
- _PyObject_INIT_VAR(_PyVarObject_CAST(op), (typeobj), (size))
162
-
163
- #define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize )
164
-
165
- /* _PyObject_VAR_SIZE returns the number of bytes (as size_t) allocated for a
166
- vrbl-size object with nitems items, exclusive of gc overhead (if any). The
167
- value is rounded up to the closest multiple of sizeof(void *), in order to
168
- ensure that pointer fields at the end of the object are correctly aligned
169
- for the platform (this is of special importance for subclasses of, e.g.,
170
- str or int, so that pointers can be stored after the embedded data).
171
-
172
- Note that there's no memory wastage in doing this, as malloc has to
173
- return (at worst) pointer-aligned memory anyway.
174
- */
175
- #if ((SIZEOF_VOID_P - 1) & SIZEOF_VOID_P) != 0
176
- # error "_PyObject_VAR_SIZE requires SIZEOF_VOID_P be a power of 2"
177
- #endif
178
-
179
- #define _PyObject_VAR_SIZE(typeobj, nitems) \
180
- _Py_SIZE_ROUND_UP((typeobj)->tp_basicsize + \
181
- (nitems)*(typeobj)->tp_itemsize, \
182
- SIZEOF_VOID_P)
183
-
184
- #define PyObject_NEW(type, typeobj) \
185
- ( (type *) PyObject_Init( \
186
- (PyObject *) PyObject_MALLOC( _PyObject_SIZE(typeobj) ), (typeobj)) )
187
-
188
- #define PyObject_NEW_VAR(type, typeobj, n) \
189
- ( (type *) PyObject_InitVar( \
190
- (PyVarObject *) PyObject_MALLOC(_PyObject_VAR_SIZE((typeobj),(n)) ),\
191
- (typeobj), (n)) )
192
-
193
- /* This example code implements an object constructor with a custom
194
- allocator, where PyObject_New is inlined, and shows the important
195
- distinction between two steps (at least):
196
- 1) the actual allocation of the object storage;
197
- 2) the initialization of the Python specific fields
198
- in this storage with PyObject_{Init, InitVar}.
199
-
200
- PyObject *
201
- YourObject_New(...)
202
- {
203
- PyObject *op;
204
-
205
- op = (PyObject *) Your_Allocator(_PyObject_SIZE(YourTypeStruct));
206
- if (op == NULL)
207
- return PyErr_NoMemory();
208
-
209
- PyObject_Init(op, &YourTypeStruct);
210
-
211
- op->ob_field = value;
212
- ...
213
- return op;
214
- }
215
-
216
- Note that in C++, the use of the new operator usually implies that
217
- the 1st step is performed automatically for you, so in a C++ class
218
- constructor you would start directly with PyObject_Init/InitVar
219
- */
220
-
221
-
222
-
223
- /*
224
- * Garbage Collection Support
225
- * ==========================
226
- */
227
-
228
- /* C equivalent of gc.collect() which ignores the state of gc.enabled. */
229
- PyAPI_FUNC(Py_ssize_t) PyGC_Collect(void);
230
-
231
- /* Test if a type has a GC head */
232
- #define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC)
233
-
234
- PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t);
235
- #define PyObject_GC_Resize(type, op, n) \
236
- ( (type *) _PyObject_GC_Resize(_PyVarObject_CAST(op), (n)) )
237
-
238
-
239
-
240
- PyAPI_FUNC(PyObject *) _PyObject_GC_New(PyTypeObject *);
241
- PyAPI_FUNC(PyVarObject *) _PyObject_GC_NewVar(PyTypeObject *, Py_ssize_t);
242
-
243
- /* Tell the GC to track this object.
244
- *
245
- * See also private _PyObject_GC_TRACK() macro. */
246
- PyAPI_FUNC(void) PyObject_GC_Track(void *);
247
-
248
- /* Tell the GC to stop tracking this object.
249
- *
250
- * See also private _PyObject_GC_UNTRACK() macro. */
251
- PyAPI_FUNC(void) PyObject_GC_UnTrack(void *);
252
-
253
- PyAPI_FUNC(void) PyObject_GC_Del(void *);
254
-
255
- #define PyObject_GC_New(type, typeobj) \
256
- ( (type *) _PyObject_GC_New(typeobj) )
257
- #define PyObject_GC_NewVar(type, typeobj, n) \
258
- ( (type *) _PyObject_GC_NewVar((typeobj), (n)) )
259
-
260
-
261
- /* Utility macro to help write tp_traverse functions.
262
- * To use this macro, the tp_traverse function must name its arguments
263
- * "visit" and "arg". This is intended to keep tp_traverse functions
264
- * looking as much alike as possible.
265
- */
266
- #define Py_VISIT(op) \
267
- do { \
268
- if (op) { \
269
- int vret = visit(_PyObject_CAST(op), arg); \
270
- if (vret) \
271
- return vret; \
272
- } \
273
- } while (0)
274
-
275
- #ifndef Py_LIMITED_API
276
- # define Py_CPYTHON_OBJIMPL_H
277
- # include "cpython/objimpl.h"
278
- # undef Py_CPYTHON_OBJIMPL_H
279
- #endif
280
-
281
- #ifdef __cplusplus
282
- }
283
- #endif
284
- #endif /* !Py_OBJIMPL_H */
@@ -1,43 +0,0 @@
1
- #ifndef Py_ODICTOBJECT_H
2
- #define Py_ODICTOBJECT_H
3
- #ifdef __cplusplus
4
- extern "C" {
5
- #endif
6
-
7
-
8
- /* OrderedDict */
9
- /* This API is optional and mostly redundant. */
10
-
11
- #ifndef Py_LIMITED_API
12
-
13
- typedef struct _odictobject PyODictObject;
14
-
15
- PyAPI_DATA(PyTypeObject) PyODict_Type;
16
- PyAPI_DATA(PyTypeObject) PyODictIter_Type;
17
- PyAPI_DATA(PyTypeObject) PyODictKeys_Type;
18
- PyAPI_DATA(PyTypeObject) PyODictItems_Type;
19
- PyAPI_DATA(PyTypeObject) PyODictValues_Type;
20
-
21
- #define PyODict_Check(op) PyObject_TypeCheck(op, &PyODict_Type)
22
- #define PyODict_CheckExact(op) (Py_TYPE(op) == &PyODict_Type)
23
- #define PyODict_SIZE(op) PyDict_GET_SIZE((op))
24
-
25
- PyAPI_FUNC(PyObject *) PyODict_New(void);
26
- PyAPI_FUNC(int) PyODict_SetItem(PyObject *od, PyObject *key, PyObject *item);
27
- PyAPI_FUNC(int) PyODict_DelItem(PyObject *od, PyObject *key);
28
-
29
- /* wrappers around PyDict* functions */
30
- #define PyODict_GetItem(od, key) PyDict_GetItem(_PyObject_CAST(od), key)
31
- #define PyODict_GetItemWithError(od, key) \
32
- PyDict_GetItemWithError(_PyObject_CAST(od), key)
33
- #define PyODict_Contains(od, key) PyDict_Contains(_PyObject_CAST(od), key)
34
- #define PyODict_Size(od) PyDict_Size(_PyObject_CAST(od))
35
- #define PyODict_GetItemString(od, key) \
36
- PyDict_GetItemString(_PyObject_CAST(od), key)
37
-
38
- #endif
39
-
40
- #ifdef __cplusplus
41
- }
42
- #endif
43
- #endif /* !Py_ODICTOBJECT_H */
@@ -1,148 +0,0 @@
1
- /* Auto-generated by Tools/scripts/generate_opcode_h.py from Lib/opcode.py */
2
- #ifndef Py_OPCODE_H
3
- #define Py_OPCODE_H
4
- #ifdef __cplusplus
5
- extern "C" {
6
- #endif
7
-
8
-
9
- /* Instruction opcodes for compiled code */
10
- #define POP_TOP 1
11
- #define ROT_TWO 2
12
- #define ROT_THREE 3
13
- #define DUP_TOP 4
14
- #define DUP_TOP_TWO 5
15
- #define ROT_FOUR 6
16
- #define NOP 9
17
- #define UNARY_POSITIVE 10
18
- #define UNARY_NEGATIVE 11
19
- #define UNARY_NOT 12
20
- #define UNARY_INVERT 15
21
- #define BINARY_MATRIX_MULTIPLY 16
22
- #define INPLACE_MATRIX_MULTIPLY 17
23
- #define BINARY_POWER 19
24
- #define BINARY_MULTIPLY 20
25
- #define BINARY_MODULO 22
26
- #define BINARY_ADD 23
27
- #define BINARY_SUBTRACT 24
28
- #define BINARY_SUBSCR 25
29
- #define BINARY_FLOOR_DIVIDE 26
30
- #define BINARY_TRUE_DIVIDE 27
31
- #define INPLACE_FLOOR_DIVIDE 28
32
- #define INPLACE_TRUE_DIVIDE 29
33
- #define GET_AITER 50
34
- #define GET_ANEXT 51
35
- #define BEFORE_ASYNC_WITH 52
36
- #define BEGIN_FINALLY 53
37
- #define END_ASYNC_FOR 54
38
- #define INPLACE_ADD 55
39
- #define INPLACE_SUBTRACT 56
40
- #define INPLACE_MULTIPLY 57
41
- #define INPLACE_MODULO 59
42
- #define STORE_SUBSCR 60
43
- #define DELETE_SUBSCR 61
44
- #define BINARY_LSHIFT 62
45
- #define BINARY_RSHIFT 63
46
- #define BINARY_AND 64
47
- #define BINARY_XOR 65
48
- #define BINARY_OR 66
49
- #define INPLACE_POWER 67
50
- #define GET_ITER 68
51
- #define GET_YIELD_FROM_ITER 69
52
- #define PRINT_EXPR 70
53
- #define LOAD_BUILD_CLASS 71
54
- #define YIELD_FROM 72
55
- #define GET_AWAITABLE 73
56
- #define INPLACE_LSHIFT 75
57
- #define INPLACE_RSHIFT 76
58
- #define INPLACE_AND 77
59
- #define INPLACE_XOR 78
60
- #define INPLACE_OR 79
61
- #define WITH_CLEANUP_START 81
62
- #define WITH_CLEANUP_FINISH 82
63
- #define RETURN_VALUE 83
64
- #define IMPORT_STAR 84
65
- #define SETUP_ANNOTATIONS 85
66
- #define YIELD_VALUE 86
67
- #define POP_BLOCK 87
68
- #define END_FINALLY 88
69
- #define POP_EXCEPT 89
70
- #define HAVE_ARGUMENT 90
71
- #define STORE_NAME 90
72
- #define DELETE_NAME 91
73
- #define UNPACK_SEQUENCE 92
74
- #define FOR_ITER 93
75
- #define UNPACK_EX 94
76
- #define STORE_ATTR 95
77
- #define DELETE_ATTR 96
78
- #define STORE_GLOBAL 97
79
- #define DELETE_GLOBAL 98
80
- #define LOAD_CONST 100
81
- #define LOAD_NAME 101
82
- #define BUILD_TUPLE 102
83
- #define BUILD_LIST 103
84
- #define BUILD_SET 104
85
- #define BUILD_MAP 105
86
- #define LOAD_ATTR 106
87
- #define COMPARE_OP 107
88
- #define IMPORT_NAME 108
89
- #define IMPORT_FROM 109
90
- #define JUMP_FORWARD 110
91
- #define JUMP_IF_FALSE_OR_POP 111
92
- #define JUMP_IF_TRUE_OR_POP 112
93
- #define JUMP_ABSOLUTE 113
94
- #define POP_JUMP_IF_FALSE 114
95
- #define POP_JUMP_IF_TRUE 115
96
- #define LOAD_GLOBAL 116
97
- #define SETUP_FINALLY 122
98
- #define LOAD_FAST 124
99
- #define STORE_FAST 125
100
- #define DELETE_FAST 126
101
- #define RAISE_VARARGS 130
102
- #define CALL_FUNCTION 131
103
- #define MAKE_FUNCTION 132
104
- #define BUILD_SLICE 133
105
- #define LOAD_CLOSURE 135
106
- #define LOAD_DEREF 136
107
- #define STORE_DEREF 137
108
- #define DELETE_DEREF 138
109
- #define CALL_FUNCTION_KW 141
110
- #define CALL_FUNCTION_EX 142
111
- #define SETUP_WITH 143
112
- #define EXTENDED_ARG 144
113
- #define LIST_APPEND 145
114
- #define SET_ADD 146
115
- #define MAP_ADD 147
116
- #define LOAD_CLASSDEREF 148
117
- #define BUILD_LIST_UNPACK 149
118
- #define BUILD_MAP_UNPACK 150
119
- #define BUILD_MAP_UNPACK_WITH_CALL 151
120
- #define BUILD_TUPLE_UNPACK 152
121
- #define BUILD_SET_UNPACK 153
122
- #define SETUP_ASYNC_WITH 154
123
- #define FORMAT_VALUE 155
124
- #define BUILD_CONST_KEY_MAP 156
125
- #define BUILD_STRING 157
126
- #define BUILD_TUPLE_UNPACK_WITH_CALL 158
127
- #define LOAD_METHOD 160
128
- #define CALL_METHOD 161
129
- #define CALL_FINALLY 162
130
- #define POP_FINALLY 163
131
-
132
- /* EXCEPT_HANDLER is a special, implicit block type which is created when
133
- entering an except handler. It is not an opcode but we define it here
134
- as we want it to be available to both frameobject.c and ceval.c, while
135
- remaining private.*/
136
- #define EXCEPT_HANDLER 257
137
-
138
-
139
- enum cmp_op {PyCmp_LT=Py_LT, PyCmp_LE=Py_LE, PyCmp_EQ=Py_EQ, PyCmp_NE=Py_NE,
140
- PyCmp_GT=Py_GT, PyCmp_GE=Py_GE, PyCmp_IN, PyCmp_NOT_IN,
141
- PyCmp_IS, PyCmp_IS_NOT, PyCmp_EXC_MATCH, PyCmp_BAD};
142
-
143
- #define HAS_ARG(op) ((op) >= HAVE_ARGUMENT)
144
-
145
- #ifdef __cplusplus
146
- }
147
- #endif
148
- #endif /* !Py_OPCODE_H */
@@ -1,51 +0,0 @@
1
- #ifndef Py_OSDEFS_H
2
- #define Py_OSDEFS_H
3
- #ifdef __cplusplus
4
- extern "C" {
5
- #endif
6
-
7
-
8
- /* Operating system dependencies */
9
-
10
- #ifdef MS_WINDOWS
11
- #define SEP L'\\'
12
- #define ALTSEP L'/'
13
- #define MAXPATHLEN 256
14
- #define DELIM L';'
15
- #endif
16
-
17
- #ifdef __VXWORKS__
18
- #define DELIM L';'
19
- #endif
20
-
21
- /* Filename separator */
22
- #ifndef SEP
23
- #define SEP L'/'
24
- #endif
25
-
26
- /* Max pathname length */
27
- #ifdef __hpux
28
- #include <sys/param.h>
29
- #include <limits.h>
30
- #ifndef PATH_MAX
31
- #define PATH_MAX MAXPATHLEN
32
- #endif
33
- #endif
34
-
35
- #ifndef MAXPATHLEN
36
- #if defined(PATH_MAX) && PATH_MAX > 1024
37
- #define MAXPATHLEN PATH_MAX
38
- #else
39
- #define MAXPATHLEN 1024
40
- #endif
41
- #endif
42
-
43
- /* Search path entry delimiter */
44
- #ifndef DELIM
45
- #define DELIM L':'
46
- #endif
47
-
48
- #ifdef __cplusplus
49
- }
50
- #endif
51
- #endif /* !Py_OSDEFS_H */
@@ -1,17 +0,0 @@
1
-
2
- /* os module interface */
3
-
4
- #ifndef Py_OSMODULE_H
5
- #define Py_OSMODULE_H
6
- #ifdef __cplusplus
7
- extern "C" {
8
- #endif
9
-
10
- #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
11
- PyAPI_FUNC(PyObject *) PyOS_FSPath(PyObject *path);
12
- #endif
13
-
14
- #ifdef __cplusplus
15
- }
16
- #endif
17
- #endif /* !Py_OSMODULE_H */
@@ -1,110 +0,0 @@
1
- /* Parser-tokenizer link interface */
2
-
3
- #ifndef Py_LIMITED_API
4
- #ifndef Py_PARSETOK_H
5
- #define Py_PARSETOK_H
6
- #ifdef __cplusplus
7
- extern "C" {
8
- #endif
9
-
10
- #include "grammar.h" /* grammar */
11
- #include "node.h" /* node */
12
-
13
- typedef struct {
14
- int error;
15
- PyObject *filename;
16
- int lineno;
17
- int offset;
18
- char *text; /* UTF-8-encoded string */
19
- int token;
20
- int expected;
21
- } perrdetail;
22
-
23
- #if 0
24
- #define PyPARSE_YIELD_IS_KEYWORD 0x0001
25
- #endif
26
-
27
- #define PyPARSE_DONT_IMPLY_DEDENT 0x0002
28
-
29
- #if 0
30
- #define PyPARSE_WITH_IS_KEYWORD 0x0003
31
- #define PyPARSE_PRINT_IS_FUNCTION 0x0004
32
- #define PyPARSE_UNICODE_LITERALS 0x0008
33
- #endif
34
-
35
- #define PyPARSE_IGNORE_COOKIE 0x0010
36
- #define PyPARSE_BARRY_AS_BDFL 0x0020
37
- #define PyPARSE_TYPE_COMMENTS 0x0040
38
- #define PyPARSE_ASYNC_HACKS 0x0080
39
-
40
- PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int,
41
- perrdetail *);
42
- PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int,
43
- const char *, const char *,
44
- perrdetail *);
45
-
46
- PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int,
47
- perrdetail *, int);
48
- PyAPI_FUNC(node *) PyParser_ParseFileFlags(
49
- FILE *fp,
50
- const char *filename, /* decoded from the filesystem encoding */
51
- const char *enc,
52
- grammar *g,
53
- int start,
54
- const char *ps1,
55
- const char *ps2,
56
- perrdetail *err_ret,
57
- int flags);
58
- PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(
59
- FILE *fp,
60
- const char *filename, /* decoded from the filesystem encoding */
61
- const char *enc,
62
- grammar *g,
63
- int start,
64
- const char *ps1,
65
- const char *ps2,
66
- perrdetail *err_ret,
67
- int *flags);
68
- PyAPI_FUNC(node *) PyParser_ParseFileObject(
69
- FILE *fp,
70
- PyObject *filename,
71
- const char *enc,
72
- grammar *g,
73
- int start,
74
- const char *ps1,
75
- const char *ps2,
76
- perrdetail *err_ret,
77
- int *flags);
78
-
79
- PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(
80
- const char *s,
81
- const char *filename, /* decoded from the filesystem encoding */
82
- grammar *g,
83
- int start,
84
- perrdetail *err_ret,
85
- int flags);
86
- PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(
87
- const char *s,
88
- const char *filename, /* decoded from the filesystem encoding */
89
- grammar *g,
90
- int start,
91
- perrdetail *err_ret,
92
- int *flags);
93
- PyAPI_FUNC(node *) PyParser_ParseStringObject(
94
- const char *s,
95
- PyObject *filename,
96
- grammar *g,
97
- int start,
98
- perrdetail *err_ret,
99
- int *flags);
100
-
101
- /* Note that the following functions are defined in pythonrun.c,
102
- not in parsetok.c */
103
- PyAPI_FUNC(void) PyParser_SetError(perrdetail *);
104
- PyAPI_FUNC(void) PyParser_ClearError(perrdetail *);
105
-
106
- #ifdef __cplusplus
107
- }
108
- #endif
109
- #endif /* !Py_PARSETOK_H */
110
- #endif /* !Py_LIMITED_API */
@@ -1,35 +0,0 @@
1
-
2
- /* Python version identification scheme.
3
-
4
- When the major or minor version changes, the VERSION variable in
5
- configure.ac must also be changed.
6
-
7
- There is also (independent) API version information in modsupport.h.
8
- */
9
-
10
- /* Values for PY_RELEASE_LEVEL */
11
- #define PY_RELEASE_LEVEL_ALPHA 0xA
12
- #define PY_RELEASE_LEVEL_BETA 0xB
13
- #define PY_RELEASE_LEVEL_GAMMA 0xC /* For release candidates */
14
- #define PY_RELEASE_LEVEL_FINAL 0xF /* Serial should be 0 here */
15
- /* Higher for patch releases */
16
-
17
- /* Version parsed out into numeric values */
18
- /*--start constants--*/
19
- #define PY_MAJOR_VERSION 3
20
- #define PY_MINOR_VERSION 8
21
- #define PY_MICRO_VERSION 10
22
- #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
23
- #define PY_RELEASE_SERIAL 0
24
-
25
- /* Version as a string */
26
- #define PY_VERSION "3.8.10"
27
- /*--end constants--*/
28
-
29
- /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
30
- Use this for numeric comparisons, e.g. #if PY_VERSION_HEX >= ... */
31
- #define PY_VERSION_HEX ((PY_MAJOR_VERSION << 24) | \
32
- (PY_MINOR_VERSION << 16) | \
33
- (PY_MICRO_VERSION << 8) | \
34
- (PY_RELEASE_LEVEL << 4) | \
35
- (PY_RELEASE_SERIAL << 0))