diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2007-05-28 22:57:39 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2007-05-28 22:57:39 +0000 |
commit | b0c5f09169ac31855ebf0e93772bb57b9635b380 (patch) | |
tree | 410c43a9843b2c88166c2cb9acd531eaa36d036d /Src/Modules/zprof.c | |
parent | bd7632079045b1b6d0dee498c40833b409cf757e (diff) | |
download | zsh-b0c5f09169ac31855ebf0e93772bb57b9635b380.tar.gz zsh-b0c5f09169ac31855ebf0e93772bb57b9635b380.tar.xz zsh-b0c5f09169ac31855ebf0e93772bb57b9635b380.zip |
see 23479: add initial features support for modules
Diffstat (limited to 'Src/Modules/zprof.c')
-rw-r--r-- | Src/Modules/zprof.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/Src/Modules/zprof.c b/Src/Modules/zprof.c index ca053a9e9..b30e44432 100644 --- a/Src/Modules/zprof.c +++ b/Src/Modules/zprof.c @@ -295,6 +295,14 @@ static struct funcwrap wrapper[] = { WRAPDEF(zprof_wrapper), }; +static struct features module_features = { + bintab, sizeof(bintab)/sizeof(*bintab), + NULL, 0, + NULL, 0, + NULL, 0, + 0 +}; + /**/ int setup_(Module m) @@ -305,6 +313,21 @@ setup_(Module m) /**/ int +features_(Module m, char ***features) +{ + *features = featuresarray(m->nam, &module_features); + return 0; +} + +/**/ +int +enables_(Module m, int **enables) +{ + return handlefeatures(m->nam, &module_features, enables); +} + +/**/ +int boot_(Module m) { calls = NULL; @@ -312,8 +335,7 @@ boot_(Module m) arcs = NULL; narcs = 0; stack = NULL; - return !(addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)) | - !addwrapper(m, wrapper)); + return addwrapper(m, wrapper); } /**/ @@ -322,9 +344,8 @@ cleanup_(Module m) { freepfuncs(calls); freeparcs(arcs); - deletebuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)); deletewrapper(m, wrapper); - return 0; + return setfeatureenables(m->nam, &module_features, NULL); } /**/ |