@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,42 +0,0 @@
1
- #ifndef Py_INTERNAL_CONTEXT_H
2
- #define Py_INTERNAL_CONTEXT_H
3
-
4
- #ifndef Py_BUILD_CORE
5
- # error "this header requires Py_BUILD_CORE define"
6
- #endif
7
-
8
- #include "pycore_hamt.h"
9
-
10
- struct _pycontextobject {
11
- PyObject_HEAD
12
- PyContext *ctx_prev;
13
- PyHamtObject *ctx_vars;
14
- PyObject *ctx_weakreflist;
15
- int ctx_entered;
16
- };
17
-
18
-
19
- struct _pycontextvarobject {
20
- PyObject_HEAD
21
- PyObject *var_name;
22
- PyObject *var_default;
23
- PyObject *var_cached;
24
- uint64_t var_cached_tsid;
25
- uint64_t var_cached_tsver;
26
- Py_hash_t var_hash;
27
- };
28
-
29
-
30
- struct _pycontexttokenobject {
31
- PyObject_HEAD
32
- PyContext *tok_ctx;
33
- PyContextVar *tok_var;
34
- PyObject *tok_oldval;
35
- int tok_used;
36
- };
37
-
38
-
39
- int _PyContext_Init(void);
40
- void _PyContext_Fini(void);
41
-
42
- #endif /* !Py_INTERNAL_CONTEXT_H */
@@ -1,54 +0,0 @@
1
- #ifndef Py_INTERNAL_FILEUTILS_H
2
- #define Py_INTERNAL_FILEUTILS_H
3
- #ifdef __cplusplus
4
- extern "C" {
5
- #endif
6
-
7
- #ifndef Py_BUILD_CORE
8
- # error "Py_BUILD_CORE must be defined to include this header"
9
- #endif
10
-
11
- #include <locale.h> /* struct lconv */
12
-
13
- PyAPI_DATA(int) _Py_HasFileSystemDefaultEncodeErrors;
14
-
15
- PyAPI_FUNC(int) _Py_DecodeUTF8Ex(
16
- const char *arg,
17
- Py_ssize_t arglen,
18
- wchar_t **wstr,
19
- size_t *wlen,
20
- const char **reason,
21
- _Py_error_handler errors);
22
-
23
- PyAPI_FUNC(int) _Py_EncodeUTF8Ex(
24
- const wchar_t *text,
25
- char **str,
26
- size_t *error_pos,
27
- const char **reason,
28
- int raw_malloc,
29
- _Py_error_handler errors);
30
-
31
- PyAPI_FUNC(wchar_t*) _Py_DecodeUTF8_surrogateescape(
32
- const char *arg,
33
- Py_ssize_t arglen,
34
- size_t *wlen);
35
-
36
- PyAPI_FUNC(int) _Py_GetForceASCII(void);
37
-
38
- /* Reset "force ASCII" mode (if it was initialized).
39
-
40
- This function should be called when Python changes the LC_CTYPE locale,
41
- so the "force ASCII" mode can be detected again on the new locale
42
- encoding. */
43
- PyAPI_FUNC(void) _Py_ResetForceASCII(void);
44
-
45
-
46
- PyAPI_FUNC(int) _Py_GetLocaleconvNumeric(
47
- struct lconv *lc,
48
- PyObject **decimal_point,
49
- PyObject **thousands_sep);
50
-
51
- #ifdef __cplusplus
52
- }
53
- #endif
54
- #endif /* !Py_INTERNAL_FILEUTILS_H */
@@ -1,22 +0,0 @@
1
- #ifndef Py_INTERNAL_PYGETOPT_H
2
- #define Py_INTERNAL_PYGETOPT_H
3
-
4
- #ifndef Py_BUILD_CORE
5
- # error "this header requires Py_BUILD_CORE define"
6
- #endif
7
-
8
- extern int _PyOS_opterr;
9
- extern Py_ssize_t _PyOS_optind;
10
- extern const wchar_t *_PyOS_optarg;
11
-
12
- extern void _PyOS_ResetGetOpt(void);
13
-
14
- typedef struct {
15
- const wchar_t *name;
16
- int has_arg;
17
- int val;
18
- } _PyOS_LongOption;
19
-
20
- extern int _PyOS_GetOpt(Py_ssize_t argc, wchar_t * const *argv, int *longindex);
21
-
22
- #endif /* !Py_INTERNAL_PYGETOPT_H */
@@ -1,50 +0,0 @@
1
- #ifndef Py_INTERNAL_GIL_H
2
- #define Py_INTERNAL_GIL_H
3
- #ifdef __cplusplus
4
- extern "C" {
5
- #endif
6
-
7
- #ifndef Py_BUILD_CORE
8
- # error "this header requires Py_BUILD_CORE define"
9
- #endif
10
-
11
- #include "pycore_condvar.h"
12
- #include "pycore_atomic.h"
13
-
14
- #ifndef Py_HAVE_CONDVAR
15
- # error You need either a POSIX-compatible or a Windows system!
16
- #endif
17
-
18
- /* Enable if you want to force the switching of threads at least
19
- every `interval`. */
20
- #undef FORCE_SWITCHING
21
- #define FORCE_SWITCHING
22
-
23
- struct _gil_runtime_state {
24
- /* microseconds (the Python API uses seconds, though) */
25
- unsigned long interval;
26
- /* Last PyThreadState holding / having held the GIL. This helps us
27
- know whether anyone else was scheduled after we dropped the GIL. */
28
- _Py_atomic_address last_holder;
29
- /* Whether the GIL is already taken (-1 if uninitialized). This is
30
- atomic because it can be read without any lock taken in ceval.c. */
31
- _Py_atomic_int locked;
32
- /* Number of GIL switches since the beginning. */
33
- unsigned long switch_number;
34
- /* This condition variable allows one or several threads to wait
35
- until the GIL is released. In addition, the mutex also protects
36
- the above variables. */
37
- PyCOND_T cond;
38
- PyMUTEX_T mutex;
39
- #ifdef FORCE_SWITCHING
40
- /* This condition variable helps the GIL-releasing thread wait for
41
- a GIL-awaiting thread to be scheduled and take the GIL. */
42
- PyCOND_T switch_cond;
43
- PyMUTEX_T switch_mutex;
44
- #endif
45
- };
46
-
47
- #ifdef __cplusplus
48
- }
49
- #endif
50
- #endif /* !Py_INTERNAL_GIL_H */
@@ -1,116 +0,0 @@
1
- #ifndef Py_INTERNAL_HAMT_H
2
- #define Py_INTERNAL_HAMT_H
3
-
4
- #ifndef Py_BUILD_CORE
5
- # error "this header requires Py_BUILD_CORE define"
6
- #endif
7
-
8
- #define _Py_HAMT_MAX_TREE_DEPTH 7
9
-
10
-
11
- #define PyHamt_Check(o) (Py_TYPE(o) == &_PyHamt_Type)
12
-
13
-
14
- /* Abstract tree node. */
15
- typedef struct {
16
- PyObject_HEAD
17
- } PyHamtNode;
18
-
19
-
20
- /* An HAMT immutable mapping collection. */
21
- typedef struct {
22
- PyObject_HEAD
23
- PyHamtNode *h_root;
24
- PyObject *h_weakreflist;
25
- Py_ssize_t h_count;
26
- } PyHamtObject;
27
-
28
-
29
- /* A struct to hold the state of depth-first traverse of the tree.
30
-
31
- HAMT is an immutable collection. Iterators will hold a strong reference
32
- to it, and every node in the HAMT has strong references to its children.
33
-
34
- So for iterators, we can implement zero allocations and zero reference
35
- inc/dec depth-first iteration.
36
-
37
- - i_nodes: an array of seven pointers to tree nodes
38
- - i_level: the current node in i_nodes
39
- - i_pos: an array of positions within nodes in i_nodes.
40
- */
41
- typedef struct {
42
- PyHamtNode *i_nodes[_Py_HAMT_MAX_TREE_DEPTH];
43
- Py_ssize_t i_pos[_Py_HAMT_MAX_TREE_DEPTH];
44
- int8_t i_level;
45
- } PyHamtIteratorState;
46
-
47
-
48
- /* Base iterator object.
49
-
50
- Contains the iteration state, a pointer to the HAMT tree,
51
- and a pointer to the 'yield function'. The latter is a simple
52
- function that returns a key/value tuple for the 'Items' iterator,
53
- just a key for the 'Keys' iterator, and a value for the 'Values'
54
- iterator.
55
- */
56
- typedef struct {
57
- PyObject_HEAD
58
- PyHamtObject *hi_obj;
59
- PyHamtIteratorState hi_iter;
60
- binaryfunc hi_yield;
61
- } PyHamtIterator;
62
-
63
-
64
- PyAPI_DATA(PyTypeObject) _PyHamt_Type;
65
- PyAPI_DATA(PyTypeObject) _PyHamt_ArrayNode_Type;
66
- PyAPI_DATA(PyTypeObject) _PyHamt_BitmapNode_Type;
67
- PyAPI_DATA(PyTypeObject) _PyHamt_CollisionNode_Type;
68
- PyAPI_DATA(PyTypeObject) _PyHamtKeys_Type;
69
- PyAPI_DATA(PyTypeObject) _PyHamtValues_Type;
70
- PyAPI_DATA(PyTypeObject) _PyHamtItems_Type;
71
-
72
-
73
- /* Create a new HAMT immutable mapping. */
74
- PyHamtObject * _PyHamt_New(void);
75
-
76
- /* Return a new collection based on "o", but with an additional
77
- key/val pair. */
78
- PyHamtObject * _PyHamt_Assoc(PyHamtObject *o, PyObject *key, PyObject *val);
79
-
80
- /* Return a new collection based on "o", but without "key". */
81
- PyHamtObject * _PyHamt_Without(PyHamtObject *o, PyObject *key);
82
-
83
- /* Find "key" in the "o" collection.
84
-
85
- Return:
86
- - -1: An error occurred.
87
- - 0: "key" wasn't found in "o".
88
- - 1: "key" is in "o"; "*val" is set to its value (a borrowed ref).
89
- */
90
- int _PyHamt_Find(PyHamtObject *o, PyObject *key, PyObject **val);
91
-
92
- /* Check if "v" is equal to "w".
93
-
94
- Return:
95
- - 0: v != w
96
- - 1: v == w
97
- - -1: An error occurred.
98
- */
99
- int _PyHamt_Eq(PyHamtObject *v, PyHamtObject *w);
100
-
101
- /* Return the size of "o"; equivalent of "len(o)". */
102
- Py_ssize_t _PyHamt_Len(PyHamtObject *o);
103
-
104
- /* Return a Keys iterator over "o". */
105
- PyObject * _PyHamt_NewIterKeys(PyHamtObject *o);
106
-
107
- /* Return a Values iterator over "o". */
108
- PyObject * _PyHamt_NewIterValues(PyHamtObject *o);
109
-
110
- /* Return a Items iterator over "o". */
111
- PyObject * _PyHamt_NewIterItems(PyHamtObject *o);
112
-
113
- int _PyHamt_Init(void);
114
- void _PyHamt_Fini(void);
115
-
116
- #endif /* !Py_INTERNAL_HAMT_H */
@@ -1,166 +0,0 @@
1
- #ifndef Py_INTERNAL_CORECONFIG_H
2
- #define Py_INTERNAL_CORECONFIG_H
3
- #ifdef __cplusplus
4
- extern "C" {
5
- #endif
6
-
7
- #ifndef Py_BUILD_CORE
8
- # error "this header requires Py_BUILD_CORE define"
9
- #endif
10
-
11
- #include "pycore_pystate.h" /* _PyRuntimeState */
12
-
13
- /* --- PyStatus ----------------------------------------------- */
14
-
15
- /* Almost all errors causing Python initialization to fail */
16
- #ifdef _MSC_VER
17
- /* Visual Studio 2015 doesn't implement C99 __func__ in C */
18
- # define _PyStatus_GET_FUNC() __FUNCTION__
19
- #else
20
- # define _PyStatus_GET_FUNC() __func__
21
- #endif
22
-
23
- #define _PyStatus_OK() \
24
- (PyStatus){._type = _PyStatus_TYPE_OK,}
25
- /* other fields are set to 0 */
26
- #define _PyStatus_ERR(ERR_MSG) \
27
- (PyStatus){ \
28
- ._type = _PyStatus_TYPE_ERROR, \
29
- .func = _PyStatus_GET_FUNC(), \
30
- .err_msg = (ERR_MSG)}
31
- /* other fields are set to 0 */
32
- #define _PyStatus_NO_MEMORY() _PyStatus_ERR("memory allocation failed")
33
- #define _PyStatus_EXIT(EXITCODE) \
34
- (PyStatus){ \
35
- ._type = _PyStatus_TYPE_EXIT, \
36
- .exitcode = (EXITCODE)}
37
- #define _PyStatus_IS_ERROR(err) \
38
- (err._type == _PyStatus_TYPE_ERROR)
39
- #define _PyStatus_IS_EXIT(err) \
40
- (err._type == _PyStatus_TYPE_EXIT)
41
- #define _PyStatus_EXCEPTION(err) \
42
- (err._type != _PyStatus_TYPE_OK)
43
- #define _PyStatus_UPDATE_FUNC(err) \
44
- do { err.func = _PyStatus_GET_FUNC(); } while (0)
45
-
46
- /* --- PyWideStringList ------------------------------------------------ */
47
-
48
- #define _PyWideStringList_INIT (PyWideStringList){.length = 0, .items = NULL}
49
-
50
- #ifndef NDEBUG
51
- PyAPI_FUNC(int) _PyWideStringList_CheckConsistency(const PyWideStringList *list);
52
- #endif
53
- PyAPI_FUNC(void) _PyWideStringList_Clear(PyWideStringList *list);
54
- PyAPI_FUNC(int) _PyWideStringList_Copy(PyWideStringList *list,
55
- const PyWideStringList *list2);
56
- PyAPI_FUNC(PyStatus) _PyWideStringList_Extend(PyWideStringList *list,
57
- const PyWideStringList *list2);
58
- PyAPI_FUNC(PyObject*) _PyWideStringList_AsList(const PyWideStringList *list);
59
-
60
-
61
- /* --- _PyArgv ---------------------------------------------------- */
62
-
63
- typedef struct {
64
- Py_ssize_t argc;
65
- int use_bytes_argv;
66
- char * const *bytes_argv;
67
- wchar_t * const *wchar_argv;
68
- } _PyArgv;
69
-
70
- PyAPI_FUNC(PyStatus) _PyArgv_AsWstrList(const _PyArgv *args,
71
- PyWideStringList *list);
72
-
73
-
74
- /* --- Helper functions ------------------------------------------- */
75
-
76
- PyAPI_FUNC(int) _Py_str_to_int(
77
- const char *str,
78
- int *result);
79
- PyAPI_FUNC(const wchar_t*) _Py_get_xoption(
80
- const PyWideStringList *xoptions,
81
- const wchar_t *name);
82
- PyAPI_FUNC(const char*) _Py_GetEnv(
83
- int use_environment,
84
- const char *name);
85
- PyAPI_FUNC(void) _Py_get_env_flag(
86
- int use_environment,
87
- int *flag,
88
- const char *name);
89
-
90
- /* Py_GetArgcArgv() helper */
91
- PyAPI_FUNC(void) _Py_ClearArgcArgv(void);
92
-
93
-
94
- /* --- _PyPreCmdline ------------------------------------------------- */
95
-
96
- typedef struct {
97
- PyWideStringList argv;
98
- PyWideStringList xoptions; /* "-X value" option */
99
- int isolated; /* -I option */
100
- int use_environment; /* -E option */
101
- int dev_mode; /* -X dev and PYTHONDEVMODE */
102
- } _PyPreCmdline;
103
-
104
- #define _PyPreCmdline_INIT \
105
- (_PyPreCmdline){ \
106
- .use_environment = -1, \
107
- .isolated = -1, \
108
- .dev_mode = -1}
109
- /* Note: _PyPreCmdline_INIT sets other fields to 0/NULL */
110
-
111
- extern void _PyPreCmdline_Clear(_PyPreCmdline *cmdline);
112
- extern PyStatus _PyPreCmdline_SetArgv(_PyPreCmdline *cmdline,
113
- const _PyArgv *args);
114
- extern PyStatus _PyPreCmdline_SetConfig(
115
- const _PyPreCmdline *cmdline,
116
- PyConfig *config);
117
- extern PyStatus _PyPreCmdline_Read(_PyPreCmdline *cmdline,
118
- const PyPreConfig *preconfig);
119
-
120
-
121
- /* --- PyPreConfig ----------------------------------------------- */
122
-
123
- PyAPI_FUNC(void) _PyPreConfig_InitCompatConfig(PyPreConfig *preconfig);
124
- extern void _PyPreConfig_InitFromConfig(
125
- PyPreConfig *preconfig,
126
- const PyConfig *config);
127
- extern PyStatus _PyPreConfig_InitFromPreConfig(
128
- PyPreConfig *preconfig,
129
- const PyPreConfig *config2);
130
- extern PyObject* _PyPreConfig_AsDict(const PyPreConfig *preconfig);
131
- extern void _PyPreConfig_GetConfig(PyPreConfig *preconfig,
132
- const PyConfig *config);
133
- extern PyStatus _PyPreConfig_Read(PyPreConfig *preconfig,
134
- const _PyArgv *args);
135
- extern PyStatus _PyPreConfig_Write(const PyPreConfig *preconfig);
136
-
137
-
138
- /* --- PyConfig ---------------------------------------------- */
139
-
140
- typedef enum {
141
- /* Py_Initialize() API: backward compatibility with Python 3.6 and 3.7 */
142
- _PyConfig_INIT_COMPAT = 1,
143
- _PyConfig_INIT_PYTHON = 2,
144
- _PyConfig_INIT_ISOLATED = 3
145
- } _PyConfigInitEnum;
146
-
147
- PyAPI_FUNC(void) _PyConfig_InitCompatConfig(PyConfig *config);
148
- extern PyStatus _PyConfig_Copy(
149
- PyConfig *config,
150
- const PyConfig *config2);
151
- extern PyStatus _PyConfig_InitPathConfig(PyConfig *config);
152
- extern void _PyConfig_Write(const PyConfig *config,
153
- _PyRuntimeState *runtime);
154
- extern PyStatus _PyConfig_SetPyArgv(
155
- PyConfig *config,
156
- const _PyArgv *args);
157
-
158
-
159
- /* --- Function used for testing ---------------------------------- */
160
-
161
- PyAPI_FUNC(PyObject*) _Py_GetConfigsAsDict(void);
162
-
163
- #ifdef __cplusplus
164
- }
165
- #endif
166
- #endif /* !Py_INTERNAL_CORECONFIG_H */
@@ -1,81 +0,0 @@
1
- #ifndef Py_INTERNAL_OBJECT_H
2
- #define Py_INTERNAL_OBJECT_H
3
- #ifdef __cplusplus
4
- extern "C" {
5
- #endif
6
-
7
- #ifndef Py_BUILD_CORE
8
- # error "this header requires Py_BUILD_CORE define"
9
- #endif
10
-
11
- #include "pycore_pystate.h" /* _PyRuntime */
12
-
13
- PyAPI_FUNC(int) _PyType_CheckConsistency(PyTypeObject *type);
14
- PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content);
15
-
16
- /* Tell the GC to track this object.
17
- *
18
- * NB: While the object is tracked by the collector, it must be safe to call the
19
- * ob_traverse method.
20
- *
21
- * Internal note: _PyRuntime.gc.generation0->_gc_prev doesn't have any bit flags
22
- * because it's not object header. So we don't use _PyGCHead_PREV() and
23
- * _PyGCHead_SET_PREV() for it to avoid unnecessary bitwise operations.
24
- *
25
- * The PyObject_GC_Track() function is the public version of this macro.
26
- */
27
- static inline void _PyObject_GC_TRACK_impl(const char *filename, int lineno,
28
- PyObject *op)
29
- {
30
- _PyObject_ASSERT_FROM(op, !_PyObject_GC_IS_TRACKED(op),
31
- "object already tracked by the garbage collector",
32
- filename, lineno, "_PyObject_GC_TRACK");
33
-
34
- PyGC_Head *gc = _Py_AS_GC(op);
35
- _PyObject_ASSERT_FROM(op,
36
- (gc->_gc_prev & _PyGC_PREV_MASK_COLLECTING) == 0,
37
- "object is in generation which is garbage collected",
38
- filename, lineno, "_PyObject_GC_TRACK");
39
-
40
- PyGC_Head *last = (PyGC_Head*)(_PyRuntime.gc.generation0->_gc_prev);
41
- _PyGCHead_SET_NEXT(last, gc);
42
- _PyGCHead_SET_PREV(gc, last);
43
- _PyGCHead_SET_NEXT(gc, _PyRuntime.gc.generation0);
44
- _PyRuntime.gc.generation0->_gc_prev = (uintptr_t)gc;
45
- }
46
-
47
- #define _PyObject_GC_TRACK(op) \
48
- _PyObject_GC_TRACK_impl(__FILE__, __LINE__, _PyObject_CAST(op))
49
-
50
- /* Tell the GC to stop tracking this object.
51
- *
52
- * Internal note: This may be called while GC. So _PyGC_PREV_MASK_COLLECTING
53
- * must be cleared. But _PyGC_PREV_MASK_FINALIZED bit is kept.
54
- *
55
- * The object must be tracked by the GC.
56
- *
57
- * The PyObject_GC_UnTrack() function is the public version of this macro.
58
- */
59
- static inline void _PyObject_GC_UNTRACK_impl(const char *filename, int lineno,
60
- PyObject *op)
61
- {
62
- _PyObject_ASSERT_FROM(op, _PyObject_GC_IS_TRACKED(op),
63
- "object not tracked by the garbage collector",
64
- filename, lineno, "_PyObject_GC_UNTRACK");
65
-
66
- PyGC_Head *gc = _Py_AS_GC(op);
67
- PyGC_Head *prev = _PyGCHead_PREV(gc);
68
- PyGC_Head *next = _PyGCHead_NEXT(gc);
69
- _PyGCHead_SET_NEXT(prev, next);
70
- _PyGCHead_SET_PREV(next, prev);
71
- gc->_gc_next = 0;
72
- gc->_gc_prev &= _PyGC_PREV_MASK_FINALIZED;
73
- }
74
-
75
- #define _PyObject_GC_UNTRACK(op) \
76
- _PyObject_GC_UNTRACK_impl(__FILE__, __LINE__, _PyObject_CAST(op))
77
-
78
- #ifdef __cplusplus
79
- }
80
- #endif
81
- #endif /* !Py_INTERNAL_OBJECT_H */
@@ -1,75 +0,0 @@
1
- #ifndef Py_INTERNAL_PATHCONFIG_H
2
- #define Py_INTERNAL_PATHCONFIG_H
3
- #ifdef __cplusplus
4
- extern "C" {
5
- #endif
6
-
7
- #ifndef Py_BUILD_CORE
8
- # error "this header requires Py_BUILD_CORE define"
9
- #endif
10
-
11
- typedef struct _PyPathConfig {
12
- /* Full path to the Python program */
13
- wchar_t *program_full_path;
14
- wchar_t *prefix;
15
- wchar_t *exec_prefix;
16
- /* Set by Py_SetPath(), or computed by _PyConfig_InitPathConfig() */
17
- wchar_t *module_search_path;
18
- /* Python program name */
19
- wchar_t *program_name;
20
- /* Set by Py_SetPythonHome() or PYTHONHOME environment variable */
21
- wchar_t *home;
22
- #ifdef MS_WINDOWS
23
- /* isolated and site_import are used to set Py_IsolatedFlag and
24
- Py_NoSiteFlag flags on Windows in read_pth_file(). These fields
25
- are ignored when their value are equal to -1 (unset). */
26
- int isolated;
27
- int site_import;
28
- /* Set when a venv is detected */
29
- wchar_t *base_executable;
30
- #endif
31
- } _PyPathConfig;
32
-
33
- #ifdef MS_WINDOWS
34
- # define _PyPathConfig_INIT \
35
- {.module_search_path = NULL, \
36
- .isolated = -1, \
37
- .site_import = -1}
38
- #else
39
- # define _PyPathConfig_INIT \
40
- {.module_search_path = NULL}
41
- #endif
42
- /* Note: _PyPathConfig_INIT sets other fields to 0/NULL */
43
-
44
- PyAPI_DATA(_PyPathConfig) _Py_path_config;
45
- #ifdef MS_WINDOWS
46
- PyAPI_DATA(wchar_t*) _Py_dll_path;
47
- #endif
48
-
49
- extern void _PyPathConfig_ClearGlobal(void);
50
- extern PyStatus _PyPathConfig_SetGlobal(
51
- const struct _PyPathConfig *pathconfig);
52
-
53
- extern PyStatus _PyPathConfig_Calculate(
54
- _PyPathConfig *pathconfig,
55
- const PyConfig *config);
56
- extern int _PyPathConfig_ComputeSysPath0(
57
- const PyWideStringList *argv,
58
- PyObject **path0);
59
- extern int _Py_FindEnvConfigValue(
60
- FILE *env_file,
61
- const wchar_t *key,
62
- wchar_t *value,
63
- size_t value_size);
64
-
65
- #ifdef MS_WINDOWS
66
- extern wchar_t* _Py_GetDLLPath(void);
67
- #endif
68
-
69
- extern PyStatus _PyConfig_WritePathConfig(const PyConfig *config);
70
- extern void _Py_DumpPathConfig(PyThreadState *tstate);
71
-
72
- #ifdef __cplusplus
73
- }
74
- #endif
75
- #endif /* !Py_INTERNAL_PATHCONFIG_H */
@@ -1,62 +0,0 @@
1
- #ifndef Py_INTERNAL_PYERRORS_H
2
- #define Py_INTERNAL_PYERRORS_H
3
- #ifdef __cplusplus
4
- extern "C" {
5
- #endif
6
-
7
- #ifndef Py_BUILD_CORE
8
- # error "this header requires Py_BUILD_CORE define"
9
- #endif
10
-
11
- static inline PyObject* _PyErr_Occurred(PyThreadState *tstate)
12
- {
13
- return tstate == NULL ? NULL : tstate->curexc_type;
14
- }
15
-
16
-
17
- PyAPI_FUNC(void) _PyErr_Fetch(
18
- PyThreadState *tstate,
19
- PyObject **type,
20
- PyObject **value,
21
- PyObject **traceback);
22
-
23
- PyAPI_FUNC(int) _PyErr_ExceptionMatches(
24
- PyThreadState *tstate,
25
- PyObject *exc);
26
-
27
- PyAPI_FUNC(void) _PyErr_Restore(
28
- PyThreadState *tstate,
29
- PyObject *type,
30
- PyObject *value,
31
- PyObject *traceback);
32
-
33
- PyAPI_FUNC(void) _PyErr_SetObject(
34
- PyThreadState *tstate,
35
- PyObject *type,
36
- PyObject *value);
37
-
38
- PyAPI_FUNC(void) _PyErr_Clear(PyThreadState *tstate);
39
-
40
- PyAPI_FUNC(void) _PyErr_SetNone(PyThreadState *tstate, PyObject *exception);
41
-
42
- PyAPI_FUNC(void) _PyErr_SetString(
43
- PyThreadState *tstate,
44
- PyObject *exception,
45
- const char *string);
46
-
47
- PyAPI_FUNC(PyObject *) _PyErr_Format(
48
- PyThreadState *tstate,
49
- PyObject *exception,
50
- const char *format,
51
- ...);
52
-
53
- PyAPI_FUNC(void) _PyErr_NormalizeException(
54
- PyThreadState *tstate,
55
- PyObject **exc,
56
- PyObject **val,
57
- PyObject **tb);
58
-
59
- #ifdef __cplusplus
60
- }
61
- #endif
62
- #endif /* !Py_INTERNAL_PYERRORS_H */
@@ -1,10 +0,0 @@
1
- #ifndef Py_INTERNAL_HASH_H
2
- #define Py_INTERNAL_HASH_H
3
-
4
- #ifndef Py_BUILD_CORE
5
- # error "this header requires Py_BUILD_CORE define"
6
- #endif
7
-
8
- uint64_t _Py_KeyedHash(uint64_t, const char *, Py_ssize_t);
9
-
10
- #endif