Mercurial > cpython-lru_cache-weakref
annotate Include/pystrtod.h @ 54294:dba767bc3155 legacy-trunk
remove mention of old ctypes version
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 23 May 2009 20:59:09 +0000 |
| parents | 6947bc3dd433 |
| children | 74472da09f6c |
| rev | line source |
|---|---|
|
32305
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
1 #ifndef Py_STRTOD_H |
|
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
2 #define Py_STRTOD_H |
|
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
3 |
|
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
4 #ifdef __cplusplus |
|
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
5 extern "C" { |
|
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
6 #endif |
|
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
7 |
|
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
8 |
|
33070
4e6f4e9ec9b3
Patch #1006003: Cygwin standard module build problems
Jason Tishler <jason@tishler.net>
parents:
32305
diff
changeset
|
9 PyAPI_FUNC(double) PyOS_ascii_strtod(const char *str, char **ptr); |
|
4e6f4e9ec9b3
Patch #1006003: Cygwin standard module build problems
Jason Tishler <jason@tishler.net>
parents:
32305
diff
changeset
|
10 PyAPI_FUNC(double) PyOS_ascii_atof(const char *str); |
|
53442
6947bc3dd433
Issue #5835, deprecate PyOS_ascii_formatd.
Eric Smith <eric@trueblade.com>
parents:
53312
diff
changeset
|
11 |
|
6947bc3dd433
Issue #5835, deprecate PyOS_ascii_formatd.
Eric Smith <eric@trueblade.com>
parents:
53312
diff
changeset
|
12 /* Deprecated in 2.7 and 3.1. Will disappear in 2.8 (if it exists) and 3.2 */ |
|
6947bc3dd433
Issue #5835, deprecate PyOS_ascii_formatd.
Eric Smith <eric@trueblade.com>
parents:
53312
diff
changeset
|
13 PyAPI_FUNC(char *) PyOS_ascii_formatd(char *buffer, size_t buf_len, |
|
6947bc3dd433
Issue #5835, deprecate PyOS_ascii_formatd.
Eric Smith <eric@trueblade.com>
parents:
53312
diff
changeset
|
14 const char *format, double d); |
|
6947bc3dd433
Issue #5835, deprecate PyOS_ascii_formatd.
Eric Smith <eric@trueblade.com>
parents:
53312
diff
changeset
|
15 |
|
6947bc3dd433
Issue #5835, deprecate PyOS_ascii_formatd.
Eric Smith <eric@trueblade.com>
parents:
53312
diff
changeset
|
16 /* Use PyOS_double_to_string instead. It's the same, except it allocates |
|
6947bc3dd433
Issue #5835, deprecate PyOS_ascii_formatd.
Eric Smith <eric@trueblade.com>
parents:
53312
diff
changeset
|
17 the appropriately sized buffer and returns it. This function will go |
|
6947bc3dd433
Issue #5835, deprecate PyOS_ascii_formatd.
Eric Smith <eric@trueblade.com>
parents:
53312
diff
changeset
|
18 away in Python 2.8 and 3.2. */ |
|
6947bc3dd433
Issue #5835, deprecate PyOS_ascii_formatd.
Eric Smith <eric@trueblade.com>
parents:
53312
diff
changeset
|
19 PyAPI_FUNC(void) _PyOS_double_to_string(char *buf, size_t buf_len, double val, |
|
6947bc3dd433
Issue #5835, deprecate PyOS_ascii_formatd.
Eric Smith <eric@trueblade.com>
parents:
53312
diff
changeset
|
20 char format_code, int precision, |
|
6947bc3dd433
Issue #5835, deprecate PyOS_ascii_formatd.
Eric Smith <eric@trueblade.com>
parents:
53312
diff
changeset
|
21 int flags, int* type); |
|
32305
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
22 |
|
53312
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
23 /* The caller is responsible for calling PyMem_Free to free the buffer |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
24 that's is returned. */ |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
25 PyAPI_FUNC(char *) PyOS_double_to_string(double val, |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
26 char format_code, |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
27 int precision, |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
28 int flags, |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
29 int *type); |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
30 |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
31 |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
32 /* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */ |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
33 #define Py_DTSF_SIGN 0x01 /* always add the sign */ |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
34 #define Py_DTSF_ADD_DOT_0 0x02 /* if the result is an integer add ".0" */ |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
35 #define Py_DTSF_ALT 0x04 /* "alternate" formatting. it's format_code |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
36 specific */ |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
37 |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
38 /* PyOS_double_to_string's "type", if non-NULL, will be set to one of: */ |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
39 #define Py_DTST_FINITE 0 |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
40 #define Py_DTST_INFINITE 1 |
|
c5e0d9beebf9
Backport of some of the work in r71665 to trunk. This reworks much of
Eric Smith <eric@trueblade.com>
parents:
36501
diff
changeset
|
41 #define Py_DTST_NAN 2 |
|
32305
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
42 |
|
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
43 #ifdef __cplusplus |
|
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
44 } |
|
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
45 #endif |
|
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
46 |
|
13656d58d450
Patch #774665: Make Python LC_NUMERIC agnostic.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff
changeset
|
47 #endif /* !Py_STRTOD_H */ |
