@plone/volto 14.0.0 → 14.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/locales/ca/LC_MESSAGES/volto.po +12 -2
  3. package/locales/ca.json +1 -1
  4. package/locales/de/LC_MESSAGES/volto.po +12 -2
  5. package/locales/de.json +1 -1
  6. package/locales/en/LC_MESSAGES/volto.po +12 -2
  7. package/locales/en.json +1 -1
  8. package/locales/es/LC_MESSAGES/volto.po +12 -2
  9. package/locales/es.json +1 -1
  10. package/locales/eu/LC_MESSAGES/volto.po +12 -2
  11. package/locales/eu.json +1 -1
  12. package/locales/fr/LC_MESSAGES/volto.po +12 -2
  13. package/locales/fr.json +1 -1
  14. package/locales/it/LC_MESSAGES/volto.po +12 -2
  15. package/locales/it.json +1 -1
  16. package/locales/ja/LC_MESSAGES/volto.po +12 -2
  17. package/locales/ja.json +1 -1
  18. package/locales/nl/LC_MESSAGES/volto.po +12 -2
  19. package/locales/nl.json +1 -1
  20. package/locales/pt/LC_MESSAGES/volto.po +12 -2
  21. package/locales/pt.json +1 -1
  22. package/locales/pt_BR/LC_MESSAGES/volto.po +12 -2
  23. package/locales/pt_BR.json +1 -1
  24. package/locales/ro/LC_MESSAGES/volto.po +12 -2
  25. package/locales/ro.json +1 -1
  26. package/locales/volto.pot +12 -2
  27. package/package.json +2 -1
  28. package/public/icon.svg +13 -0
  29. package/src/actions/vocabularies/vocabularies.js +15 -3
  30. package/src/components/index.js +1 -0
  31. package/src/components/manage/Blocks/HeroImageLeft/Edit.jsx +1 -1
  32. package/src/components/manage/Blocks/Listing/getAsyncData.js +1 -1
  33. package/src/components/manage/Blocks/Text/Edit.jsx +19 -0
  34. package/src/components/manage/Form/Form.jsx +11 -1
  35. package/src/components/manage/Form/UndoToolbar.jsx +78 -0
  36. package/src/components/manage/Widgets/AlignWidget.stories.jsx +5 -21
  37. package/src/components/manage/Widgets/ArrayWidget.jsx +83 -101
  38. package/src/components/manage/Widgets/ArrayWidget.stories.jsx +29 -64
  39. package/src/components/manage/Widgets/CheckboxWidget.stories.jsx +5 -22
  40. package/src/components/manage/Widgets/DatetimeWidget.jsx +65 -74
  41. package/src/components/manage/Widgets/DatetimeWidget.stories.jsx +7 -23
  42. package/src/components/manage/Widgets/DatetimeWidget.test.jsx +17 -15
  43. package/src/components/manage/Widgets/EmailWidget.stories.jsx +5 -22
  44. package/src/components/manage/Widgets/FileWidget.stories.jsx +5 -22
  45. package/src/components/manage/Widgets/NumberWidget.stories.jsx +5 -23
  46. package/src/components/manage/Widgets/ObjectBrowserWidget.stories.js +24 -32
  47. package/src/components/manage/Widgets/ObjectListWidget.stories.js +44 -44
  48. package/src/components/manage/Widgets/ObjectWidget.stories.jsx +13 -28
  49. package/src/components/manage/Widgets/PasswordWidget.stories.jsx +5 -22
  50. package/src/components/manage/Widgets/QueryWidget.jsx +2 -2
  51. package/src/components/manage/Widgets/QueryWidget.stories.jsx +1637 -22
  52. package/src/components/manage/Widgets/SelectAutoComplete.jsx +79 -48
  53. package/src/components/manage/Widgets/SelectAutoComplete.test.jsx +16 -0
  54. package/src/components/manage/Widgets/SelectAutocompleteWidget.stories.jsx +161 -0
  55. package/src/components/manage/Widgets/SelectUtils.js +90 -30
  56. package/src/components/manage/Widgets/SelectUtils.test.jsx +76 -1
  57. package/src/components/manage/Widgets/SelectWidget.jsx +26 -37
  58. package/src/components/manage/Widgets/SelectWidget.stories.jsx +96 -28
  59. package/src/components/manage/Widgets/TextWidget.stories.jsx +5 -22
  60. package/src/components/manage/Widgets/TextareaWidget.stories.jsx +5 -22
  61. package/src/components/manage/Widgets/TokenWidget.jsx +19 -17
  62. package/src/components/manage/Widgets/TokenWidget.stories.jsx +141 -0
  63. package/src/components/manage/Widgets/UrlWidget.stories.jsx +5 -21
  64. package/src/components/manage/Widgets/VocabularyTermsWidget.stories.js +27 -64
  65. package/src/components/manage/Widgets/WysiwygWidget.stories.jsx +5 -22
  66. package/src/components/manage/Widgets/story.jsx +38 -0
  67. package/src/components/theme/ContactForm/ContactForm.jsx +1 -0
  68. package/src/components/theme/ContactForm/ContactForm.stories.jsx +126 -0
  69. package/src/components/theme/CorsError/CorsError.jsx +2 -2
  70. package/src/config/Loadables.jsx +2 -0
  71. package/src/config/index.js +1 -0
  72. package/src/helpers/Html/Html.jsx +2 -12
  73. package/src/helpers/UndoManager/useUndoManager.js +102 -0
  74. package/src/helpers/index.js +1 -0
  75. package/src/middleware/Api.test.js +57 -6
  76. package/src/middleware/api.js +34 -13
  77. package/src/reducers/vocabularies/vocabularies.js +13 -2
  78. package/src/store.js +1 -1
  79. package/src/storybook.jsx +55 -0
  80. package/theme/themes/pastanaga/extras/time-picker-overrides.less +1 -1
  81. package/include/python3.8/Python-ast.h +0 -715
  82. package/include/python3.8/Python.h +0 -160
  83. package/include/python3.8/abstract.h +0 -844
  84. package/include/python3.8/asdl.h +0 -46
  85. package/include/python3.8/ast.h +0 -37
  86. package/include/python3.8/bitset.h +0 -23
  87. package/include/python3.8/bltinmodule.h +0 -14
  88. package/include/python3.8/boolobject.h +0 -34
  89. package/include/python3.8/bytearrayobject.h +0 -62
  90. package/include/python3.8/bytes_methods.h +0 -69
  91. package/include/python3.8/bytesobject.h +0 -224
  92. package/include/python3.8/cellobject.h +0 -29
  93. package/include/python3.8/ceval.h +0 -231
  94. package/include/python3.8/classobject.h +0 -59
  95. package/include/python3.8/code.h +0 -180
  96. package/include/python3.8/codecs.h +0 -240
  97. package/include/python3.8/compile.h +0 -106
  98. package/include/python3.8/complexobject.h +0 -69
  99. package/include/python3.8/context.h +0 -84
  100. package/include/python3.8/cpython/abstract.h +0 -319
  101. package/include/python3.8/cpython/dictobject.h +0 -94
  102. package/include/python3.8/cpython/fileobject.h +0 -24
  103. package/include/python3.8/cpython/initconfig.h +0 -434
  104. package/include/python3.8/cpython/interpreteridobject.h +0 -19
  105. package/include/python3.8/cpython/object.h +0 -470
  106. package/include/python3.8/cpython/objimpl.h +0 -113
  107. package/include/python3.8/cpython/pyerrors.h +0 -188
  108. package/include/python3.8/cpython/pylifecycle.h +0 -78
  109. package/include/python3.8/cpython/pymem.h +0 -108
  110. package/include/python3.8/cpython/pystate.h +0 -252
  111. package/include/python3.8/cpython/sysmodule.h +0 -21
  112. package/include/python3.8/cpython/traceback.h +0 -22
  113. package/include/python3.8/cpython/tupleobject.h +0 -36
  114. package/include/python3.8/cpython/unicodeobject.h +0 -1239
  115. package/include/python3.8/datetime.h +0 -259
  116. package/include/python3.8/descrobject.h +0 -108
  117. package/include/python3.8/dictobject.h +0 -94
  118. package/include/python3.8/dtoa.h +0 -19
  119. package/include/python3.8/dynamic_annotations.h +0 -499
  120. package/include/python3.8/enumobject.h +0 -17
  121. package/include/python3.8/errcode.h +0 -38
  122. package/include/python3.8/eval.h +0 -37
  123. package/include/python3.8/fileobject.h +0 -49
  124. package/include/python3.8/fileutils.h +0 -185
  125. package/include/python3.8/floatobject.h +0 -130
  126. package/include/python3.8/frameobject.h +0 -92
  127. package/include/python3.8/funcobject.h +0 -104
  128. package/include/python3.8/genobject.h +0 -109
  129. package/include/python3.8/graminit.h +0 -94
  130. package/include/python3.8/grammar.h +0 -77
  131. package/include/python3.8/import.h +0 -149
  132. package/include/python3.8/internal/pycore_accu.h +0 -39
  133. package/include/python3.8/internal/pycore_atomic.h +0 -558
  134. package/include/python3.8/internal/pycore_ceval.h +0 -37
  135. package/include/python3.8/internal/pycore_code.h +0 -27
  136. package/include/python3.8/internal/pycore_condvar.h +0 -95
  137. package/include/python3.8/internal/pycore_context.h +0 -42
  138. package/include/python3.8/internal/pycore_fileutils.h +0 -54
  139. package/include/python3.8/internal/pycore_getopt.h +0 -22
  140. package/include/python3.8/internal/pycore_gil.h +0 -50
  141. package/include/python3.8/internal/pycore_hamt.h +0 -116
  142. package/include/python3.8/internal/pycore_initconfig.h +0 -166
  143. package/include/python3.8/internal/pycore_object.h +0 -81
  144. package/include/python3.8/internal/pycore_pathconfig.h +0 -75
  145. package/include/python3.8/internal/pycore_pyerrors.h +0 -62
  146. package/include/python3.8/internal/pycore_pyhash.h +0 -10
  147. package/include/python3.8/internal/pycore_pylifecycle.h +0 -118
  148. package/include/python3.8/internal/pycore_pymem.h +0 -212
  149. package/include/python3.8/internal/pycore_pystate.h +0 -326
  150. package/include/python3.8/internal/pycore_traceback.h +0 -96
  151. package/include/python3.8/internal/pycore_tupleobject.h +0 -19
  152. package/include/python3.8/internal/pycore_warnings.h +0 -25
  153. package/include/python3.8/interpreteridobject.h +0 -17
  154. package/include/python3.8/intrcheck.h +0 -33
  155. package/include/python3.8/iterobject.h +0 -25
  156. package/include/python3.8/listobject.h +0 -81
  157. package/include/python3.8/longintrepr.h +0 -99
  158. package/include/python3.8/longobject.h +0 -242
  159. package/include/python3.8/marshal.h +0 -28
  160. package/include/python3.8/memoryobject.h +0 -72
  161. package/include/python3.8/methodobject.h +0 -131
  162. package/include/python3.8/modsupport.h +0 -248
  163. package/include/python3.8/moduleobject.h +0 -90
  164. package/include/python3.8/namespaceobject.h +0 -19
  165. package/include/python3.8/node.h +0 -48
  166. package/include/python3.8/object.h +0 -753
  167. package/include/python3.8/objimpl.h +0 -284
  168. package/include/python3.8/odictobject.h +0 -43
  169. package/include/python3.8/opcode.h +0 -148
  170. package/include/python3.8/osdefs.h +0 -51
  171. package/include/python3.8/osmodule.h +0 -17
  172. package/include/python3.8/parsetok.h +0 -110
  173. package/include/python3.8/patchlevel.h +0 -35
  174. package/include/python3.8/picklebufobject.h +0 -31
  175. package/include/python3.8/py_curses.h +0 -100
  176. package/include/python3.8/pyarena.h +0 -64
  177. package/include/python3.8/pycapsule.h +0 -59
  178. package/include/python3.8/pyconfig.h +0 -1665
  179. package/include/python3.8/pyctype.h +0 -39
  180. package/include/python3.8/pydebug.h +0 -40
  181. package/include/python3.8/pydtrace.h +0 -59
  182. package/include/python3.8/pydtrace_probes.h +0 -228
  183. package/include/python3.8/pyerrors.h +0 -335
  184. package/include/python3.8/pyexpat.h +0 -55
  185. package/include/python3.8/pyfpe.h +0 -12
  186. package/include/python3.8/pyhash.h +0 -145
  187. package/include/python3.8/pylifecycle.h +0 -75
  188. package/include/python3.8/pymacconfig.h +0 -102
  189. package/include/python3.8/pymacro.h +0 -106
  190. package/include/python3.8/pymath.h +0 -230
  191. package/include/python3.8/pymem.h +0 -150
  192. package/include/python3.8/pyport.h +0 -850
  193. package/include/python3.8/pystate.h +0 -136
  194. package/include/python3.8/pystrcmp.h +0 -23
  195. package/include/python3.8/pystrhex.h +0 -22
  196. package/include/python3.8/pystrtod.h +0 -45
  197. package/include/python3.8/pythonrun.h +0 -210
  198. package/include/python3.8/pythread.h +0 -161
  199. package/include/python3.8/pytime.h +0 -246
  200. package/include/python3.8/rangeobject.h +0 -27
  201. package/include/python3.8/setobject.h +0 -108
  202. package/include/python3.8/sliceobject.h +0 -65
  203. package/include/python3.8/structmember.h +0 -74
  204. package/include/python3.8/structseq.h +0 -49
  205. package/include/python3.8/symtable.h +0 -123
  206. package/include/python3.8/sysmodule.h +0 -41
  207. package/include/python3.8/token.h +0 -92
  208. package/include/python3.8/traceback.h +0 -28
  209. package/include/python3.8/tracemalloc.h +0 -38
  210. package/include/python3.8/tupleobject.h +0 -48
  211. package/include/python3.8/typeslots.h +0 -85
  212. package/include/python3.8/ucnhash.h +0 -36
  213. package/include/python3.8/unicodeobject.h +0 -1044
  214. package/include/python3.8/warnings.h +0 -67
  215. package/include/python3.8/weakrefobject.h +0 -86
  216. package/src/components/theme/ContactForm/ContactForm.stories.mdx +0 -39
