From 7ec295f319608ec045e73877ff8727a0e25722c1 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Wed, 22 Aug 2001 00:42:13 +0000 Subject: mixguile: first version --- mixlib/mix_vm_command.c | 26 +++++++++++++++++++++++++- mixlib/mix_vm_command.h | 8 ++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) (limited to 'mixlib') diff --git a/mixlib/mix_vm_command.c b/mixlib/mix_vm_command.c index e9e3751..dd0bb2d 100644 --- a/mixlib/mix_vm_command.c +++ b/mixlib/mix_vm_command.c @@ -258,7 +258,7 @@ mix_vm_cmd_dispatcher_new (FILE *out_fd, /* output messages file */ mix_vm_cmd_dispatcher_t *result = NULL; int k; - g_return_val_if_fail (out_fd && err_fd, NULL); + /* g_return_val_if_fail (out_fd && err_fd, NULL); */ result = g_new (mix_vm_cmd_dispatcher_t, 1); result->result = TRUE; @@ -364,6 +364,30 @@ mix_vm_cmd_dispatcher_delete (mix_vm_cmd_dispatcher_t *dis) g_free (dis); } +/* set/get out/error streams */ +FILE * /* old output stream */ +mix_vm_cmd_dispatcher_set_out_stream (mix_vm_cmd_dispatcher_t *dis, FILE *out) +{ + FILE *old = NULL; + g_return_val_if_fail (dis != NULL, old); + old = dis->out; + dis->out = out; + dis->dump->channel = out; + return old; +} + +FILE * /* old error stream */ +mix_vm_cmd_dispatcher_set_error_stream (mix_vm_cmd_dispatcher_t *dis, + FILE *err) +{ + FILE *old = NULL; + g_return_val_if_fail (dis != NULL, old); + old = dis->err; + dis->err = err; + return old; +} + + /* set editor and compiler templates */ void mix_vm_cmd_dispatcher_set_editor (mix_vm_cmd_dispatcher_t *dis, diff --git a/mixlib/mix_vm_command.h b/mixlib/mix_vm_command.h index 5d5ebca..4603f78 100644 --- a/mixlib/mix_vm_command.h +++ b/mixlib/mix_vm_command.h @@ -118,6 +118,14 @@ mix_vm_cmd_dispatcher_new_with_config (FILE *out, FILE *err, extern void mix_vm_cmd_dispatcher_delete (mix_vm_cmd_dispatcher_t *dis); +/* set/get out/error streams */ +extern FILE * /* old output stream */ +mix_vm_cmd_dispatcher_set_out_stream (mix_vm_cmd_dispatcher_t *dis, + FILE *out); + +extern FILE * /* old error stream */ +mix_vm_cmd_dispatcher_set_error_stream (mix_vm_cmd_dispatcher_t *dis, + FILE *err); /* set editor and compiler templates */ extern void -- cgit v1.2.3