@plone/volto 14.0.1 → 14.2.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 (218) hide show
  1. package/CHANGELOG.md +41 -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/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/config/Blocks.jsx +8 -1
  74. package/src/config/Loadables.jsx +2 -0
  75. package/src/config/index.js +3 -0
  76. package/src/helpers/Html/Html.jsx +2 -12
  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,102 +0,0 @@
1
- #ifndef PYMACCONFIG_H
2
- #define PYMACCONFIG_H
3
- /*
4
- * This file moves some of the autoconf magic to compile-time
5
- * when building on MacOSX. This is needed for building 4-way
6
- * universal binaries and for 64-bit universal binaries because
7
- * the values redefined below aren't configure-time constant but
8
- * only compile-time constant in these scenarios.
9
- */
10
-
11
- #if defined(__APPLE__)
12
-
13
- # undef SIZEOF_LONG
14
- # undef SIZEOF_PTHREAD_T
15
- # undef SIZEOF_SIZE_T
16
- # undef SIZEOF_TIME_T
17
- # undef SIZEOF_VOID_P
18
- # undef SIZEOF__BOOL
19
- # undef SIZEOF_UINTPTR_T
20
- # undef SIZEOF_PTHREAD_T
21
- # undef WORDS_BIGENDIAN
22
- # undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754
23
- # undef DOUBLE_IS_BIG_ENDIAN_IEEE754
24
- # undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754
25
- # undef HAVE_GCC_ASM_FOR_X87
26
-
27
- # undef VA_LIST_IS_ARRAY
28
- # if defined(__LP64__) && defined(__x86_64__)
29
- # define VA_LIST_IS_ARRAY 1
30
- # endif
31
-
32
- # undef HAVE_LARGEFILE_SUPPORT
33
- # ifndef __LP64__
34
- # define HAVE_LARGEFILE_SUPPORT 1
35
- # endif
36
-
37
- # undef SIZEOF_LONG
38
- # ifdef __LP64__
39
- # define SIZEOF__BOOL 1
40
- # define SIZEOF__BOOL 1
41
- # define SIZEOF_LONG 8
42
- # define SIZEOF_PTHREAD_T 8
43
- # define SIZEOF_SIZE_T 8
44
- # define SIZEOF_TIME_T 8
45
- # define SIZEOF_VOID_P 8
46
- # define SIZEOF_UINTPTR_T 8
47
- # define SIZEOF_PTHREAD_T 8
48
- # else
49
- # ifdef __ppc__
50
- # define SIZEOF__BOOL 4
51
- # else
52
- # define SIZEOF__BOOL 1
53
- # endif
54
- # define SIZEOF_LONG 4
55
- # define SIZEOF_PTHREAD_T 4
56
- # define SIZEOF_SIZE_T 4
57
- # define SIZEOF_TIME_T 4
58
- # define SIZEOF_VOID_P 4
59
- # define SIZEOF_UINTPTR_T 4
60
- # define SIZEOF_PTHREAD_T 4
61
- # endif
62
-
63
- # if defined(__LP64__)
64
- /* MacOSX 10.4 (the first release to support 64-bit code
65
- * at all) only supports 64-bit in the UNIX layer.
66
- * Therefore suppress the toolbox-glue in 64-bit mode.
67
- */
68
-
69
- /* In 64-bit mode setpgrp always has no arguments, in 32-bit
70
- * mode that depends on the compilation environment
71
- */
72
- # undef SETPGRP_HAVE_ARG
73
-
74
- # endif
75
-
76
- #ifdef __BIG_ENDIAN__
77
- #define WORDS_BIGENDIAN 1
78
- #define DOUBLE_IS_BIG_ENDIAN_IEEE754
79
- #else
80
- #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754
81
- #endif /* __BIG_ENDIAN */
82
-
83
- #ifdef __i386__
84
- # define HAVE_GCC_ASM_FOR_X87
85
- #endif
86
-
87
- /*
88
- * The definition in pyconfig.h is only valid on the OS release
89
- * where configure ran on and not necessarily for all systems where
90
- * the executable can be used on.
91
- *
92
- * Specifically: OSX 10.4 has limited supported for '%zd', while
93
- * 10.5 has full support for '%zd'. A binary built on 10.5 won't
94
- * work properly on 10.4 unless we suppress the definition
95
- * of PY_FORMAT_SIZE_T
96
- */
97
- #undef PY_FORMAT_SIZE_T
98
-
99
-
100
- #endif /* defined(_APPLE__) */
101
-
102
- #endif /* PYMACCONFIG_H */
@@ -1,106 +0,0 @@
1
- #ifndef Py_PYMACRO_H
2
- #define Py_PYMACRO_H
3
-
4
- /* Minimum value between x and y */
5
- #define Py_MIN(x, y) (((x) > (y)) ? (y) : (x))
6
-
7
- /* Maximum value between x and y */
8
- #define Py_MAX(x, y) (((x) > (y)) ? (x) : (y))
9
-
10
- /* Absolute value of the number x */
11
- #define Py_ABS(x) ((x) < 0 ? -(x) : (x))
12
-
13
- #define _Py_XSTRINGIFY(x) #x
14
-
15
- /* Convert the argument to a string. For example, Py_STRINGIFY(123) is replaced
16
- with "123" by the preprocessor. Defines are also replaced by their value.
17
- For example Py_STRINGIFY(__LINE__) is replaced by the line number, not
18
- by "__LINE__". */
19
- #define Py_STRINGIFY(x) _Py_XSTRINGIFY(x)
20
-
21
- /* Get the size of a structure member in bytes */
22
- #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
23
-
24
- /* Argument must be a char or an int in [-128, 127] or [0, 255]. */
25
- #define Py_CHARMASK(c) ((unsigned char)((c) & 0xff))
26
-
27
- /* Assert a build-time dependency, as an expression.
28
-
29
- Your compile will fail if the condition isn't true, or can't be evaluated
30
- by the compiler. This can be used in an expression: its value is 0.
31
-
32
- Example:
33
-
34
- #define foo_to_char(foo) \
35
- ((char *)(foo) \
36
- + Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))
37
-
38
- Written by Rusty Russell, public domain, http://ccodearchive.net/ */
39
- #define Py_BUILD_ASSERT_EXPR(cond) \
40
- (sizeof(char [1 - 2*!(cond)]) - 1)
41
-
42
- #define Py_BUILD_ASSERT(cond) do { \
43
- (void)Py_BUILD_ASSERT_EXPR(cond); \
44
- } while(0)
45
-
46
- /* Get the number of elements in a visible array
47
-
48
- This does not work on pointers, or arrays declared as [], or function
49
- parameters. With correct compiler support, such usage will cause a build
50
- error (see Py_BUILD_ASSERT_EXPR).
51
-
52
- Written by Rusty Russell, public domain, http://ccodearchive.net/
53
-
54
- Requires at GCC 3.1+ */
55
- #if (defined(__GNUC__) && !defined(__STRICT_ANSI__) && \
56
- (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ >= 4)))
57
- /* Two gcc extensions.
58
- &a[0] degrades to a pointer: a different type from an array */
59
- #define Py_ARRAY_LENGTH(array) \
60
- (sizeof(array) / sizeof((array)[0]) \
61
- + Py_BUILD_ASSERT_EXPR(!__builtin_types_compatible_p(typeof(array), \
62
- typeof(&(array)[0]))))
63
- #else
64
- #define Py_ARRAY_LENGTH(array) \
65
- (sizeof(array) / sizeof((array)[0]))
66
- #endif
67
-
68
-
69
- /* Define macros for inline documentation. */
70
- #define PyDoc_VAR(name) static const char name[]
71
- #define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
72
- #ifdef WITH_DOC_STRINGS
73
- #define PyDoc_STR(str) str
74
- #else
75
- #define PyDoc_STR(str) ""
76
- #endif
77
-
78
- /* Below "a" is a power of 2. */
79
- /* Round down size "n" to be a multiple of "a". */
80
- #define _Py_SIZE_ROUND_DOWN(n, a) ((size_t)(n) & ~(size_t)((a) - 1))
81
- /* Round up size "n" to be a multiple of "a". */
82
- #define _Py_SIZE_ROUND_UP(n, a) (((size_t)(n) + \
83
- (size_t)((a) - 1)) & ~(size_t)((a) - 1))
84
- /* Round pointer "p" down to the closest "a"-aligned address <= "p". */
85
- #define _Py_ALIGN_DOWN(p, a) ((void *)((uintptr_t)(p) & ~(uintptr_t)((a) - 1)))
86
- /* Round pointer "p" up to the closest "a"-aligned address >= "p". */
87
- #define _Py_ALIGN_UP(p, a) ((void *)(((uintptr_t)(p) + \
88
- (uintptr_t)((a) - 1)) & ~(uintptr_t)((a) - 1)))
89
- /* Check if pointer "p" is aligned to "a"-bytes boundary. */
90
- #define _Py_IS_ALIGNED(p, a) (!((uintptr_t)(p) & (uintptr_t)((a) - 1)))
91
-
92
- /* Use this for unused arguments in a function definition to silence compiler
93
- * warnings. Example:
94
- *
95
- * int func(int a, int Py_UNUSED(b)) { return a; }
96
- */
97
- #if defined(__GNUC__) || defined(__clang__)
98
- # define Py_UNUSED(name) _unused_ ## name __attribute__((unused))
99
- #else
100
- # define Py_UNUSED(name) _unused_ ## name
101
- #endif
102
-
103
- #define Py_UNREACHABLE() \
104
- Py_FatalError("Unreachable C code path reached")
105
-
106
- #endif /* Py_PYMACRO_H */
@@ -1,230 +0,0 @@
1
- #ifndef Py_PYMATH_H
2
- #define Py_PYMATH_H
3
-
4
- #include "pyconfig.h" /* include for defines */
5
-
6
- /**************************************************************************
7
- Symbols and macros to supply platform-independent interfaces to mathematical
8
- functions and constants
9
- **************************************************************************/
10
-
11
- /* Python provides implementations for copysign, round and hypot in
12
- * Python/pymath.c just in case your math library doesn't provide the
13
- * functions.
14
- *
15
- *Note: PC/pyconfig.h defines copysign as _copysign
16
- */
17
- #ifndef HAVE_COPYSIGN
18
- extern double copysign(double, double);
19
- #endif
20
-
21
- #ifndef HAVE_ROUND
22
- extern double round(double);
23
- #endif
24
-
25
- #ifndef HAVE_HYPOT
26
- extern double hypot(double, double);
27
- #endif
28
-
29
- /* extra declarations */
30
- #ifndef _MSC_VER
31
- #ifndef __STDC__
32
- extern double fmod (double, double);
33
- extern double frexp (double, int *);
34
- extern double ldexp (double, int);
35
- extern double modf (double, double *);
36
- extern double pow(double, double);
37
- #endif /* __STDC__ */
38
- #endif /* _MSC_VER */
39
-
40
- /* High precision definition of pi and e (Euler)
41
- * The values are taken from libc6's math.h.
42
- */
43
- #ifndef Py_MATH_PIl
44
- #define Py_MATH_PIl 3.1415926535897932384626433832795029L
45
- #endif
46
- #ifndef Py_MATH_PI
47
- #define Py_MATH_PI 3.14159265358979323846
48
- #endif
49
-
50
- #ifndef Py_MATH_El
51
- #define Py_MATH_El 2.7182818284590452353602874713526625L
52
- #endif
53
-
54
- #ifndef Py_MATH_E
55
- #define Py_MATH_E 2.7182818284590452354
56
- #endif
57
-
58
- /* Tau (2pi) to 40 digits, taken from tauday.com/tau-digits. */
59
- #ifndef Py_MATH_TAU
60
- #define Py_MATH_TAU 6.2831853071795864769252867665590057683943L
61
- #endif
62
-
63
-
64
- /* On x86, Py_FORCE_DOUBLE forces a floating-point number out of an x87 FPU
65
- register and into a 64-bit memory location, rounding from extended
66
- precision to double precision in the process. On other platforms it does
67
- nothing. */
68
-
69
- /* we take double rounding as evidence of x87 usage */
70
- #ifndef Py_LIMITED_API
71
- #ifndef Py_FORCE_DOUBLE
72
- # ifdef X87_DOUBLE_ROUNDING
73
- PyAPI_FUNC(double) _Py_force_double(double);
74
- # define Py_FORCE_DOUBLE(X) (_Py_force_double(X))
75
- # else
76
- # define Py_FORCE_DOUBLE(X) (X)
77
- # endif
78
- #endif
79
- #endif
80
-
81
- #ifndef Py_LIMITED_API
82
- #ifdef HAVE_GCC_ASM_FOR_X87
83
- PyAPI_FUNC(unsigned short) _Py_get_387controlword(void);
84
- PyAPI_FUNC(void) _Py_set_387controlword(unsigned short);
85
- #endif
86
- #endif
87
-
88
- /* Py_IS_NAN(X)
89
- * Return 1 if float or double arg is a NaN, else 0.
90
- * Caution:
91
- * X is evaluated more than once.
92
- * This may not work on all platforms. Each platform has *some*
93
- * way to spell this, though -- override in pyconfig.h if you have
94
- * a platform where it doesn't work.
95
- * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan
96
- */
97
- #ifndef Py_IS_NAN
98
- #if defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1
99
- #define Py_IS_NAN(X) isnan(X)
100
- #else
101
- #define Py_IS_NAN(X) ((X) != (X))
102
- #endif
103
- #endif
104
-
105
- /* Py_IS_INFINITY(X)
106
- * Return 1 if float or double arg is an infinity, else 0.
107
- * Caution:
108
- * X is evaluated more than once.
109
- * This implementation may set the underflow flag if |X| is very small;
110
- * it really can't be implemented correctly (& easily) before C99.
111
- * Override in pyconfig.h if you have a better spelling on your platform.
112
- * Py_FORCE_DOUBLE is used to avoid getting false negatives from a
113
- * non-infinite value v sitting in an 80-bit x87 register such that
114
- * v becomes infinite when spilled from the register to 64-bit memory.
115
- * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf
116
- */
117
- #ifndef Py_IS_INFINITY
118
- # if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1
119
- # define Py_IS_INFINITY(X) isinf(X)
120
- # else
121
- # define Py_IS_INFINITY(X) ((X) && \
122
- (Py_FORCE_DOUBLE(X)*0.5 == Py_FORCE_DOUBLE(X)))
123
- # endif
124
- #endif
125
-
126
- /* Py_IS_FINITE(X)
127
- * Return 1 if float or double arg is neither infinite nor NAN, else 0.
128
- * Some compilers (e.g. VisualStudio) have intrisics for this, so a special
129
- * macro for this particular test is useful
130
- * Note: PC/pyconfig.h defines Py_IS_FINITE as _finite
131
- */
132
- #ifndef Py_IS_FINITE
133
- #if defined HAVE_DECL_ISFINITE && HAVE_DECL_ISFINITE == 1
134
- #define Py_IS_FINITE(X) isfinite(X)
135
- #elif defined HAVE_FINITE
136
- #define Py_IS_FINITE(X) finite(X)
137
- #else
138
- #define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X))
139
- #endif
140
- #endif
141
-
142
- /* HUGE_VAL is supposed to expand to a positive double infinity. Python
143
- * uses Py_HUGE_VAL instead because some platforms are broken in this
144
- * respect. We used to embed code in pyport.h to try to worm around that,
145
- * but different platforms are broken in conflicting ways. If you're on
146
- * a platform where HUGE_VAL is defined incorrectly, fiddle your Python
147
- * config to #define Py_HUGE_VAL to something that works on your platform.
148
- */
149
- #ifndef Py_HUGE_VAL
150
- #define Py_HUGE_VAL HUGE_VAL
151
- #endif
152
-
153
- /* Py_NAN
154
- * A value that evaluates to a NaN. On IEEE 754 platforms INF*0 or
155
- * INF/INF works. Define Py_NO_NAN in pyconfig.h if your platform
156
- * doesn't support NaNs.
157
- */
158
- #if !defined(Py_NAN) && !defined(Py_NO_NAN)
159
- #if !defined(__INTEL_COMPILER)
160
- #define Py_NAN (Py_HUGE_VAL * 0.)
161
- #else /* __INTEL_COMPILER */
162
- #if defined(ICC_NAN_STRICT)
163
- #pragma float_control(push)
164
- #pragma float_control(precise, on)
165
- #pragma float_control(except, on)
166
- #if defined(_MSC_VER)
167
- __declspec(noinline)
168
- #else /* Linux */
169
- __attribute__((noinline))
170
- #endif /* _MSC_VER */
171
- static double __icc_nan()
172
- {
173
- return sqrt(-1.0);
174
- }
175
- #pragma float_control (pop)
176
- #define Py_NAN __icc_nan()
177
- #else /* ICC_NAN_RELAXED as default for Intel Compiler */
178
- static const union { unsigned char buf[8]; double __icc_nan; } __nan_store = {0,0,0,0,0,0,0xf8,0x7f};
179
- #define Py_NAN (__nan_store.__icc_nan)
180
- #endif /* ICC_NAN_STRICT */
181
- #endif /* __INTEL_COMPILER */
182
- #endif
183
-
184
- /* Py_OVERFLOWED(X)
185
- * Return 1 iff a libm function overflowed. Set errno to 0 before calling
186
- * a libm function, and invoke this macro after, passing the function
187
- * result.
188
- * Caution:
189
- * This isn't reliable. C99 no longer requires libm to set errno under
190
- * any exceptional condition, but does require +- HUGE_VAL return
191
- * values on overflow. A 754 box *probably* maps HUGE_VAL to a
192
- * double infinity, and we're cool if that's so, unless the input
193
- * was an infinity and an infinity is the expected result. A C89
194
- * system sets errno to ERANGE, so we check for that too. We're
195
- * out of luck if a C99 754 box doesn't map HUGE_VAL to +Inf, or
196
- * if the returned result is a NaN, or if a C89 box returns HUGE_VAL
197
- * in non-overflow cases.
198
- * X is evaluated more than once.
199
- * Some platforms have better way to spell this, so expect some #ifdef'ery.
200
- *
201
- * OpenBSD uses 'isinf()' because a compiler bug on that platform causes
202
- * the longer macro version to be mis-compiled. This isn't optimal, and
203
- * should be removed once a newer compiler is available on that platform.
204
- * The system that had the failure was running OpenBSD 3.2 on Intel, with
205
- * gcc 2.95.3.
206
- *
207
- * According to Tim's checkin, the FreeBSD systems use isinf() to work
208
- * around a FPE bug on that platform.
209
- */
210
- #if defined(__FreeBSD__) || defined(__OpenBSD__)
211
- #define Py_OVERFLOWED(X) isinf(X)
212
- #else
213
- #define Py_OVERFLOWED(X) ((X) != 0.0 && (errno == ERANGE || \
214
- (X) == Py_HUGE_VAL || \
215
- (X) == -Py_HUGE_VAL))
216
- #endif
217
-
218
- /* Return whether integral type *type* is signed or not. */
219
- #define _Py_IntegralTypeSigned(type) ((type)(-1) < 0)
220
- /* Return the maximum value of integral type *type*. */
221
- #define _Py_IntegralTypeMax(type) ((_Py_IntegralTypeSigned(type)) ? (((((type)1 << (sizeof(type)*CHAR_BIT - 2)) - 1) << 1) + 1) : ~(type)0)
222
- /* Return the minimum value of integral type *type*. */
223
- #define _Py_IntegralTypeMin(type) ((_Py_IntegralTypeSigned(type)) ? -_Py_IntegralTypeMax(type) - 1 : 0)
224
- /* Check whether *v* is in the range of integral type *type*. This is most
225
- * useful if *v* is floating-point, since demoting a floating-point *v* to an
226
- * integral type that cannot represent *v*'s integral part is undefined
227
- * behavior. */
228
- #define _Py_InIntegralTypeRange(type, v) (_Py_IntegralTypeMin(type) <= v && v <= _Py_IntegralTypeMax(type))
229
-
230
- #endif /* Py_PYMATH_H */
@@ -1,150 +0,0 @@
1
- /* The PyMem_ family: low-level memory allocation interfaces.
2
- See objimpl.h for the PyObject_ memory family.
3
- */
4
-
5
- #ifndef Py_PYMEM_H
6
- #define Py_PYMEM_H
7
-
8
- #include "pyport.h"
9
-
10
- #ifdef __cplusplus
11
- extern "C" {
12
- #endif
13
-
14
- /* BEWARE:
15
-
16
- Each interface exports both functions and macros. Extension modules should
17
- use the functions, to ensure binary compatibility across Python versions.
18
- Because the Python implementation is free to change internal details, and
19
- the macros may (or may not) expose details for speed, if you do use the
20
- macros you must recompile your extensions with each Python release.
21
-
22
- Never mix calls to PyMem_ with calls to the platform malloc/realloc/
23
- calloc/free. For example, on Windows different DLLs may end up using
24
- different heaps, and if you use PyMem_Malloc you'll get the memory from the
25
- heap used by the Python DLL; it could be a disaster if you free()'ed that
26
- directly in your own extension. Using PyMem_Free instead ensures Python
27
- can return the memory to the proper heap. As another example, in
28
- PYMALLOC_DEBUG mode, Python wraps all calls to all PyMem_ and PyObject_
29
- memory functions in special debugging wrappers that add additional
30
- debugging info to dynamic memory blocks. The system routines have no idea
31
- what to do with that stuff, and the Python wrappers have no idea what to do
32
- with raw blocks obtained directly by the system routines then.
33
-
34
- The GIL must be held when using these APIs.
35
- */
36
-
37
- /*
38
- * Raw memory interface
39
- * ====================
40
- */
41
-
42
- /* Functions
43
-
44
- Functions supplying platform-independent semantics for malloc/realloc/
45
- free. These functions make sure that allocating 0 bytes returns a distinct
46
- non-NULL pointer (whenever possible -- if we're flat out of memory, NULL
47
- may be returned), even if the platform malloc and realloc don't.
48
- Returned pointers must be checked for NULL explicitly. No action is
49
- performed on failure (no exception is set, no warning is printed, etc).
50
- */
51
-
52
- PyAPI_FUNC(void *) PyMem_Malloc(size_t size);
53
- PyAPI_FUNC(void *) PyMem_Realloc(void *ptr, size_t new_size);
54
- PyAPI_FUNC(void) PyMem_Free(void *ptr);
55
-
56
- /* Macros. */
57
-
58
- /* PyMem_MALLOC(0) means malloc(1). Some systems would return NULL
59
- for malloc(0), which would be treated as an error. Some platforms
60
- would return a pointer with no memory behind it, which would break
61
- pymalloc. To solve these problems, allocate an extra byte. */
62
- /* Returns NULL to indicate error if a negative size or size larger than
63
- Py_ssize_t can represent is supplied. Helps prevents security holes. */
64
- #define PyMem_MALLOC(n) PyMem_Malloc(n)
65
- #define PyMem_REALLOC(p, n) PyMem_Realloc(p, n)
66
- #define PyMem_FREE(p) PyMem_Free(p)
67
-
68
- /*
69
- * Type-oriented memory interface
70
- * ==============================
71
- *
72
- * Allocate memory for n objects of the given type. Returns a new pointer
73
- * or NULL if the request was too large or memory allocation failed. Use
74
- * these macros rather than doing the multiplication yourself so that proper
75
- * overflow checking is always done.
76
- */
77
-
78
- #define PyMem_New(type, n) \
79
- ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
80
- ( (type *) PyMem_Malloc((n) * sizeof(type)) ) )
81
- #define PyMem_NEW(type, n) \
82
- ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
83
- ( (type *) PyMem_MALLOC((n) * sizeof(type)) ) )
84
-
85
- /*
86
- * The value of (p) is always clobbered by this macro regardless of success.
87
- * The caller MUST check if (p) is NULL afterwards and deal with the memory
88
- * error if so. This means the original value of (p) MUST be saved for the
89
- * caller's memory error handler to not lose track of it.
90
- */
91
- #define PyMem_Resize(p, type, n) \
92
- ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
93
- (type *) PyMem_Realloc((p), (n) * sizeof(type)) )
94
- #define PyMem_RESIZE(p, type, n) \
95
- ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
96
- (type *) PyMem_REALLOC((p), (n) * sizeof(type)) )
97
-
98
- /* PyMem{Del,DEL} are left over from ancient days, and shouldn't be used
99
- * anymore. They're just confusing aliases for PyMem_{Free,FREE} now.
100
- */
101
- #define PyMem_Del PyMem_Free
102
- #define PyMem_DEL PyMem_FREE
103
-
104
- /* bpo-35053: expose _Py_tracemalloc_config for performance:
105
- _Py_NewReference() needs an efficient check to test if tracemalloc is
106
- tracing.
107
-
108
- It has to be defined in pymem.h, before object.h is included. */
109
- struct _PyTraceMalloc_Config {
110
- /* Module initialized?
111
- Variable protected by the GIL */
112
- enum {
113
- TRACEMALLOC_NOT_INITIALIZED,
114
- TRACEMALLOC_INITIALIZED,
115
- TRACEMALLOC_FINALIZED
116
- } initialized;
117
-
118
- /* Is tracemalloc tracing memory allocations?
119
- Variable protected by the GIL */
120
- int tracing;
121
-
122
- /* limit of the number of frames in a traceback, 1 by default.
123
- Variable protected by the GIL. */
124
- int max_nframe;
125
-
126
- /* use domain in trace key?
127
- Variable protected by the GIL. */
128
- int use_domain;
129
- };
130
-
131
- PyAPI_DATA(struct _PyTraceMalloc_Config) _Py_tracemalloc_config;
132
-
133
- #define _PyTraceMalloc_Config_INIT \
134
- {.initialized = TRACEMALLOC_NOT_INITIALIZED, \
135
- .tracing = 0, \
136
- .max_nframe = 1, \
137
- .use_domain = 0}
138
-
139
-
140
- #ifndef Py_LIMITED_API
141
- # define Py_CPYTHON_PYMEM_H
142
- # include "cpython/pymem.h"
143
- # undef Py_CPYTHON_PYMEM_H
144
- #endif
145
-
146
- #ifdef __cplusplus
147
- }
148
- #endif
149
-
150
- #endif /* !Py_PYMEM_H */