diff options
author | Andy Wingo <wingo@pobox.com> | 2008-09-29 21:36:25 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2008-09-29 21:36:25 +0200 |
commit | dc68fdb961f1116c67c797ca07889ae21de40492 (patch) | |
tree | 2c48eff43727e407a94c252b33d08d9abe5c3424 /libguile/modules.c | |
parent | 46d2d6f80ebbb18e787434c4bfe2031f6182f652 (diff) | |
download | guile-dc68fdb961f1116c67c797ca07889ae21de40492.tar.gz |
move module-public-interface to C, and expose it as C API
* libguile/modules.h:
* libguile/modules.c:
* ice-9/boot-9.scm (module-public-interface): Move definition of
module-public-interface to C, where it is now available as
scm_module_public_interface ().
Diffstat (limited to 'libguile/modules.c')
-rw-r--r-- | libguile/modules.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libguile/modules.c b/libguile/modules.c index d99d3e472..92fa4d365 100644 --- a/libguile/modules.c +++ b/libguile/modules.c @@ -620,6 +620,25 @@ SCM_DEFINE (scm_module_import_interface, "module-import-interface", 2, 0, 0, } #undef FUNC_NAME +SCM_SYMBOL (sym_sys_module_public_interface, "%module-public-interface"); + +SCM_DEFINE (scm_module_public_interface, "module-public-interface", 1, 0, 0, + (SCM module), + "Return the public interface of @var{module}.\n\n" + "If @var{module} has no public interface, @code{#f} is returned.") +#define FUNC_NAME s_scm_module_public_interface +{ + SCM var; + + SCM_VALIDATE_MODULE (1, module); + var = scm_module_local_variable (module, sym_sys_module_public_interface); + if (scm_is_true (var)) + return SCM_VARIABLE_REF (var); + else + return SCM_BOOL_F; +} +#undef FUNC_NAME + /* scm_sym2var * * looks up the variable bound to SYM according to PROC. PROC should be |