~bkerensa/ubuntu/raring/yasm/fix-for-1064341

« back to all changes in this revision

Viewing changes to libyasm/floatnum.h

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hocevar
  • Date: 2009-07-14 08:23:59 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090714082359-10x8mjty41gzkshs
Tags: 0.8.0-1
* New upstream release (Closes: #531047).
* Removed all tasm patches, they’ve been merged upstream.
* debian/control: set debhelper dependency to 5.0 and policy to 3.8.2.
* debian/control: mention TASM in the long description.
* debian/compat: set debhelper level to 5.
* debian/links: link tasm to ytasm and tasm.1.gz to ytasm.1.gz.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 * \brief YASM floating point (IEEE) interface.
4
4
 *
5
5
 * \rcs
6
 
 * $Id: floatnum.h 1827 2007-04-22 05:09:49Z peter $
 
6
 * $Id: floatnum.h 2101 2008-05-23 06:46:51Z peter $
7
7
 * \endrcs
8
8
 *
9
9
 * \license
36
36
#ifndef YASM_FLOATNUM_H
37
37
#define YASM_FLOATNUM_H
38
38
 
 
39
#ifndef YASM_LIB_DECL
 
40
#define YASM_LIB_DECL
 
41
#endif
 
42
 
39
43
/** Initialize floatnum internal data structures. */
 
44
YASM_LIB_DECL
40
45
void yasm_floatnum_initialize(void);
41
46
 
42
47
/** Clean up internal floatnum allocations. */
 
48
YASM_LIB_DECL
43
49
void yasm_floatnum_cleanup(void);
44
50
 
45
51
/** Create a new floatnum from a decimal string.  The input string must be in
47
53
 * \param str   floating point decimal string
48
54
 * \return Newly allocated floatnum.
49
55
 */
 
56
YASM_LIB_DECL
50
57
/*@only@*/ yasm_floatnum *yasm_floatnum_create(const char *str);
51
58
 
52
59
/** Duplicate a floatnum.
53
60
 * \param flt   floatnum
54
61
 * \return Newly allocated floatnum with the same value as flt.
55
62
 */
 
63
YASM_LIB_DECL
56
64
/*@only@*/ yasm_floatnum *yasm_floatnum_copy(const yasm_floatnum *flt);
57
65
 
58
66
/** Destroy (free allocated memory for) a floatnum.
59
67
 * \param flt   floatnum
60
68
 */
 
69
YASM_LIB_DECL
61
70
void yasm_floatnum_destroy(/*@only@*/ yasm_floatnum *flt);
62
71
 
63
72
/** Floating point calculation function: acc = acc op operand.
68
77
 * \param operand   floatnum operand
69
78
 * \return Nonzero on error.
70
79
 */
 
80
YASM_LIB_DECL
71
81
int yasm_floatnum_calc(yasm_floatnum *acc, yasm_expr_op op,
72
82
                       yasm_floatnum *operand);
73
83
 
78
88
 * \return Nonzero if flt can't fit into single precision: -1 if underflow
79
89
 *         occurred, 1 if overflow occurred.
80
90
 */
 
91
YASM_LIB_DECL
81
92
int yasm_floatnum_get_int(const yasm_floatnum *flt,
82
93
                          /*@out@*/ unsigned long *ret_val);
83
94
 
98
109
 * \return Nonzero if flt can't fit into the specified precision: -1 if
99
110
 *         underflow occurred, 1 if overflow occurred.
100
111
 */
 
112
YASM_LIB_DECL
101
113
int yasm_floatnum_get_sized(const yasm_floatnum *flt, unsigned char *ptr,
102
114
                            size_t destsize, size_t valsize, size_t shift,
103
115
                            int bigendian, int warn);
110
122
 * \param size      number of bits of output space
111
123
 * \return 1 if valid size, 0 if invalid size.
112
124
 */
 
125
YASM_LIB_DECL
113
126
int yasm_floatnum_check_size(const yasm_floatnum *flt, size_t size);
114
127
 
115
128
/** Print various representations of a floatnum.  For debugging purposes only.
116
129
 * \param f         file
117
130
 * \param flt       floatnum
118
131
 */
 
132
YASM_LIB_DECL
119
133
void yasm_floatnum_print(const yasm_floatnum *flt, FILE *f);
120
134
 
121
135
#endif