#ifndef _STRCALC_H_
#define _STRCALC_H_
+#include "irmode.h"
+
#ifdef STRCALC_DEBUG_ALL /* switch on all debug options */
# ifndef STRCALC_DEBUG
# define STRCALC_DEBUG /* switch on debug output */
* function declarations
*/
const void *sc_get_buffer(void);
-const int sc_get_buffer_length(void);
+int sc_get_buffer_length(void);
+
+void sign_extend(char *calc_buffer, ir_mode *mode);
+
+/** create an value form a string representation */
+void sc_val_from_str(const char *str, unsigned int len, void *buffer, ir_mode *mode);
-void sc_val_from_str(const char *str, unsigned int len, void *buffer);
+/** create a value from a long */
void sc_val_from_long(long l, void *buffer);
+
+/** create a value form an unsigned long */
void sc_val_from_ulong(unsigned long l, void *buffer);
+
+/** converts a value to a long */
long sc_val_to_long(const void *val);
void sc_min_from_bits(unsigned int num_bits, unsigned int sign, void *buffer);
void sc_max_from_bits(unsigned int num_bits, unsigned int sign, void *buffer);
/**
* 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
+ * @param signed_mode print it signed (only decimal mode supported
*/
-const char *sc_print(const void *val1, unsigned bits, enum base_t base);
+const char *sc_print(const void *val1, unsigned bits, enum base_t base, int signed_mode);
/** Initialize the strcalc module.
* Sets up internal data structures and constants