mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
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 ().
This commit is contained in:
parent
46d2d6f80e
commit
dc68fdb961
3 changed files with 21 additions and 2 deletions
|
@ -1783,8 +1783,7 @@
|
|||
;;; The directory of all modules and the standard root module.
|
||||
;;;
|
||||
|
||||
(define (module-public-interface m)
|
||||
(module-ref m '%module-public-interface #f))
|
||||
;; module-public-interface is defined in C.
|
||||
(define (set-module-public-interface! m i)
|
||||
(module-define! m '%module-public-interface i))
|
||||
(define (set-system-module! m s)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -100,6 +100,7 @@ SCM_API void scm_c_export (const char *name, ...);
|
|||
|
||||
SCM_API SCM scm_sym2var (SCM sym, SCM thunk, SCM definep);
|
||||
|
||||
SCM_API SCM scm_module_public_interface (SCM module);
|
||||
SCM_API SCM scm_module_import_interface (SCM module, SCM sym);
|
||||
SCM_API SCM scm_module_lookup_closure (SCM module);
|
||||
SCM_API SCM scm_module_transformer (SCM module);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue