summaryrefslogtreecommitdiffhomepage
path: root/mixlib
diff options
context:
space:
mode:
Diffstat (limited to 'mixlib')
-rw-r--r--mixlib/mix_types.c22
-rw-r--r--mixlib/mix_types.h8
-rw-r--r--mixlib/xmix_device.c4
-rw-r--r--mixlib/xmix_device.h4
4 files changed, 32 insertions, 6 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));*/
+}
+
diff --git a/mixlib/mix_types.h b/mixlib/mix_types.h
index dae6ff8..918046e 100644
--- a/mixlib/mix_types.h
+++ b/mixlib/mix_types.h
@@ -25,7 +25,7 @@
#define MIX_TYPES_H
#include <stdio.h>
-#include <glib.h>
+#include "mix.h"
/* Initialisation function to be called before using the other
* functions in this file
@@ -219,6 +219,9 @@ mix_word_store_field(mix_fspec_t f, mix_word_t from, mix_word_t to);
extern void
mix_word_print_to_file (mix_word_t word, const char *message, FILE *f);
+extern void
+mix_word_print_to_buffer (mix_word_t word, gchar *buf);
+
/*----------------- mix_short_t ------------------------------------------*/
typedef guint16 mix_short_t;
@@ -276,7 +279,8 @@ mix_short_add(mix_short_t x, mix_short_t y);
extern void
mix_short_print(mix_short_t s, const gchar *message);
-
+extern void
+mix_short_print_to_buffer (mix_short_t s, gchar *buf);
diff --git a/mixlib/xmix_device.c b/mixlib/xmix_device.c
index aaf2663..4754015 100644
--- a/mixlib/xmix_device.c
+++ b/mixlib/xmix_device.c
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- xmix_device.c :
* Implementation of the functions declared in xmix_device.h
* ------------------------------------------------------------------
- * Last change: Time-stamp: "01/03/02 00:27:37 jose"
+ * Last change: Time-stamp: "01/03/02 23:14:57 jose"
* ------------------------------------------------------------------
* Copyright (C) 2001 Free Software Foundation, Inc.
*
@@ -51,7 +51,7 @@ const mix_fmode_t FMODES_[] = {
mix_io_RDWRT, mix_io_RDWRT, mix_io_RDWRT, mix_io_RDWRT,
mix_io_RDWRT, mix_io_RDWRT, mix_io_RDWRT, mix_io_RDWRT,
mix_io_RDWRT, mix_io_RDWRT, mix_io_RDWRT, mix_io_RDWRT,
- mix_io_READ, mix_io_WRITE, mix_io_WRITE, mix_io_RDWRT, mix_io_WRITE
+ mix_io_READ, mix_io_WRITE, mix_io_WRITE, mix_io_WRITE, mix_io_WRITE
};
/*
diff --git a/mixlib/xmix_device.h b/mixlib/xmix_device.h
index c3e8a88..45fd7d3 100644
--- a/mixlib/xmix_device.h
+++ b/mixlib/xmix_device.h
@@ -1,7 +1,7 @@
/* -*-c-*- ---------------- xmix_device.h :
* Protected declarations for mix_device_t
* ------------------------------------------------------------------
- * Last change: Time-stamp: <01/03/02 00:30:56 jose>
+ * Last change: Time-stamp: <01/03/02 01:15:22 jose>
* ------------------------------------------------------------------
* Copyright (C) 2001 Free Software Foundation, Inc.
*
@@ -65,7 +65,7 @@ extern const char *DEV_EXT_;
extern const char *DEF_NAMES_[];
/* block sizes for devices */
extern const size_t SIZES_[];
-/* modes for devices */
+/* io modes for devices */
extern const mix_device_mode_t MODES_[];
/* files modes for devices */
extern const mix_fmode_t FMODES_[];