summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-10-19 00:04:52 (GMT)
committerGitHub <noreply@github.com>2021-10-19 00:04:52 (GMT)
commit5f09bb021a2862ba89c3ecb53e7e6e95a9e07e1d (patch)
treea7e0aaa8abfd098cc990c8137d65164e2bc40ebd /Include/internal
parentaad88d33d9db0a93e480f0234292b948890dfc2a (diff)
downloadcpython-5f09bb021a2862ba89c3ecb53e7e6e95a9e07e1d.zip
cpython-5f09bb021a2862ba89c3ecb53e7e6e95a9e07e1d.tar.gz
cpython-5f09bb021a2862ba89c3ecb53e7e6e95a9e07e1d.tar.bz2
bpo-35134: Add Include/cpython/longobject.h (GH-29044)
Move Include/longobject.h non-limited API to a new Include/cpython/longobject.h header file. Move the following definitions to the internal C API: * _PyLong_DigitValue * _PyLong_FormatAdvancedWriter() * _PyLong_FormatWriter()
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/pycore_long.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/Include/internal/pycore_long.h b/Include/internal/pycore_long.h
index 8edc902..8bdf8e5 100644
--- a/Include/internal/pycore_long.h
+++ b/Include/internal/pycore_long.h
@@ -37,6 +37,32 @@ static inline PyObject* _PyLong_GetOne(void)
PyObject *_PyLong_Add(PyLongObject *left, PyLongObject *right);
PyObject *_PyLong_Multiply(PyLongObject *left, PyLongObject *right);
+/* Used by Python/mystrtoul.c, _PyBytes_FromHex(),
+ _PyBytes_DecodeEscape(), etc. */
+PyAPI_DATA(unsigned char) _PyLong_DigitValue[256];
+
+/* Format the object based on the format_spec, as defined in PEP 3101
+ (Advanced String Formatting). */
+PyAPI_FUNC(int) _PyLong_FormatAdvancedWriter(
+ _PyUnicodeWriter *writer,
+ PyObject *obj,
+ PyObject *format_spec,
+ Py_ssize_t start,
+ Py_ssize_t end);
+
+PyAPI_FUNC(int) _PyLong_FormatWriter(
+ _PyUnicodeWriter *writer,
+ PyObject *obj,
+ int base,
+ int alternate);
+
+PyAPI_FUNC(char*) _PyLong_FormatBytesWriter(
+ _PyBytesWriter *writer,
+ char *str,
+ PyObject *obj,
+ int base,
+ int alternate);
+
#ifdef __cplusplus
}
#endif