added MOO_MOD_INDEX

This commit is contained in:
hyunghwan.chung 2018-04-09 16:31:11 +00:00
parent 231610a884
commit ad04eaa7b1
6 changed files with 37 additions and 8 deletions

View File

@ -354,6 +354,7 @@ pdfdir = @pdfdir@
prefix = @prefix@ prefix = @prefix@
program_transform_name = @program_transform_name@ program_transform_name = @program_transform_name@
psdir = @psdir@ psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@ srcdir = @srcdir@
@ -584,7 +585,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)" || chmod -R a+r "$(distdir)"
dist-gzip: distdir dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-bzip2: distdir dist-bzip2: distdir
@ -610,7 +611,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \ @echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2 "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-zip: distdir dist-zip: distdir
@ -628,7 +629,7 @@ dist dist-all:
distcheck: dist distcheck: dist
case '$(DIST_ARCHIVES)' in \ case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \ *.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \ *.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \ *.tar.lz*) \
@ -638,7 +639,7 @@ distcheck: dist
*.tar.Z*) \ *.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \ *.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \ *.zip*) \
unzip $(distdir).zip ;;\ unzip $(distdir).zip ;;\
esac esac

14
moo/configure vendored
View File

@ -786,6 +786,7 @@ infodir
docdir docdir
oldincludedir oldincludedir
includedir includedir
runstatedir
localstatedir localstatedir
sharedstatedir sharedstatedir
sysconfdir sysconfdir
@ -881,6 +882,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc' sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com' sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var' localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include' includedir='${prefix}/include'
oldincludedir='/usr/include' oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1133,6 +1135,15 @@ do
| -silent | --silent | --silen | --sile | --sil) | -silent | --silent | --silen | --sile | --sil)
silent=yes ;; silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;; ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1270,7 +1281,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \ datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir libdir localedir mandir runstatedir
do do
eval ac_val=\$$ac_var eval ac_val=\$$ac_var
# Remove trailing slashes. # Remove trailing slashes.
@ -1423,6 +1434,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var] --localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib] --libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include] --includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include] --oldincludedir=DIR C header files for non-gcc [/usr/include]

View File

@ -397,6 +397,7 @@ pdfdir = @pdfdir@
prefix = @prefix@ prefix = @prefix@
program_transform_name = @program_transform_name@ program_transform_name = @program_transform_name@
psdir = @psdir@ psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@ srcdir = @srcdir@

View File

@ -337,6 +337,10 @@ int moo_setoption (moo_t* moo, moo_option_t id, const void* value)
moo->option.dfl_procstk_size = *(moo_oow_t*)value; moo->option.dfl_procstk_size = *(moo_oow_t*)value;
return 0; return 0;
} }
case MOO_MOD_INCTX:
moo->option.mod_inctx = *(void**)value;
return 0;
} }
einval: einval:
@ -371,6 +375,10 @@ int moo_getoption (moo_t* moo, moo_option_t id, void* value)
case MOO_PROCSTK_SIZE: case MOO_PROCSTK_SIZE:
*(moo_oow_t*)value = moo->option.dfl_procstk_size; *(moo_oow_t*)value = moo->option.dfl_procstk_size;
return 0; return 0;
case MOO_MOD_INCTX:
*(void**)value = moo->option.mod_inctx;
return 0;
}; };
moo_seterrnum (moo, MOO_EINVAL); moo_seterrnum (moo, MOO_EINVAL);
@ -535,6 +543,7 @@ moo_mod_data_t* moo_openmod (moo_t* moo, const moo_ooch_t* name, moo_oow_t namel
/* found the module in the staic module table */ /* found the module in the staic module table */
MOO_MEMSET (&md, 0, MOO_SIZEOF(md)); MOO_MEMSET (&md, 0, MOO_SIZEOF(md));
md.mod.inctx = moo->option.mod_inctx;
moo_copy_oochars ((moo_ooch_t*)md.mod.name, name, namelen); moo_copy_oochars ((moo_ooch_t*)md.mod.name, name, namelen);
/* Note md.handle is MOO_NULL for a static module */ /* Note md.handle is MOO_NULL for a static module */
@ -579,6 +588,7 @@ moo_mod_data_t* moo_openmod (moo_t* moo, const moo_ooch_t* name, moo_oow_t namel
/* attempt to find a dynamic external module */ /* attempt to find a dynamic external module */
MOO_MEMSET (&md, 0, MOO_SIZEOF(md)); MOO_MEMSET (&md, 0, MOO_SIZEOF(md));
md.mod.inctx = moo->option.mod_inctx;
moo_copy_oochars ((moo_ooch_t*)md.mod.name, name, namelen); moo_copy_oochars ((moo_ooch_t*)md.mod.name, name, namelen);
if (moo->vmprim.dl_open && moo->vmprim.dl_getsym && moo->vmprim.dl_close) if (moo->vmprim.dl_open && moo->vmprim.dl_getsym && moo->vmprim.dl_close)
{ {

View File

@ -95,7 +95,8 @@ enum moo_option_t
MOO_LOG_MAXCAPA, MOO_LOG_MAXCAPA,
MOO_SYMTAB_SIZE, /* default system table size */ MOO_SYMTAB_SIZE, /* default system table size */
MOO_SYSDIC_SIZE, /* default system dictionary size */ MOO_SYSDIC_SIZE, /* default system dictionary size */
MOO_PROCSTK_SIZE /* default process stack size */ MOO_PROCSTK_SIZE, /* default process stack size */
MOO_MOD_INCTX
}; };
typedef enum moo_option_t moo_option_t; typedef enum moo_option_t moo_option_t;
@ -1111,8 +1112,9 @@ typedef void (*moo_mod_gc_t) (
struct moo_mod_t struct moo_mod_t
{ {
/* input */ /* input */
/*const*/ moo_ooch_t name[MOO_MOD_NAME_LEN_MAX + 1]; moo_ooch_t name[MOO_MOD_NAME_LEN_MAX + 1];
/*const*/ int hints; /* bitwised-ORed of moo_mod_hint_t enumerators */ void* inctx;
unsigned int hints; /* bitwised-ORed of moo_mod_hint_t enumerators */
/* user-defined data */ /* user-defined data */
moo_mod_import_t import; moo_mod_import_t import;
@ -1193,6 +1195,8 @@ struct moo_t
moo_oow_t dfl_sysdic_size; moo_oow_t dfl_sysdic_size;
moo_oow_t dfl_procstk_size; moo_oow_t dfl_procstk_size;
void* mod_inctx;
#if defined(MOO_BUILD_DEBUG) #if defined(MOO_BUILD_DEBUG)
/* set automatically when trait is set */ /* set automatically when trait is set */
moo_oow_t karatsuba_cutoff; moo_oow_t karatsuba_cutoff;

View File

@ -423,6 +423,7 @@ pdfdir = @pdfdir@
prefix = @prefix@ prefix = @prefix@
program_transform_name = @program_transform_name@ program_transform_name = @program_transform_name@
psdir = @psdir@ psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@ srcdir = @srcdir@