libyasm

libyasm/intnum.h

Go to the documentation of this file.
00001 
00030 #ifndef YASM_INTNUM_H
00031 #define YASM_INTNUM_H
00032 
00033 #ifndef YASM_LIB_DECL
00034 #define YASM_LIB_DECL
00035 #endif
00036 
00038 YASM_LIB_DECL
00039 void yasm_intnum_initialize(void);
00040 
00042 YASM_LIB_DECL
00043 void yasm_intnum_cleanup(void);
00044 
00049 YASM_LIB_DECL
00050 /*@only@*/ yasm_intnum *yasm_intnum_create_dec(char *str);
00051 
00056 YASM_LIB_DECL
00057 /*@only@*/ yasm_intnum *yasm_intnum_create_bin(char *str);
00058 
00063 YASM_LIB_DECL
00064 /*@only@*/ yasm_intnum *yasm_intnum_create_oct(char *str);
00065 
00070 YASM_LIB_DECL
00071 /*@only@*/ yasm_intnum *yasm_intnum_create_hex(char *str);
00072 
00079 YASM_LIB_DECL
00080 /*@only@*/ yasm_intnum *yasm_intnum_create_charconst_nasm(const char *str);
00081 
00088 YASM_LIB_DECL
00089 /*@only@*/ yasm_intnum *yasm_intnum_create_charconst_tasm(const char *str);
00090 
00095 YASM_LIB_DECL
00096 /*@only@*/ yasm_intnum *yasm_intnum_create_uint(unsigned long i);
00097 
00102 YASM_LIB_DECL
00103 /*@only@*/ yasm_intnum *yasm_intnum_create_int(long i);
00104 
00112 YASM_LIB_DECL
00113 /*@only@*/ yasm_intnum *yasm_intnum_create_leb128
00114     (const unsigned char *ptr, int sign, /*@out@*/ unsigned long *size);
00115 
00123 YASM_LIB_DECL
00124 /*@only@*/ yasm_intnum *yasm_intnum_create_sized
00125     (unsigned char *ptr, int sign, size_t srcsize, int bigendian);
00126 
00131 YASM_LIB_DECL
00132 /*@only@*/ yasm_intnum *yasm_intnum_copy(const yasm_intnum *intn);
00133 
00137 YASM_LIB_DECL
00138 void yasm_intnum_destroy(/*@only@*/ yasm_intnum *intn);
00139 
00148 YASM_LIB_DECL
00149 int yasm_intnum_calc(yasm_intnum *acc, yasm_expr_op op, yasm_intnum *operand);
00150 
00156 YASM_LIB_DECL
00157 int yasm_intnum_compare(const yasm_intnum *intn1, const yasm_intnum *intn2);
00158 
00162 YASM_LIB_DECL
00163 void yasm_intnum_zero(yasm_intnum *intn);
00164 
00169 YASM_LIB_DECL
00170 void yasm_intnum_set(yasm_intnum *intn, const yasm_intnum *val);
00171 
00176 YASM_LIB_DECL
00177 void yasm_intnum_set_uint(yasm_intnum *intn, unsigned long val);
00178 
00183 YASM_LIB_DECL
00184 void yasm_intnum_set_int(yasm_intnum *intn, long val);
00185 
00190 YASM_LIB_DECL
00191 int yasm_intnum_is_zero(const yasm_intnum *acc);
00192 
00197 YASM_LIB_DECL
00198 int yasm_intnum_is_pos1(const yasm_intnum *acc);
00199 
00204 YASM_LIB_DECL
00205 int yasm_intnum_is_neg1(const yasm_intnum *acc);
00206 
00211 YASM_LIB_DECL
00212 int yasm_intnum_sign(const yasm_intnum *acc);
00213 
00221 YASM_LIB_DECL
00222 unsigned long yasm_intnum_get_uint(const yasm_intnum *intn);
00223 
00231 YASM_LIB_DECL
00232 long yasm_intnum_get_int(const yasm_intnum *intn);
00233 
00248 YASM_LIB_DECL
00249 void yasm_intnum_get_sized(const yasm_intnum *intn, unsigned char *ptr,
00250                            size_t destsize, size_t valsize, int shift,
00251                            int bigendian, int warn);
00252 
00263 YASM_LIB_DECL
00264 int yasm_intnum_check_size(const yasm_intnum *intn, size_t size,
00265                            size_t rshift, int rangetype);
00266 
00273 YASM_LIB_DECL
00274 int yasm_intnum_in_range(const yasm_intnum *intn, long low, long high);
00275 
00282 YASM_LIB_DECL
00283 unsigned long yasm_intnum_get_leb128(const yasm_intnum *intn,
00284                                      unsigned char *ptr, int sign);
00285 
00291 YASM_LIB_DECL
00292 unsigned long yasm_intnum_size_leb128(const yasm_intnum *intn, int sign);
00293 
00299 YASM_LIB_DECL
00300 unsigned long yasm_get_sleb128(long v, unsigned char *ptr);
00301 
00306 YASM_LIB_DECL
00307 unsigned long yasm_size_sleb128(long v);
00308 
00314 YASM_LIB_DECL
00315 unsigned long yasm_get_uleb128(unsigned long v, unsigned char *ptr);
00316 
00321 YASM_LIB_DECL
00322 unsigned long yasm_size_uleb128(unsigned long v);
00323 
00330 YASM_LIB_DECL
00331 /*@only@*/ char *yasm_intnum_get_str(const yasm_intnum *intn);
00332 
00337 YASM_LIB_DECL
00338 void yasm_intnum_print(const yasm_intnum *intn, FILE *f);
00339 
00340 #endif