From 879b84f0f16a441566015902ec34f102c058097b Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sat, 1 Sep 2001 00:19:50 +0000 Subject: new commands: pddir, sddir, ptime, psrc, pprog, pline --- mixlib/xmix_vm_command.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'mixlib/xmix_vm_command.c') diff --git a/mixlib/xmix_vm_command.c b/mixlib/xmix_vm_command.c index 0c0ec8a..32acc92 100644 --- a/mixlib/xmix_vm_command.c +++ b/mixlib/xmix_vm_command.c @@ -21,6 +21,8 @@ * */ +#include +#include #include "xmix_vm_command.h" @@ -29,3 +31,34 @@ const gchar *TRACING_KEY_ = "Tracing"; const gchar *TIMING_KEY_ = "Timing"; const gchar *EDITOR_KEY_ = "Editor"; const gchar *ASM_KEY_ = "Assembler"; +const gchar *LOGGING_KEY_ = "Logs"; + +void +log_message_ (mix_vm_cmd_dispatcher_t *dis, const gchar *fmt, ...) +{ + if (dis && fmt && dis->log_msg && dis->out) + { + va_list args; + va_start (args, fmt); + vfprintf (dis->out, fmt, args); + fprintf (dis->out, "\n"); + va_end (args); + } +} + + +extern void +log_error_ (mix_vm_cmd_dispatcher_t *dis, const gchar *fmt, ...) +{ + enum {BUFF_SIZE = 256}; + static gchar BUFFER[256]; + + if (dis && fmt && dis->err) + { + va_list args; + va_start (args, fmt); + snprintf (BUFFER, BUFF_SIZE, "ERROR: %s\n", fmt); + vfprintf (dis->err, BUFFER, args); + va_end (args); + } +} -- cgit v1.2.3