diff options
Diffstat (limited to 'mixguile/xmixguile_cmd_dispatcher.c')
-rw-r--r-- | mixguile/xmixguile_cmd_dispatcher.c | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/mixguile/xmixguile_cmd_dispatcher.c b/mixguile/xmixguile_cmd_dispatcher.c index 78fbce2..ae383ac 100644 --- a/mixguile/xmixguile_cmd_dispatcher.c +++ b/mixguile/xmixguile_cmd_dispatcher.c @@ -1,28 +1,31 @@ /* -*-c-*- -------------- xmixguile_cmd_dispatcher.c : * Implementation of the functions declared in xmixguile_cmd_dispatcher.h * ------------------------------------------------------------------ - * $Id: xmixguile_cmd_dispatcher.c,v 1.9 2002/04/09 23:28:19 jao Exp $ + * $Id: xmixguile_cmd_dispatcher.c,v 1.10 2003/04/06 13:27:42 jao Exp $ * ------------------------------------------------------------------ - * Copyright (C) 2001, 2002 Free Software Foundation, Inc. - * + * Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * + * */ +#include <string.h> + #include <mixlib/mix.h> #include <guile/gh.h> + #include "xmixguile_cmd_dispatcher.h" /* cmd dispatcher for use within the scm commands */ @@ -62,7 +65,7 @@ mixvm_cmd_ (SCM cmd, SCM arg) char *com = NULL, *argu = NULL; int len; gboolean result; - + SCM_ASSERT (SCM_STRINGP (cmd) || SCM_SYMBOLP (cmd), cmd, SCM_ARG1, "mixvm-cmd"); SCM_ASSERT (SCM_STRINGP (arg) || SCM_SYMBOLP (arg), @@ -114,7 +117,7 @@ mix_reg_ (SCM reg) char *regis; int len; long val = MIX_WORD_MAX + 1; - + SCM_ASSERT (SCM_STRINGP (reg) || SCM_SYMBOLP (reg), reg, SCM_ARG1, "mix-reg"); SCM_DEFER_INTS; @@ -141,7 +144,7 @@ mix_reg_ (SCM reg) SCM_ALLOW_INTS; SCM_ASSERT (val <= MIX_WORD_MAX, reg, SCM_ARG1, "mix-reg"); - + return gh_long2scm (val); } @@ -152,11 +155,11 @@ mix_set_reg_ (SCM reg, SCM value) int len; long val; gboolean result = TRUE; - + SCM_ASSERT (SCM_STRINGP (reg) || SCM_SYMBOLP (reg), reg, SCM_ARG1, "mix-set-reg!"); SCM_ASSERT (SCM_NUMBERP (value), value, SCM_ARG2, "mix-set-reg!"); - + SCM_DEFER_INTS; regis = gh_scm2newstr (reg, &len); val = gh_scm2long (value); @@ -183,7 +186,7 @@ mix_set_reg_ (SCM reg, SCM value) SCM_ALLOW_INTS; SCM_ASSERT (result, reg, SCM_ARG1, "mix-set-reg!"); - + return gh_symbol2scm ("ok"); } @@ -192,7 +195,7 @@ mix_cell_ (SCM no) { int cell; long result; - + SCM_ASSERT (SCM_NUMBERP (no), no, SCM_ARG1, "mix-cell"); cell = gh_scm2int (no); SCM_ASSERT (cell < MIX_VM_CELL_NO, no, SCM_ARG1, "mix-cell"); @@ -205,7 +208,7 @@ mix_set_cell_ (SCM no, SCM val) { int cell; long result; - + SCM_ASSERT (SCM_NUMBERP (no), no, SCM_ARG1, "mix-set-cell!"); SCM_ASSERT (SCM_NUMBERP (val), no, SCM_ARG2, "mix-set-cell!"); cell = gh_scm2int (no); @@ -254,10 +257,10 @@ mix_set_cmp_ (SCM value) gchar *val = NULL; int len; mix_cmpflag_t result = -1; - + SCM_ASSERT (SCM_STRINGP (value) || SCM_SYMBOLP (value), value, SCM_ARG1, "mix-set-cmp!"); - + SCM_DEFER_INTS; val = gh_scm2newstr (value, &len); if (strlen (val) == 1) @@ -341,9 +344,9 @@ mix_src_line_ (SCM opt) } else no = mix_vm_cmd_dispatcher_get_src_file_lineno (vm_dispatcher_); - + SCM_ASSERT (line >= 0, opt, SCM_ARG1, "mix-src-line"); - + if (no > 0) line = mix_vm_cmd_dispatcher_get_src_file_line (vm_dispatcher_, no, FALSE); @@ -455,7 +458,7 @@ mix_add_hook_ (SCM cmd, SCM function, gboolean pre) mix_vm_command_t command; int len; const gchar *fun = pre? "mix-add-pre-hook" : "mix-add-post-hook"; - + SCM_ASSERT (SCM_STRINGP (cmd) || SCM_SYMBOLP (cmd), cmd, SCM_ARG1, fun); SCM_ASSERT (gh_procedure_p (function), function, SCM_ARG2, fun); SCM_DEFER_INTS; @@ -482,7 +485,7 @@ mix_add_global_hook_ (SCM function, gboolean pre) { const gchar *fun = pre? "mix-add-global-pre-hook" : "mix-add-global-post-hook"; - + SCM_ASSERT (gh_procedure_p (function), function, SCM_ARG1, fun); SCM_DEFER_INTS; if (pre) |