Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / stdlib / gdtoa.h
blobf4d2a56db8793a03a0b07e84f7fa490ceaec098f
1 /****************************************************************
3 The author of this software is David M. Gay.
5 Copyright (C) 1998 by Lucent Technologies
6 All Rights Reserved
8 Permission to use, copy, modify, and distribute this software and
9 its documentation for any purpose and without fee is hereby
10 granted, provided that the above copyright notice appear in all
11 copies and that both that the copyright notice and this
12 permission notice and warranty disclaimer appear in supporting
13 documentation, and that the name of Lucent or any of its entities
14 not be used in advertising or publicity pertaining to
15 distribution of the software without specific, written prior
16 permission.
18 LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
19 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
20 IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
21 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
23 IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
25 THIS SOFTWARE.
27 ****************************************************************/
29 /* Please send bug reports to David M. Gay (dmg at acm dot org,
30 * with " at " changed at "@" and " dot " changed to "."). */
32 #ifndef GDTOA_H_INCLUDED
33 #define GDTOA_H_INCLUDED
35 #include <stddef.h> /* for size_t */
36 #include <reent.h>
38 #define PROTO_NORMAL(x)
39 #define __BEGIN_HIDDEN_DECLS
40 #define __END_HIDDEN_DECLS
41 #define DEF_STRONG(x)
43 #ifndef ULong
44 #define ULong __ULong
45 #endif
47 #ifndef ANSI
48 #ifdef KR_headers
49 #define ANSI(x) ()
50 #define Void /*nothing*/
51 #else
52 #define ANSI(x) x
53 #define Void void
54 #endif
55 #endif /* ANSI */
57 #ifndef CONST
58 #ifdef KR_headers
59 #define CONST /* blank */
60 #else
61 #define CONST const
62 #endif
63 #endif /* CONST */
65 enum { /* return values from strtodg */
66 STRTOG_Zero = 0x000,
67 STRTOG_Normal = 0x001,
68 STRTOG_Denormal = 0x002,
69 STRTOG_Infinite = 0x003,
70 STRTOG_NaN = 0x004,
71 STRTOG_NaNbits = 0x005,
72 STRTOG_NoNumber = 0x006,
73 STRTOG_NoMemory = 0x007,
74 STRTOG_Retmask = 0x00f,
76 /* The following may be or-ed into one of the above values. */
78 STRTOG_Inexlo = 0x010, /* returned result rounded toward zero */
79 STRTOG_Inexhi = 0x020, /* returned result rounded away from zero */
80 STRTOG_Inexact = 0x030,
81 STRTOG_Underflow= 0x040,
82 STRTOG_Overflow = 0x080,
83 STRTOG_Neg = 0x100 /* does not affect STRTOG_Inexlo or STRTOG_Inexhi */
86 typedef struct
87 FPI {
88 int nbits;
89 int emin;
90 int emax;
91 int rounding;
92 int sudden_underflow;
93 } FPI;
95 enum { /* FPI.rounding values: same as FLT_ROUNDS */
96 FPI_Round_zero = 0,
97 FPI_Round_near = 1,
98 FPI_Round_up = 2,
99 FPI_Round_down = 3
102 typedef unsigned short __UShort;
103 typedef struct _Bigint Bigint;
105 #ifdef __cplusplus
106 extern "C" {
107 #endif
109 extern char* __dtoa ANSI((struct _reent *ptr,
110 double d, int mode, int ndigits, int *decpt,
111 int *sign, char **rve));
112 extern char* __gdtoa ANSI((struct _reent *ptr,
113 FPI *fpi, int be, ULong *bits, int *kindp,
114 int mode, int ndigits, int *decpt, char **rve));
115 extern void __freedtoa ANSI((struct _reent *, char*));
116 extern float strtof ANSI((CONST char *, char **));
117 extern double strtod ANSI((CONST char *, char **));
118 extern int __strtodg ANSI((CONST char*, char**, FPI*, Long*, ULong*));
119 char *__hdtoa(double, const char *, int, int *, int *, char **);
120 char *__hldtoa(long double, const char *, int, int *, int *, char **);
121 char *__ldtoa(struct _reent *ptr,
122 long double *, int, int, int *, int *, char **);
124 PROTO_NORMAL(__dtoa);
125 PROTO_NORMAL(__gdtoa);
126 PROTO_NORMAL(__freedtoa);
127 PROTO_NORMAL(__hdtoa);
128 PROTO_NORMAL(__hldtoa);
129 PROTO_NORMAL(__ldtoa);
131 __BEGIN_HIDDEN_DECLS
132 extern char* __g_ddfmt ANSI((char*, double*, int, size_t));
133 extern char* __g_dfmt ANSI((char*, double*, int, size_t));
134 extern char* __g_ffmt ANSI((char*, float*, int, size_t));
135 extern char* __g_Qfmt ANSI((char*, void*, int, size_t));
136 extern char* __g_xfmt ANSI((char*, void*, int, size_t));
137 extern char* __g_xLfmt ANSI((char*, void*, int, size_t));
139 extern int __strtoId ANSI((CONST char*, char**, double*, double*));
140 extern int __strtoIdd ANSI((CONST char*, char**, double*, double*));
141 extern int __strtoIf ANSI((CONST char*, char**, float*, float*));
142 extern int __strtoIQ ANSI((CONST char*, char**, void*, void*));
143 extern int __strtoIx ANSI((CONST char*, char**, void*, void*));
144 extern int __strtoIxL ANSI((CONST char*, char**, void*, void*));
145 extern int __strtord ANSI((CONST char*, char**, int, double*));
146 extern int __strtordd ANSI((CONST char*, char**, int, double*));
147 extern int __strtorf ANSI((CONST char*, char**, int, float*));
148 extern int __strtorQ ANSI((CONST char*, char**, int, void*));
149 extern int __strtorx ANSI((CONST char*, char**, int, void*));
150 extern int __strtorxL ANSI((CONST char*, char**, int, void*));
151 #if 1
152 extern int __strtodI ANSI((CONST char*, char**, double*));
153 extern int __strtopd ANSI((CONST char*, char**, double*));
154 extern int __strtopdd ANSI((CONST char*, char**, double*));
155 extern int __strtopf ANSI((CONST char*, char**, float*));
156 extern int __strtopQ ANSI((CONST char*, char**, void*));
157 extern int __strtopx ANSI((CONST char*, char**, void*));
158 extern int __strtopxL ANSI((CONST char*, char**, void*));
159 #else
160 #define __strtopd(s,se,x) strtord(s,se,1,x)
161 #define __strtopdd(s,se,x) strtordd(s,se,1,x)
162 #define __strtopf(s,se,x) strtorf(s,se,1,x)
163 #define __strtopQ(s,se,x) strtorQ(s,se,1,x)
164 #define __strtopx(s,se,x) strtorx(s,se,1,x)
165 #define __strtopxL(s,se,x) strtorxL(s,se,1,x)
166 #endif
167 __END_HIDDEN_DECLS
169 #ifdef __cplusplus
171 #endif
172 #endif /* GDTOA_H_INCLUDED */