@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,96 +0,0 @@
|
|
|
1
|
-
#ifndef Py_INTERNAL_TRACEBACK_H
|
|
2
|
-
#define Py_INTERNAL_TRACEBACK_H
|
|
3
|
-
#ifdef __cplusplus
|
|
4
|
-
extern "C" {
|
|
5
|
-
#endif
|
|
6
|
-
|
|
7
|
-
#ifndef Py_BUILD_CORE
|
|
8
|
-
# error "this header requires Py_BUILD_CORE define"
|
|
9
|
-
#endif
|
|
10
|
-
|
|
11
|
-
#include "pystate.h" /* PyInterpreterState */
|
|
12
|
-
|
|
13
|
-
/* Write the Python traceback into the file 'fd'. For example:
|
|
14
|
-
|
|
15
|
-
Traceback (most recent call first):
|
|
16
|
-
File "xxx", line xxx in <xxx>
|
|
17
|
-
File "xxx", line xxx in <xxx>
|
|
18
|
-
...
|
|
19
|
-
File "xxx", line xxx in <xxx>
|
|
20
|
-
|
|
21
|
-
This function is written for debug purpose only, to dump the traceback in
|
|
22
|
-
the worst case: after a segmentation fault, at fatal error, etc. That's why,
|
|
23
|
-
it is very limited. Strings are truncated to 100 characters and encoded to
|
|
24
|
-
ASCII with backslashreplace. It doesn't write the source code, only the
|
|
25
|
-
function name, filename and line number of each frame. Write only the first
|
|
26
|
-
100 frames: if the traceback is truncated, write the line " ...".
|
|
27
|
-
|
|
28
|
-
This function is signal safe. */
|
|
29
|
-
|
|
30
|
-
PyAPI_FUNC(void) _Py_DumpTraceback(
|
|
31
|
-
int fd,
|
|
32
|
-
PyThreadState *tstate);
|
|
33
|
-
|
|
34
|
-
/* Write the traceback of all threads into the file 'fd'. current_thread can be
|
|
35
|
-
NULL.
|
|
36
|
-
|
|
37
|
-
Return NULL on success, or an error message on error.
|
|
38
|
-
|
|
39
|
-
This function is written for debug purpose only. It calls
|
|
40
|
-
_Py_DumpTraceback() for each thread, and so has the same limitations. It
|
|
41
|
-
only write the traceback of the first 100 threads: write "..." if there are
|
|
42
|
-
more threads.
|
|
43
|
-
|
|
44
|
-
If current_tstate is NULL, the function tries to get the Python thread state
|
|
45
|
-
of the current thread. It is not an error if the function is unable to get
|
|
46
|
-
the current Python thread state.
|
|
47
|
-
|
|
48
|
-
If interp is NULL, the function tries to get the interpreter state from
|
|
49
|
-
the current Python thread state, or from
|
|
50
|
-
_PyGILState_GetInterpreterStateUnsafe() in last resort.
|
|
51
|
-
|
|
52
|
-
It is better to pass NULL to interp and current_tstate, the function tries
|
|
53
|
-
different options to retrieve these informations.
|
|
54
|
-
|
|
55
|
-
This function is signal safe. */
|
|
56
|
-
|
|
57
|
-
PyAPI_FUNC(const char*) _Py_DumpTracebackThreads(
|
|
58
|
-
int fd,
|
|
59
|
-
PyInterpreterState *interp,
|
|
60
|
-
PyThreadState *current_tstate);
|
|
61
|
-
|
|
62
|
-
/* Write a Unicode object into the file descriptor fd. Encode the string to
|
|
63
|
-
ASCII using the backslashreplace error handler.
|
|
64
|
-
|
|
65
|
-
Do nothing if text is not a Unicode object. The function accepts Unicode
|
|
66
|
-
string which is not ready (PyUnicode_WCHAR_KIND).
|
|
67
|
-
|
|
68
|
-
This function is signal safe. */
|
|
69
|
-
PyAPI_FUNC(void) _Py_DumpASCII(int fd, PyObject *text);
|
|
70
|
-
|
|
71
|
-
/* Format an integer as decimal into the file descriptor fd.
|
|
72
|
-
|
|
73
|
-
This function is signal safe. */
|
|
74
|
-
PyAPI_FUNC(void) _Py_DumpDecimal(
|
|
75
|
-
int fd,
|
|
76
|
-
unsigned long value);
|
|
77
|
-
|
|
78
|
-
/* Format an integer as hexadecimal into the file descriptor fd with at least
|
|
79
|
-
width digits.
|
|
80
|
-
|
|
81
|
-
The maximum width is sizeof(unsigned long)*2 digits.
|
|
82
|
-
|
|
83
|
-
This function is signal safe. */
|
|
84
|
-
PyAPI_FUNC(void) _Py_DumpHexadecimal(
|
|
85
|
-
int fd,
|
|
86
|
-
unsigned long value,
|
|
87
|
-
Py_ssize_t width);
|
|
88
|
-
|
|
89
|
-
PyAPI_FUNC(PyObject*) _PyTraceBack_FromFrame(
|
|
90
|
-
PyObject *tb_next,
|
|
91
|
-
struct _frame *frame);
|
|
92
|
-
|
|
93
|
-
#ifdef __cplusplus
|
|
94
|
-
}
|
|
95
|
-
#endif
|
|
96
|
-
#endif /* !Py_INTERNAL_TRACEBACK_H */
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#ifndef Py_INTERNAL_TUPLEOBJECT_H
|
|
2
|
-
#define Py_INTERNAL_TUPLEOBJECT_H
|
|
3
|
-
#ifdef __cplusplus
|
|
4
|
-
extern "C" {
|
|
5
|
-
#endif
|
|
6
|
-
|
|
7
|
-
#ifndef Py_BUILD_CORE
|
|
8
|
-
# error "this header requires Py_BUILD_CORE define"
|
|
9
|
-
#endif
|
|
10
|
-
|
|
11
|
-
#include "tupleobject.h"
|
|
12
|
-
|
|
13
|
-
#define _PyTuple_ITEMS(op) (_PyTuple_CAST(op)->ob_item)
|
|
14
|
-
PyAPI_FUNC(PyObject *) _PyTuple_FromArray(PyObject *const *, Py_ssize_t);
|
|
15
|
-
|
|
16
|
-
#ifdef __cplusplus
|
|
17
|
-
}
|
|
18
|
-
#endif
|
|
19
|
-
#endif /* !Py_INTERNAL_TUPLEOBJECT_H */
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#ifndef Py_INTERNAL_WARNINGS_H
|
|
2
|
-
#define Py_INTERNAL_WARNINGS_H
|
|
3
|
-
#ifdef __cplusplus
|
|
4
|
-
extern "C" {
|
|
5
|
-
#endif
|
|
6
|
-
|
|
7
|
-
#ifndef Py_BUILD_CORE
|
|
8
|
-
# error "this header requires Py_BUILD_CORE define"
|
|
9
|
-
#endif
|
|
10
|
-
|
|
11
|
-
#include "object.h"
|
|
12
|
-
|
|
13
|
-
struct _warnings_runtime_state {
|
|
14
|
-
/* Both 'filters' and 'onceregistry' can be set in warnings.py;
|
|
15
|
-
get_warnings_attr() will reset these variables accordingly. */
|
|
16
|
-
PyObject *filters; /* List */
|
|
17
|
-
PyObject *once_registry; /* Dict */
|
|
18
|
-
PyObject *default_action; /* String */
|
|
19
|
-
long filters_version;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
#ifdef __cplusplus
|
|
23
|
-
}
|
|
24
|
-
#endif
|
|
25
|
-
#endif /* !Py_INTERNAL_WARNINGS_H */
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#ifndef Py_INTERPRETERIDOBJECT_H
|
|
2
|
-
#define Py_INTERPRETERIDOBJECT_H
|
|
3
|
-
|
|
4
|
-
#ifdef __cplusplus
|
|
5
|
-
extern "C" {
|
|
6
|
-
#endif
|
|
7
|
-
|
|
8
|
-
#ifndef Py_LIMITED_API
|
|
9
|
-
# define Py_CPYTHON_INTERPRETERIDOBJECT_H
|
|
10
|
-
# include "cpython/interpreteridobject.h"
|
|
11
|
-
# undef Py_CPYTHON_INTERPRETERIDOBJECT_H
|
|
12
|
-
#endif
|
|
13
|
-
|
|
14
|
-
#ifdef __cplusplus
|
|
15
|
-
}
|
|
16
|
-
#endif
|
|
17
|
-
#endif /* !Py_INTERPRETERIDOBJECT_H */
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
#ifndef Py_INTRCHECK_H
|
|
3
|
-
#define Py_INTRCHECK_H
|
|
4
|
-
#ifdef __cplusplus
|
|
5
|
-
extern "C" {
|
|
6
|
-
#endif
|
|
7
|
-
|
|
8
|
-
PyAPI_FUNC(int) PyOS_InterruptOccurred(void);
|
|
9
|
-
PyAPI_FUNC(void) PyOS_InitInterrupts(void);
|
|
10
|
-
#ifdef HAVE_FORK
|
|
11
|
-
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
|
|
12
|
-
PyAPI_FUNC(void) PyOS_BeforeFork(void);
|
|
13
|
-
PyAPI_FUNC(void) PyOS_AfterFork_Parent(void);
|
|
14
|
-
PyAPI_FUNC(void) PyOS_AfterFork_Child(void);
|
|
15
|
-
#endif
|
|
16
|
-
#endif
|
|
17
|
-
/* Deprecated, please use PyOS_AfterFork_Child() instead */
|
|
18
|
-
Py_DEPRECATED(3.7) PyAPI_FUNC(void) PyOS_AfterFork(void);
|
|
19
|
-
|
|
20
|
-
#ifndef Py_LIMITED_API
|
|
21
|
-
PyAPI_FUNC(int) _PyOS_IsMainThread(void);
|
|
22
|
-
PyAPI_FUNC(void) _PySignal_AfterFork(void);
|
|
23
|
-
|
|
24
|
-
#ifdef MS_WINDOWS
|
|
25
|
-
/* windows.h is not included by Python.h so use void* instead of HANDLE */
|
|
26
|
-
PyAPI_FUNC(void*) _PyOS_SigintEvent(void);
|
|
27
|
-
#endif
|
|
28
|
-
#endif /* !Py_LIMITED_API */
|
|
29
|
-
|
|
30
|
-
#ifdef __cplusplus
|
|
31
|
-
}
|
|
32
|
-
#endif
|
|
33
|
-
#endif /* !Py_INTRCHECK_H */
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#ifndef Py_ITEROBJECT_H
|
|
2
|
-
#define Py_ITEROBJECT_H
|
|
3
|
-
/* Iterators (the basic kind, over a sequence) */
|
|
4
|
-
#ifdef __cplusplus
|
|
5
|
-
extern "C" {
|
|
6
|
-
#endif
|
|
7
|
-
|
|
8
|
-
PyAPI_DATA(PyTypeObject) PySeqIter_Type;
|
|
9
|
-
PyAPI_DATA(PyTypeObject) PyCallIter_Type;
|
|
10
|
-
PyAPI_DATA(PyTypeObject) PyCmpWrapper_Type;
|
|
11
|
-
|
|
12
|
-
#define PySeqIter_Check(op) (Py_TYPE(op) == &PySeqIter_Type)
|
|
13
|
-
|
|
14
|
-
PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
#define PyCallIter_Check(op) (Py_TYPE(op) == &PyCallIter_Type)
|
|
18
|
-
|
|
19
|
-
PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *);
|
|
20
|
-
|
|
21
|
-
#ifdef __cplusplus
|
|
22
|
-
}
|
|
23
|
-
#endif
|
|
24
|
-
#endif /* !Py_ITEROBJECT_H */
|
|
25
|
-
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/* List object interface */
|
|
3
|
-
|
|
4
|
-
/*
|
|
5
|
-
Another generally useful object type is a list of object pointers.
|
|
6
|
-
This is a mutable type: the list items can be changed, and items can be
|
|
7
|
-
added or removed. Out-of-range indices or non-list objects are ignored.
|
|
8
|
-
|
|
9
|
-
*** WARNING *** PyList_SetItem does not increment the new item's reference
|
|
10
|
-
count, but does decrement the reference count of the item it replaces,
|
|
11
|
-
if not nil. It does *decrement* the reference count if it is *not*
|
|
12
|
-
inserted in the list. Similarly, PyList_GetItem does not increment the
|
|
13
|
-
returned item's reference count.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
#ifndef Py_LISTOBJECT_H
|
|
17
|
-
#define Py_LISTOBJECT_H
|
|
18
|
-
#ifdef __cplusplus
|
|
19
|
-
extern "C" {
|
|
20
|
-
#endif
|
|
21
|
-
|
|
22
|
-
#ifndef Py_LIMITED_API
|
|
23
|
-
typedef struct {
|
|
24
|
-
PyObject_VAR_HEAD
|
|
25
|
-
/* Vector of pointers to list elements. list[0] is ob_item[0], etc. */
|
|
26
|
-
PyObject **ob_item;
|
|
27
|
-
|
|
28
|
-
/* ob_item contains space for 'allocated' elements. The number
|
|
29
|
-
* currently in use is ob_size.
|
|
30
|
-
* Invariants:
|
|
31
|
-
* 0 <= ob_size <= allocated
|
|
32
|
-
* len(list) == ob_size
|
|
33
|
-
* ob_item == NULL implies ob_size == allocated == 0
|
|
34
|
-
* list.sort() temporarily sets allocated to -1 to detect mutations.
|
|
35
|
-
*
|
|
36
|
-
* Items must normally not be NULL, except during construction when
|
|
37
|
-
* the list is not yet visible outside the function that builds it.
|
|
38
|
-
*/
|
|
39
|
-
Py_ssize_t allocated;
|
|
40
|
-
} PyListObject;
|
|
41
|
-
#endif
|
|
42
|
-
|
|
43
|
-
PyAPI_DATA(PyTypeObject) PyList_Type;
|
|
44
|
-
PyAPI_DATA(PyTypeObject) PyListIter_Type;
|
|
45
|
-
PyAPI_DATA(PyTypeObject) PyListRevIter_Type;
|
|
46
|
-
PyAPI_DATA(PyTypeObject) PySortWrapper_Type;
|
|
47
|
-
|
|
48
|
-
#define PyList_Check(op) \
|
|
49
|
-
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
|
|
50
|
-
#define PyList_CheckExact(op) (Py_TYPE(op) == &PyList_Type)
|
|
51
|
-
|
|
52
|
-
PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size);
|
|
53
|
-
PyAPI_FUNC(Py_ssize_t) PyList_Size(PyObject *);
|
|
54
|
-
PyAPI_FUNC(PyObject *) PyList_GetItem(PyObject *, Py_ssize_t);
|
|
55
|
-
PyAPI_FUNC(int) PyList_SetItem(PyObject *, Py_ssize_t, PyObject *);
|
|
56
|
-
PyAPI_FUNC(int) PyList_Insert(PyObject *, Py_ssize_t, PyObject *);
|
|
57
|
-
PyAPI_FUNC(int) PyList_Append(PyObject *, PyObject *);
|
|
58
|
-
PyAPI_FUNC(PyObject *) PyList_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t);
|
|
59
|
-
PyAPI_FUNC(int) PyList_SetSlice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
|
|
60
|
-
PyAPI_FUNC(int) PyList_Sort(PyObject *);
|
|
61
|
-
PyAPI_FUNC(int) PyList_Reverse(PyObject *);
|
|
62
|
-
PyAPI_FUNC(PyObject *) PyList_AsTuple(PyObject *);
|
|
63
|
-
#ifndef Py_LIMITED_API
|
|
64
|
-
PyAPI_FUNC(PyObject *) _PyList_Extend(PyListObject *, PyObject *);
|
|
65
|
-
|
|
66
|
-
PyAPI_FUNC(int) PyList_ClearFreeList(void);
|
|
67
|
-
PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out);
|
|
68
|
-
#endif
|
|
69
|
-
|
|
70
|
-
/* Macro, trading safety for speed */
|
|
71
|
-
#ifndef Py_LIMITED_API
|
|
72
|
-
#define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i])
|
|
73
|
-
#define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v))
|
|
74
|
-
#define PyList_GET_SIZE(op) (assert(PyList_Check(op)),Py_SIZE(op))
|
|
75
|
-
#define _PyList_ITEMS(op) (((PyListObject *)(op))->ob_item)
|
|
76
|
-
#endif
|
|
77
|
-
|
|
78
|
-
#ifdef __cplusplus
|
|
79
|
-
}
|
|
80
|
-
#endif
|
|
81
|
-
#endif /* !Py_LISTOBJECT_H */
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
#ifndef Py_LIMITED_API
|
|
2
|
-
#ifndef Py_LONGINTREPR_H
|
|
3
|
-
#define Py_LONGINTREPR_H
|
|
4
|
-
#ifdef __cplusplus
|
|
5
|
-
extern "C" {
|
|
6
|
-
#endif
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/* This is published for the benefit of "friends" marshal.c and _decimal.c. */
|
|
10
|
-
|
|
11
|
-
/* Parameters of the integer representation. There are two different
|
|
12
|
-
sets of parameters: one set for 30-bit digits, stored in an unsigned 32-bit
|
|
13
|
-
integer type, and one set for 15-bit digits with each digit stored in an
|
|
14
|
-
unsigned short. The value of PYLONG_BITS_IN_DIGIT, defined either at
|
|
15
|
-
configure time or in pyport.h, is used to decide which digit size to use.
|
|
16
|
-
|
|
17
|
-
Type 'digit' should be able to hold 2*PyLong_BASE-1, and type 'twodigits'
|
|
18
|
-
should be an unsigned integer type able to hold all integers up to
|
|
19
|
-
PyLong_BASE*PyLong_BASE-1. x_sub assumes that 'digit' is an unsigned type,
|
|
20
|
-
and that overflow is handled by taking the result modulo 2**N for some N >
|
|
21
|
-
PyLong_SHIFT. The majority of the code doesn't care about the precise
|
|
22
|
-
value of PyLong_SHIFT, but there are some notable exceptions:
|
|
23
|
-
|
|
24
|
-
- long_pow() requires that PyLong_SHIFT be divisible by 5
|
|
25
|
-
|
|
26
|
-
- PyLong_{As,From}ByteArray require that PyLong_SHIFT be at least 8
|
|
27
|
-
|
|
28
|
-
- long_hash() requires that PyLong_SHIFT is *strictly* less than the number
|
|
29
|
-
of bits in an unsigned long, as do the PyLong <-> long (or unsigned long)
|
|
30
|
-
conversion functions
|
|
31
|
-
|
|
32
|
-
- the Python int <-> size_t/Py_ssize_t conversion functions expect that
|
|
33
|
-
PyLong_SHIFT is strictly less than the number of bits in a size_t
|
|
34
|
-
|
|
35
|
-
- the marshal code currently expects that PyLong_SHIFT is a multiple of 15
|
|
36
|
-
|
|
37
|
-
- NSMALLNEGINTS and NSMALLPOSINTS should be small enough to fit in a single
|
|
38
|
-
digit; with the current values this forces PyLong_SHIFT >= 9
|
|
39
|
-
|
|
40
|
-
The values 15 and 30 should fit all of the above requirements, on any
|
|
41
|
-
platform.
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
#if PYLONG_BITS_IN_DIGIT == 30
|
|
45
|
-
typedef uint32_t digit;
|
|
46
|
-
typedef int32_t sdigit; /* signed variant of digit */
|
|
47
|
-
typedef uint64_t twodigits;
|
|
48
|
-
typedef int64_t stwodigits; /* signed variant of twodigits */
|
|
49
|
-
#define PyLong_SHIFT 30
|
|
50
|
-
#define _PyLong_DECIMAL_SHIFT 9 /* max(e such that 10**e fits in a digit) */
|
|
51
|
-
#define _PyLong_DECIMAL_BASE ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */
|
|
52
|
-
#elif PYLONG_BITS_IN_DIGIT == 15
|
|
53
|
-
typedef unsigned short digit;
|
|
54
|
-
typedef short sdigit; /* signed variant of digit */
|
|
55
|
-
typedef unsigned long twodigits;
|
|
56
|
-
typedef long stwodigits; /* signed variant of twodigits */
|
|
57
|
-
#define PyLong_SHIFT 15
|
|
58
|
-
#define _PyLong_DECIMAL_SHIFT 4 /* max(e such that 10**e fits in a digit) */
|
|
59
|
-
#define _PyLong_DECIMAL_BASE ((digit)10000) /* 10 ** DECIMAL_SHIFT */
|
|
60
|
-
#else
|
|
61
|
-
#error "PYLONG_BITS_IN_DIGIT should be 15 or 30"
|
|
62
|
-
#endif
|
|
63
|
-
#define PyLong_BASE ((digit)1 << PyLong_SHIFT)
|
|
64
|
-
#define PyLong_MASK ((digit)(PyLong_BASE - 1))
|
|
65
|
-
|
|
66
|
-
#if PyLong_SHIFT % 5 != 0
|
|
67
|
-
#error "longobject.c requires that PyLong_SHIFT be divisible by 5"
|
|
68
|
-
#endif
|
|
69
|
-
|
|
70
|
-
/* Long integer representation.
|
|
71
|
-
The absolute value of a number is equal to
|
|
72
|
-
SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i)
|
|
73
|
-
Negative numbers are represented with ob_size < 0;
|
|
74
|
-
zero is represented by ob_size == 0.
|
|
75
|
-
In a normalized number, ob_digit[abs(ob_size)-1] (the most significant
|
|
76
|
-
digit) is never zero. Also, in all cases, for all valid i,
|
|
77
|
-
0 <= ob_digit[i] <= MASK.
|
|
78
|
-
The allocation function takes care of allocating extra memory
|
|
79
|
-
so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available.
|
|
80
|
-
|
|
81
|
-
CAUTION: Generic code manipulating subtypes of PyVarObject has to
|
|
82
|
-
aware that ints abuse ob_size's sign bit.
|
|
83
|
-
*/
|
|
84
|
-
|
|
85
|
-
struct _longobject {
|
|
86
|
-
PyObject_VAR_HEAD
|
|
87
|
-
digit ob_digit[1];
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t);
|
|
91
|
-
|
|
92
|
-
/* Return a copy of src. */
|
|
93
|
-
PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src);
|
|
94
|
-
|
|
95
|
-
#ifdef __cplusplus
|
|
96
|
-
}
|
|
97
|
-
#endif
|
|
98
|
-
#endif /* !Py_LONGINTREPR_H */
|
|
99
|
-
#endif /* Py_LIMITED_API */
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
#ifndef Py_LONGOBJECT_H
|
|
2
|
-
#define Py_LONGOBJECT_H
|
|
3
|
-
#ifdef __cplusplus
|
|
4
|
-
extern "C" {
|
|
5
|
-
#endif
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* Long (arbitrary precision) integer object interface */
|
|
9
|
-
|
|
10
|
-
typedef struct _longobject PyLongObject; /* Revealed in longintrepr.h */
|
|
11
|
-
|
|
12
|
-
PyAPI_DATA(PyTypeObject) PyLong_Type;
|
|
13
|
-
|
|
14
|
-
#define PyLong_Check(op) \
|
|
15
|
-
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
|
|
16
|
-
#define PyLong_CheckExact(op) (Py_TYPE(op) == &PyLong_Type)
|
|
17
|
-
|
|
18
|
-
PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
|
|
19
|
-
PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLong(unsigned long);
|
|
20
|
-
PyAPI_FUNC(PyObject *) PyLong_FromSize_t(size_t);
|
|
21
|
-
PyAPI_FUNC(PyObject *) PyLong_FromSsize_t(Py_ssize_t);
|
|
22
|
-
PyAPI_FUNC(PyObject *) PyLong_FromDouble(double);
|
|
23
|
-
PyAPI_FUNC(long) PyLong_AsLong(PyObject *);
|
|
24
|
-
PyAPI_FUNC(long) PyLong_AsLongAndOverflow(PyObject *, int *);
|
|
25
|
-
PyAPI_FUNC(Py_ssize_t) PyLong_AsSsize_t(PyObject *);
|
|
26
|
-
PyAPI_FUNC(size_t) PyLong_AsSize_t(PyObject *);
|
|
27
|
-
PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
|
|
28
|
-
PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
|
|
29
|
-
#ifndef Py_LIMITED_API
|
|
30
|
-
PyAPI_FUNC(int) _PyLong_AsInt(PyObject *);
|
|
31
|
-
#endif
|
|
32
|
-
PyAPI_FUNC(PyObject *) PyLong_GetInfo(void);
|
|
33
|
-
|
|
34
|
-
/* It may be useful in the future. I've added it in the PyInt -> PyLong
|
|
35
|
-
cleanup to keep the extra information. [CH] */
|
|
36
|
-
#define PyLong_AS_LONG(op) PyLong_AsLong(op)
|
|
37
|
-
|
|
38
|
-
/* Issue #1983: pid_t can be longer than a C long on some systems */
|
|
39
|
-
#if !defined(SIZEOF_PID_T) || SIZEOF_PID_T == SIZEOF_INT
|
|
40
|
-
#define _Py_PARSE_PID "i"
|
|
41
|
-
#define PyLong_FromPid PyLong_FromLong
|
|
42
|
-
#define PyLong_AsPid PyLong_AsLong
|
|
43
|
-
#elif SIZEOF_PID_T == SIZEOF_LONG
|
|
44
|
-
#define _Py_PARSE_PID "l"
|
|
45
|
-
#define PyLong_FromPid PyLong_FromLong
|
|
46
|
-
#define PyLong_AsPid PyLong_AsLong
|
|
47
|
-
#elif defined(SIZEOF_LONG_LONG) && SIZEOF_PID_T == SIZEOF_LONG_LONG
|
|
48
|
-
#define _Py_PARSE_PID "L"
|
|
49
|
-
#define PyLong_FromPid PyLong_FromLongLong
|
|
50
|
-
#define PyLong_AsPid PyLong_AsLongLong
|
|
51
|
-
#else
|
|
52
|
-
#error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)"
|
|
53
|
-
#endif /* SIZEOF_PID_T */
|
|
54
|
-
|
|
55
|
-
#if SIZEOF_VOID_P == SIZEOF_INT
|
|
56
|
-
# define _Py_PARSE_INTPTR "i"
|
|
57
|
-
# define _Py_PARSE_UINTPTR "I"
|
|
58
|
-
#elif SIZEOF_VOID_P == SIZEOF_LONG
|
|
59
|
-
# define _Py_PARSE_INTPTR "l"
|
|
60
|
-
# define _Py_PARSE_UINTPTR "k"
|
|
61
|
-
#elif defined(SIZEOF_LONG_LONG) && SIZEOF_VOID_P == SIZEOF_LONG_LONG
|
|
62
|
-
# define _Py_PARSE_INTPTR "L"
|
|
63
|
-
# define _Py_PARSE_UINTPTR "K"
|
|
64
|
-
#else
|
|
65
|
-
# error "void* different in size from int, long and long long"
|
|
66
|
-
#endif /* SIZEOF_VOID_P */
|
|
67
|
-
|
|
68
|
-
#ifndef Py_LIMITED_API
|
|
69
|
-
PyAPI_FUNC(int) _PyLong_UnsignedShort_Converter(PyObject *, void *);
|
|
70
|
-
PyAPI_FUNC(int) _PyLong_UnsignedInt_Converter(PyObject *, void *);
|
|
71
|
-
PyAPI_FUNC(int) _PyLong_UnsignedLong_Converter(PyObject *, void *);
|
|
72
|
-
PyAPI_FUNC(int) _PyLong_UnsignedLongLong_Converter(PyObject *, void *);
|
|
73
|
-
PyAPI_FUNC(int) _PyLong_Size_t_Converter(PyObject *, void *);
|
|
74
|
-
#endif
|
|
75
|
-
|
|
76
|
-
/* Used by Python/mystrtoul.c, _PyBytes_FromHex(),
|
|
77
|
-
_PyBytes_DecodeEscapeRecode(), etc. */
|
|
78
|
-
#ifndef Py_LIMITED_API
|
|
79
|
-
PyAPI_DATA(unsigned char) _PyLong_DigitValue[256];
|
|
80
|
-
#endif
|
|
81
|
-
|
|
82
|
-
/* _PyLong_Frexp returns a double x and an exponent e such that the
|
|
83
|
-
true value is approximately equal to x * 2**e. e is >= 0. x is
|
|
84
|
-
0.0 if and only if the input is 0 (in which case, e and x are both
|
|
85
|
-
zeroes); otherwise, 0.5 <= abs(x) < 1.0. On overflow, which is
|
|
86
|
-
possible if the number of bits doesn't fit into a Py_ssize_t, sets
|
|
87
|
-
OverflowError and returns -1.0 for x, 0 for e. */
|
|
88
|
-
#ifndef Py_LIMITED_API
|
|
89
|
-
PyAPI_FUNC(double) _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e);
|
|
90
|
-
#endif
|
|
91
|
-
|
|
92
|
-
PyAPI_FUNC(double) PyLong_AsDouble(PyObject *);
|
|
93
|
-
PyAPI_FUNC(PyObject *) PyLong_FromVoidPtr(void *);
|
|
94
|
-
PyAPI_FUNC(void *) PyLong_AsVoidPtr(PyObject *);
|
|
95
|
-
|
|
96
|
-
PyAPI_FUNC(PyObject *) PyLong_FromLongLong(long long);
|
|
97
|
-
PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLongLong(unsigned long long);
|
|
98
|
-
PyAPI_FUNC(long long) PyLong_AsLongLong(PyObject *);
|
|
99
|
-
PyAPI_FUNC(unsigned long long) PyLong_AsUnsignedLongLong(PyObject *);
|
|
100
|
-
PyAPI_FUNC(unsigned long long) PyLong_AsUnsignedLongLongMask(PyObject *);
|
|
101
|
-
PyAPI_FUNC(long long) PyLong_AsLongLongAndOverflow(PyObject *, int *);
|
|
102
|
-
|
|
103
|
-
PyAPI_FUNC(PyObject *) PyLong_FromString(const char *, char **, int);
|
|
104
|
-
#ifndef Py_LIMITED_API
|
|
105
|
-
Py_DEPRECATED(3.3)
|
|
106
|
-
PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int);
|
|
107
|
-
PyAPI_FUNC(PyObject *) PyLong_FromUnicodeObject(PyObject *u, int base);
|
|
108
|
-
PyAPI_FUNC(PyObject *) _PyLong_FromBytes(const char *, Py_ssize_t, int);
|
|
109
|
-
#endif
|
|
110
|
-
|
|
111
|
-
#ifndef Py_LIMITED_API
|
|
112
|
-
/* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0.
|
|
113
|
-
v must not be NULL, and must be a normalized long.
|
|
114
|
-
There are no error cases.
|
|
115
|
-
*/
|
|
116
|
-
PyAPI_FUNC(int) _PyLong_Sign(PyObject *v);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
/* _PyLong_NumBits. Return the number of bits needed to represent the
|
|
120
|
-
absolute value of a long. For example, this returns 1 for 1 and -1, 2
|
|
121
|
-
for 2 and -2, and 2 for 3 and -3. It returns 0 for 0.
|
|
122
|
-
v must not be NULL, and must be a normalized long.
|
|
123
|
-
(size_t)-1 is returned and OverflowError set if the true result doesn't
|
|
124
|
-
fit in a size_t.
|
|
125
|
-
*/
|
|
126
|
-
PyAPI_FUNC(size_t) _PyLong_NumBits(PyObject *v);
|
|
127
|
-
|
|
128
|
-
/* _PyLong_DivmodNear. Given integers a and b, compute the nearest
|
|
129
|
-
integer q to the exact quotient a / b, rounding to the nearest even integer
|
|
130
|
-
in the case of a tie. Return (q, r), where r = a - q*b. The remainder r
|
|
131
|
-
will satisfy abs(r) <= abs(b)/2, with equality possible only if q is
|
|
132
|
-
even.
|
|
133
|
-
*/
|
|
134
|
-
PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *);
|
|
135
|
-
|
|
136
|
-
/* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in
|
|
137
|
-
base 256, and return a Python int with the same numeric value.
|
|
138
|
-
If n is 0, the integer is 0. Else:
|
|
139
|
-
If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB;
|
|
140
|
-
else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the
|
|
141
|
-
LSB.
|
|
142
|
-
If is_signed is 0/false, view the bytes as a non-negative integer.
|
|
143
|
-
If is_signed is 1/true, view the bytes as a 2's-complement integer,
|
|
144
|
-
non-negative if bit 0x80 of the MSB is clear, negative if set.
|
|
145
|
-
Error returns:
|
|
146
|
-
+ Return NULL with the appropriate exception set if there's not
|
|
147
|
-
enough memory to create the Python int.
|
|
148
|
-
*/
|
|
149
|
-
PyAPI_FUNC(PyObject *) _PyLong_FromByteArray(
|
|
150
|
-
const unsigned char* bytes, size_t n,
|
|
151
|
-
int little_endian, int is_signed);
|
|
152
|
-
|
|
153
|
-
/* _PyLong_AsByteArray: Convert the least-significant 8*n bits of long
|
|
154
|
-
v to a base-256 integer, stored in array bytes. Normally return 0,
|
|
155
|
-
return -1 on error.
|
|
156
|
-
If little_endian is 1/true, store the MSB at bytes[n-1] and the LSB at
|
|
157
|
-
bytes[0]; else (little_endian is 0/false) store the MSB at bytes[0] and
|
|
158
|
-
the LSB at bytes[n-1].
|
|
159
|
-
If is_signed is 0/false, it's an error if v < 0; else (v >= 0) n bytes
|
|
160
|
-
are filled and there's nothing special about bit 0x80 of the MSB.
|
|
161
|
-
If is_signed is 1/true, bytes is filled with the 2's-complement
|
|
162
|
-
representation of v's value. Bit 0x80 of the MSB is the sign bit.
|
|
163
|
-
Error returns (-1):
|
|
164
|
-
+ is_signed is 0 and v < 0. TypeError is set in this case, and bytes
|
|
165
|
-
isn't altered.
|
|
166
|
-
+ n isn't big enough to hold the full mathematical value of v. For
|
|
167
|
-
example, if is_signed is 0 and there are more digits in the v than
|
|
168
|
-
fit in n; or if is_signed is 1, v < 0, and n is just 1 bit shy of
|
|
169
|
-
being large enough to hold a sign bit. OverflowError is set in this
|
|
170
|
-
case, but bytes holds the least-significant n bytes of the true value.
|
|
171
|
-
*/
|
|
172
|
-
PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
|
|
173
|
-
unsigned char* bytes, size_t n,
|
|
174
|
-
int little_endian, int is_signed);
|
|
175
|
-
|
|
176
|
-
/* _PyLong_FromNbInt: Convert the given object to a PyLongObject
|
|
177
|
-
using the nb_int slot, if available. Raise TypeError if either the
|
|
178
|
-
nb_int slot is not available or the result of the call to nb_int
|
|
179
|
-
returns something not of type int.
|
|
180
|
-
*/
|
|
181
|
-
PyAPI_FUNC(PyObject *) _PyLong_FromNbInt(PyObject *);
|
|
182
|
-
|
|
183
|
-
/* Convert the given object to a PyLongObject using the nb_index or
|
|
184
|
-
nb_int slots, if available (the latter is deprecated).
|
|
185
|
-
Raise TypeError if either nb_index and nb_int slots are not
|
|
186
|
-
available or the result of the call to nb_index or nb_int
|
|
187
|
-
returns something not of type int.
|
|
188
|
-
Should be replaced with PyNumber_Index after the end of the
|
|
189
|
-
deprecation period.
|
|
190
|
-
*/
|
|
191
|
-
PyAPI_FUNC(PyObject *) _PyLong_FromNbIndexOrNbInt(PyObject *);
|
|
192
|
-
|
|
193
|
-
/* _PyLong_Format: Convert the long to a string object with given base,
|
|
194
|
-
appending a base prefix of 0[box] if base is 2, 8 or 16. */
|
|
195
|
-
PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *obj, int base);
|
|
196
|
-
|
|
197
|
-
PyAPI_FUNC(int) _PyLong_FormatWriter(
|
|
198
|
-
_PyUnicodeWriter *writer,
|
|
199
|
-
PyObject *obj,
|
|
200
|
-
int base,
|
|
201
|
-
int alternate);
|
|
202
|
-
|
|
203
|
-
PyAPI_FUNC(char*) _PyLong_FormatBytesWriter(
|
|
204
|
-
_PyBytesWriter *writer,
|
|
205
|
-
char *str,
|
|
206
|
-
PyObject *obj,
|
|
207
|
-
int base,
|
|
208
|
-
int alternate);
|
|
209
|
-
|
|
210
|
-
/* Format the object based on the format_spec, as defined in PEP 3101
|
|
211
|
-
(Advanced String Formatting). */
|
|
212
|
-
PyAPI_FUNC(int) _PyLong_FormatAdvancedWriter(
|
|
213
|
-
_PyUnicodeWriter *writer,
|
|
214
|
-
PyObject *obj,
|
|
215
|
-
PyObject *format_spec,
|
|
216
|
-
Py_ssize_t start,
|
|
217
|
-
Py_ssize_t end);
|
|
218
|
-
#endif /* Py_LIMITED_API */
|
|
219
|
-
|
|
220
|
-
/* These aren't really part of the int object, but they're handy. The
|
|
221
|
-
functions are in Python/mystrtoul.c.
|
|
222
|
-
*/
|
|
223
|
-
PyAPI_FUNC(unsigned long) PyOS_strtoul(const char *, char **, int);
|
|
224
|
-
PyAPI_FUNC(long) PyOS_strtol(const char *, char **, int);
|
|
225
|
-
|
|
226
|
-
#ifndef Py_LIMITED_API
|
|
227
|
-
/* For use by the gcd function in mathmodule.c */
|
|
228
|
-
PyAPI_FUNC(PyObject *) _PyLong_GCD(PyObject *, PyObject *);
|
|
229
|
-
#endif /* !Py_LIMITED_API */
|
|
230
|
-
|
|
231
|
-
#ifndef Py_LIMITED_API
|
|
232
|
-
PyAPI_DATA(PyObject *) _PyLong_Zero;
|
|
233
|
-
PyAPI_DATA(PyObject *) _PyLong_One;
|
|
234
|
-
|
|
235
|
-
PyAPI_FUNC(PyObject *) _PyLong_Rshift(PyObject *, size_t);
|
|
236
|
-
PyAPI_FUNC(PyObject *) _PyLong_Lshift(PyObject *, size_t);
|
|
237
|
-
#endif
|
|
238
|
-
|
|
239
|
-
#ifdef __cplusplus
|
|
240
|
-
}
|
|
241
|
-
#endif
|
|
242
|
-
#endif /* !Py_LONGOBJECT_H */
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/* Interface for marshal.c */
|
|
3
|
-
|
|
4
|
-
#ifndef Py_MARSHAL_H
|
|
5
|
-
#define Py_MARSHAL_H
|
|
6
|
-
#ifdef __cplusplus
|
|
7
|
-
extern "C" {
|
|
8
|
-
#endif
|
|
9
|
-
|
|
10
|
-
#define Py_MARSHAL_VERSION 4
|
|
11
|
-
|
|
12
|
-
PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int);
|
|
13
|
-
PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int);
|
|
14
|
-
PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int);
|
|
15
|
-
|
|
16
|
-
#ifndef Py_LIMITED_API
|
|
17
|
-
PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *);
|
|
18
|
-
PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *);
|
|
19
|
-
PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *);
|
|
20
|
-
PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *);
|
|
21
|
-
#endif
|
|
22
|
-
PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(const char *,
|
|
23
|
-
Py_ssize_t);
|
|
24
|
-
|
|
25
|
-
#ifdef __cplusplus
|
|
26
|
-
}
|
|
27
|
-
#endif
|
|
28
|
-
#endif /* !Py_MARSHAL_H */
|