1998-04-10 06:59:06 -04:00
|
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
* m o d u l e . h -- A simple module sytem
|
|
|
|
|
*
|
1999-09-05 07:16:41 -04:00
|
|
|
|
* Copyright <EFBFBD> 1993-1999 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
1998-04-10 06:59:06 -04:00
|
|
|
|
*
|
|
|
|
|
*
|
1999-09-05 07:16:41 -04:00
|
|
|
|
* Permission to use, copy, modify, distribute,and license this
|
|
|
|
|
* software and its documentation for any purpose is hereby granted,
|
|
|
|
|
* provided that existing copyright notices are retained in all
|
|
|
|
|
* copies and that this notice is included verbatim in any
|
|
|
|
|
* distributions. No written agreement, license, or royalty fee is
|
|
|
|
|
* required for any of the authorized uses.
|
|
|
|
|
* This software is provided ``AS IS'' without express or implied
|
|
|
|
|
* warranty.
|
1998-04-10 06:59:06 -04:00
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* Author: Erick Gallesio [eg@kaolin.unice.fr]
|
|
|
|
|
* Creation date: 13-Mar-1997 20:11
|
1999-09-05 07:16:41 -04:00
|
|
|
|
* Last file update: 3-Sep-1999 20:21 (eg)
|
1998-04-10 06:59:06 -04:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
struct module_info {
|
|
|
|
|
SCM name; /* module name */
|
|
|
|
|
SCM exported_symbols; /* symbols declared as exported */
|
|
|
|
|
SCM imports; /* imported modules */
|
|
|
|
|
SCM env; /* module environment */
|
|
|
|
|
SCM ref_module; /* module associated to a fake one */
|
|
|
|
|
int export_all; /* #t if all symbols are exported */
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define MOD_TABLE(x) ((x)->storage_as.module.t)
|
|
|
|
|
#define MOD_INFO(x) ((x)->storage_as.module.data)
|
|
|
|
|
#define LMOD_INFO(x) ((struct module_info*)MOD_INFO(x))
|
|
|
|
|
|
|
|
|
|
#define MOD_NAME(x) (LMOD_INFO(x)->name)
|
|
|
|
|
#define MOD_EXPORTS(x) (LMOD_INFO(x)->exported_symbols)
|
|
|
|
|
#define MOD_IMPORTED(x) (LMOD_INFO(x)->imports)
|
|
|
|
|
#define MOD_ENV(x) (LMOD_INFO(x)->env)
|
|
|
|
|
#define MOD_REFMOD(x) (LMOD_INFO(x)->ref_module)
|
|
|
|
|
#define MOD_EXPORTALL(x) (LMOD_INFO(x)->export_all)
|
|
|
|
|
#ifdef USE_STKLOS
|
1998-09-30 07:11:02 -04:00
|
|
|
|
# define MOD_CLASSES(x) (LMOD_INFO(x)->classes)
|
1998-04-10 06:59:06 -04:00
|
|
|
|
#endif
|
|
|
|
|
#define FAKE_MODULEP(x) (!MOD_TABLE(x))
|
|
|
|
|
#define FIND_TABLE(m) (MOD_TABLE(MOD_TABLE(m) ? m : MOD_REFMOD(m)))
|
|
|
|
|
|
|
|
|
|
|