@plone/volto 14.0.2 → 14.1.0

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 (212) hide show
  1. package/CHANGELOG.md +22 -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/src/actions/vocabularies/vocabularies.js +14 -3
  29. package/src/components/index.js +1 -0
  30. package/src/components/manage/Blocks/HeroImageLeft/Edit.jsx +1 -1
  31. package/src/components/manage/Blocks/Listing/getAsyncData.js +1 -1
  32. package/src/components/manage/Blocks/Text/Edit.jsx +19 -0
  33. package/src/components/manage/Form/Form.jsx +11 -1
  34. package/src/components/manage/Form/UndoToolbar.jsx +78 -0
  35. package/src/components/manage/Widgets/AlignWidget.stories.jsx +5 -21
  36. package/src/components/manage/Widgets/ArrayWidget.jsx +83 -101
  37. package/src/components/manage/Widgets/ArrayWidget.stories.jsx +29 -64
  38. package/src/components/manage/Widgets/CheckboxWidget.stories.jsx +5 -22
  39. package/src/components/manage/Widgets/DatetimeWidget.jsx +65 -74
  40. package/src/components/manage/Widgets/DatetimeWidget.stories.jsx +7 -23
  41. package/src/components/manage/Widgets/DatetimeWidget.test.jsx +17 -15
  42. package/src/components/manage/Widgets/EmailWidget.stories.jsx +5 -22
  43. package/src/components/manage/Widgets/FileWidget.stories.jsx +5 -22
  44. package/src/components/manage/Widgets/NumberWidget.stories.jsx +5 -23
  45. package/src/components/manage/Widgets/ObjectBrowserWidget.stories.js +24 -32
  46. package/src/components/manage/Widgets/ObjectListWidget.stories.js +44 -44
  47. package/src/components/manage/Widgets/ObjectWidget.stories.jsx +13 -28
  48. package/src/components/manage/Widgets/PasswordWidget.stories.jsx +5 -22
  49. package/src/components/manage/Widgets/QueryWidget.jsx +2 -2
  50. package/src/components/manage/Widgets/QueryWidget.stories.jsx +1637 -22
  51. package/src/components/manage/Widgets/SelectAutoComplete.jsx +79 -48
  52. package/src/components/manage/Widgets/SelectAutoComplete.test.jsx +16 -0
  53. package/src/components/manage/Widgets/SelectAutocompleteWidget.stories.jsx +161 -0
  54. package/src/components/manage/Widgets/SelectUtils.js +90 -30
  55. package/src/components/manage/Widgets/SelectUtils.test.jsx +76 -1
  56. package/src/components/manage/Widgets/SelectWidget.jsx +26 -37
  57. package/src/components/manage/Widgets/SelectWidget.stories.jsx +96 -28
  58. package/src/components/manage/Widgets/TextWidget.stories.jsx +5 -22
  59. package/src/components/manage/Widgets/TextareaWidget.stories.jsx +5 -22
  60. package/src/components/manage/Widgets/TokenWidget.jsx +19 -17
  61. package/src/components/manage/Widgets/TokenWidget.stories.jsx +141 -0
  62. package/src/components/manage/Widgets/UrlWidget.stories.jsx +5 -21
  63. package/src/components/manage/Widgets/VocabularyTermsWidget.stories.js +27 -64
  64. package/src/components/manage/Widgets/WysiwygWidget.stories.jsx +5 -22
  65. package/src/components/manage/Widgets/story.jsx +38 -0
  66. package/src/components/theme/ContactForm/ContactForm.jsx +1 -0
  67. package/src/components/theme/ContactForm/ContactForm.stories.jsx +126 -0
  68. package/src/components/theme/CorsError/CorsError.jsx +2 -2
  69. package/src/config/Loadables.jsx +2 -0
  70. package/src/config/index.js +1 -0
  71. package/src/helpers/UndoManager/useUndoManager.js +102 -0
  72. package/src/helpers/index.js +1 -0
  73. package/src/reducers/vocabularies/vocabularies.js +13 -2
  74. package/src/store.js +1 -1
  75. package/src/storybook.jsx +55 -0
  76. package/theme/themes/pastanaga/extras/time-picker-overrides.less +1 -1
  77. package/include/python3.8/Python-ast.h +0 -715
  78. package/include/python3.8/Python.h +0 -160
  79. package/include/python3.8/abstract.h +0 -844
  80. package/include/python3.8/asdl.h +0 -46
  81. package/include/python3.8/ast.h +0 -37
  82. package/include/python3.8/bitset.h +0 -23
  83. package/include/python3.8/bltinmodule.h +0 -14
  84. package/include/python3.8/boolobject.h +0 -34
  85. package/include/python3.8/bytearrayobject.h +0 -62
  86. package/include/python3.8/bytes_methods.h +0 -69
  87. package/include/python3.8/bytesobject.h +0 -224
  88. package/include/python3.8/cellobject.h +0 -29
  89. package/include/python3.8/ceval.h +0 -231
  90. package/include/python3.8/classobject.h +0 -59
  91. package/include/python3.8/code.h +0 -180
  92. package/include/python3.8/codecs.h +0 -240
  93. package/include/python3.8/compile.h +0 -106
  94. package/include/python3.8/complexobject.h +0 -69
  95. package/include/python3.8/context.h +0 -84
  96. package/include/python3.8/cpython/abstract.h +0 -319
  97. package/include/python3.8/cpython/dictobject.h +0 -94
  98. package/include/python3.8/cpython/fileobject.h +0 -24
  99. package/include/python3.8/cpython/initconfig.h +0 -434
  100. package/include/python3.8/cpython/interpreteridobject.h +0 -19
  101. package/include/python3.8/cpython/object.h +0 -470
  102. package/include/python3.8/cpython/objimpl.h +0 -113
  103. package/include/python3.8/cpython/pyerrors.h +0 -188
  104. package/include/python3.8/cpython/pylifecycle.h +0 -78
  105. package/include/python3.8/cpython/pymem.h +0 -108
  106. package/include/python3.8/cpython/pystate.h +0 -252
  107. package/include/python3.8/cpython/sysmodule.h +0 -21
  108. package/include/python3.8/cpython/traceback.h +0 -22
  109. package/include/python3.8/cpython/tupleobject.h +0 -36
  110. package/include/python3.8/cpython/unicodeobject.h +0 -1239
  111. package/include/python3.8/datetime.h +0 -259
  112. package/include/python3.8/descrobject.h +0 -108
  113. package/include/python3.8/dictobject.h +0 -94
  114. package/include/python3.8/dtoa.h +0 -19
  115. package/include/python3.8/dynamic_annotations.h +0 -499
  116. package/include/python3.8/enumobject.h +0 -17
  117. package/include/python3.8/errcode.h +0 -38
  118. package/include/python3.8/eval.h +0 -37
  119. package/include/python3.8/fileobject.h +0 -49
  120. package/include/python3.8/fileutils.h +0 -185
  121. package/include/python3.8/floatobject.h +0 -130
  122. package/include/python3.8/frameobject.h +0 -92
  123. package/include/python3.8/funcobject.h +0 -104
  124. package/include/python3.8/genobject.h +0 -109
  125. package/include/python3.8/graminit.h +0 -94
  126. package/include/python3.8/grammar.h +0 -77
  127. package/include/python3.8/import.h +0 -149
  128. package/include/python3.8/internal/pycore_accu.h +0 -39
  129. package/include/python3.8/internal/pycore_atomic.h +0 -558
  130. package/include/python3.8/internal/pycore_ceval.h +0 -37
  131. package/include/python3.8/internal/pycore_code.h +0 -27
  132. package/include/python3.8/internal/pycore_condvar.h +0 -95
  133. package/include/python3.8/internal/pycore_context.h +0 -42
  134. package/include/python3.8/internal/pycore_fileutils.h +0 -54
  135. package/include/python3.8/internal/pycore_getopt.h +0 -22
  136. package/include/python3.8/internal/pycore_gil.h +0 -50
  137. package/include/python3.8/internal/pycore_hamt.h +0 -116
  138. package/include/python3.8/internal/pycore_initconfig.h +0 -166
  139. package/include/python3.8/internal/pycore_object.h +0 -81
  140. package/include/python3.8/internal/pycore_pathconfig.h +0 -75
  141. package/include/python3.8/internal/pycore_pyerrors.h +0 -62
  142. package/include/python3.8/internal/pycore_pyhash.h +0 -10
  143. package/include/python3.8/internal/pycore_pylifecycle.h +0 -118
  144. package/include/python3.8/internal/pycore_pymem.h +0 -212
  145. package/include/python3.8/internal/pycore_pystate.h +0 -326
  146. package/include/python3.8/internal/pycore_traceback.h +0 -96
  147. package/include/python3.8/internal/pycore_tupleobject.h +0 -19
  148. package/include/python3.8/internal/pycore_warnings.h +0 -25
  149. package/include/python3.8/interpreteridobject.h +0 -17
  150. package/include/python3.8/intrcheck.h +0 -33
  151. package/include/python3.8/iterobject.h +0 -25
  152. package/include/python3.8/listobject.h +0 -81
  153. package/include/python3.8/longintrepr.h +0 -99
  154. package/include/python3.8/longobject.h +0 -242
  155. package/include/python3.8/marshal.h +0 -28
  156. package/include/python3.8/memoryobject.h +0 -72
  157. package/include/python3.8/methodobject.h +0 -131
  158. package/include/python3.8/modsupport.h +0 -248
  159. package/include/python3.8/moduleobject.h +0 -90
  160. package/include/python3.8/namespaceobject.h +0 -19
  161. package/include/python3.8/node.h +0 -48
  162. package/include/python3.8/object.h +0 -753
  163. package/include/python3.8/objimpl.h +0 -284
  164. package/include/python3.8/odictobject.h +0 -43
  165. package/include/python3.8/opcode.h +0 -148
  166. package/include/python3.8/osdefs.h +0 -51
  167. package/include/python3.8/osmodule.h +0 -17
  168. package/include/python3.8/parsetok.h +0 -110
  169. package/include/python3.8/patchlevel.h +0 -35
  170. package/include/python3.8/picklebufobject.h +0 -31
  171. package/include/python3.8/py_curses.h +0 -100
  172. package/include/python3.8/pyarena.h +0 -64
  173. package/include/python3.8/pycapsule.h +0 -59
  174. package/include/python3.8/pyconfig.h +0 -1665
  175. package/include/python3.8/pyctype.h +0 -39
  176. package/include/python3.8/pydebug.h +0 -40
  177. package/include/python3.8/pydtrace.h +0 -59
  178. package/include/python3.8/pydtrace_probes.h +0 -228
  179. package/include/python3.8/pyerrors.h +0 -335
  180. package/include/python3.8/pyexpat.h +0 -55
  181. package/include/python3.8/pyfpe.h +0 -12
  182. package/include/python3.8/pyhash.h +0 -145
  183. package/include/python3.8/pylifecycle.h +0 -75
  184. package/include/python3.8/pymacconfig.h +0 -102
  185. package/include/python3.8/pymacro.h +0 -106
  186. package/include/python3.8/pymath.h +0 -230
  187. package/include/python3.8/pymem.h +0 -150
  188. package/include/python3.8/pyport.h +0 -850
  189. package/include/python3.8/pystate.h +0 -136
  190. package/include/python3.8/pystrcmp.h +0 -23
  191. package/include/python3.8/pystrhex.h +0 -22
  192. package/include/python3.8/pystrtod.h +0 -45
  193. package/include/python3.8/pythonrun.h +0 -210
  194. package/include/python3.8/pythread.h +0 -161
  195. package/include/python3.8/pytime.h +0 -246
  196. package/include/python3.8/rangeobject.h +0 -27
  197. package/include/python3.8/setobject.h +0 -108
  198. package/include/python3.8/sliceobject.h +0 -65
  199. package/include/python3.8/structmember.h +0 -74
  200. package/include/python3.8/structseq.h +0 -49
  201. package/include/python3.8/symtable.h +0 -123
  202. package/include/python3.8/sysmodule.h +0 -41
  203. package/include/python3.8/token.h +0 -92
  204. package/include/python3.8/traceback.h +0 -28
  205. package/include/python3.8/tracemalloc.h +0 -38
  206. package/include/python3.8/tupleobject.h +0 -48
  207. package/include/python3.8/typeslots.h +0 -85
  208. package/include/python3.8/ucnhash.h +0 -36
  209. package/include/python3.8/unicodeobject.h +0 -1044
  210. package/include/python3.8/warnings.h +0 -67
  211. package/include/python3.8/weakrefobject.h +0 -86
  212. package/src/components/theme/ContactForm/ContactForm.stories.mdx +0 -39
