@plone/volto 14.0.2 → 14.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/locales/ca/LC_MESSAGES/volto.po +12 -2
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +12 -2
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +12 -2
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +12 -2
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +12 -2
- package/locales/eu.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +12 -2
- package/locales/fr.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +12 -2
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +12 -2
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +12 -2
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +12 -2
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +12 -2
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +12 -2
- package/locales/ro.json +1 -1
- package/locales/volto.pot +12 -2
- package/package.json +2 -1
- package/src/actions/vocabularies/vocabularies.js +14 -3
- package/src/components/index.js +1 -0
- package/src/components/manage/Blocks/HeroImageLeft/Edit.jsx +1 -1
- package/src/components/manage/Blocks/Listing/getAsyncData.js +1 -1
- package/src/components/manage/Blocks/Text/Edit.jsx +19 -0
- package/src/components/manage/Form/Form.jsx +11 -1
- package/src/components/manage/Form/UndoToolbar.jsx +78 -0
- package/src/components/manage/Widgets/AlignWidget.stories.jsx +5 -21
- package/src/components/manage/Widgets/ArrayWidget.jsx +83 -101
- package/src/components/manage/Widgets/ArrayWidget.stories.jsx +29 -64
- package/src/components/manage/Widgets/CheckboxWidget.stories.jsx +5 -22
- package/src/components/manage/Widgets/DatetimeWidget.jsx +65 -74
- package/src/components/manage/Widgets/DatetimeWidget.stories.jsx +7 -23
- package/src/components/manage/Widgets/DatetimeWidget.test.jsx +17 -15
- package/src/components/manage/Widgets/EmailWidget.stories.jsx +5 -22
- package/src/components/manage/Widgets/FileWidget.stories.jsx +5 -22
- package/src/components/manage/Widgets/NumberWidget.stories.jsx +5 -23
- package/src/components/manage/Widgets/ObjectBrowserWidget.stories.js +24 -32
- package/src/components/manage/Widgets/ObjectListWidget.stories.js +44 -44
- package/src/components/manage/Widgets/ObjectWidget.stories.jsx +13 -28
- package/src/components/manage/Widgets/PasswordWidget.stories.jsx +5 -22
- package/src/components/manage/Widgets/QueryWidget.jsx +2 -2
- package/src/components/manage/Widgets/QueryWidget.stories.jsx +1637 -22
- package/src/components/manage/Widgets/SelectAutoComplete.jsx +79 -48
- package/src/components/manage/Widgets/SelectAutoComplete.test.jsx +16 -0
- package/src/components/manage/Widgets/SelectAutocompleteWidget.stories.jsx +161 -0
- package/src/components/manage/Widgets/SelectUtils.js +90 -30
- package/src/components/manage/Widgets/SelectUtils.test.jsx +76 -1
- package/src/components/manage/Widgets/SelectWidget.jsx +26 -37
- package/src/components/manage/Widgets/SelectWidget.stories.jsx +96 -28
- package/src/components/manage/Widgets/TextWidget.stories.jsx +5 -22
- package/src/components/manage/Widgets/TextareaWidget.stories.jsx +5 -22
- package/src/components/manage/Widgets/TokenWidget.jsx +19 -17
- package/src/components/manage/Widgets/TokenWidget.stories.jsx +141 -0
- package/src/components/manage/Widgets/UrlWidget.stories.jsx +5 -21
- package/src/components/manage/Widgets/VocabularyTermsWidget.stories.js +27 -64
- package/src/components/manage/Widgets/WysiwygWidget.stories.jsx +5 -22
- package/src/components/manage/Widgets/story.jsx +38 -0
- package/src/components/theme/ContactForm/ContactForm.jsx +1 -0
- package/src/components/theme/ContactForm/ContactForm.stories.jsx +126 -0
- package/src/components/theme/CorsError/CorsError.jsx +2 -2
- package/src/config/Loadables.jsx +2 -0
- package/src/config/index.js +1 -0
- package/src/helpers/UndoManager/useUndoManager.js +102 -0
- package/src/helpers/index.js +1 -0
- package/src/reducers/vocabularies/vocabularies.js +13 -2
- package/src/store.js +1 -1
- package/src/storybook.jsx +55 -0
- package/theme/themes/pastanaga/extras/time-picker-overrides.less +1 -1
- package/include/python3.8/Python-ast.h +0 -715
- package/include/python3.8/Python.h +0 -160
- package/include/python3.8/abstract.h +0 -844
- package/include/python3.8/asdl.h +0 -46
- package/include/python3.8/ast.h +0 -37
- package/include/python3.8/bitset.h +0 -23
- package/include/python3.8/bltinmodule.h +0 -14
- package/include/python3.8/boolobject.h +0 -34
- package/include/python3.8/bytearrayobject.h +0 -62
- package/include/python3.8/bytes_methods.h +0 -69
- package/include/python3.8/bytesobject.h +0 -224
- package/include/python3.8/cellobject.h +0 -29
- package/include/python3.8/ceval.h +0 -231
- package/include/python3.8/classobject.h +0 -59
- package/include/python3.8/code.h +0 -180
- package/include/python3.8/codecs.h +0 -240
- package/include/python3.8/compile.h +0 -106
- package/include/python3.8/complexobject.h +0 -69
- package/include/python3.8/context.h +0 -84
- package/include/python3.8/cpython/abstract.h +0 -319
- package/include/python3.8/cpython/dictobject.h +0 -94
- package/include/python3.8/cpython/fileobject.h +0 -24
- package/include/python3.8/cpython/initconfig.h +0 -434
- package/include/python3.8/cpython/interpreteridobject.h +0 -19
- package/include/python3.8/cpython/object.h +0 -470
- package/include/python3.8/cpython/objimpl.h +0 -113
- package/include/python3.8/cpython/pyerrors.h +0 -188
- package/include/python3.8/cpython/pylifecycle.h +0 -78
- package/include/python3.8/cpython/pymem.h +0 -108
- package/include/python3.8/cpython/pystate.h +0 -252
- package/include/python3.8/cpython/sysmodule.h +0 -21
- package/include/python3.8/cpython/traceback.h +0 -22
- package/include/python3.8/cpython/tupleobject.h +0 -36
- package/include/python3.8/cpython/unicodeobject.h +0 -1239
- package/include/python3.8/datetime.h +0 -259
- package/include/python3.8/descrobject.h +0 -108
- package/include/python3.8/dictobject.h +0 -94
- package/include/python3.8/dtoa.h +0 -19
- package/include/python3.8/dynamic_annotations.h +0 -499
- package/include/python3.8/enumobject.h +0 -17
- package/include/python3.8/errcode.h +0 -38
- package/include/python3.8/eval.h +0 -37
- package/include/python3.8/fileobject.h +0 -49
- package/include/python3.8/fileutils.h +0 -185
- package/include/python3.8/floatobject.h +0 -130
- package/include/python3.8/frameobject.h +0 -92
- package/include/python3.8/funcobject.h +0 -104
- package/include/python3.8/genobject.h +0 -109
- package/include/python3.8/graminit.h +0 -94
- package/include/python3.8/grammar.h +0 -77
- package/include/python3.8/import.h +0 -149
- package/include/python3.8/internal/pycore_accu.h +0 -39
- package/include/python3.8/internal/pycore_atomic.h +0 -558
- package/include/python3.8/internal/pycore_ceval.h +0 -37
- package/include/python3.8/internal/pycore_code.h +0 -27
- package/include/python3.8/internal/pycore_condvar.h +0 -95
- package/include/python3.8/internal/pycore_context.h +0 -42
- package/include/python3.8/internal/pycore_fileutils.h +0 -54
- package/include/python3.8/internal/pycore_getopt.h +0 -22
- package/include/python3.8/internal/pycore_gil.h +0 -50
- package/include/python3.8/internal/pycore_hamt.h +0 -116
- package/include/python3.8/internal/pycore_initconfig.h +0 -166
- package/include/python3.8/internal/pycore_object.h +0 -81
- package/include/python3.8/internal/pycore_pathconfig.h +0 -75
- package/include/python3.8/internal/pycore_pyerrors.h +0 -62
- package/include/python3.8/internal/pycore_pyhash.h +0 -10
- package/include/python3.8/internal/pycore_pylifecycle.h +0 -118
- package/include/python3.8/internal/pycore_pymem.h +0 -212
- package/include/python3.8/internal/pycore_pystate.h +0 -326
- package/include/python3.8/internal/pycore_traceback.h +0 -96
- package/include/python3.8/internal/pycore_tupleobject.h +0 -19
- package/include/python3.8/internal/pycore_warnings.h +0 -25
- package/include/python3.8/interpreteridobject.h +0 -17
- package/include/python3.8/intrcheck.h +0 -33
- package/include/python3.8/iterobject.h +0 -25
- package/include/python3.8/listobject.h +0 -81
- package/include/python3.8/longintrepr.h +0 -99
- package/include/python3.8/longobject.h +0 -242
- package/include/python3.8/marshal.h +0 -28
- package/include/python3.8/memoryobject.h +0 -72
- package/include/python3.8/methodobject.h +0 -131
- package/include/python3.8/modsupport.h +0 -248
- package/include/python3.8/moduleobject.h +0 -90
- package/include/python3.8/namespaceobject.h +0 -19
- package/include/python3.8/node.h +0 -48
- package/include/python3.8/object.h +0 -753
- package/include/python3.8/objimpl.h +0 -284
- package/include/python3.8/odictobject.h +0 -43
- package/include/python3.8/opcode.h +0 -148
- package/include/python3.8/osdefs.h +0 -51
- package/include/python3.8/osmodule.h +0 -17
- package/include/python3.8/parsetok.h +0 -110
- package/include/python3.8/patchlevel.h +0 -35
- package/include/python3.8/picklebufobject.h +0 -31
- package/include/python3.8/py_curses.h +0 -100
- package/include/python3.8/pyarena.h +0 -64
- package/include/python3.8/pycapsule.h +0 -59
- package/include/python3.8/pyconfig.h +0 -1665
- package/include/python3.8/pyctype.h +0 -39
- package/include/python3.8/pydebug.h +0 -40
- package/include/python3.8/pydtrace.h +0 -59
- package/include/python3.8/pydtrace_probes.h +0 -228
- package/include/python3.8/pyerrors.h +0 -335
- package/include/python3.8/pyexpat.h +0 -55
- package/include/python3.8/pyfpe.h +0 -12
- package/include/python3.8/pyhash.h +0 -145
- package/include/python3.8/pylifecycle.h +0 -75
- package/include/python3.8/pymacconfig.h +0 -102
- package/include/python3.8/pymacro.h +0 -106
- package/include/python3.8/pymath.h +0 -230
- package/include/python3.8/pymem.h +0 -150
- package/include/python3.8/pyport.h +0 -850
- package/include/python3.8/pystate.h +0 -136
- package/include/python3.8/pystrcmp.h +0 -23
- package/include/python3.8/pystrhex.h +0 -22
- package/include/python3.8/pystrtod.h +0 -45
- package/include/python3.8/pythonrun.h +0 -210
- package/include/python3.8/pythread.h +0 -161
- package/include/python3.8/pytime.h +0 -246
- package/include/python3.8/rangeobject.h +0 -27
- package/include/python3.8/setobject.h +0 -108
- package/include/python3.8/sliceobject.h +0 -65
- package/include/python3.8/structmember.h +0 -74
- package/include/python3.8/structseq.h +0 -49
- package/include/python3.8/symtable.h +0 -123
- package/include/python3.8/sysmodule.h +0 -41
- package/include/python3.8/token.h +0 -92
- package/include/python3.8/traceback.h +0 -28
- package/include/python3.8/tracemalloc.h +0 -38
- package/include/python3.8/tupleobject.h +0 -48
- package/include/python3.8/typeslots.h +0 -85
- package/include/python3.8/ucnhash.h +0 -36
- package/include/python3.8/unicodeobject.h +0 -1044
- package/include/python3.8/warnings.h +0 -67
- package/include/python3.8/weakrefobject.h +0 -86
- package/src/components/theme/ContactForm/ContactForm.stories.mdx +0 -39
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
#ifndef Py_LIMITED_API
|
|
2
|
-
#ifndef Py_PYTIME_H
|
|
3
|
-
#define Py_PYTIME_H
|
|
4
|
-
|
|
5
|
-
#include "pyconfig.h" /* include for defines */
|
|
6
|
-
#include "object.h"
|
|
7
|
-
|
|
8
|
-
/**************************************************************************
|
|
9
|
-
Symbols and macros to supply platform-independent interfaces to time related
|
|
10
|
-
functions and constants
|
|
11
|
-
**************************************************************************/
|
|
12
|
-
#ifdef __cplusplus
|
|
13
|
-
extern "C" {
|
|
14
|
-
#endif
|
|
15
|
-
|
|
16
|
-
/* _PyTime_t: Python timestamp with subsecond precision. It can be used to
|
|
17
|
-
store a duration, and so indirectly a date (related to another date, like
|
|
18
|
-
UNIX epoch). */
|
|
19
|
-
typedef int64_t _PyTime_t;
|
|
20
|
-
#define _PyTime_MIN INT64_MIN
|
|
21
|
-
#define _PyTime_MAX INT64_MAX
|
|
22
|
-
|
|
23
|
-
typedef enum {
|
|
24
|
-
/* Round towards minus infinity (-inf).
|
|
25
|
-
For example, used to read a clock. */
|
|
26
|
-
_PyTime_ROUND_FLOOR=0,
|
|
27
|
-
/* Round towards infinity (+inf).
|
|
28
|
-
For example, used for timeout to wait "at least" N seconds. */
|
|
29
|
-
_PyTime_ROUND_CEILING=1,
|
|
30
|
-
/* Round to nearest with ties going to nearest even integer.
|
|
31
|
-
For example, used to round from a Python float. */
|
|
32
|
-
_PyTime_ROUND_HALF_EVEN=2,
|
|
33
|
-
/* Round away from zero
|
|
34
|
-
For example, used for timeout. _PyTime_ROUND_CEILING rounds
|
|
35
|
-
-1e-9 to 0 milliseconds which causes bpo-31786 issue.
|
|
36
|
-
_PyTime_ROUND_UP rounds -1e-9 to -1 millisecond which keeps
|
|
37
|
-
the timeout sign as expected. select.poll(timeout) must block
|
|
38
|
-
for negative values." */
|
|
39
|
-
_PyTime_ROUND_UP=3,
|
|
40
|
-
/* _PyTime_ROUND_TIMEOUT (an alias for _PyTime_ROUND_UP) should be
|
|
41
|
-
used for timeouts. */
|
|
42
|
-
_PyTime_ROUND_TIMEOUT = _PyTime_ROUND_UP
|
|
43
|
-
} _PyTime_round_t;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/* Convert a time_t to a PyLong. */
|
|
47
|
-
PyAPI_FUNC(PyObject *) _PyLong_FromTime_t(
|
|
48
|
-
time_t sec);
|
|
49
|
-
|
|
50
|
-
/* Convert a PyLong to a time_t. */
|
|
51
|
-
PyAPI_FUNC(time_t) _PyLong_AsTime_t(
|
|
52
|
-
PyObject *obj);
|
|
53
|
-
|
|
54
|
-
/* Convert a number of seconds, int or float, to time_t. */
|
|
55
|
-
PyAPI_FUNC(int) _PyTime_ObjectToTime_t(
|
|
56
|
-
PyObject *obj,
|
|
57
|
-
time_t *sec,
|
|
58
|
-
_PyTime_round_t);
|
|
59
|
-
|
|
60
|
-
/* Convert a number of seconds, int or float, to a timeval structure.
|
|
61
|
-
usec is in the range [0; 999999] and rounded towards zero.
|
|
62
|
-
For example, -1.2 is converted to (-2, 800000). */
|
|
63
|
-
PyAPI_FUNC(int) _PyTime_ObjectToTimeval(
|
|
64
|
-
PyObject *obj,
|
|
65
|
-
time_t *sec,
|
|
66
|
-
long *usec,
|
|
67
|
-
_PyTime_round_t);
|
|
68
|
-
|
|
69
|
-
/* Convert a number of seconds, int or float, to a timespec structure.
|
|
70
|
-
nsec is in the range [0; 999999999] and rounded towards zero.
|
|
71
|
-
For example, -1.2 is converted to (-2, 800000000). */
|
|
72
|
-
PyAPI_FUNC(int) _PyTime_ObjectToTimespec(
|
|
73
|
-
PyObject *obj,
|
|
74
|
-
time_t *sec,
|
|
75
|
-
long *nsec,
|
|
76
|
-
_PyTime_round_t);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
/* Create a timestamp from a number of seconds. */
|
|
80
|
-
PyAPI_FUNC(_PyTime_t) _PyTime_FromSeconds(int seconds);
|
|
81
|
-
|
|
82
|
-
/* Macro to create a timestamp from a number of seconds, no integer overflow.
|
|
83
|
-
Only use the macro for small values, prefer _PyTime_FromSeconds(). */
|
|
84
|
-
#define _PYTIME_FROMSECONDS(seconds) \
|
|
85
|
-
((_PyTime_t)(seconds) * (1000 * 1000 * 1000))
|
|
86
|
-
|
|
87
|
-
/* Create a timestamp from a number of nanoseconds. */
|
|
88
|
-
PyAPI_FUNC(_PyTime_t) _PyTime_FromNanoseconds(_PyTime_t ns);
|
|
89
|
-
|
|
90
|
-
/* Create a timestamp from nanoseconds (Python int). */
|
|
91
|
-
PyAPI_FUNC(int) _PyTime_FromNanosecondsObject(_PyTime_t *t,
|
|
92
|
-
PyObject *obj);
|
|
93
|
-
|
|
94
|
-
/* Convert a number of seconds (Python float or int) to a timetamp.
|
|
95
|
-
Raise an exception and return -1 on error, return 0 on success. */
|
|
96
|
-
PyAPI_FUNC(int) _PyTime_FromSecondsObject(_PyTime_t *t,
|
|
97
|
-
PyObject *obj,
|
|
98
|
-
_PyTime_round_t round);
|
|
99
|
-
|
|
100
|
-
/* Convert a number of milliseconds (Python float or int, 10^-3) to a timetamp.
|
|
101
|
-
Raise an exception and return -1 on error, return 0 on success. */
|
|
102
|
-
PyAPI_FUNC(int) _PyTime_FromMillisecondsObject(_PyTime_t *t,
|
|
103
|
-
PyObject *obj,
|
|
104
|
-
_PyTime_round_t round);
|
|
105
|
-
|
|
106
|
-
/* Convert a timestamp to a number of seconds as a C double. */
|
|
107
|
-
PyAPI_FUNC(double) _PyTime_AsSecondsDouble(_PyTime_t t);
|
|
108
|
-
|
|
109
|
-
/* Convert timestamp to a number of milliseconds (10^-3 seconds). */
|
|
110
|
-
PyAPI_FUNC(_PyTime_t) _PyTime_AsMilliseconds(_PyTime_t t,
|
|
111
|
-
_PyTime_round_t round);
|
|
112
|
-
|
|
113
|
-
/* Convert timestamp to a number of microseconds (10^-6 seconds). */
|
|
114
|
-
PyAPI_FUNC(_PyTime_t) _PyTime_AsMicroseconds(_PyTime_t t,
|
|
115
|
-
_PyTime_round_t round);
|
|
116
|
-
|
|
117
|
-
/* Convert timestamp to a number of nanoseconds (10^-9 seconds) as a Python int
|
|
118
|
-
object. */
|
|
119
|
-
PyAPI_FUNC(PyObject *) _PyTime_AsNanosecondsObject(_PyTime_t t);
|
|
120
|
-
|
|
121
|
-
/* Create a timestamp from a timeval structure.
|
|
122
|
-
Raise an exception and return -1 on overflow, return 0 on success. */
|
|
123
|
-
PyAPI_FUNC(int) _PyTime_FromTimeval(_PyTime_t *tp, struct timeval *tv);
|
|
124
|
-
|
|
125
|
-
/* Convert a timestamp to a timeval structure (microsecond resolution).
|
|
126
|
-
tv_usec is always positive.
|
|
127
|
-
Raise an exception and return -1 if the conversion overflowed,
|
|
128
|
-
return 0 on success. */
|
|
129
|
-
PyAPI_FUNC(int) _PyTime_AsTimeval(_PyTime_t t,
|
|
130
|
-
struct timeval *tv,
|
|
131
|
-
_PyTime_round_t round);
|
|
132
|
-
|
|
133
|
-
/* Similar to _PyTime_AsTimeval(), but don't raise an exception on error. */
|
|
134
|
-
PyAPI_FUNC(int) _PyTime_AsTimeval_noraise(_PyTime_t t,
|
|
135
|
-
struct timeval *tv,
|
|
136
|
-
_PyTime_round_t round);
|
|
137
|
-
|
|
138
|
-
/* Convert a timestamp to a number of seconds (secs) and microseconds (us).
|
|
139
|
-
us is always positive. This function is similar to _PyTime_AsTimeval()
|
|
140
|
-
except that secs is always a time_t type, whereas the timeval structure
|
|
141
|
-
uses a C long for tv_sec on Windows.
|
|
142
|
-
Raise an exception and return -1 if the conversion overflowed,
|
|
143
|
-
return 0 on success. */
|
|
144
|
-
PyAPI_FUNC(int) _PyTime_AsTimevalTime_t(
|
|
145
|
-
_PyTime_t t,
|
|
146
|
-
time_t *secs,
|
|
147
|
-
int *us,
|
|
148
|
-
_PyTime_round_t round);
|
|
149
|
-
|
|
150
|
-
#if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_KQUEUE)
|
|
151
|
-
/* Create a timestamp from a timespec structure.
|
|
152
|
-
Raise an exception and return -1 on overflow, return 0 on success. */
|
|
153
|
-
PyAPI_FUNC(int) _PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts);
|
|
154
|
-
|
|
155
|
-
/* Convert a timestamp to a timespec structure (nanosecond resolution).
|
|
156
|
-
tv_nsec is always positive.
|
|
157
|
-
Raise an exception and return -1 on error, return 0 on success. */
|
|
158
|
-
PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts);
|
|
159
|
-
#endif
|
|
160
|
-
|
|
161
|
-
/* Compute ticks * mul / div.
|
|
162
|
-
The caller must ensure that ((div - 1) * mul) cannot overflow. */
|
|
163
|
-
PyAPI_FUNC(_PyTime_t) _PyTime_MulDiv(_PyTime_t ticks,
|
|
164
|
-
_PyTime_t mul,
|
|
165
|
-
_PyTime_t div);
|
|
166
|
-
|
|
167
|
-
/* Get the current time from the system clock.
|
|
168
|
-
|
|
169
|
-
The function cannot fail. _PyTime_Init() ensures that the system clock
|
|
170
|
-
works. */
|
|
171
|
-
PyAPI_FUNC(_PyTime_t) _PyTime_GetSystemClock(void);
|
|
172
|
-
|
|
173
|
-
/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards.
|
|
174
|
-
The clock is not affected by system clock updates. The reference point of
|
|
175
|
-
the returned value is undefined, so that only the difference between the
|
|
176
|
-
results of consecutive calls is valid.
|
|
177
|
-
|
|
178
|
-
The function cannot fail. _PyTime_Init() ensures that a monotonic clock
|
|
179
|
-
is available and works. */
|
|
180
|
-
PyAPI_FUNC(_PyTime_t) _PyTime_GetMonotonicClock(void);
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
/* Structure used by time.get_clock_info() */
|
|
184
|
-
typedef struct {
|
|
185
|
-
const char *implementation;
|
|
186
|
-
int monotonic;
|
|
187
|
-
int adjustable;
|
|
188
|
-
double resolution;
|
|
189
|
-
} _Py_clock_info_t;
|
|
190
|
-
|
|
191
|
-
/* Get the current time from the system clock.
|
|
192
|
-
* Fill clock information if info is not NULL.
|
|
193
|
-
* Raise an exception and return -1 on error, return 0 on success.
|
|
194
|
-
*/
|
|
195
|
-
PyAPI_FUNC(int) _PyTime_GetSystemClockWithInfo(
|
|
196
|
-
_PyTime_t *t,
|
|
197
|
-
_Py_clock_info_t *info);
|
|
198
|
-
|
|
199
|
-
/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards.
|
|
200
|
-
The clock is not affected by system clock updates. The reference point of
|
|
201
|
-
the returned value is undefined, so that only the difference between the
|
|
202
|
-
results of consecutive calls is valid.
|
|
203
|
-
|
|
204
|
-
Fill info (if set) with information of the function used to get the time.
|
|
205
|
-
|
|
206
|
-
Return 0 on success, raise an exception and return -1 on error. */
|
|
207
|
-
PyAPI_FUNC(int) _PyTime_GetMonotonicClockWithInfo(
|
|
208
|
-
_PyTime_t *t,
|
|
209
|
-
_Py_clock_info_t *info);
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
/* Initialize time.
|
|
213
|
-
Return 0 on success, raise an exception and return -1 on error. */
|
|
214
|
-
PyAPI_FUNC(int) _PyTime_Init(void);
|
|
215
|
-
|
|
216
|
-
/* Converts a timestamp to the Gregorian time, using the local time zone.
|
|
217
|
-
Return 0 on success, raise an exception and return -1 on error. */
|
|
218
|
-
PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm);
|
|
219
|
-
|
|
220
|
-
/* Converts a timestamp to the Gregorian time, assuming UTC.
|
|
221
|
-
Return 0 on success, raise an exception and return -1 on error. */
|
|
222
|
-
PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm);
|
|
223
|
-
|
|
224
|
-
/* Get the performance counter: clock with the highest available resolution to
|
|
225
|
-
measure a short duration.
|
|
226
|
-
|
|
227
|
-
The function cannot fail. _PyTime_Init() ensures that the system clock
|
|
228
|
-
works. */
|
|
229
|
-
PyAPI_FUNC(_PyTime_t) _PyTime_GetPerfCounter(void);
|
|
230
|
-
|
|
231
|
-
/* Get the performance counter: clock with the highest available resolution to
|
|
232
|
-
measure a short duration.
|
|
233
|
-
|
|
234
|
-
Fill info (if set) with information of the function used to get the time.
|
|
235
|
-
|
|
236
|
-
Return 0 on success, raise an exception and return -1 on error. */
|
|
237
|
-
PyAPI_FUNC(int) _PyTime_GetPerfCounterWithInfo(
|
|
238
|
-
_PyTime_t *t,
|
|
239
|
-
_Py_clock_info_t *info);
|
|
240
|
-
|
|
241
|
-
#ifdef __cplusplus
|
|
242
|
-
}
|
|
243
|
-
#endif
|
|
244
|
-
|
|
245
|
-
#endif /* Py_PYTIME_H */
|
|
246
|
-
#endif /* Py_LIMITED_API */
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/* Range object interface */
|
|
3
|
-
|
|
4
|
-
#ifndef Py_RANGEOBJECT_H
|
|
5
|
-
#define Py_RANGEOBJECT_H
|
|
6
|
-
#ifdef __cplusplus
|
|
7
|
-
extern "C" {
|
|
8
|
-
#endif
|
|
9
|
-
|
|
10
|
-
/*
|
|
11
|
-
A range object represents an integer range. This is an immutable object;
|
|
12
|
-
a range cannot change its value after creation.
|
|
13
|
-
|
|
14
|
-
Range objects behave like the corresponding tuple objects except that
|
|
15
|
-
they are represented by a start, stop, and step datamembers.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
PyAPI_DATA(PyTypeObject) PyRange_Type;
|
|
19
|
-
PyAPI_DATA(PyTypeObject) PyRangeIter_Type;
|
|
20
|
-
PyAPI_DATA(PyTypeObject) PyLongRangeIter_Type;
|
|
21
|
-
|
|
22
|
-
#define PyRange_Check(op) (Py_TYPE(op) == &PyRange_Type)
|
|
23
|
-
|
|
24
|
-
#ifdef __cplusplus
|
|
25
|
-
}
|
|
26
|
-
#endif
|
|
27
|
-
#endif /* !Py_RANGEOBJECT_H */
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/* Set object interface */
|
|
2
|
-
|
|
3
|
-
#ifndef Py_SETOBJECT_H
|
|
4
|
-
#define Py_SETOBJECT_H
|
|
5
|
-
#ifdef __cplusplus
|
|
6
|
-
extern "C" {
|
|
7
|
-
#endif
|
|
8
|
-
|
|
9
|
-
#ifndef Py_LIMITED_API
|
|
10
|
-
|
|
11
|
-
/* There are three kinds of entries in the table:
|
|
12
|
-
|
|
13
|
-
1. Unused: key == NULL and hash == 0
|
|
14
|
-
2. Dummy: key == dummy and hash == -1
|
|
15
|
-
3. Active: key != NULL and key != dummy and hash != -1
|
|
16
|
-
|
|
17
|
-
The hash field of Unused slots is always zero.
|
|
18
|
-
|
|
19
|
-
The hash field of Dummy slots are set to -1
|
|
20
|
-
meaning that dummy entries can be detected by
|
|
21
|
-
either entry->key==dummy or by entry->hash==-1.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
#define PySet_MINSIZE 8
|
|
25
|
-
|
|
26
|
-
typedef struct {
|
|
27
|
-
PyObject *key;
|
|
28
|
-
Py_hash_t hash; /* Cached hash code of the key */
|
|
29
|
-
} setentry;
|
|
30
|
-
|
|
31
|
-
/* The SetObject data structure is shared by set and frozenset objects.
|
|
32
|
-
|
|
33
|
-
Invariant for sets:
|
|
34
|
-
- hash is -1
|
|
35
|
-
|
|
36
|
-
Invariants for frozensets:
|
|
37
|
-
- data is immutable.
|
|
38
|
-
- hash is the hash of the frozenset or -1 if not computed yet.
|
|
39
|
-
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
typedef struct {
|
|
43
|
-
PyObject_HEAD
|
|
44
|
-
|
|
45
|
-
Py_ssize_t fill; /* Number active and dummy entries*/
|
|
46
|
-
Py_ssize_t used; /* Number active entries */
|
|
47
|
-
|
|
48
|
-
/* The table contains mask + 1 slots, and that's a power of 2.
|
|
49
|
-
* We store the mask instead of the size because the mask is more
|
|
50
|
-
* frequently needed.
|
|
51
|
-
*/
|
|
52
|
-
Py_ssize_t mask;
|
|
53
|
-
|
|
54
|
-
/* The table points to a fixed-size smalltable for small tables
|
|
55
|
-
* or to additional malloc'ed memory for bigger tables.
|
|
56
|
-
* The table pointer is never NULL which saves us from repeated
|
|
57
|
-
* runtime null-tests.
|
|
58
|
-
*/
|
|
59
|
-
setentry *table;
|
|
60
|
-
Py_hash_t hash; /* Only used by frozenset objects */
|
|
61
|
-
Py_ssize_t finger; /* Search finger for pop() */
|
|
62
|
-
|
|
63
|
-
setentry smalltable[PySet_MINSIZE];
|
|
64
|
-
PyObject *weakreflist; /* List of weak references */
|
|
65
|
-
} PySetObject;
|
|
66
|
-
|
|
67
|
-
#define PySet_GET_SIZE(so) (assert(PyAnySet_Check(so)),(((PySetObject *)(so))->used))
|
|
68
|
-
|
|
69
|
-
PyAPI_DATA(PyObject *) _PySet_Dummy;
|
|
70
|
-
|
|
71
|
-
PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash);
|
|
72
|
-
PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable);
|
|
73
|
-
PyAPI_FUNC(int) PySet_ClearFreeList(void);
|
|
74
|
-
|
|
75
|
-
#endif /* Section excluded by Py_LIMITED_API */
|
|
76
|
-
|
|
77
|
-
PyAPI_DATA(PyTypeObject) PySet_Type;
|
|
78
|
-
PyAPI_DATA(PyTypeObject) PyFrozenSet_Type;
|
|
79
|
-
PyAPI_DATA(PyTypeObject) PySetIter_Type;
|
|
80
|
-
|
|
81
|
-
PyAPI_FUNC(PyObject *) PySet_New(PyObject *);
|
|
82
|
-
PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *);
|
|
83
|
-
|
|
84
|
-
PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key);
|
|
85
|
-
PyAPI_FUNC(int) PySet_Clear(PyObject *set);
|
|
86
|
-
PyAPI_FUNC(int) PySet_Contains(PyObject *anyset, PyObject *key);
|
|
87
|
-
PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key);
|
|
88
|
-
PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set);
|
|
89
|
-
PyAPI_FUNC(Py_ssize_t) PySet_Size(PyObject *anyset);
|
|
90
|
-
|
|
91
|
-
#define PyFrozenSet_CheckExact(ob) (Py_TYPE(ob) == &PyFrozenSet_Type)
|
|
92
|
-
#define PyAnySet_CheckExact(ob) \
|
|
93
|
-
(Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type)
|
|
94
|
-
#define PyAnySet_Check(ob) \
|
|
95
|
-
(Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type || \
|
|
96
|
-
PyType_IsSubtype(Py_TYPE(ob), &PySet_Type) || \
|
|
97
|
-
PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))
|
|
98
|
-
#define PySet_Check(ob) \
|
|
99
|
-
(Py_TYPE(ob) == &PySet_Type || \
|
|
100
|
-
PyType_IsSubtype(Py_TYPE(ob), &PySet_Type))
|
|
101
|
-
#define PyFrozenSet_Check(ob) \
|
|
102
|
-
(Py_TYPE(ob) == &PyFrozenSet_Type || \
|
|
103
|
-
PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))
|
|
104
|
-
|
|
105
|
-
#ifdef __cplusplus
|
|
106
|
-
}
|
|
107
|
-
#endif
|
|
108
|
-
#endif /* !Py_SETOBJECT_H */
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
#ifndef Py_SLICEOBJECT_H
|
|
2
|
-
#define Py_SLICEOBJECT_H
|
|
3
|
-
#ifdef __cplusplus
|
|
4
|
-
extern "C" {
|
|
5
|
-
#endif
|
|
6
|
-
|
|
7
|
-
/* The unique ellipsis object "..." */
|
|
8
|
-
|
|
9
|
-
PyAPI_DATA(PyObject) _Py_EllipsisObject; /* Don't use this directly */
|
|
10
|
-
|
|
11
|
-
#define Py_Ellipsis (&_Py_EllipsisObject)
|
|
12
|
-
|
|
13
|
-
/* Slice object interface */
|
|
14
|
-
|
|
15
|
-
/*
|
|
16
|
-
|
|
17
|
-
A slice object containing start, stop, and step data members (the
|
|
18
|
-
names are from range). After much talk with Guido, it was decided to
|
|
19
|
-
let these be any arbitrary python type. Py_None stands for omitted values.
|
|
20
|
-
*/
|
|
21
|
-
#ifndef Py_LIMITED_API
|
|
22
|
-
typedef struct {
|
|
23
|
-
PyObject_HEAD
|
|
24
|
-
PyObject *start, *stop, *step; /* not NULL */
|
|
25
|
-
} PySliceObject;
|
|
26
|
-
#endif
|
|
27
|
-
|
|
28
|
-
PyAPI_DATA(PyTypeObject) PySlice_Type;
|
|
29
|
-
PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
|
|
30
|
-
|
|
31
|
-
#define PySlice_Check(op) (Py_TYPE(op) == &PySlice_Type)
|
|
32
|
-
|
|
33
|
-
PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
|
|
34
|
-
PyObject* step);
|
|
35
|
-
#ifndef Py_LIMITED_API
|
|
36
|
-
PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
|
|
37
|
-
PyAPI_FUNC(int) _PySlice_GetLongIndices(PySliceObject *self, PyObject *length,
|
|
38
|
-
PyObject **start_ptr, PyObject **stop_ptr,
|
|
39
|
-
PyObject **step_ptr);
|
|
40
|
-
#endif
|
|
41
|
-
PyAPI_FUNC(int) PySlice_GetIndices(PyObject *r, Py_ssize_t length,
|
|
42
|
-
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
|
|
43
|
-
Py_DEPRECATED(3.7)
|
|
44
|
-
PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
|
|
45
|
-
Py_ssize_t *start, Py_ssize_t *stop,
|
|
46
|
-
Py_ssize_t *step,
|
|
47
|
-
Py_ssize_t *slicelength);
|
|
48
|
-
|
|
49
|
-
#if !defined(Py_LIMITED_API) || (Py_LIMITED_API+0 >= 0x03050400 && Py_LIMITED_API+0 < 0x03060000) || Py_LIMITED_API+0 >= 0x03060100
|
|
50
|
-
#define PySlice_GetIndicesEx(slice, length, start, stop, step, slicelen) ( \
|
|
51
|
-
PySlice_Unpack((slice), (start), (stop), (step)) < 0 ? \
|
|
52
|
-
((*(slicelen) = 0), -1) : \
|
|
53
|
-
((*(slicelen) = PySlice_AdjustIndices((length), (start), (stop), *(step))), \
|
|
54
|
-
0))
|
|
55
|
-
PyAPI_FUNC(int) PySlice_Unpack(PyObject *slice,
|
|
56
|
-
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
|
|
57
|
-
PyAPI_FUNC(Py_ssize_t) PySlice_AdjustIndices(Py_ssize_t length,
|
|
58
|
-
Py_ssize_t *start, Py_ssize_t *stop,
|
|
59
|
-
Py_ssize_t step);
|
|
60
|
-
#endif
|
|
61
|
-
|
|
62
|
-
#ifdef __cplusplus
|
|
63
|
-
}
|
|
64
|
-
#endif
|
|
65
|
-
#endif /* !Py_SLICEOBJECT_H */
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
#ifndef Py_STRUCTMEMBER_H
|
|
2
|
-
#define Py_STRUCTMEMBER_H
|
|
3
|
-
#ifdef __cplusplus
|
|
4
|
-
extern "C" {
|
|
5
|
-
#endif
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* Interface to map C struct members to Python object attributes */
|
|
9
|
-
|
|
10
|
-
#include <stddef.h> /* For offsetof */
|
|
11
|
-
|
|
12
|
-
/* An array of PyMemberDef structures defines the name, type and offset
|
|
13
|
-
of selected members of a C structure. These can be read by
|
|
14
|
-
PyMember_GetOne() and set by PyMember_SetOne() (except if their READONLY
|
|
15
|
-
flag is set). The array must be terminated with an entry whose name
|
|
16
|
-
pointer is NULL. */
|
|
17
|
-
|
|
18
|
-
typedef struct PyMemberDef {
|
|
19
|
-
const char *name;
|
|
20
|
-
int type;
|
|
21
|
-
Py_ssize_t offset;
|
|
22
|
-
int flags;
|
|
23
|
-
const char *doc;
|
|
24
|
-
} PyMemberDef;
|
|
25
|
-
|
|
26
|
-
/* Types */
|
|
27
|
-
#define T_SHORT 0
|
|
28
|
-
#define T_INT 1
|
|
29
|
-
#define T_LONG 2
|
|
30
|
-
#define T_FLOAT 3
|
|
31
|
-
#define T_DOUBLE 4
|
|
32
|
-
#define T_STRING 5
|
|
33
|
-
#define T_OBJECT 6
|
|
34
|
-
/* XXX the ordering here is weird for binary compatibility */
|
|
35
|
-
#define T_CHAR 7 /* 1-character string */
|
|
36
|
-
#define T_BYTE 8 /* 8-bit signed int */
|
|
37
|
-
/* unsigned variants: */
|
|
38
|
-
#define T_UBYTE 9
|
|
39
|
-
#define T_USHORT 10
|
|
40
|
-
#define T_UINT 11
|
|
41
|
-
#define T_ULONG 12
|
|
42
|
-
|
|
43
|
-
/* Added by Jack: strings contained in the structure */
|
|
44
|
-
#define T_STRING_INPLACE 13
|
|
45
|
-
|
|
46
|
-
/* Added by Lillo: bools contained in the structure (assumed char) */
|
|
47
|
-
#define T_BOOL 14
|
|
48
|
-
|
|
49
|
-
#define T_OBJECT_EX 16 /* Like T_OBJECT, but raises AttributeError
|
|
50
|
-
when the value is NULL, instead of
|
|
51
|
-
converting to None. */
|
|
52
|
-
#define T_LONGLONG 17
|
|
53
|
-
#define T_ULONGLONG 18
|
|
54
|
-
|
|
55
|
-
#define T_PYSSIZET 19 /* Py_ssize_t */
|
|
56
|
-
#define T_NONE 20 /* Value is always None */
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/* Flags */
|
|
60
|
-
#define READONLY 1
|
|
61
|
-
#define READ_RESTRICTED 2
|
|
62
|
-
#define PY_WRITE_RESTRICTED 4
|
|
63
|
-
#define RESTRICTED (READ_RESTRICTED | PY_WRITE_RESTRICTED)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/* Current API, use this */
|
|
67
|
-
PyAPI_FUNC(PyObject *) PyMember_GetOne(const char *, struct PyMemberDef *);
|
|
68
|
-
PyAPI_FUNC(int) PyMember_SetOne(char *, struct PyMemberDef *, PyObject *);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
#ifdef __cplusplus
|
|
72
|
-
}
|
|
73
|
-
#endif
|
|
74
|
-
#endif /* !Py_STRUCTMEMBER_H */
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/* Named tuple object interface */
|
|
3
|
-
|
|
4
|
-
#ifndef Py_STRUCTSEQ_H
|
|
5
|
-
#define Py_STRUCTSEQ_H
|
|
6
|
-
#ifdef __cplusplus
|
|
7
|
-
extern "C" {
|
|
8
|
-
#endif
|
|
9
|
-
|
|
10
|
-
typedef struct PyStructSequence_Field {
|
|
11
|
-
const char *name;
|
|
12
|
-
const char *doc;
|
|
13
|
-
} PyStructSequence_Field;
|
|
14
|
-
|
|
15
|
-
typedef struct PyStructSequence_Desc {
|
|
16
|
-
const char *name;
|
|
17
|
-
const char *doc;
|
|
18
|
-
struct PyStructSequence_Field *fields;
|
|
19
|
-
int n_in_sequence;
|
|
20
|
-
} PyStructSequence_Desc;
|
|
21
|
-
|
|
22
|
-
extern char* PyStructSequence_UnnamedField;
|
|
23
|
-
|
|
24
|
-
#ifndef Py_LIMITED_API
|
|
25
|
-
PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
|
|
26
|
-
PyStructSequence_Desc *desc);
|
|
27
|
-
PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type,
|
|
28
|
-
PyStructSequence_Desc *desc);
|
|
29
|
-
#endif
|
|
30
|
-
PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
|
|
31
|
-
|
|
32
|
-
PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
|
|
33
|
-
|
|
34
|
-
#ifndef Py_LIMITED_API
|
|
35
|
-
typedef PyTupleObject PyStructSequence;
|
|
36
|
-
|
|
37
|
-
/* Macro, *only* to be used to fill in brand new objects */
|
|
38
|
-
#define PyStructSequence_SET_ITEM(op, i, v) PyTuple_SET_ITEM(op, i, v)
|
|
39
|
-
|
|
40
|
-
#define PyStructSequence_GET_ITEM(op, i) PyTuple_GET_ITEM(op, i)
|
|
41
|
-
#endif
|
|
42
|
-
|
|
43
|
-
PyAPI_FUNC(void) PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*);
|
|
44
|
-
PyAPI_FUNC(PyObject*) PyStructSequence_GetItem(PyObject*, Py_ssize_t);
|
|
45
|
-
|
|
46
|
-
#ifdef __cplusplus
|
|
47
|
-
}
|
|
48
|
-
#endif
|
|
49
|
-
#endif /* !Py_STRUCTSEQ_H */
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
#ifndef Py_LIMITED_API
|
|
2
|
-
#ifndef Py_SYMTABLE_H
|
|
3
|
-
#define Py_SYMTABLE_H
|
|
4
|
-
#ifdef __cplusplus
|
|
5
|
-
extern "C" {
|
|
6
|
-
#endif
|
|
7
|
-
|
|
8
|
-
#include "Python-ast.h" /* mod_ty */
|
|
9
|
-
|
|
10
|
-
/* XXX(ncoghlan): This is a weird mix of public names and interpreter internal
|
|
11
|
-
* names.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock }
|
|
15
|
-
_Py_block_ty;
|
|
16
|
-
|
|
17
|
-
struct _symtable_entry;
|
|
18
|
-
|
|
19
|
-
struct symtable {
|
|
20
|
-
PyObject *st_filename; /* name of file being compiled,
|
|
21
|
-
decoded from the filesystem encoding */
|
|
22
|
-
struct _symtable_entry *st_cur; /* current symbol table entry */
|
|
23
|
-
struct _symtable_entry *st_top; /* symbol table entry for module */
|
|
24
|
-
PyObject *st_blocks; /* dict: map AST node addresses
|
|
25
|
-
* to symbol table entries */
|
|
26
|
-
PyObject *st_stack; /* list: stack of namespace info */
|
|
27
|
-
PyObject *st_global; /* borrowed ref to st_top->ste_symbols */
|
|
28
|
-
int st_nblocks; /* number of blocks used. kept for
|
|
29
|
-
consistency with the corresponding
|
|
30
|
-
compiler structure */
|
|
31
|
-
PyObject *st_private; /* name of current class or NULL */
|
|
32
|
-
PyFutureFeatures *st_future; /* module's future features that affect
|
|
33
|
-
the symbol table */
|
|
34
|
-
int recursion_depth; /* current recursion depth */
|
|
35
|
-
int recursion_limit; /* recursion limit */
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
typedef struct _symtable_entry {
|
|
39
|
-
PyObject_HEAD
|
|
40
|
-
PyObject *ste_id; /* int: key in ste_table->st_blocks */
|
|
41
|
-
PyObject *ste_symbols; /* dict: variable names to flags */
|
|
42
|
-
PyObject *ste_name; /* string: name of current block */
|
|
43
|
-
PyObject *ste_varnames; /* list of function parameters */
|
|
44
|
-
PyObject *ste_children; /* list of child blocks */
|
|
45
|
-
PyObject *ste_directives;/* locations of global and nonlocal statements */
|
|
46
|
-
_Py_block_ty ste_type; /* module, class, or function */
|
|
47
|
-
int ste_nested; /* true if block is nested */
|
|
48
|
-
unsigned ste_free : 1; /* true if block has free variables */
|
|
49
|
-
unsigned ste_child_free : 1; /* true if a child block has free vars,
|
|
50
|
-
including free refs to globals */
|
|
51
|
-
unsigned ste_generator : 1; /* true if namespace is a generator */
|
|
52
|
-
unsigned ste_coroutine : 1; /* true if namespace is a coroutine */
|
|
53
|
-
unsigned ste_comprehension : 1; /* true if namespace is a list comprehension */
|
|
54
|
-
unsigned ste_varargs : 1; /* true if block has varargs */
|
|
55
|
-
unsigned ste_varkeywords : 1; /* true if block has varkeywords */
|
|
56
|
-
unsigned ste_returns_value : 1; /* true if namespace uses return with
|
|
57
|
-
an argument */
|
|
58
|
-
unsigned ste_needs_class_closure : 1; /* for class scopes, true if a
|
|
59
|
-
closure over __class__
|
|
60
|
-
should be created */
|
|
61
|
-
unsigned ste_comp_iter_target : 1; /* true if visiting comprehension target */
|
|
62
|
-
int ste_comp_iter_expr; /* non-zero if visiting a comprehension range expression */
|
|
63
|
-
int ste_lineno; /* first line of block */
|
|
64
|
-
int ste_col_offset; /* offset of first line of block */
|
|
65
|
-
int ste_opt_lineno; /* lineno of last exec or import * */
|
|
66
|
-
int ste_opt_col_offset; /* offset of last exec or import * */
|
|
67
|
-
struct symtable *ste_table;
|
|
68
|
-
} PySTEntryObject;
|
|
69
|
-
|
|
70
|
-
PyAPI_DATA(PyTypeObject) PySTEntry_Type;
|
|
71
|
-
|
|
72
|
-
#define PySTEntry_Check(op) (Py_TYPE(op) == &PySTEntry_Type)
|
|
73
|
-
|
|
74
|
-
PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *);
|
|
75
|
-
|
|
76
|
-
PyAPI_FUNC(struct symtable *) PySymtable_Build(
|
|
77
|
-
mod_ty mod,
|
|
78
|
-
const char *filename, /* decoded from the filesystem encoding */
|
|
79
|
-
PyFutureFeatures *future);
|
|
80
|
-
PyAPI_FUNC(struct symtable *) PySymtable_BuildObject(
|
|
81
|
-
mod_ty mod,
|
|
82
|
-
PyObject *filename,
|
|
83
|
-
PyFutureFeatures *future);
|
|
84
|
-
PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *);
|
|
85
|
-
|
|
86
|
-
PyAPI_FUNC(void) PySymtable_Free(struct symtable *);
|
|
87
|
-
|
|
88
|
-
/* Flags for def-use information */
|
|
89
|
-
|
|
90
|
-
#define DEF_GLOBAL 1 /* global stmt */
|
|
91
|
-
#define DEF_LOCAL 2 /* assignment in code block */
|
|
92
|
-
#define DEF_PARAM 2<<1 /* formal parameter */
|
|
93
|
-
#define DEF_NONLOCAL 2<<2 /* nonlocal stmt */
|
|
94
|
-
#define USE 2<<3 /* name is used */
|
|
95
|
-
#define DEF_FREE 2<<4 /* name used but not defined in nested block */
|
|
96
|
-
#define DEF_FREE_CLASS 2<<5 /* free variable from class's method */
|
|
97
|
-
#define DEF_IMPORT 2<<6 /* assignment occurred via import */
|
|
98
|
-
#define DEF_ANNOT 2<<7 /* this name is annotated */
|
|
99
|
-
#define DEF_COMP_ITER 2<<8 /* this name is a comprehension iteration variable */
|
|
100
|
-
|
|
101
|
-
#define DEF_BOUND (DEF_LOCAL | DEF_PARAM | DEF_IMPORT)
|
|
102
|
-
|
|
103
|
-
/* GLOBAL_EXPLICIT and GLOBAL_IMPLICIT are used internally by the symbol
|
|
104
|
-
table. GLOBAL is returned from PyST_GetScope() for either of them.
|
|
105
|
-
It is stored in ste_symbols at bits 12-15.
|
|
106
|
-
*/
|
|
107
|
-
#define SCOPE_OFFSET 11
|
|
108
|
-
#define SCOPE_MASK (DEF_GLOBAL | DEF_LOCAL | DEF_PARAM | DEF_NONLOCAL)
|
|
109
|
-
|
|
110
|
-
#define LOCAL 1
|
|
111
|
-
#define GLOBAL_EXPLICIT 2
|
|
112
|
-
#define GLOBAL_IMPLICIT 3
|
|
113
|
-
#define FREE 4
|
|
114
|
-
#define CELL 5
|
|
115
|
-
|
|
116
|
-
#define GENERATOR 1
|
|
117
|
-
#define GENERATOR_EXPRESSION 2
|
|
118
|
-
|
|
119
|
-
#ifdef __cplusplus
|
|
120
|
-
}
|
|
121
|
-
#endif
|
|
122
|
-
#endif /* !Py_SYMTABLE_H */
|
|
123
|
-
#endif /* !Py_LIMITED_API */
|