• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef Py_INTERNAL_FLOATOBJECT_H
2 #define Py_INTERNAL_FLOATOBJECT_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_freelist.h"      // _PyFreeListState
12 #include "pycore_unicodeobject.h" // _PyUnicodeWriter
13 
14 /* runtime lifecycle */
15 
16 extern void _PyFloat_InitState(PyInterpreterState *);
17 extern PyStatus _PyFloat_InitTypes(PyInterpreterState *);
18 extern void _PyFloat_FiniType(PyInterpreterState *);
19 
20 
21 /* other API */
22 
23 enum _py_float_format_type {
24     _py_float_format_unknown,
25     _py_float_format_ieee_big_endian,
26     _py_float_format_ieee_little_endian,
27 };
28 
29 struct _Py_float_runtime_state {
30     enum _py_float_format_type float_format;
31     enum _py_float_format_type double_format;
32 };
33 
34 
35 
36 
37 PyAPI_FUNC(void) _PyFloat_ExactDealloc(PyObject *op);
38 
39 
40 extern void _PyFloat_DebugMallocStats(FILE* out);
41 
42 
43 /* Format the object based on the format_spec, as defined in PEP 3101
44    (Advanced String Formatting). */
45 extern int _PyFloat_FormatAdvancedWriter(
46     _PyUnicodeWriter *writer,
47     PyObject *obj,
48     PyObject *format_spec,
49     Py_ssize_t start,
50     Py_ssize_t end);
51 
52 extern PyObject* _Py_string_to_number_with_underscores(
53     const char *str, Py_ssize_t len, const char *what, PyObject *obj, void *arg,
54     PyObject *(*innerfunc)(const char *, Py_ssize_t, void *));
55 
56 extern double _Py_parse_inf_or_nan(const char *p, char **endptr);
57 
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 #endif /* !Py_INTERNAL_FLOATOBJECT_H */
63