mirror of
https://github.com/python/cpython.git
synced 2025-08-26 19:55:24 +00:00

No longer export these 49 internal C API functions: * _PyArgv_AsWstrList() * _PyCode_New() * _PyCode_Validate() * _PyFloat_DebugMallocStats() * _PyFloat_FormatAdvancedWriter() * _PyImport_CheckSubinterpIncompatibleExtensionAllowed() * _PyImport_ClearExtension() * _PyImport_GetModuleId() * _PyImport_SetModuleString() * _PyInterpreterState_IDDecref() * _PyInterpreterState_IDIncref() * _PyInterpreterState_IDInitref() * _PyInterpreterState_LookUpID() * _PyWideStringList_AsList() * _PyWideStringList_CheckConsistency() * _PyWideStringList_Clear() * _PyWideStringList_Copy() * _PyWideStringList_Extend() * _Py_ClearArgcArgv() * _Py_DecodeUTF8Ex() * _Py_DecodeUTF8_surrogateescape() * _Py_EncodeLocaleRaw() * _Py_EncodeUTF8Ex() * _Py_GetEnv() * _Py_GetForceASCII() * _Py_GetLocaleEncoding() * _Py_GetLocaleEncodingObject() * _Py_GetLocaleconvNumeric() * _Py_ResetForceASCII() * _Py_device_encoding() * _Py_dg_dtoa() * _Py_dg_freedtoa() * _Py_dg_strtod() * _Py_get_blocking() * _Py_get_env_flag() * _Py_get_inheritable() * _Py_get_osfhandle_noraise() * _Py_get_xoption() * _Py_open() * _Py_open_osfhandle() * _Py_open_osfhandle_noraise() * _Py_read() * _Py_set_blocking() * _Py_str_to_int() * _Py_wfopen() * _Py_wgetcwd() * _Py_wreadlink() * _Py_wrealpath() * _Py_write()
73 lines
1.6 KiB
C
73 lines
1.6 KiB
C
#ifndef Py_INTERNAL_DTOA_H
|
|
#define Py_INTERNAL_DTOA_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifndef Py_BUILD_CORE
|
|
# error "this header requires Py_BUILD_CORE define"
|
|
#endif
|
|
|
|
#include "pycore_pymath.h" // _PY_SHORT_FLOAT_REPR
|
|
|
|
|
|
#if _PY_SHORT_FLOAT_REPR == 1
|
|
|
|
typedef uint32_t ULong;
|
|
|
|
struct
|
|
Bigint {
|
|
struct Bigint *next;
|
|
int k, maxwds, sign, wds;
|
|
ULong x[1];
|
|
};
|
|
|
|
#ifdef Py_USING_MEMORY_DEBUGGER
|
|
|
|
struct _dtoa_state {
|
|
int _not_used;
|
|
};
|
|
#define _dtoa_interp_state_INIT(INTERP) \
|
|
{0}
|
|
|
|
#else // !Py_USING_MEMORY_DEBUGGER
|
|
|
|
/* The size of the Bigint freelist */
|
|
#define Bigint_Kmax 7
|
|
|
|
#ifndef PRIVATE_MEM
|
|
#define PRIVATE_MEM 2304
|
|
#endif
|
|
#define Bigint_PREALLOC_SIZE \
|
|
((PRIVATE_MEM+sizeof(double)-1)/sizeof(double))
|
|
|
|
struct _dtoa_state {
|
|
/* p5s is a linked list of powers of 5 of the form 5**(2**i), i >= 2 */
|
|
// XXX This should be freed during runtime fini.
|
|
struct Bigint *p5s;
|
|
struct Bigint *freelist[Bigint_Kmax+1];
|
|
double preallocated[Bigint_PREALLOC_SIZE];
|
|
double *preallocated_next;
|
|
};
|
|
#define _dtoa_state_INIT(INTERP) \
|
|
{ \
|
|
.preallocated_next = (INTERP)->dtoa.preallocated, \
|
|
}
|
|
|
|
#endif // !Py_USING_MEMORY_DEBUGGER
|
|
|
|
|
|
/* These functions are used by modules compiled as C extension like math:
|
|
they must be exported. */
|
|
|
|
extern double _Py_dg_strtod(const char *str, char **ptr);
|
|
extern char* _Py_dg_dtoa(double d, int mode, int ndigits,
|
|
int *decpt, int *sign, char **rve);
|
|
extern void _Py_dg_freedtoa(char *s);
|
|
|
|
#endif // _PY_SHORT_FLOAT_REPR == 1
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* !Py_INTERNAL_DTOA_H */
|