/home/mdboom/Work/builds/cpython/Include/internal/pycore_long.h
Line | Count | Source |
1 | #ifndef Py_INTERNAL_LONG_H |
2 | #define Py_INTERNAL_LONG_H |
3 | #ifdef __cplusplus |
4 | extern "C" { |
5 | #endif |
6 | |
7 | #ifndef Py_BUILD_CORE |
8 | # error "this header requires Py_BUILD_CORE define" |
9 | #endif |
10 | |
11 | #include "pycore_global_objects.h" // _PY_NSMALLNEGINTS |
12 | #include "pycore_runtime.h" // _PyRuntime |
13 | |
14 | |
15 | /* runtime lifecycle */ |
16 | |
17 | extern PyStatus _PyLong_InitTypes(PyInterpreterState *); |
18 | extern void _PyLong_FiniTypes(PyInterpreterState *interp); |
19 | |
20 | |
21 | /* other API */ |
22 | |
23 | #define _PyLong_SMALL_INTS _Py_SINGLETON(small_ints) |
24 | |
25 | // _PyLong_GetZero() and _PyLong_GetOne() must always be available |
26 | // _PyLong_FromUnsignedChar must always be available |
27 | #if _PY_NSMALLPOSINTS < 257 |
28 | # error "_PY_NSMALLPOSINTS must be greater than or equal to 257" |
29 | #endif |
30 | |
31 | // Return a borrowed reference to the zero singleton. |
32 | // The function cannot return NULL. |
33 | static inline PyObject* _PyLong_GetZero(void) |
34 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } Unexecuted instantiation: bytearrayobject.c:_PyLong_GetZero Unexecuted instantiation: bytesobject.c:_PyLong_GetZero complexobject.c:_PyLong_GetZero Line | Count | Source | 34 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } |
Unexecuted instantiation: enumobject.c:_PyLong_GetZero floatobject.c:_PyLong_GetZero Line | Count | Source | 34 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } |
longobject.c:_PyLong_GetZero Line | Count | Source | 34 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } |
rangeobject.c:_PyLong_GetZero Line | Count | Source | 34 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } |
sliceobject.c:_PyLong_GetZero Line | Count | Source | 34 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } |
Unexecuted instantiation: unicodeobject.c:_PyLong_GetZero _warnings.c:_PyLong_GetZero Line | Count | Source | 34 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } |
Unexecuted instantiation: ceval.c:_PyLong_GetZero compile.c:_PyLong_GetZero Line | Count | Source | 34 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } |
Unexecuted instantiation: mystrtoul.c:_PyLong_GetZero Unexecuted instantiation: pylifecycle.c:_PyLong_GetZero Unexecuted instantiation: specialize.c:_PyLong_GetZero Unexecuted instantiation: formatter_unicode.c:_PyLong_GetZero _collectionsmodule.c:_PyLong_GetZero Line | Count | Source | 34 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } |
Unexecuted instantiation: iobase.c:_PyLong_GetZero Line | Count | Source | 34 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } |
itertoolsmodule.c:_PyLong_GetZero Line | Count | Source | 34 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } |
Line | Count | Source | 34 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } |
_functoolsmodule.c:_PyLong_GetZero Line | Count | Source | 34 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS]; } |
Unexecuted instantiation: deepfreeze.c:_PyLong_GetZero |
35 | |
36 | // Return a borrowed reference to the one singleton. |
37 | // The function cannot return NULL. |
38 | static inline PyObject* _PyLong_GetOne(void) |
39 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+1]; } Unexecuted instantiation: bytearrayobject.c:_PyLong_GetOne Unexecuted instantiation: bytesobject.c:_PyLong_GetOne Unexecuted instantiation: complexobject.c:_PyLong_GetOne enumobject.c:_PyLong_GetOne Line | Count | Source | 39 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+1]; } |
floatobject.c:_PyLong_GetOne Line | Count | Source | 39 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+1]; } |
longobject.c:_PyLong_GetOne Line | Count | Source | 39 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+1]; } |
rangeobject.c:_PyLong_GetOne Line | Count | Source | 39 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+1]; } |
sliceobject.c:_PyLong_GetOne Line | Count | Source | 39 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+1]; } |
Unexecuted instantiation: unicodeobject.c:_PyLong_GetOne Unexecuted instantiation: _warnings.c:_PyLong_GetOne Unexecuted instantiation: ceval.c:_PyLong_GetOne Unexecuted instantiation: compile.c:_PyLong_GetOne Unexecuted instantiation: mystrtoul.c:_PyLong_GetOne Unexecuted instantiation: pylifecycle.c:_PyLong_GetOne Unexecuted instantiation: specialize.c:_PyLong_GetOne Unexecuted instantiation: formatter_unicode.c:_PyLong_GetOne _collectionsmodule.c:_PyLong_GetOne Line | Count | Source | 39 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+1]; } |
Line | Count | Source | 39 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+1]; } |
Unexecuted instantiation: textio.c:_PyLong_GetOne itertoolsmodule.c:_PyLong_GetOne Line | Count | Source | 39 | { return (PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+1]; } |
Unexecuted instantiation: sre.c:_PyLong_GetOne Unexecuted instantiation: _functoolsmodule.c:_PyLong_GetOne Unexecuted instantiation: deepfreeze.c:_PyLong_GetOne |
40 | |
41 | static inline PyObject* _PyLong_FromUnsignedChar(unsigned char i) |
42 | { |
43 | return Py_NewRef((PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+i]); |
44 | } bytearrayobject.c:_PyLong_FromUnsignedChar Line | Count | Source | 42 | { | 43 | return Py_NewRef((PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+i]); | 44 | } |
bytesobject.c:_PyLong_FromUnsignedChar Line | Count | Source | 42 | { | 43 | return Py_NewRef((PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+i]); | 44 | } |
Unexecuted instantiation: complexobject.c:_PyLong_FromUnsignedChar Unexecuted instantiation: enumobject.c:_PyLong_FromUnsignedChar Unexecuted instantiation: floatobject.c:_PyLong_FromUnsignedChar Unexecuted instantiation: longobject.c:_PyLong_FromUnsignedChar Unexecuted instantiation: rangeobject.c:_PyLong_FromUnsignedChar Unexecuted instantiation: sliceobject.c:_PyLong_FromUnsignedChar Unexecuted instantiation: unicodeobject.c:_PyLong_FromUnsignedChar Unexecuted instantiation: _warnings.c:_PyLong_FromUnsignedChar Unexecuted instantiation: ceval.c:_PyLong_FromUnsignedChar Unexecuted instantiation: compile.c:_PyLong_FromUnsignedChar Unexecuted instantiation: mystrtoul.c:_PyLong_FromUnsignedChar Unexecuted instantiation: pylifecycle.c:_PyLong_FromUnsignedChar Unexecuted instantiation: specialize.c:_PyLong_FromUnsignedChar Unexecuted instantiation: formatter_unicode.c:_PyLong_FromUnsignedChar Unexecuted instantiation: _collectionsmodule.c:_PyLong_FromUnsignedChar Unexecuted instantiation: iobase.c:_PyLong_FromUnsignedChar Unexecuted instantiation: textio.c:_PyLong_FromUnsignedChar Unexecuted instantiation: itertoolsmodule.c:_PyLong_FromUnsignedChar Unexecuted instantiation: sre.c:_PyLong_FromUnsignedChar Unexecuted instantiation: _functoolsmodule.c:_PyLong_FromUnsignedChar Unexecuted instantiation: deepfreeze.c:_PyLong_FromUnsignedChar |
45 | |
46 | PyObject *_PyLong_Add(PyLongObject *left, PyLongObject *right); |
47 | PyObject *_PyLong_Multiply(PyLongObject *left, PyLongObject *right); |
48 | PyObject *_PyLong_Subtract(PyLongObject *left, PyLongObject *right); |
49 | |
50 | int _PyLong_AssignValue(PyObject **target, Py_ssize_t value); |
51 | |
52 | /* Used by Python/mystrtoul.c, _PyBytes_FromHex(), |
53 | _PyBytes_DecodeEscape(), etc. */ |
54 | PyAPI_DATA(unsigned char) _PyLong_DigitValue[256]; |
55 | |
56 | /* Format the object based on the format_spec, as defined in PEP 3101 |
57 | (Advanced String Formatting). */ |
58 | PyAPI_FUNC(int) _PyLong_FormatAdvancedWriter( |
59 | _PyUnicodeWriter *writer, |
60 | PyObject *obj, |
61 | PyObject *format_spec, |
62 | Py_ssize_t start, |
63 | Py_ssize_t end); |
64 | |
65 | PyAPI_FUNC(int) _PyLong_FormatWriter( |
66 | _PyUnicodeWriter *writer, |
67 | PyObject *obj, |
68 | int base, |
69 | int alternate); |
70 | |
71 | PyAPI_FUNC(char*) _PyLong_FormatBytesWriter( |
72 | _PyBytesWriter *writer, |
73 | char *str, |
74 | PyObject *obj, |
75 | int base, |
76 | int alternate); |
77 | |
78 | #ifdef __cplusplus |
79 | } |
80 | #endif |
81 | #endif /* !Py_INTERNAL_LONG_H */ |