libyasm
intnum.h
Go to the documentation of this file.
1 
30 #ifndef YASM_INTNUM_H
31 #define YASM_INTNUM_H
32 
33 #ifndef YASM_LIB_DECL
34 #define YASM_LIB_DECL
35 #endif
36 
38 YASM_LIB_DECL
39 void yasm_intnum_initialize(void);
40 
42 YASM_LIB_DECL
43 void yasm_intnum_cleanup(void);
44 
49 YASM_LIB_DECL
50 /*@only@*/ yasm_intnum *yasm_intnum_create_dec(char *str);
51 
56 YASM_LIB_DECL
57 /*@only@*/ yasm_intnum *yasm_intnum_create_bin(char *str);
58 
63 YASM_LIB_DECL
64 /*@only@*/ yasm_intnum *yasm_intnum_create_oct(char *str);
65 
70 YASM_LIB_DECL
71 /*@only@*/ yasm_intnum *yasm_intnum_create_hex(char *str);
72 
79 YASM_LIB_DECL
80 /*@only@*/ yasm_intnum *yasm_intnum_create_charconst_nasm(const char *str);
81 
88 YASM_LIB_DECL
89 /*@only@*/ yasm_intnum *yasm_intnum_create_charconst_tasm(const char *str);
90 
95 YASM_LIB_DECL
96 /*@only@*/ yasm_intnum *yasm_intnum_create_uint(unsigned long i);
97 
102 YASM_LIB_DECL
103 /*@only@*/ yasm_intnum *yasm_intnum_create_int(long i);
104 
112 YASM_LIB_DECL
114  (const unsigned char *ptr, int sign, /*@out@*/ unsigned long *size);
115 
123 YASM_LIB_DECL
125  (unsigned char *ptr, int sign, size_t srcsize, int bigendian);
126 
131 YASM_LIB_DECL
132 /*@only@*/ yasm_intnum *yasm_intnum_copy(const yasm_intnum *intn);
133 
137 YASM_LIB_DECL
138 void yasm_intnum_destroy(/*@only@*/ yasm_intnum *intn);
139 
148 YASM_LIB_DECL
149 int yasm_intnum_calc(yasm_intnum *acc, yasm_expr_op op, yasm_intnum *operand);
150 
156 YASM_LIB_DECL
157 int yasm_intnum_compare(const yasm_intnum *intn1, const yasm_intnum *intn2);
158 
162 YASM_LIB_DECL
163 void yasm_intnum_zero(yasm_intnum *intn);
164 
169 YASM_LIB_DECL
170 void yasm_intnum_set(yasm_intnum *intn, const yasm_intnum *val);
171 
176 YASM_LIB_DECL
177 void yasm_intnum_set_uint(yasm_intnum *intn, unsigned long val);
178 
183 YASM_LIB_DECL
184 void yasm_intnum_set_int(yasm_intnum *intn, long val);
185 
190 YASM_LIB_DECL
191 int yasm_intnum_is_zero(const yasm_intnum *acc);
192 
197 YASM_LIB_DECL
198 int yasm_intnum_is_pos1(const yasm_intnum *acc);
199 
204 YASM_LIB_DECL
205 int yasm_intnum_is_neg1(const yasm_intnum *acc);
206 
211 YASM_LIB_DECL
212 int yasm_intnum_sign(const yasm_intnum *acc);
213 
221 YASM_LIB_DECL
222 unsigned long yasm_intnum_get_uint(const yasm_intnum *intn);
223 
231 YASM_LIB_DECL
232 long yasm_intnum_get_int(const yasm_intnum *intn);
233 
248 YASM_LIB_DECL
249 void yasm_intnum_get_sized(const yasm_intnum *intn, unsigned char *ptr,
250  size_t destsize, size_t valsize, int shift,
251  int bigendian, int warn);
252 
263 YASM_LIB_DECL
264 int yasm_intnum_check_size(const yasm_intnum *intn, size_t size,
265  size_t rshift, int rangetype);
266 
273 YASM_LIB_DECL
274 int yasm_intnum_in_range(const yasm_intnum *intn, long low, long high);
275 
282 YASM_LIB_DECL
283 unsigned long yasm_intnum_get_leb128(const yasm_intnum *intn,
284  unsigned char *ptr, int sign);
285 
291 YASM_LIB_DECL
292 unsigned long yasm_intnum_size_leb128(const yasm_intnum *intn, int sign);
293 
299 YASM_LIB_DECL
300 unsigned long yasm_get_sleb128(long v, unsigned char *ptr);
301 
306 YASM_LIB_DECL
307 unsigned long yasm_size_sleb128(long v);
308 
314 YASM_LIB_DECL
315 unsigned long yasm_get_uleb128(unsigned long v, unsigned char *ptr);
316 
321 YASM_LIB_DECL
322 unsigned long yasm_size_uleb128(unsigned long v);
323 
330 YASM_LIB_DECL
331 /*@only@*/ char *yasm_intnum_get_str(const yasm_intnum *intn);
332 
337 YASM_LIB_DECL
338 void yasm_intnum_print(const yasm_intnum *intn, FILE *f);
339 
340 #endif