diff options
Diffstat (limited to 'src/plugins/old/convert_numeric.h')
-rw-r--r-- | src/plugins/old/convert_numeric.h | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/src/plugins/old/convert_numeric.h b/src/plugins/old/convert_numeric.h index cc425f5..f3adead 100644 --- a/src/plugins/old/convert_numeric.h +++ b/src/plugins/old/convert_numeric.h | |||
@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License | |||
18 | along with this program; if not, write to the Free Software | 18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ | 19 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ |
20 | 20 | ||
21 | #if !defined (FLOATFORMAT_H) | 21 | #if ! defined (FLOATFORMAT_H) |
22 | #define FLOATFORMAT_H 1 | 22 | #define FLOATFORMAT_H 1 |
23 | 23 | ||
24 | /*#include "ansidecl.h"*/ | 24 | /*#include "ansidecl.h"*/ |
@@ -31,7 +31,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. | |||
31 | 31 | ||
32 | /* What is the order of the bytes? */ | 32 | /* What is the order of the bytes? */ |
33 | 33 | ||
34 | enum EXTRACTOR_floatformat_byteorders { | 34 | enum EXTRACTOR_floatformat_byteorders |
35 | { | ||
35 | /* Standard little endian byte order. | 36 | /* Standard little endian byte order. |
36 | EX: 1.2345678e10 => 00 00 80 c5 e0 fe 06 42 */ | 37 | EX: 1.2345678e10 => 00 00 80 c5 e0 fe 06 42 */ |
37 | floatformat_little, | 38 | floatformat_little, |
@@ -51,12 +52,13 @@ enum EXTRACTOR_floatformat_byteorders { | |||
51 | floatformat_vax | 52 | floatformat_vax |
52 | }; | 53 | }; |
53 | 54 | ||
54 | enum EXTRACTOR_floatformat_intbit { floatformat_intbit_yes, floatformat_intbit_no }; | 55 | enum EXTRACTOR_floatformat_intbit { floatformat_intbit_yes, |
56 | floatformat_intbit_no }; | ||
55 | 57 | ||
56 | struct EXTRACTOR_floatformat | 58 | struct EXTRACTOR_floatformat |
57 | { | 59 | { |
58 | enum EXTRACTOR_floatformat_byteorders byteorder; | 60 | enum EXTRACTOR_floatformat_byteorders byteorder; |
59 | unsigned int totalsize; /* Total size of number in bits */ | 61 | unsigned int totalsize; /* Total size of number in bits */ |
60 | 62 | ||
61 | /* Sign bit is always one bit long. 1 means negative, 0 means positive. */ | 63 | /* Sign bit is always one bit long. 1 means negative, 0 means positive. */ |
62 | unsigned int sign_start; | 64 | unsigned int sign_start; |
@@ -90,13 +92,16 @@ struct EXTRACTOR_floatformat | |||
90 | /* floatformats for IEEE single and double, big and little endian. */ | 92 | /* floatformats for IEEE single and double, big and little endian. */ |
91 | 93 | ||
92 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_ieee_single_big; | 94 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_ieee_single_big; |
93 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_ieee_single_little; | 95 | extern const struct EXTRACTOR_floatformat |
96 | EXTRACTOR_floatformat_ieee_single_little; | ||
94 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_ieee_double_big; | 97 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_ieee_double_big; |
95 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_ieee_double_little; | 98 | extern const struct EXTRACTOR_floatformat |
99 | EXTRACTOR_floatformat_ieee_double_little; | ||
96 | 100 | ||
97 | /* floatformat for ARM IEEE double, little endian bytes and big endian words */ | 101 | /* floatformat for ARM IEEE double, little endian bytes and big endian words */ |
98 | 102 | ||
99 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_ieee_double_littlebyte_bigword; | 103 | extern const struct EXTRACTOR_floatformat |
104 | EXTRACTOR_floatformat_ieee_double_littlebyte_bigword; | ||
100 | 105 | ||
101 | /* floatformats for VAX. */ | 106 | /* floatformats for VAX. */ |
102 | 107 | ||
@@ -110,31 +115,38 @@ extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_i387_ext; | |||
110 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_m68881_ext; | 115 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_m68881_ext; |
111 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_i960_ext; | 116 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_i960_ext; |
112 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_m88110_ext; | 117 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_m88110_ext; |
113 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_m88110_harris_ext; | 118 | extern const struct EXTRACTOR_floatformat |
119 | EXTRACTOR_floatformat_m88110_harris_ext; | ||
114 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_arm_ext_big; | 120 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_arm_ext_big; |
115 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_arm_ext_littlebyte_bigword; | 121 | extern const struct EXTRACTOR_floatformat |
122 | EXTRACTOR_floatformat_arm_ext_littlebyte_bigword; | ||
116 | /* IA-64 Floating Point register spilt into memory. */ | 123 | /* IA-64 Floating Point register spilt into memory. */ |
117 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_ia64_spill_big; | 124 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_ia64_spill_big; |
118 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_ia64_spill_little; | 125 | extern const struct EXTRACTOR_floatformat |
126 | EXTRACTOR_floatformat_ia64_spill_little; | ||
119 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_ia64_quad_big; | 127 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_ia64_quad_big; |
120 | extern const struct EXTRACTOR_floatformat EXTRACTOR_floatformat_ia64_quad_little; | 128 | extern const struct EXTRACTOR_floatformat |
129 | EXTRACTOR_floatformat_ia64_quad_little; | ||
121 | 130 | ||
122 | /* Convert from FMT to a double. | 131 | /* Convert from FMT to a double. |
123 | FROM is the address of the extended float. | 132 | FROM is the address of the extended float. |
124 | Store the double in *TO. */ | 133 | Store the double in *TO. */ |
125 | 134 | ||
126 | extern void | 135 | extern void |
127 | EXTRACTOR_common_floatformat_to_double (const struct EXTRACTOR_floatformat *, const void *, double *); | 136 | EXTRACTOR_common_floatformat_to_double (const struct EXTRACTOR_floatformat *, |
137 | const void *, double *); | ||
128 | 138 | ||
129 | /* The converse: convert the double *FROM to FMT | 139 | /* The converse: convert the double *FROM to FMT |
130 | and store where TO points. */ | 140 | and store where TO points. */ |
131 | 141 | ||
132 | extern void | 142 | extern void |
133 | EXTRACTOR_common_floatformat_from_double (const struct EXTRACTOR_floatformat *, const double *, void *); | 143 | EXTRACTOR_common_floatformat_from_double (const struct EXTRACTOR_floatformat *, |
144 | const double *, void *); | ||
134 | 145 | ||
135 | /* Return non-zero iff the data at FROM is a valid number in format FMT. */ | 146 | /* Return non-zero iff the data at FROM is a valid number in format FMT. */ |
136 | 147 | ||
137 | extern int | 148 | extern int |
138 | EXTRACTOR_common_floatformat_is_valid (const struct EXTRACTOR_floatformat *fmt, const void *from); | 149 | EXTRACTOR_common_floatformat_is_valid (const struct EXTRACTOR_floatformat *fmt, |
150 | const void *from); | ||
139 | 151 | ||
140 | #endif /* defined (FLOATFORMAT_H) */ | 152 | #endif /* defined (FLOATFORMAT_H) */ |