1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
=encoding UTF-8
=head1 NAME
BH_Util - Utility Functions
=head1 SYNTAX
#include <BH/Math.h>
cc prog.c -o prog -lbh
=head1 DESCRIPTION
The BH_Util library provides a set of functions for working with numbers in
little-endian and big-endian formats, as well as for classifying floating-point
values.
=head1 API CALLS
=head2 BH_ClassifyDouble
int BH_ClassifyDouble(double value);
Classifies a floating-point value.
This function returns a combination of the following values:
=over
=item B<BH_FP_NORMAL>
The value is normal or subnormal.
=item B<BH_FP_ZERO>
The value is positive or negative zero.
=item B<BH_FP_INFINITE>
The value is positive or negative infinity.
=item B<BH_FP_NAN>
The value is not a number (NaN).
=item B<BH_FP_NEGATIVE>
The value is negative.
=back
=head2 BH_Read16LEu
uint16_t BH_Read16LEu(const char *buffer);
Reads an unsigned 16-bit little-endian integer from the buffer.
=head2 BH_Read16LEs
int16_t BH_Read16LEs(const char *buffer);
Reads a signed 16-bit little-endian integer from the buffer.
=head2 BH_Read32LEu
uint32_t BH_Read32LEu(const char *buffer);
Reads an unsigned 32-bit little-endian integer from the buffer.
=head2 BH_Read32LEs
int32_t BH_Read32LEs(const char *buffer);
Reads a signed 32-bit little-endian integer from the buffer.
=head2 BH_Read64LEu
uint64_t BH_Read64LEu(const char *buffer);
Reads an unsigned 64-bit little-endian integer from the buffer.
=head2 BH_Read64LEs
int64_t BH_Read64LEs(const char *buffer);
Reads a signed 64-bit little-endian integer from the buffer.
=head2 BH_Read16BEu
uint16_t BH_Read16BEu(const char *buffer);
Reads an unsigned 16-bit big-endian integer from the buffer.
=head2 BH_Read16BEs
int16_t BH_Read16BEs(const char *buffer);
Reads a signed 16-bit big-endian integer from the buffer.
=head2 BH_Read32BEu
uint32_t BH_Read32BEu(const char *buffer);
Reads an unsigned 32-bit big-endian integer from the buffer.
=head2 BH_Read32BEs
int32_t BH_Read32BEs(const char *buffer);
Reads a signed 32-bit big-endian integer from the buffer.
=head2 BH_Read64BEu
uint64_t BH_Read64BEu(const char *buffer);
Reads an unsigned 64-bit big-endian integer from the buffer.
=head2 BH_Read64BEs
int64_t BH_Read64BEs(const char *buffer);
Reads a signed 64-bit big-endian integer from the buffer.
=head2 BH_Write16LEu
void BH_Write16LEu(char *buffer,
uint16_t value);
Writes an unsigned 16-bit little-endian integer to the buffer.
=head2 BH_Write16LEs
void BH_Write16LEs(char *buffer,
int16_t value);
Writes a signed 16-bit little-endian integer to the buffer.
=head2 BH_Write32LEu
void BH_Write32LEu(char *buffer,
uint32_t value);
Writes an unsigned 32-bit little-endian integer to the buffer.
=head2 BH_Write32LEs
void BH_Write32LEs(char *buffer,
int32_t value);
Writes a signed 32-bit little-endian integer to the buffer.
=head2 BH_Write64LEu
void BH_Write64LEu(char *buffer,
uint64_t value);
Writes an unsigned 64-bit little-endian integer to the buffer.
=head2 BH_Write64LEs
void BH_Write64LEs(char *buffer,
int64_t value);
Writes a signed 64-bit little-endian integer to the buffer.
=head2 BH_Write16BEu
void BH_Write16BEu(char *buffer,
uint16_t value);
Writes an unsigned 16-bit big-endian integer to the buffer.
=head2 BH_Write16BEs
void BH_Write16BEs(char *buffer,
int16_t value);
Writes a signed 16-bit big-endian integer to the buffer.
=head2 BH_Write32BEu
void BH_Write32BEu(char *buffer,
uint32_t value);
Writes an unsigned 32-bit big-endian integer to the buffer.
=head2 BH_Write32BEs
void BH_Write32BEs(char *buffer,
int32_t value);
Writes a signed 32-bit big-endian integer to the buffer.
=head2 BH_Write64BEu
void BH_Write64BEu(char *buffer,
uint64_t value);
Writes an unsigned 64-bit big-endian integer to the buffer.
=head2 BH_Write64BEs
void BH_Write64BEs(char *buffer,
int64_t value);
Writes a signed 64-bit big-endian integer to the buffer.
=head1 SEE ALSO
L<BH>
|