* Possible operations on integer values.
*/
typedef enum {
- SC_ADD = 0, /**< Addition */
- SC_SUB, /**< Substraction */
- SC_NEG, /**< Unary Minus */
- SC_MUL, /**< Multiplication */
- SC_DIV, /**< Integer Division (with rounding toward zero ?) */
- SC_MOD, /**< Devision Remainder */
- SC_SHL, /**< Left Shift */
- SC_SHR, /**< Logical (unsigned) Right Shift */
- SC_SHRS, /**< Arithmetic (signed) Right Shift */
- SC_ROT, /**< Rotation (both directions) */
- SC_AND, /**< Bitwise And */
- SC_OR, /**< Bitwise Or */
- SC_NOT, /**< Bitwise Not */
- SC_XOR, /**< Bitwise Exclusive Or */
+ SC_ADD = 0, /**< Addition */
+ SC_SUB, /**< Substraction */
+ SC_NEG, /**< Unary Minus */
+ SC_MUL, /**< Multiplication */
+ SC_DIV, /**< Integer Division (with rounding toward zero ?) */
+ SC_MOD, /**< Devision Remainder */
+ SC_SHL, /**< Left Shift */
+ SC_SHR, /**< Logical (unsigned) Right Shift */
+ SC_SHRS, /**< Arithmetic (signed) Right Shift */
+ SC_ROT, /**< Rotation (both directions) */
+ SC_AND, /**< Bitwise And */
+ SC_OR, /**< Bitwise Or */
+ SC_NOT, /**< Bitwise Not */
+ SC_XOR /**< Bitwise Exclusive Or */
} sc_op_t;
/**
* The output mode for ntger values.
*/
enum base_t {
- SC_hex, /**< hexadecimal output with small letters */
- SC_HEX, /**< hexadecimal output with BIG letters */
- SC_DEC, /**< decimal output */
- SC_OCT, /**< octal output */
- SC_BIN /**< binary output */
+ SC_hex, /**< hexadecimal output with small letters */
+ SC_HEX, /**< hexadecimal output with BIG letters */
+ SC_DEC, /**< decimal output */
+ SC_OCT, /**< octal output */
+ SC_BIN /**< binary output */
};
/*
/**
* Converts a tarval into a string.
*
- * @param val1 the value pointer
- * @param bits number of valid bits in this value
- * @param base output base
+ * @param val1 the value pointer
+ * @param bits number of valid bits in this value
+ * @param base output base
*/
const char *sc_print(const void *val1, unsigned bits, enum base_t base);
* for calculations. The reason for being multiples of 8 eludes me
*/
void init_strcalc(int precision_in_bytes);
+void finish_strcalc(void);
int sc_get_precision(void);
#endif /* _STRCALC_H_ */