summaryrefslogtreecommitdiffhomepage
path: root/mixlib/mix_types.c
diff options
context:
space:
mode:
authorjaortega <jaortega>2001-03-09 00:14:21 +0000
committerjaortega <jaortega>2001-03-09 00:14:21 +0000
commitc532202e4d9c4707cc8708b50607f246f359aac3 (patch)
tree2293b67b3be8cc49eb0829ffede6c60468feee41 /mixlib/mix_types.c
parent13884bea299129048c1912510292d1207f520323 (diff)
downloadmdk-c532202e4d9c4707cc8708b50607f246f359aac3.tar.gz
mdk-c532202e4d9c4707cc8708b50607f246f359aac3.tar.bz2
partial gui functionality implemented
Diffstat (limited to 'mixlib/mix_types.c')
-rw-r--r--mixlib/mix_types.c22
1 files changed, 22 insertions, 0 deletions
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));*/
+}
+