zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: module non-loading
Date: Thu, 25 Nov 1999 09:37:24 +0100 (MET)	[thread overview]
Message-ID: <199911250837.JAA32574@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Sven Wischnowsky's message of Wed, 24 Nov 1999 17:00:47 +0100 (MET)


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


             reply	other threads:[~1999-11-25  8:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-25  8:37 Sven Wischnowsky [this message]
1999-11-25 10:59 ` Adam Spiers
  -- strict thread matches above, loose matches on Subject: below --
1999-11-24 16:00 Sven Wischnowsky
1999-11-24 17:57 ` Bart Schaefer
1999-11-25  4:48   ` Tanaka Akira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199911250837.JAA32574@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).