diff options
-rw-r--r-- | mixguile/xmixguile_cmd_dispatcher.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/mixguile/xmixguile_cmd_dispatcher.c b/mixguile/xmixguile_cmd_dispatcher.c index 3e357a2..8eec209 100644 --- a/mixguile/xmixguile_cmd_dispatcher.c +++ b/mixguile/xmixguile_cmd_dispatcher.c @@ -317,6 +317,33 @@ mix_laptime_ (void) return gh_long2scm (mix_vm_cmd_dispatcher_get_laptime (vm_dispatcher_)); } +static SCM +mix_src_line_ (SCM opt) +{ + gulong no = 0; + const gchar *line = ""; + if (opt != SCM_UNDEFINED) + { + SCM_ASSERT (SCM_NUMBERP (opt), opt, SCM_ARG1, "mix-src-line"); + no = gh_scm2long (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); + + return gh_str02scm ((char *)line); +} + +static SCM +mix_src_line_no_ (void) +{ + return + gh_long2scm (mix_vm_cmd_dispatcher_get_src_file_lineno (vm_dispatcher_)); +} /* ----- hook functions ---- */ /* auxiliar arg list maker */ @@ -499,7 +526,8 @@ const scm_command_t DEFAULT_SCM_COMMANDS_[] = { {"mix-prog-path", mix_prog_path_, 0, 0, 0}, {"mix-src-name", mix_src_name_, 0, 0, 0}, {"mix-src-path", mix_src_path_, 0, 0, 0}, - /* {"mix-src-line-no", mix_src_line_no_, 0, 1, 0}, */ + {"mix-src-line-no", mix_src_line_no_, 0, 0, 0}, + {"mix-src-line", mix_src_line_, 0, 1, 0}, {"mix-ddir", mix_ddir_, 0, 0, 0}, {"mix-set-cmp!", mix_set_cmp_, 1, 0, 0}, {"mix-add-pre-hook", mix_add_pre_hook_, 2, 0, 0}, |