From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29664 invoked from network); 25 Nov 1999 08:37:36 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Nov 1999 08:37:36 -0000 Received: (qmail 5571 invoked by alias); 25 Nov 1999 08:37:30 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8776 Received: (qmail 5564 invoked from network); 25 Nov 1999 08:37:29 -0000 Date: Thu, 25 Nov 1999 09:37:24 +0100 (MET) Message-Id: <199911250837.JAA32574@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Sven Wischnowsky's message of Wed, 24 Nov 1999 17:00:47 +0100 (MET) Subject: Re: PATCH: module non-loading I wrote: > This patch tries to make modules behave the same independent of the > way they are made available: linked in or dynamically loaded. Two small additions/fixes: - In a static shell, trying to load an unknown module should produce a error message. - bltinmods.list should contain #ifdef-DYNAMICs for the sake of static shells (so that the autoload stuff for not linked-in modules isn't added by them). The zshxmods.h stuff (the #ifdef stuff in init.c) looks ok, btw. But it looks like shooting sparrows with cannons (is this a proverb in English, too?). All the mess could be replaced with just the variable definitions and a bit of setup code that just look if the zle module is available (by looking if the bindkey builtin is made autoloaded from a module named zle or something). Or we just make one of the scripts look out for the zle module on the fly. Hm. Bye Sven diff -u oldsrc/mkbltnmlst.sh Src/mkbltnmlst.sh --- oldsrc/mkbltnmlst.sh Wed Nov 24 17:07:10 1999 +++ Src/mkbltnmlst.sh Thu Nov 25 09:08:26 1999 @@ -20,7 +20,16 @@ exec > $1 for x_mod in $x_mods; do - echo "/* non-linked-in known module \`$x_mod' */" + case "$bin_mods" in + *" $x_mod "*) + echo "/* linked-in known module \`$x_mod' */" + linked=yes + ;; + *) + echo "#ifdef DYNAMIC" + echo "/* non-linked-in known module \`$x_mod' */" + linked=no + esac eval "loc=\$loc_$x_mod" unset moddeps autobins autoinfixconds autoprefixconds autoparams unset automathfuncs @@ -43,6 +52,7 @@ for dep in $moddeps; do echo " add_dep(\"$x_mod\", \"$dep\");" done + test "x$linked" = xno && echo "#endif" done echo diff -u oldsrc/module.c Src/module.c --- oldsrc/module.c Wed Nov 24 17:06:24 1999 +++ Src/module.c Thu Nov 25 09:28:14 1999 @@ -444,6 +444,8 @@ static void * do_load_module(char const *name) { + zerr("failed to load module: %s", name, 0); + return NULL; } -- Sven Wischnowsky wischnow@informatik.hu-berlin.de