@@ -1,188 +0,0 @@
1
- #ifndef Py_CPYTHON_ERRORS_H
2
- # error "this header file must not be included directly"
3
- #endif
4
-
5
- #ifdef __cplusplus
6
- extern "C" {
7
- #endif
8
-
9
- /* Error objects */
10
-
11
- /* PyException_HEAD defines the initial segment of every exception class. */
12
- #define PyException_HEAD PyObject_HEAD PyObject *dict;\
13
- PyObject *args; PyObject *traceback;\
14
- PyObject *context; PyObject *cause;\
15
- char suppress_context;
16
-
17
- typedef struct {
18
- PyException_HEAD
19
- } PyBaseExceptionObject;
20
-
21
- typedef struct {
22
- PyException_HEAD
23
- PyObject *msg;
24
- PyObject *filename;
25
- PyObject *lineno;
26
- PyObject *offset;
27
- PyObject *text;
28
- PyObject *print_file_and_line;
29
- } PySyntaxErrorObject;
30
-
31
- typedef struct {
32
- PyException_HEAD
33
- PyObject *msg;
34
- PyObject *name;
35
- PyObject *path;
36
- } PyImportErrorObject;
37
-
38
- typedef struct {
39
- PyException_HEAD
40
- PyObject *encoding;
41
- PyObject *object;
42
- Py_ssize_t start;
43
- Py_ssize_t end;
44
- PyObject *reason;
45
- } PyUnicodeErrorObject;
46
-
47
- typedef struct {
48
- PyException_HEAD
49
- PyObject *code;
50
- } PySystemExitObject;
51
-
52
- typedef struct {
53
- PyException_HEAD
54
- PyObject *myerrno;
55
- PyObject *strerror;
56
- PyObject *filename;
57
- PyObject *filename2;
58
- #ifdef MS_WINDOWS
59
- PyObject *winerror;
60
- #endif
61
- Py_ssize_t written; /* only for BlockingIOError, -1 otherwise */
62
- } PyOSErrorObject;
63
-
64
- typedef struct {
65
- PyException_HEAD
66
- PyObject *value;
67
- } PyStopIterationObject;
68
-
69
- /* Compatibility typedefs */
70
- typedef PyOSErrorObject PyEnvironmentErrorObject;
71
- #ifdef MS_WINDOWS
72
- typedef PyOSErrorObject PyWindowsErrorObject;
73
- #endif
74
-
75
- /* Error handling definitions */
76
-
77
- PyAPI_FUNC(void) _PyErr_SetKeyError(PyObject *);
78
- _PyErr_StackItem *_PyErr_GetTopmostException(PyThreadState *tstate);
79
-
80
- /* Context manipulation (PEP 3134) */
81
-
82
- PyAPI_FUNC(void) _PyErr_ChainExceptions(PyObject *, PyObject *, PyObject *);
83
-
84
- /* */
85
-
86
- #define PyExceptionClass_Name(x) (((PyTypeObject*)(x))->tp_name)
87
-
88
- /* Convenience functions */
89
-
90
- #ifdef MS_WINDOWS
91
- Py_DEPRECATED(3.3)
92
- PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
93
- PyObject *, const Py_UNICODE *);
94
- #endif /* MS_WINDOWS */
95
-
96
- /* Like PyErr_Format(), but saves current exception as __context__ and
97
- __cause__.
98
- */
99
- PyAPI_FUNC(PyObject *) _PyErr_FormatFromCause(
100
- PyObject *exception,
101
- const char *format, /* ASCII-encoded string */
102
- ...
103
- );
104
-
105
- #ifdef MS_WINDOWS
106
- /* XXX redeclare to use WSTRING */
107
- Py_DEPRECATED(3.3)
108
- PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
109
- int, const Py_UNICODE *);
110
- Py_DEPRECATED(3.3)
111
- PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
112
- PyObject *,int, const Py_UNICODE *);
113
- #endif
114
-
115
- /* In exceptions.c */
116
-
117
- /* Helper that attempts to replace the current exception with one of the
118
- * same type but with a prefix added to the exception text. The resulting
119
- * exception description looks like:
120
- *
121
- * prefix (exc_type: original_exc_str)
122
- *
123
- * Only some exceptions can be safely replaced. If the function determines
124
- * it isn't safe to perform the replacement, it will leave the original
125
- * unmodified exception in place.
126
- *
127
- * Returns a borrowed reference to the new exception (if any), NULL if the
128
- * existing exception was left in place.
129
- */
130
- PyAPI_FUNC(PyObject *) _PyErr_TrySetFromCause(
131
- const char *prefix_format, /* ASCII-encoded string */
132
- ...
133
- );
134
-
135
- /* In signalmodule.c */
136
-
137
- int PySignal_SetWakeupFd(int fd);
138
- PyAPI_FUNC(int) _PyErr_CheckSignals(void);
139
-
140
- /* Support for adding program text to SyntaxErrors */
141
-
142
- PyAPI_FUNC(void) PyErr_SyntaxLocationObject(
143
- PyObject *filename,
144
- int lineno,
145
- int col_offset);
146
-
147
- PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject(
148
- PyObject *filename,
149
- int lineno);
150
-
151
- /* Create a UnicodeEncodeError object.
152
- *
153
- * TODO: This API will be removed in Python 3.11.
154
- */
155
- Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create(
156
- const char *encoding, /* UTF-8 encoded string */
157
- const Py_UNICODE *object,
158
- Py_ssize_t length,
159
- Py_ssize_t start,
160
- Py_ssize_t end,
161
- const char *reason /* UTF-8 encoded string */
162
- );
163
-
164
- /* Create a UnicodeTranslateError object.
165
- *
166
- * TODO: This API will be removed in Python 3.11.
167
- */
168
- Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create(
169
- const Py_UNICODE *object,
170
- Py_ssize_t length,
171
- Py_ssize_t start,
172
- Py_ssize_t end,
173
- const char *reason /* UTF-8 encoded string */
174
- );
175
- PyAPI_FUNC(PyObject *) _PyUnicodeTranslateError_Create(
176
- PyObject *object,
177
- Py_ssize_t start,
178
- Py_ssize_t end,
179
- const char *reason /* UTF-8 encoded string */
180
- );
181
-
182
- PyAPI_FUNC(void) _PyErr_WriteUnraisableMsg(
183
- const char *err_msg,
184
- PyObject *obj);
185
-
186
- #ifdef __cplusplus
187
- }
188
- #endif
@@ -1,78 +0,0 @@
1
- #ifndef Py_CPYTHON_PYLIFECYCLE_H
2
- # error "this header file must not be included directly"
3
- #endif
4
-
5
- #ifdef __cplusplus
6
- extern "C" {
7
- #endif
8
-
9
- /* Only used by applications that embed the interpreter and need to
10
- * override the standard encoding determination mechanism
11
- */
12
- PyAPI_FUNC(int) Py_SetStandardStreamEncoding(const char *encoding,
13
- const char *errors);
14
-
15
- /* PEP 432 Multi-phase initialization API (Private while provisional!) */
16
-
17
- PyAPI_FUNC(PyStatus) Py_PreInitialize(
18
- const PyPreConfig *src_config);
19
- PyAPI_FUNC(PyStatus) Py_PreInitializeFromBytesArgs(
20
- const PyPreConfig *src_config,
21
- Py_ssize_t argc,
22
- char **argv);
23
- PyAPI_FUNC(PyStatus) Py_PreInitializeFromArgs(
24
- const PyPreConfig *src_config,
25
- Py_ssize_t argc,
26
- wchar_t **argv);
27
-
28
- PyAPI_FUNC(int) _Py_IsCoreInitialized(void);
29
-
30
-
31
- /* Initialization and finalization */
32
-
33
- PyAPI_FUNC(PyStatus) Py_InitializeFromConfig(
34
- const PyConfig *config);
35
- PyAPI_FUNC(PyStatus) _Py_InitializeFromArgs(
36
- const PyConfig *config,
37
- Py_ssize_t argc,
38
- char * const *argv);
39
- PyAPI_FUNC(PyStatus) _Py_InitializeFromWideArgs(
40
- const PyConfig *config,
41
- Py_ssize_t argc,
42
- wchar_t * const *argv);
43
- PyAPI_FUNC(PyStatus) _Py_InitializeMain(void);
44
-
45
- PyAPI_FUNC(int) Py_RunMain(void);
46
-
47
-
48
- PyAPI_FUNC(void) _Py_NO_RETURN Py_ExitStatusException(PyStatus err);
49
-
50
- /* Py_PyAtExit is for the atexit module, Py_AtExit is for low-level
51
- * exit functions.
52
- */
53
- PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(PyObject *), PyObject *);
54
-
55
- /* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */
56
- PyAPI_FUNC(void) _Py_RestoreSignals(void);
57
-
58
- PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *);
59
-
60
- PyAPI_FUNC(void) _Py_SetProgramFullPath(const wchar_t *);
61
-
62
- PyAPI_FUNC(const char *) _Py_gitidentifier(void);
63
- PyAPI_FUNC(const char *) _Py_gitversion(void);
64
-
65
- PyAPI_FUNC(int) _Py_IsFinalizing(void);
66
-
67
- /* Random */
68
- PyAPI_FUNC(int) _PyOS_URandom(void *buffer, Py_ssize_t size);
69
- PyAPI_FUNC(int) _PyOS_URandomNonblock(void *buffer, Py_ssize_t size);
70
-
71
- /* Legacy locale support */
72
- PyAPI_FUNC(int) _Py_CoerceLegacyLocale(int warn);
73
- PyAPI_FUNC(int) _Py_LegacyLocaleDetected(int warn);
74
- PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category);
75
-
76
- #ifdef __cplusplus
77
- }
78
- #endif
@@ -1,108 +0,0 @@
1
- #ifndef Py_CPYTHON_PYMEM_H
2
- # error "this header file must not be included directly"
3
- #endif
4
-
5
- #ifdef __cplusplus
6
- extern "C" {
7
- #endif
8
-
9
- PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size);
10
- PyAPI_FUNC(void *) PyMem_RawCalloc(size_t nelem, size_t elsize);
11
- PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size);
12
- PyAPI_FUNC(void) PyMem_RawFree(void *ptr);
13
-
14
- /* Try to get the allocators name set by _PyMem_SetupAllocators(). */
15
- PyAPI_FUNC(const char*) _PyMem_GetCurrentAllocatorName(void);
16
-
17
- PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
18
-
19
- /* strdup() using PyMem_RawMalloc() */
20
- PyAPI_FUNC(char *) _PyMem_RawStrdup(const char *str);
21
-
22
- /* strdup() using PyMem_Malloc() */
23
- PyAPI_FUNC(char *) _PyMem_Strdup(const char *str);
24
-
25
- /* wcsdup() using PyMem_RawMalloc() */
26
- PyAPI_FUNC(wchar_t*) _PyMem_RawWcsdup(const wchar_t *str);
27
-
28
-
29
- typedef enum {
30
- /* PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() */
31
- PYMEM_DOMAIN_RAW,
32
-
33
- /* PyMem_Malloc(), PyMem_Realloc() and PyMem_Free() */
34
- PYMEM_DOMAIN_MEM,
35
-
36
- /* PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() */
37
- PYMEM_DOMAIN_OBJ
38
- } PyMemAllocatorDomain;
39
-
40
- typedef enum {
41
- PYMEM_ALLOCATOR_NOT_SET = 0,
42
- PYMEM_ALLOCATOR_DEFAULT = 1,
43
- PYMEM_ALLOCATOR_DEBUG = 2,
44
- PYMEM_ALLOCATOR_MALLOC = 3,
45
- PYMEM_ALLOCATOR_MALLOC_DEBUG = 4,
46
- #ifdef WITH_PYMALLOC
47
- PYMEM_ALLOCATOR_PYMALLOC = 5,
48
- PYMEM_ALLOCATOR_PYMALLOC_DEBUG = 6,
49
- #endif
50
- } PyMemAllocatorName;
51
-
52
-
53
- typedef struct {
54
- /* user context passed as the first argument to the 4 functions */
55
- void *ctx;
56
-
57
- /* allocate a memory block */
58
- void* (*malloc) (void *ctx, size_t size);
59
-
60
- /* allocate a memory block initialized by zeros */
61
- void* (*calloc) (void *ctx, size_t nelem, size_t elsize);
62
-
63
- /* allocate or resize a memory block */
64
- void* (*realloc) (void *ctx, void *ptr, size_t new_size);
65
-
66
- /* release a memory block */
67
- void (*free) (void *ctx, void *ptr);
68
- } PyMemAllocatorEx;
69
-
70
- /* Get the memory block allocator of the specified domain. */
71
- PyAPI_FUNC(void) PyMem_GetAllocator(PyMemAllocatorDomain domain,
72
- PyMemAllocatorEx *allocator);
73
-
74
- /* Set the memory block allocator of the specified domain.
75
-
76
- The new allocator must return a distinct non-NULL pointer when requesting
77
- zero bytes.
78
-
79
- For the PYMEM_DOMAIN_RAW domain, the allocator must be thread-safe: the GIL
80
- is not held when the allocator is called.
81
-
82
- If the new allocator is not a hook (don't call the previous allocator), the
83
- PyMem_SetupDebugHooks() function must be called to reinstall the debug hooks
84
- on top on the new allocator. */
85
- PyAPI_FUNC(void) PyMem_SetAllocator(PyMemAllocatorDomain domain,
86
- PyMemAllocatorEx *allocator);
87
-
88
- /* Setup hooks to detect bugs in the following Python memory allocator
89
- functions:
90
-
91
- - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree()
92
- - PyMem_Malloc(), PyMem_Realloc(), PyMem_Free()
93
- - PyObject_Malloc(), PyObject_Realloc() and PyObject_Free()
94
-
95
- Newly allocated memory is filled with the byte 0xCB, freed memory is filled
96
- with the byte 0xDB. Additional checks:
97
-
98
- - detect API violations, ex: PyObject_Free() called on a buffer allocated
99
- by PyMem_Malloc()
100
- - detect write before the start of the buffer (buffer underflow)
101
- - detect write after the end of the buffer (buffer overflow)
102
-
103
- The function does nothing if Python is not compiled is debug mode. */
104
- PyAPI_FUNC(void) PyMem_SetupDebugHooks(void);
105
-
106
- #ifdef __cplusplus
107
- }
108
- #endif
@@ -1,252 +0,0 @@
1
- #ifndef Py_CPYTHON_PYSTATE_H
2
- # error "this header file must not be included directly"
3
- #endif
4
-
5
- #ifdef __cplusplus
6
- extern "C" {
7
- #endif
8
-
9
- #include "cpython/initconfig.h"
10
-
11
- PyAPI_FUNC(int) _PyInterpreterState_RequiresIDRef(PyInterpreterState *);
12
- PyAPI_FUNC(void) _PyInterpreterState_RequireIDRef(PyInterpreterState *, int);
13
-
14
- PyAPI_FUNC(PyObject *) _PyInterpreterState_GetMainModule(PyInterpreterState *);
15
-
16
- /* State unique per thread */
17
-
18
- /* Py_tracefunc return -1 when raising an exception, or 0 for success. */
19
- typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *);
20
-
21
- /* The following values are used for 'what' for tracefunc functions
22
- *
23
- * To add a new kind of trace event, also update "trace_init" in
24
- * Python/sysmodule.c to define the Python level event name
25
- */
26
- #define PyTrace_CALL 0
27
- #define PyTrace_EXCEPTION 1
28
- #define PyTrace_LINE 2
29
- #define PyTrace_RETURN 3
30
- #define PyTrace_C_CALL 4
31
- #define PyTrace_C_EXCEPTION 5
32
- #define PyTrace_C_RETURN 6
33
- #define PyTrace_OPCODE 7
34
-
35
-
36
- typedef struct _err_stackitem {
37
- /* This struct represents an entry on the exception stack, which is a
38
- * per-coroutine state. (Coroutine in the computer science sense,
39
- * including the thread and generators).
40
- * This ensures that the exception state is not impacted by "yields"
41
- * from an except handler.
42
- */
43
- PyObject *exc_type, *exc_value, *exc_traceback;
44
-
45
- struct _err_stackitem *previous_item;
46
-
47
- } _PyErr_StackItem;
48
-
49
-
50
- // The PyThreadState typedef is in Include/pystate.h.
51
- struct _ts {
52
- /* See Python/ceval.c for comments explaining most fields */
53
-
54
- struct _ts *prev;
55
- struct _ts *next;
56
- PyInterpreterState *interp;
57
-
58
- /* Borrowed reference to the current frame (it can be NULL) */
59
- struct _frame *frame;
60
- int recursion_depth;
61
- char overflowed; /* The stack has overflowed. Allow 50 more calls
62
- to handle the runtime error. */
63
- char recursion_critical; /* The current calls must not cause
64
- a stack overflow. */
65
- int stackcheck_counter;
66
-
67
- /* 'tracing' keeps track of the execution depth when tracing/profiling.
68
- This is to prevent the actual trace/profile code from being recorded in
69
- the trace/profile. */
70
- int tracing;
71
- int use_tracing;
72
-
73
- Py_tracefunc c_profilefunc;
74
- Py_tracefunc c_tracefunc;
75
- PyObject *c_profileobj;
76
- PyObject *c_traceobj;
77
-
78
- /* The exception currently being raised */
79
- PyObject *curexc_type;
80
- PyObject *curexc_value;
81
- PyObject *curexc_traceback;
82
-
83
- /* The exception currently being handled, if no coroutines/generators
84
- * are present. Always last element on the stack referred to be exc_info.
85
- */
86
- _PyErr_StackItem exc_state;
87
-
88
- /* Pointer to the top of the stack of the exceptions currently
89
- * being handled */
90
- _PyErr_StackItem *exc_info;
91
-
92
- PyObject *dict; /* Stores per-thread state */
93
-
94
- int gilstate_counter;
95
-
96
- PyObject *async_exc; /* Asynchronous exception to raise */
97
- unsigned long thread_id; /* Thread id where this tstate was created */
98
-
99
- int trash_delete_nesting;
100
- PyObject *trash_delete_later;
101
-
102
- /* Called when a thread state is deleted normally, but not when it
103
- * is destroyed after fork().
104
- * Pain: to prevent rare but fatal shutdown errors (issue 18808),
105
- * Thread.join() must wait for the join'ed thread's tstate to be unlinked
106
- * from the tstate chain. That happens at the end of a thread's life,
107
- * in pystate.c.
108
- * The obvious way doesn't quite work: create a lock which the tstate
109
- * unlinking code releases, and have Thread.join() wait to acquire that
110
- * lock. The problem is that we _are_ at the end of the thread's life:
111
- * if the thread holds the last reference to the lock, decref'ing the
112
- * lock will delete the lock, and that may trigger arbitrary Python code
113
- * if there's a weakref, with a callback, to the lock. But by this time
114
- * _PyRuntime.gilstate.tstate_current is already NULL, so only the simplest
115
- * of C code can be allowed to run (in particular it must not be possible to
116
- * release the GIL).
117
- * So instead of holding the lock directly, the tstate holds a weakref to
118
- * the lock: that's the value of on_delete_data below. Decref'ing a
119
- * weakref is harmless.
120
- * on_delete points to _threadmodule.c's static release_sentinel() function.
121
- * After the tstate is unlinked, release_sentinel is called with the
122
- * weakref-to-lock (on_delete_data) argument, and release_sentinel releases
123
- * the indirectly held lock.
124
- */
125
- void (*on_delete)(void *);
126
- void *on_delete_data;
127
-
128
- int coroutine_origin_tracking_depth;
129
-
130
- PyObject *async_gen_firstiter;
131
- PyObject *async_gen_finalizer;
132
-
133
- PyObject *context;
134
- uint64_t context_ver;
135
-
136
- /* Unique thread state id. */
137
- uint64_t id;
138
-
139
- /* XXX signal handlers should also be here */
140
-
141
- };
142
-
143
- /* Get the current interpreter state.
144
-
145
- Issue a fatal error if there no current Python thread state or no current
146
- interpreter. It cannot return NULL.
147
-
148
- The caller must hold the GIL.*/
149
- PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_Get(void);
150
-
151
- PyAPI_FUNC(int) _PyState_AddModule(PyObject*, struct PyModuleDef*);
152
- PyAPI_FUNC(void) _PyState_ClearModules(void);
153
- PyAPI_FUNC(PyThreadState *) _PyThreadState_Prealloc(PyInterpreterState *);
154
-
155
- /* Similar to PyThreadState_Get(), but don't issue a fatal error
156
- * if it is NULL. */
157
- PyAPI_FUNC(PyThreadState *) _PyThreadState_UncheckedGet(void);
158
-
159
- /* PyGILState */
160
-
161
- /* Helper/diagnostic function - return 1 if the current thread
162
- currently holds the GIL, 0 otherwise.
163
-
164
- The function returns 1 if _PyGILState_check_enabled is non-zero. */
165
- PyAPI_FUNC(int) PyGILState_Check(void);
166
-
167
- /* Get the single PyInterpreterState used by this process' GILState
168
- implementation.
169
-
170
- This function doesn't check for error. Return NULL before _PyGILState_Init()
171
- is called and after _PyGILState_Fini() is called.
172
-
173
- See also _PyInterpreterState_Get() and _PyInterpreterState_GET_UNSAFE(). */
174
- PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void);
175
-
176
- /* The implementation of sys._current_frames() Returns a dict mapping
177
- thread id to that thread's current frame.
178
- */
179
- PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void);
180
-
181
- /* Routines for advanced debuggers, requested by David Beazley.
182
- Don't use unless you know what you are doing! */
183
- PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Main(void);
184
- PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void);
185
- PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *);
186
- PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *);
187
- PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *);
188
-
189
- typedef struct _frame *(*PyThreadFrameGetter)(PyThreadState *self_);
190
-
191
- /* cross-interpreter data */
192
-
193
- struct _xid;
194
-
195
- // _PyCrossInterpreterData is similar to Py_buffer as an effectively
196
- // opaque struct that holds data outside the object machinery. This
197
- // is necessary to pass safely between interpreters in the same process.
198
- typedef struct _xid {
199
- // data is the cross-interpreter-safe derivation of a Python object
200
- // (see _PyObject_GetCrossInterpreterData). It will be NULL if the
201
- // new_object func (below) encodes the data.
202
- void *data;
203
- // obj is the Python object from which the data was derived. This
204
- // is non-NULL only if the data remains bound to the object in some
205
- // way, such that the object must be "released" (via a decref) when
206
- // the data is released. In that case the code that sets the field,
207
- // likely a registered "crossinterpdatafunc", is responsible for
208
- // ensuring it owns the reference (i.e. incref).
209
- PyObject *obj;
210
- // interp is the ID of the owning interpreter of the original
211
- // object. It corresponds to the active interpreter when
212
- // _PyObject_GetCrossInterpreterData() was called. This should only
213
- // be set by the cross-interpreter machinery.
214
- //
215
- // We use the ID rather than the PyInterpreterState to avoid issues
216
- // with deleted interpreters. Note that IDs are never re-used, so
217
- // each one will always correspond to a specific interpreter
218
- // (whether still alive or not).
219
- int64_t interp;
220
- // new_object is a function that returns a new object in the current
221
- // interpreter given the data. The resulting object (a new
222
- // reference) will be equivalent to the original object. This field
223
- // is required.
224
- PyObject *(*new_object)(struct _xid *);
225
- // free is called when the data is released. If it is NULL then
226
- // nothing will be done to free the data. For some types this is
227
- // okay (e.g. bytes) and for those types this field should be set
228
- // to NULL. However, for most the data was allocated just for
229
- // cross-interpreter use, so it must be freed when
230
- // _PyCrossInterpreterData_Release is called or the memory will
231
- // leak. In that case, at the very least this field should be set
232
- // to PyMem_RawFree (the default if not explicitly set to NULL).
233
- // The call will happen with the original interpreter activated.
234
- void (*free)(void *);
235
- } _PyCrossInterpreterData;
236
-
237
- PyAPI_FUNC(int) _PyObject_GetCrossInterpreterData(PyObject *, _PyCrossInterpreterData *);
238
- PyAPI_FUNC(PyObject *) _PyCrossInterpreterData_NewObject(_PyCrossInterpreterData *);
239
- PyAPI_FUNC(void) _PyCrossInterpreterData_Release(_PyCrossInterpreterData *);
240
-
241
- PyAPI_FUNC(int) _PyObject_CheckCrossInterpreterData(PyObject *);
242
-
243
- /* cross-interpreter data registry */
244
-
245
- typedef int (*crossinterpdatafunc)(PyObject *, struct _xid *);
246
-
247
- PyAPI_FUNC(int) _PyCrossInterpreterData_RegisterClass(PyTypeObject *, crossinterpdatafunc);
248
- PyAPI_FUNC(crossinterpdatafunc) _PyCrossInterpreterData_Lookup(PyObject *);
249
-
250
- #ifdef __cplusplus
251
- }
252
- #endif
@@ -1,21 +0,0 @@
1
- #ifndef Py_CPYTHON_SYSMODULE_H
2
- # error "this header file must not be included directly"
3
- #endif
4
-
5
- #ifdef __cplusplus
6
- extern "C" {
7
- #endif
8
-
9
- PyAPI_FUNC(PyObject *) _PySys_GetObjectId(_Py_Identifier *key);
10
- PyAPI_FUNC(int) _PySys_SetObjectId(_Py_Identifier *key, PyObject *);
11
-
12
- PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *);
13
-
14
- typedef int(*Py_AuditHookFunction)(const char *, PyObject *, void *);
15
-
16
- PyAPI_FUNC(int) PySys_Audit(const char*, const char *, ...);
17
- PyAPI_FUNC(int) PySys_AddAuditHook(Py_AuditHookFunction, void*);
18
-
19
- #ifdef __cplusplus
20
- }
21
- #endif
@@ -1,22 +0,0 @@
1
- #ifndef Py_CPYTHON_TRACEBACK_H
2
- # error "this header file must not be included directly"
3
- #endif
4
-
5
- #ifdef __cplusplus
6
- extern "C" {
7
- #endif
8
-
9
- typedef struct _traceback {
10
- PyObject_HEAD
11
- struct _traceback *tb_next;
12
- struct _frame *tb_frame;
13
- int tb_lasti;
14
- int tb_lineno;
15
- } PyTracebackObject;
16
-
17
- PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int);
18
- PyAPI_FUNC(void) _PyTraceback_Add(const char *, const char *, int);
19
-
20
- #ifdef __cplusplus
21
- }
22
- #endif