@@ -1,470 +0,0 @@
1
- #ifndef Py_CPYTHON_OBJECT_H
2
- # error "this header file must not be included directly"
3
- #endif
4
-
5
- #ifdef __cplusplus
6
- extern "C" {
7
- #endif
8
-
9
- /********************* String Literals ****************************************/
10
- /* This structure helps managing static strings. The basic usage goes like this:
11
- Instead of doing
12
-
13
- r = PyObject_CallMethod(o, "foo", "args", ...);
14
-
15
- do
16
-
17
- _Py_IDENTIFIER(foo);
18
- ...
19
- r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...);
20
-
21
- PyId_foo is a static variable, either on block level or file level. On first
22
- usage, the string "foo" is interned, and the structures are linked. On interpreter
23
- shutdown, all strings are released (through _PyUnicode_ClearStaticStrings).
24
-
25
- Alternatively, _Py_static_string allows choosing the variable name.
26
- _PyUnicode_FromId returns a borrowed reference to the interned string.
27
- _PyObject_{Get,Set,Has}AttrId are __getattr__ versions using _Py_Identifier*.
28
- */
29
- typedef struct _Py_Identifier {
30
- struct _Py_Identifier *next;
31
- const char* string;
32
- PyObject *object;
33
- } _Py_Identifier;
34
-
35
- #define _Py_static_string_init(value) { .next = NULL, .string = value, .object = NULL }
36
- #define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value)
37
- #define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname)
38
-
39
- /* buffer interface */
40
- typedef struct bufferinfo {
41
- void *buf;
42
- PyObject *obj; /* owned reference */
43
- Py_ssize_t len;
44
- Py_ssize_t itemsize; /* This is Py_ssize_t so it can be
45
- pointed to by strides in simple case.*/
46
- int readonly;
47
- int ndim;
48
- char *format;
49
- Py_ssize_t *shape;
50
- Py_ssize_t *strides;
51
- Py_ssize_t *suboffsets;
52
- void *internal;
53
- } Py_buffer;
54
-
55
- typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
56
- typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
57
-
58
- typedef PyObject *(*vectorcallfunc)(PyObject *callable, PyObject *const *args,
59
- size_t nargsf, PyObject *kwnames);
60
-
61
- /* Maximum number of dimensions */
62
- #define PyBUF_MAX_NDIM 64
63
-
64
- /* Flags for getting buffers */
65
- #define PyBUF_SIMPLE 0
66
- #define PyBUF_WRITABLE 0x0001
67
- /* we used to include an E, backwards compatible alias */
68
- #define PyBUF_WRITEABLE PyBUF_WRITABLE
69
- #define PyBUF_FORMAT 0x0004
70
- #define PyBUF_ND 0x0008
71
- #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
72
- #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
73
- #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
74
- #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
75
- #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
76
-
77
- #define PyBUF_CONTIG (PyBUF_ND | PyBUF_WRITABLE)
78
- #define PyBUF_CONTIG_RO (PyBUF_ND)
79
-
80
- #define PyBUF_STRIDED (PyBUF_STRIDES | PyBUF_WRITABLE)
81
- #define PyBUF_STRIDED_RO (PyBUF_STRIDES)
82
-
83
- #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT)
84
- #define PyBUF_RECORDS_RO (PyBUF_STRIDES | PyBUF_FORMAT)
85
-
86
- #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT)
87
- #define PyBUF_FULL_RO (PyBUF_INDIRECT | PyBUF_FORMAT)
88
-
89
-
90
- #define PyBUF_READ 0x100
91
- #define PyBUF_WRITE 0x200
92
- /* End buffer interface */
93
-
94
-
95
- typedef struct {
96
- /* Number implementations must check *both*
97
- arguments for proper type and implement the necessary conversions
98
- in the slot functions themselves. */
99
-
100
- binaryfunc nb_add;
101
- binaryfunc nb_subtract;
102
- binaryfunc nb_multiply;
103
- binaryfunc nb_remainder;
104
- binaryfunc nb_divmod;
105
- ternaryfunc nb_power;
106
- unaryfunc nb_negative;
107
- unaryfunc nb_positive;
108
- unaryfunc nb_absolute;
109
- inquiry nb_bool;
110
- unaryfunc nb_invert;
111
- binaryfunc nb_lshift;
112
- binaryfunc nb_rshift;
113
- binaryfunc nb_and;
114
- binaryfunc nb_xor;
115
- binaryfunc nb_or;
116
- unaryfunc nb_int;
117
- void *nb_reserved; /* the slot formerly known as nb_long */
118
- unaryfunc nb_float;
119
-
120
- binaryfunc nb_inplace_add;
121
- binaryfunc nb_inplace_subtract;
122
- binaryfunc nb_inplace_multiply;
123
- binaryfunc nb_inplace_remainder;
124
- ternaryfunc nb_inplace_power;
125
- binaryfunc nb_inplace_lshift;
126
- binaryfunc nb_inplace_rshift;
127
- binaryfunc nb_inplace_and;
128
- binaryfunc nb_inplace_xor;
129
- binaryfunc nb_inplace_or;
130
-
131
- binaryfunc nb_floor_divide;
132
- binaryfunc nb_true_divide;
133
- binaryfunc nb_inplace_floor_divide;
134
- binaryfunc nb_inplace_true_divide;
135
-
136
- unaryfunc nb_index;
137
-
138
- binaryfunc nb_matrix_multiply;
139
- binaryfunc nb_inplace_matrix_multiply;
140
- } PyNumberMethods;
141
-
142
- typedef struct {
143
- lenfunc sq_length;
144
- binaryfunc sq_concat;
145
- ssizeargfunc sq_repeat;
146
- ssizeargfunc sq_item;
147
- void *was_sq_slice;
148
- ssizeobjargproc sq_ass_item;
149
- void *was_sq_ass_slice;
150
- objobjproc sq_contains;
151
-
152
- binaryfunc sq_inplace_concat;
153
- ssizeargfunc sq_inplace_repeat;
154
- } PySequenceMethods;
155
-
156
- typedef struct {
157
- lenfunc mp_length;
158
- binaryfunc mp_subscript;
159
- objobjargproc mp_ass_subscript;
160
- } PyMappingMethods;
161
-
162
- typedef struct {
163
- unaryfunc am_await;
164
- unaryfunc am_aiter;
165
- unaryfunc am_anext;
166
- } PyAsyncMethods;
167
-
168
- typedef struct {
169
- getbufferproc bf_getbuffer;
170
- releasebufferproc bf_releasebuffer;
171
- } PyBufferProcs;
172
-
173
- /* Allow printfunc in the tp_vectorcall_offset slot for
174
- * backwards-compatibility */
175
- typedef Py_ssize_t printfunc;
176
-
177
- typedef struct _typeobject {
178
- PyObject_VAR_HEAD
179
- const char *tp_name; /* For printing, in format "<module>.<name>" */
180
- Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */
181
-
182
- /* Methods to implement standard operations */
183
-
184
- destructor tp_dealloc;
185
- Py_ssize_t tp_vectorcall_offset;
186
- getattrfunc tp_getattr;
187
- setattrfunc tp_setattr;
188
- PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2)
189
- or tp_reserved (Python 3) */
190
- reprfunc tp_repr;
191
-
192
- /* Method suites for standard classes */
193
-
194
- PyNumberMethods *tp_as_number;
195
- PySequenceMethods *tp_as_sequence;
196
- PyMappingMethods *tp_as_mapping;
197
-
198
- /* More standard operations (here for binary compatibility) */
199
-
200
- hashfunc tp_hash;
201
- ternaryfunc tp_call;
202
- reprfunc tp_str;
203
- getattrofunc tp_getattro;
204
- setattrofunc tp_setattro;
205
-
206
- /* Functions to access object as input/output buffer */
207
- PyBufferProcs *tp_as_buffer;
208
-
209
- /* Flags to define presence of optional/expanded features */
210
- unsigned long tp_flags;
211
-
212
- const char *tp_doc; /* Documentation string */
213
-
214
- /* Assigned meaning in release 2.0 */
215
- /* call function for all accessible objects */
216
- traverseproc tp_traverse;
217
-
218
- /* delete references to contained objects */
219
- inquiry tp_clear;
220
-
221
- /* Assigned meaning in release 2.1 */
222
- /* rich comparisons */
223
- richcmpfunc tp_richcompare;
224
-
225
- /* weak reference enabler */
226
- Py_ssize_t tp_weaklistoffset;
227
-
228
- /* Iterators */
229
- getiterfunc tp_iter;
230
- iternextfunc tp_iternext;
231
-
232
- /* Attribute descriptor and subclassing stuff */
233
- struct PyMethodDef *tp_methods;
234
- struct PyMemberDef *tp_members;
235
- struct PyGetSetDef *tp_getset;
236
- struct _typeobject *tp_base;
237
- PyObject *tp_dict;
238
- descrgetfunc tp_descr_get;
239
- descrsetfunc tp_descr_set;
240
- Py_ssize_t tp_dictoffset;
241
- initproc tp_init;
242
- allocfunc tp_alloc;
243
- newfunc tp_new;
244
- freefunc tp_free; /* Low-level free-memory routine */
245
- inquiry tp_is_gc; /* For PyObject_IS_GC */
246
- PyObject *tp_bases;
247
- PyObject *tp_mro; /* method resolution order */
248
- PyObject *tp_cache;
249
- PyObject *tp_subclasses;
250
- PyObject *tp_weaklist;
251
- destructor tp_del;
252
-
253
- /* Type attribute cache version tag. Added in version 2.6 */
254
- unsigned int tp_version_tag;
255
-
256
- destructor tp_finalize;
257
- vectorcallfunc tp_vectorcall;
258
-
259
- /* bpo-37250: kept for backwards compatibility in CPython 3.8 only */
260
- Py_DEPRECATED(3.8) int (*tp_print)(PyObject *, FILE *, int);
261
-
262
- #ifdef COUNT_ALLOCS
263
- /* these must be last and never explicitly initialized */
264
- Py_ssize_t tp_allocs;
265
- Py_ssize_t tp_frees;
266
- Py_ssize_t tp_maxalloc;
267
- struct _typeobject *tp_prev;
268
- struct _typeobject *tp_next;
269
- #endif
270
- } PyTypeObject;
271
-
272
- /* The *real* layout of a type object when allocated on the heap */
273
- typedef struct _heaptypeobject {
274
- /* Note: there's a dependency on the order of these members
275
- in slotptr() in typeobject.c . */
276
- PyTypeObject ht_type;
277
- PyAsyncMethods as_async;
278
- PyNumberMethods as_number;
279
- PyMappingMethods as_mapping;
280
- PySequenceMethods as_sequence; /* as_sequence comes after as_mapping,
281
- so that the mapping wins when both
282
- the mapping and the sequence define
283
- a given operator (e.g. __getitem__).
284
- see add_operators() in typeobject.c . */
285
- PyBufferProcs as_buffer;
286
- PyObject *ht_name, *ht_slots, *ht_qualname;
287
- struct _dictkeysobject *ht_cached_keys;
288
- /* here are optional user slots, followed by the members. */
289
- } PyHeapTypeObject;
290
-
291
- /* access macro to the members which are floating "behind" the object */
292
- #define PyHeapType_GET_MEMBERS(etype) \
293
- ((PyMemberDef *)(((char *)etype) + Py_TYPE(etype)->tp_basicsize))
294
-
295
- PyAPI_FUNC(const char *) _PyType_Name(PyTypeObject *);
296
- PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *);
297
- PyAPI_FUNC(PyObject *) _PyType_LookupId(PyTypeObject *, _Py_Identifier *);
298
- PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, _Py_Identifier *);
299
- PyAPI_FUNC(PyTypeObject *) _PyType_CalculateMetaclass(PyTypeObject *, PyObject *);
300
- PyAPI_FUNC(PyObject *) _PyType_GetDocFromInternalDoc(const char *, const char *);
301
- PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *, const char *);
302
-
303
- struct _Py_Identifier;
304
- PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);
305
- PyAPI_FUNC(void) _Py_BreakPoint(void);
306
- PyAPI_FUNC(void) _PyObject_Dump(PyObject *);
307
- PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *);
308
-
309
- PyAPI_FUNC(int) _PyObject_IsAbstract(PyObject *);
310
- PyAPI_FUNC(PyObject *) _PyObject_GetAttrId(PyObject *, struct _Py_Identifier *);
311
- PyAPI_FUNC(int) _PyObject_SetAttrId(PyObject *, struct _Py_Identifier *, PyObject *);
312
- PyAPI_FUNC(int) _PyObject_HasAttrId(PyObject *, struct _Py_Identifier *);
313
- /* Replacements of PyObject_GetAttr() and _PyObject_GetAttrId() which
314
- don't raise AttributeError.
315
-
316
- Return 1 and set *result != NULL if an attribute is found.
317
- Return 0 and set *result == NULL if an attribute is not found;
318
- an AttributeError is silenced.
319
- Return -1 and set *result == NULL if an error other than AttributeError
320
- is raised.
321
- */
322
- PyAPI_FUNC(int) _PyObject_LookupAttr(PyObject *, PyObject *, PyObject **);
323
- PyAPI_FUNC(int) _PyObject_LookupAttrId(PyObject *, struct _Py_Identifier *, PyObject **);
324
- PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *);
325
- PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *);
326
- PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *);
327
- PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *);
328
-
329
- /* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes
330
- dict as the last parameter. */
331
- PyAPI_FUNC(PyObject *)
332
- _PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *, int);
333
- PyAPI_FUNC(int)
334
- _PyObject_GenericSetAttrWithDict(PyObject *, PyObject *,
335
- PyObject *, PyObject *);
336
-
337
- #define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0)
338
-
339
- static inline void _Py_Dealloc_inline(PyObject *op)
340
- {
341
- destructor dealloc = Py_TYPE(op)->tp_dealloc;
342
- #ifdef Py_TRACE_REFS
343
- _Py_ForgetReference(op);
344
- #else
345
- _Py_INC_TPFREES(op);
346
- #endif
347
- (*dealloc)(op);
348
- }
349
- #define _Py_Dealloc(op) _Py_Dealloc_inline(op)
350
-
351
-
352
- /* Safely decref `op` and set `op` to `op2`.
353
- *
354
- * As in case of Py_CLEAR "the obvious" code can be deadly:
355
- *
356
- * Py_DECREF(op);
357
- * op = op2;
358
- *
359
- * The safe way is:
360
- *
361
- * Py_SETREF(op, op2);
362
- *
363
- * That arranges to set `op` to `op2` _before_ decref'ing, so that any code
364
- * triggered as a side-effect of `op` getting torn down no longer believes
365
- * `op` points to a valid object.
366
- *
367
- * Py_XSETREF is a variant of Py_SETREF that uses Py_XDECREF instead of
368
- * Py_DECREF.
369
- */
370
-
371
- #define Py_SETREF(op, op2) \
372
- do { \
373
- PyObject *_py_tmp = _PyObject_CAST(op); \
374
- (op) = (op2); \
375
- Py_DECREF(_py_tmp); \
376
- } while (0)
377
-
378
- #define Py_XSETREF(op, op2) \
379
- do { \
380
- PyObject *_py_tmp = _PyObject_CAST(op); \
381
- (op) = (op2); \
382
- Py_XDECREF(_py_tmp); \
383
- } while (0)
384
-
385
-
386
- PyAPI_DATA(PyTypeObject) _PyNone_Type;
387
- PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type;
388
-
389
- /* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE.
390
- * Defined in object.c.
391
- */
392
- PyAPI_DATA(int) _Py_SwappedOp[];
393
-
394
- /* This is the old private API, invoked by the macros before 3.2.4.
395
- Kept for binary compatibility of extensions using the stable ABI. */
396
- PyAPI_FUNC(void) _PyTrash_deposit_object(PyObject*);
397
- PyAPI_FUNC(void) _PyTrash_destroy_chain(void);
398
-
399
- PyAPI_FUNC(void)
400
- _PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks,
401
- size_t sizeof_block);
402
- PyAPI_FUNC(void)
403
- _PyObject_DebugTypeStats(FILE *out);
404
-
405
- /* Define a pair of assertion macros:
406
- _PyObject_ASSERT_FROM(), _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT().
407
-
408
- These work like the regular C assert(), in that they will abort the
409
- process with a message on stderr if the given condition fails to hold,
410
- but compile away to nothing if NDEBUG is defined.
411
-
412
- However, before aborting, Python will also try to call _PyObject_Dump() on
413
- the given object. This may be of use when investigating bugs in which a
414
- particular object is corrupt (e.g. buggy a tp_visit method in an extension
415
- module breaking the garbage collector), to help locate the broken objects.
416
-
417
- The WITH_MSG variant allows you to supply an additional message that Python
418
- will attempt to print to stderr, after the object dump. */
419
- #ifdef NDEBUG
420
- /* No debugging: compile away the assertions: */
421
- # define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \
422
- ((void)0)
423
- #else
424
- /* With debugging: generate checks: */
425
- # define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \
426
- ((expr) \
427
- ? (void)(0) \
428
- : _PyObject_AssertFailed((obj), Py_STRINGIFY(expr), \
429
- (msg), (filename), (lineno), (func)))
430
- #endif
431
-
432
- #define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) \
433
- _PyObject_ASSERT_FROM(obj, expr, msg, __FILE__, __LINE__, __func__)
434
- #define _PyObject_ASSERT(obj, expr) \
435
- _PyObject_ASSERT_WITH_MSG(obj, expr, NULL)
436
-
437
- #define _PyObject_ASSERT_FAILED_MSG(obj, msg) \
438
- _PyObject_AssertFailed((obj), NULL, (msg), __FILE__, __LINE__, __func__)
439
-
440
- /* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined,
441
- to avoid causing compiler/linker errors when building extensions without
442
- NDEBUG against a Python built with NDEBUG defined.
443
-
444
- msg, expr and function can be NULL. */
445
- PyAPI_FUNC(void) _PyObject_AssertFailed(
446
- PyObject *obj,
447
- const char *expr,
448
- const char *msg,
449
- const char *file,
450
- int line,
451
- const char *function);
452
-
453
- /* Check if an object is consistent. For example, ensure that the reference
454
- counter is greater than or equal to 1, and ensure that ob_type is not NULL.
455
-
456
- Call _PyObject_AssertFailed() if the object is inconsistent.
457
-
458
- If check_content is zero, only check header fields: reduce the overhead.
459
-
460
- The function always return 1. The return value is just here to be able to
461
- write:
462
-
463
- assert(_PyObject_CheckConsistency(obj, 1)); */
464
- PyAPI_FUNC(int) _PyObject_CheckConsistency(
465
- PyObject *op,
466
- int check_content);
467
-
468
- #ifdef __cplusplus
469
- }
470
- #endif
@@ -1,113 +0,0 @@
1
- #ifndef Py_CPYTHON_OBJIMPL_H
2
- # error "this header file must not be included directly"
3
- #endif
4
-
5
- #ifdef __cplusplus
6
- extern "C" {
7
- #endif
8
-
9
- /* This function returns the number of allocated memory blocks, regardless of size */
10
- PyAPI_FUNC(Py_ssize_t) _Py_GetAllocatedBlocks(void);
11
-
12
- /* Macros */
13
- #ifdef WITH_PYMALLOC
14
- PyAPI_FUNC(int) _PyObject_DebugMallocStats(FILE *out);
15
- #endif
16
-
17
-
18
- typedef struct {
19
- /* user context passed as the first argument to the 2 functions */
20
- void *ctx;
21
-
22
- /* allocate an arena of size bytes */
23
- void* (*alloc) (void *ctx, size_t size);
24
-
25
- /* free an arena */
26
- void (*free) (void *ctx, void *ptr, size_t size);
27
- } PyObjectArenaAllocator;
28
-
29
- /* Get the arena allocator. */
30
- PyAPI_FUNC(void) PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator);
31
-
32
- /* Set the arena allocator. */
33
- PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator);
34
-
35
-
36
- PyAPI_FUNC(Py_ssize_t) _PyGC_CollectNoFail(void);
37
- PyAPI_FUNC(Py_ssize_t) _PyGC_CollectIfEnabled(void);
38
-
39
-
40
- /* Test if an object has a GC head */
41
- #define PyObject_IS_GC(o) \
42
- (PyType_IS_GC(Py_TYPE(o)) \
43
- && (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o)))
44
-
45
- /* GC information is stored BEFORE the object structure. */
46
- typedef struct {
47
- // Pointer to next object in the list.
48
- // 0 means the object is not tracked
49
- uintptr_t _gc_next;
50
-
51
- // Pointer to previous object in the list.
52
- // Lowest two bits are used for flags documented later.
53
- uintptr_t _gc_prev;
54
- } PyGC_Head;
55
-
56
- #define _Py_AS_GC(o) ((PyGC_Head *)(o)-1)
57
-
58
- /* True if the object is currently tracked by the GC. */
59
- #define _PyObject_GC_IS_TRACKED(o) (_Py_AS_GC(o)->_gc_next != 0)
60
-
61
- /* True if the object may be tracked by the GC in the future, or already is.
62
- This can be useful to implement some optimizations. */
63
- #define _PyObject_GC_MAY_BE_TRACKED(obj) \
64
- (PyObject_IS_GC(obj) && \
65
- (!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj)))
66
-
67
-
68
- /* Bit flags for _gc_prev */
69
- /* Bit 0 is set when tp_finalize is called */
70
- #define _PyGC_PREV_MASK_FINALIZED (1)
71
- /* Bit 1 is set when the object is in generation which is GCed currently. */
72
- #define _PyGC_PREV_MASK_COLLECTING (2)
73
- /* The (N-2) most significant bits contain the real address. */
74
- #define _PyGC_PREV_SHIFT (2)
75
- #define _PyGC_PREV_MASK (((uintptr_t) -1) << _PyGC_PREV_SHIFT)
76
-
77
- // Lowest bit of _gc_next is used for flags only in GC.
78
- // But it is always 0 for normal code.
79
- #define _PyGCHead_NEXT(g) ((PyGC_Head*)(g)->_gc_next)
80
- #define _PyGCHead_SET_NEXT(g, p) ((g)->_gc_next = (uintptr_t)(p))
81
-
82
- // Lowest two bits of _gc_prev is used for _PyGC_PREV_MASK_* flags.
83
- #define _PyGCHead_PREV(g) ((PyGC_Head*)((g)->_gc_prev & _PyGC_PREV_MASK))
84
- #define _PyGCHead_SET_PREV(g, p) do { \
85
- assert(((uintptr_t)p & ~_PyGC_PREV_MASK) == 0); \
86
- (g)->_gc_prev = ((g)->_gc_prev & ~_PyGC_PREV_MASK) \
87
- | ((uintptr_t)(p)); \
88
- } while (0)
89
-
90
- #define _PyGCHead_FINALIZED(g) \
91
- (((g)->_gc_prev & _PyGC_PREV_MASK_FINALIZED) != 0)
92
- #define _PyGCHead_SET_FINALIZED(g) \
93
- ((g)->_gc_prev |= _PyGC_PREV_MASK_FINALIZED)
94
-
95
- #define _PyGC_FINALIZED(o) \
96
- _PyGCHead_FINALIZED(_Py_AS_GC(o))
97
- #define _PyGC_SET_FINALIZED(o) \
98
- _PyGCHead_SET_FINALIZED(_Py_AS_GC(o))
99
-
100
-
101
- PyAPI_FUNC(PyObject *) _PyObject_GC_Malloc(size_t size);
102
- PyAPI_FUNC(PyObject *) _PyObject_GC_Calloc(size_t size);
103
-
104
-
105
- /* Test if a type supports weak references */
106
- #define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0)
107
-
108
- #define PyObject_GET_WEAKREFS_LISTPTR(o) \
109
- ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset))
110
-
111
- #ifdef __cplusplus
112
- }
113
- #endif