summaryrefslogtreecommitdiff
path: root/libguile/modules.h
diff options
context:
space:
mode:
authorMikael Djurfeldt <djurfeldt@nada.kth.se>2000-08-11 08:44:16 +0000
committerMikael Djurfeldt <djurfeldt@nada.kth.se>2000-08-11 08:44:16 +0000
commitb486ccc869a9c12df574a93f1c40726333383bcb (patch)
tree674aed1c475e1854dd455471d754a5061cbfb749 /libguile/modules.h
parente3365c07da4368e533584d7d3103a8042a5fea32 (diff)
downloadguile-b486ccc869a9c12df574a93f1c40726333383bcb.tar.gz
* modules.h (SCM_MODULEP, SCM_VALIDATE_MODULE,
SCM_MODULE_OBARRAY, SCM_MODULE_USES, SCM_MODULE_BINDER, SCM_MODULE_EVAL_CLOSURE): New macros. (scm_module_index_obarray, scm_module_index_uses, scm_module_index_binder, scm_module_index_eval_closure): New constants; #include "validate.h".
Diffstat (limited to 'libguile/modules.h')
-rw-r--r--libguile/modules.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/libguile/modules.h b/libguile/modules.h
index 9ed8d49d7..9e7f8eb11 100644
--- a/libguile/modules.h
+++ b/libguile/modules.h
@@ -46,10 +46,41 @@
#include "libguile/__scm.h"
+#include "libguile/validate.h"
+
+#define SCM_MODULEP(OBJ) \
+ (SCM_NIMP (OBJ) && SCM_CELL_TYPE (OBJ) == scm_module_tag)
+
+#define SCM_VALIDATE_MODULE(pos, scm) SCM_MAKE_VALIDATE (pos, scm, MODULEP)
+
+/* NOTE: Indexes of module fields are dependent upon the definition of
+ * module-type in boot-9.scm.
+ */
+
+#define scm_module_index_obarray 0
+#define scm_module_index_uses 1
+#define scm_module_index_binder 2
+#define scm_module_index_eval_closure 3
+
+#define SCM_MODULE_OBARRAY(module) \
+ SCM_PACK (SCM_STRUCT_DATA (module) [scm_module_index_obarray])
+#define SCM_MODULE_USES(module) \
+ SCM_PACK (SCM_STRUCT_DATA (module) [scm_module_index_uses])
+#define SCM_MODULE_BINDER(module) \
+ SCM_PACK (SCM_STRUCT_DATA (module) [scm_module_index_binder])
+#define SCM_MODULE_EVAL_CLOSURE(module) \
+ SCM_PACK (SCM_STRUCT_DATA (module)[scm_module_index_eval_closure])
+
+
+
+extern SCM scm_module_system_booted_p;
+extern SCM scm_module_tag;
+
extern SCM scm_the_root_module (void);
extern SCM scm_selected_module (void);
+extern SCM scm_interaction_environment (void);
extern SCM scm_select_module (SCM module);
extern SCM scm_make_module (SCM name);
extern SCM scm_ensure_user_module (SCM name);