summaryrefslogtreecommitdiffhomepage
path: root/mixlib
diff options
context:
space:
mode:
authorjaortega <jaortega>2000-12-20 00:59:20 +0000
committerjaortega <jaortega>2000-12-20 00:59:20 +0000
commitcf68b09511481dbafcd625b8dec4603d4126599f (patch)
treeb5ddf8db011bd534fab1b8127471a12e5dd0effb /mixlib
parent37bb3b675d3a9bcb492b9a1e1e19860228f8a8ca (diff)
downloadmdk-cf68b09511481dbafcd625b8dec4603d4126599f.tar.gz
mdk-cf68b09511481dbafcd625b8dec4603d4126599f.tar.bz2
(mix_ins_to_string_in_buffer) new function
Diffstat (limited to 'mixlib')
-rw-r--r--mixlib/mix_ins.c26
-rw-r--r--mixlib/mix_ins.h3
2 files changed, 29 insertions, 0 deletions
diff --git a/mixlib/mix_ins.c b/mixlib/mix_ins.c
index c5fcaf7..90ca15d 100644
--- a/mixlib/mix_ins.c
+++ b/mixlib/mix_ins.c
@@ -246,6 +246,32 @@ mix_ins_to_string(const mix_ins_t *ins)
return result;
}
+extern void
+mix_ins_to_string_in_buffer (const mix_ins_t *ins, gchar *buf, guint len)
+{
+ gboolean needs_f;
+ mix_ins_id_t id;
+
+ g_return_if_fail (ins != NULL);
+ g_return_if_fail (buf != NULL);
+ id = mix_ins_id_from_ins(*ins);
+ needs_f = ins->fspec != id_to_desc_[id].def_fspec;
+ if ( needs_f )
+ g_snprintf (buf, len, "%s\t%s%d,%d(%d:%d)",
+ mix_get_string_from_id(id),
+ mix_short_is_negative(ins->address)?"-":"",
+ mix_short_magnitude(ins->address), ins->index,
+ mix_fspec_left(ins->fspec),
+ mix_fspec_right(ins->fspec));
+ else
+ g_snprintf(buf, len, "%s\t%s%d,%d",
+ mix_get_string_from_id(id),
+ mix_short_is_negative(ins->address)?"-":"",
+ mix_short_magnitude(ins->address), ins->index);
+}
+
+
+
void
mix_ins_print(const mix_ins_t *ins)
{
diff --git a/mixlib/mix_ins.h b/mixlib/mix_ins.h
index d0829e5..065b342 100644
--- a/mixlib/mix_ins.h
+++ b/mixlib/mix_ins.h
@@ -173,6 +173,9 @@ extern gchar * /* this pointer must be freed by caller */
mix_ins_to_string(const mix_ins_t *ins);
extern void
+mix_ins_to_string_in_buffer (const mix_ins_t *ins, gchar *buf, guint len);
+
+extern void
mix_ins_print(const mix_ins_t *ins);