diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2001-09-02 00:49:29 +0000 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2001-09-02 00:49:29 +0000 |
commit | 9971f4ed145c30f6dd27617cdb134b63e65b1cc9 (patch) | |
tree | 2b4c6c40c24d6bb423292bf74ff09416c49bf020 | |
parent | d8ff337568f9cda78317ca08895c1f15ee4d9f89 (diff) | |
download | mdk-9971f4ed145c30f6dd27617cdb134b63e65b1cc9.tar.gz mdk-9971f4ed145c30f6dd27617cdb134b63e65b1cc9.tar.bz2 |
new procedures mix-src-line, mix-src-line-no
-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}, |