From c532202e4d9c4707cc8708b50607f246f359aac3 Mon Sep 17 00:00:00 2001 From: jaortega Date: Fri, 9 Mar 2001 00:14:21 +0000 Subject: partial gui functionality implemented --- mixlib/mix_types.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'mixlib/mix_types.c') diff --git a/mixlib/mix_types.c b/mixlib/mix_types.c index 4baa4f0..79e0bb6 100644 --- a/mixlib/mix_types.c +++ b/mixlib/mix_types.c @@ -476,6 +476,18 @@ mix_word_print_to_file (mix_word_t word, const char *message, FILE *f) fprintf (f, "(%010ld)", mix_word_magnitude (word)); } +void +mix_word_print_to_buffer (mix_word_t word, gchar *buf) +{ + guint k; + g_return_if_fail (buf != NULL); + sprintf (buf, "%s ", mix_word_sign (word) == 0 ? "+" : "-"); + for ( k = 1; k < 6; ++k ) { + sprintf (buf + 2 + 3 * (k -1), "%02d ", mix_word_get_byte (word,k)); + } + /* sprintf (buf, "(%010ld)", mix_word_magnitude (word));*/ +} + /* Conversions between words and shorts */ mix_short_t mix_word_to_short (mix_word_t word) @@ -538,6 +550,16 @@ mix_short_print (mix_short_t s, const gchar *message) g_print ("(%04d)", mix_short_magnitude (s)); } +void +mix_short_print_to_buffer (mix_short_t s, gchar *buf) +{ + g_return_if_fail (buf != NULL); + sprintf (buf, "%s %02d %02d", + mix_short_sign (s) == 0 ? "+" : "-", + mix_byte_new (s>>6), mix_byte_new (s)); + /* g_print ("(%04d)", mix_short_magnitude (s));*/ +} + -- cgit v1.2.3