zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: wrapper functions in modules
  1998-12-10  9:22 PATCH: wrapper functions in modules Sven Wischnowsky
@ 1998-12-10  9:22 ` Peter Stephenson
  1998-12-11  6:59   ` Phil Pennock
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 1998-12-10  9:22 UTC (permalink / raw)
  To: zsh-workers

Sven Wischnowsky wrote:
> Alternatively I could change the code so that a module cannot be
> unloaded if it has defined `after'-functions and there are currently
> shell functions being executed.

Would it be possible for zmodload in such circumstances to mark the
function for unloading after the wrapper has been called, and then do
so?

> I think we could even change the code so that unloading a module
> automatically removes builtins, conditions, and wrapper functions
> defined by it...

It's probably OK leaving that explicitly in the cleanup function until
it gets too unwieldy there.

> And another question: why is the variable containing the paths to
> module-directories named `module_path'? Comparing this with `fpath' I
> would have expected `mpath' (and `MPATH') or something like that.

And someone pointed out MODULE_PATH is a bit generic for a
shell-specific variable, you never know what something else is going
to do with the environment variable.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re:  PATCH: wrapper functions in modules
@ 1998-12-10  9:22 Sven Wischnowsky
  1998-12-10  9:22 ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Wischnowsky @ 1998-12-10  9:22 UTC (permalink / raw)
  To: zsh-workers


I wrote:

> ... [patch for adding wrapper functions in modules]

I forgot to mention it: If a module installs such wrapper functions
and there was a function called which caused the `before'-function to
be executed and the module also has a `after'-function which needs to
be called if the `before'-function was called we might have problems,
since the shell function may unload the module so that the `after'
function will not be called.
So the question is: should we add a convention that the module can
export a function that will be called when trying to unload a module
and which says if the module can currently be unloaded?
Alternatively I could change the code so that a module cannot be
unloaded if it has defined `after'-functions and there are currently
shell functions being executed.
I think we could even change the code so that unloading a module
automatically removes builtins, conditions, and wrapper functions
defined by it...

And another question: why is the variable containing the paths to
module-directories named `module_path'? Comparing this with `fpath' I
would have expected `mpath' (and `MPATH') or something like that.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PATCH: wrapper functions in modules
  1998-12-10  9:22 ` Peter Stephenson
@ 1998-12-11  6:59   ` Phil Pennock
  1998-12-11  8:46     ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Pennock @ 1998-12-11  6:59 UTC (permalink / raw)
  To: zsh-workers

Typing away merrily, Peter Stephenson produced the immortal words:
> And someone pointed out MODULE_PATH is a bit generic for a
> shell-specific variable, you never know what something else is going
> to do with the environment variable.

Environment?
Since MODULE_PATH is only used by zsh and any zsh normall uses .zshenv,
it can be set there.  Why pollute the environment needlessly.

The namespace is getting a bit polluted though, yes.  Perhaps a few more
variables should start with 'Z', just as 'modload' became 'zmodload'.
And I know that they're local and will just shadow other variables, but
I keep looking at the ZLE special variable like CURSOR and wincing a
little.

A thought:
How about a convention that any special variables, and perhaps commands,
defined by a module should start with that module's name, and a leading
Z or z if the module name doesn't start with a z?  Exemptions for
specific overrides such as the files module or where it's just a
modularisation of established naming (sched).  But we'd then have zstat,
zexample, etc.
-- 
--> Phil Pennock ; GAT d- s+:+ a22 C++(++++) UL++++/I+++/S+++/H+ P++@ L+++
E-@ W(+) N>++ o !K w--- O>+ M V !PS PE Y+ PGP+ t-- 5++ X+ R !tv b++>+++ DI+ D+
G+ e+ h* r y?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PATCH: wrapper functions in modules
  1998-12-11  6:59   ` Phil Pennock
@ 1998-12-11  8:46     ` Peter Stephenson
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 1998-12-11  8:46 UTC (permalink / raw)
  To: zsh-workers

Phil Pennock wrote:
> Environment?
> Since MODULE_PATH is only used by zsh and any zsh normall uses .zshenv,
> it can be set there.  Why pollute the environment needlessly.

The point is if something else needs it in the environment, you don't
have a choice and it's going to clash with the zsh internals anyway.
I'm not currently aware of anything else.

> How about a convention that any special variables, and perhaps commands,
> defined by a module should start with that module's name, and a leading
> Z or z if the module name doesn't start with a z?

On the whole, that's probably a good idea, but I'm not convinced
wholesale rewriting of existing modules is necessary.  It depends how
generic a module is.  Even starting things with 'Z' isn't necessarily
enough.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PATCH: wrapper functions in modules
@ 1998-12-10 10:28 Sven Wischnowsky
  0 siblings, 0 replies; 6+ messages in thread
From: Sven Wischnowsky @ 1998-12-10 10:28 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> 
> Sven Wischnowsky wrote:
> > Alternatively I could change the code so that a module cannot be
> > unloaded if it has defined `after'-functions and there are currently
> > shell functions being executed.
> 
> Would it be possible for zmodload in such circumstances to mark the
> function for unloading after the wrapper has been called, and then do
> so?

Yes, I like this idea. The patch below ensures that the real unloading 
of a module happens only if there are no more `after'-functions to be
called.


Bye
 Sven

diff -c os/exec.c Src/exec.c
*** os/exec.c	Thu Dec 10 09:04:21 1998
--- Src/exec.c	Thu Dec 10 11:22:29 1998
***************
*** 2661,2667 ****
      void *xexitfn, *newexitfn;
      char saveopts[OPT_SIZE];
      int obreaks = breaks;
!     FuncWrap wrap;
  
      HEAPALLOC {
  	pushheap();
--- 2661,2667 ----
      void *xexitfn, *newexitfn;
      char saveopts[OPT_SIZE];
      int obreaks = breaks;
!     FuncWrap wrap, nwrap;
  
      HEAPALLOC {
  	pushheap();
***************
*** 2709,2714 ****
--- 2709,2718 ----
  	for (wrap = wrappers; wrap; wrap = wrap->next) {
  	    if (wrap->before)
  		wrap->before(wrap, name);
+ 	    if (wrap->after) {
+ 		wrap->module->flags |= MOD_WRAPPER;
+ 		wrap->count++;
+ 	    }
  	}
  	startparamscope();
  	ou = underscore;
***************
*** 2717,2725 ****
  	zsfree(underscore);
  	underscore = ou;
  	endparamscope();
! 	for (wrap = wrappers; wrap; wrap = wrap->next) {
! 	    if (wrap->after)
  		wrap->after(wrap, name, lastval);
  	}
  	if (retflag) {
  	    retflag = 0;
--- 2721,2739 ----
  	zsfree(underscore);
  	underscore = ou;
  	endparamscope();
! 	for (wrap = wrappers; wrap; wrap = nwrap) {
! 	    nwrap = wrap->next;
! 	    if (wrap->after) {
  		wrap->after(wrap, name, lastval);
+ 		wrap->count--;
+ 		if (!wrap->count) {
+ 		    wrap->module->flags &= ~MOD_WRAPPER;
+ 		    if (wrap->module->flags & MOD_UNLOAD) {
+ 			wrap->module->flags &= ~MOD_UNLOAD;
+ 			unload_module(wrap->module, NULL);
+ 		    }
+ 		}
+ 	    }
  	}
  	if (retflag) {
  	    retflag = 0;
diff -c os/module.c Src/module.c
*** os/module.c	Thu Dec 10 09:04:25 1998
--- Src/module.c	Thu Dec 10 11:07:55 1998
***************
*** 326,338 ****
  
  /**/
  int
! addwrapper(FuncWrap w)
  {
      if (w->flags & WRAPF_ADDED)
  	return 1;
      w->next = wrappers;
      wrappers = w;
      w->flags |= WRAPF_ADDED;
  
      return 0;
  }
--- 326,340 ----
  
  /**/
  int
! addwrapper(Module m, FuncWrap w)
  {
      if (w->flags & WRAPF_ADDED)
  	return 1;
      w->next = wrappers;
      wrappers = w;
      w->flags |= WRAPF_ADDED;
+     w->module = m;
+     w->count = 0;
  
      return 0;
  }
***************
*** 342,348 ****
  
  /**/
  int
! deletewrapper(FuncWrap w)
  {
      FuncWrap p, q;
  
--- 344,350 ----
  
  /**/
  int
! deletewrapper(Module m, FuncWrap w)
  {
      FuncWrap p, q;
  
***************
*** 838,843 ****
--- 840,871 ----
  }
  
  /**/
+ int
+ unload_module(Module m, LinkNode node)
+ {
+     if (m->handle && cleanup_module(m))
+ 	return 1;
+     else {
+ 	if (m->handle)
+ 	    dlclose(m->handle);
+ 	m->handle = NULL;
+ 	if(!m->deps) {
+ 	    if (!node) {
+ 		for (node = firstnode(modules); node; incnode(node))
+ 		    if (m == (Module) getdata(node))
+ 			break;
+ 		if (!node)
+ 		    return 1;
+ 	    }
+ 	    remnode(modules, node);
+ 	    zsfree(m->nam);
+ 	    zfree(m, sizeof(*m));
+ 	}
+     }
+     return 0;
+ }
+ 
+ /**/
  static int
  bin_zmodload_load(char *nam, char **args, char *ops)
  {
***************
*** 861,880 ****
  				goto cont;
  			    }
  		}
- 
  		m = (Module) getdata(node);
! 		if (m->handle && cleanup_module(m))
! 		    ret = 1;
! 		else {
! 		    if (m->handle)
! 			dlclose(m->handle);
! 		    m->handle = NULL;
! 		    if(!m->deps) {
! 			remnode(modules, node);
! 			zsfree(m->nam);
! 			zfree(m, sizeof(*m));
! 		    }
  		}
  	    } else if (!ops['i']) {
  		zwarnnam(nam, "no such module %s", *args, 0);
  		ret = 1;
--- 889,901 ----
  				goto cont;
  			    }
  		}
  		m = (Module) getdata(node);
! 		if (!(m->flags & MOD_WRAPPER)) {
! 		    if (unload_module(m, node))
! 			ret = 1;
  		}
+ 		else
+ 		    m->flags |= MOD_UNLOAD;
  	    } else if (!ops['i']) {
  		zwarnnam(nam, "no such module %s", *args, 0);
  		ret = 1;
diff -c os/zsh.h Src/zsh.h
*** os/zsh.h	Thu Dec 10 09:04:27 1998
--- Src/zsh.h	Thu Dec 10 10:49:44 1998
***************
*** 782,792 ****
      int flags;
      WrapBefore before;
      WrapAfter after;
  };
  
  #define WRAPF_ADDED 1
  
! #define WRAPDEF(before, after) { NULL, 0, before, after }
  
  /* node in builtin command hash table (builtintab) */
  
--- 782,795 ----
      int flags;
      WrapBefore before;
      WrapAfter after;
+     Module module;
+     int count;
  };
  
  #define WRAPF_ADDED 1
  
! #define WRAPDEF(before, after) \
!     { NULL, 0, before, after, NULL, 0 }
  
  /* node in builtin command hash table (builtintab) */
  
***************
*** 838,843 ****
--- 841,848 ----
  };
  
  #define MOD_BUSY    (1<<0)
+ #define MOD_WRAPPER (1<<1)
+ #define MOD_UNLOAD  (1<<2)
  
  /* node used in parameter hash table (paramtab) */
  

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 6+ messages in thread

* PATCH: wrapper functions in modules
@ 1998-12-09 14:44 Sven Wischnowsky
  0 siblings, 0 replies; 6+ messages in thread
From: Sven Wischnowsky @ 1998-12-09 14:44 UTC (permalink / raw)
  To: zsh-workers


Hello

This is the next bit prepared for the new completion stuff that might
be interesting to have elsewhere.

The patch below allows modules to register functions that are to be
executed before and after a function is called. This is completely
hidden from the user so there is no documentation for it.

Again, I have enhanced the example module. After you have loaded it it 
turns on GLOB_DOTS in every function whose name starts with `example'.

Several of the hunks are used to change calls to doshfunc(), since
this now gets the name of the function called as its first argument.


Bye
 Sven

diff -c os/builtin.c Src/builtin.c
*** os/builtin.c	Wed Dec  9 15:36:12 1998
--- Src/builtin.c	Wed Dec  9 14:40:24 1998
***************
*** 994,1000 ****
      if ((l = getshfunc("chpwd")) != &dummy_list) {
  	fflush(stdout);
  	fflush(stderr);
! 	doshfunc(l, NULL, 0, 1);
      }
  
      dirstacksize = getiparam("DIRSTACKSIZE");
--- 994,1000 ----
      if ((l = getshfunc("chpwd")) != &dummy_list) {
  	fflush(stdout);
  	fflush(stderr);
! 	doshfunc("chpwd", l, NULL, 0, 1);
      }
  
      dirstacksize = getiparam("DIRSTACKSIZE");
diff -c os/exec.c Src/exec.c
*** os/exec.c	Tue Dec  8 16:31:15 1998
--- Src/exec.c	Wed Dec  9 15:17:00 1998
***************
*** 2602,2608 ****
  	deletejob(jobtab + thisjob);
      }
  
!     doshfunc(shf->funcdef, cmd->args, shf->flags, 0);
  
      if (!list_pipe)
  	deletefilelist(last_file_list);
--- 2602,2608 ----
  	deletejob(jobtab + thisjob);
      }
  
!     doshfunc(shf->nam, shf->funcdef, cmd->args, shf->flags, 0);
  
      if (!list_pipe)
  	deletefilelist(last_file_list);
***************
*** 2650,2656 ****
  
  /**/
  void
! doshfunc(List list, LinkList doshargs, int flags, int noreturnval)
  /* If noreturnval is nonzero, then reset the current return *
   * value (lastval) to its value before the shell function   *
   * was executed.                                            */
--- 2650,2656 ----
  
  /**/
  void
! doshfunc(char *name, List list, LinkList doshargs, int flags, int noreturnval)
  /* If noreturnval is nonzero, then reset the current return *
   * value (lastval) to its value before the shell function   *
   * was executed.                                            */
***************
*** 2661,2666 ****
--- 2661,2667 ----
      void *xexitfn, *newexitfn;
      char saveopts[OPT_SIZE];
      int obreaks = breaks;
+     FuncWrap wrap;
  
      HEAPALLOC {
  	pushheap();
***************
*** 2705,2710 ****
--- 2706,2715 ----
  		argzero = ztrdup(argzero);
  	    }
  	}
+ 	for (wrap = wrappers; wrap; wrap = wrap->next) {
+ 	    if (wrap->before)
+ 		wrap->before(wrap, name);
+ 	}
  	startparamscope();
  	ou = underscore;
  	underscore = ztrdup(underscore);
***************
*** 2712,2718 ****
  	zsfree(underscore);
  	underscore = ou;
  	endparamscope();
! 
  	if (retflag) {
  	    retflag = 0;
  	    breaks = obreaks;
--- 2717,2726 ----
  	zsfree(underscore);
  	underscore = ou;
  	endparamscope();
! 	for (wrap = wrappers; wrap; wrap = wrap->next) {
! 	    if (wrap->after)
! 		wrap->after(wrap, name, lastval);
! 	}
  	if (retflag) {
  	    retflag = 0;
  	    breaks = obreaks;
diff -c os/init.c Src/init.c
*** os/init.c	Wed Dec  9 15:36:12 1998
--- Src/init.c	Wed Dec  9 14:57:49 1998
***************
*** 117,123 ****
  		    if (he && he->text)
  			addlinknode(args, he->text);
  		} LASTALLOC;
! 		doshfunc(prelist, args, 0, 1);
  		freelinklist(args, (FreeFunc) NULL);
  		errflag = 0;
  	    }
--- 117,123 ----
  		    if (he && he->text)
  			addlinknode(args, he->text);
  		} LASTALLOC;
! 		doshfunc("preexec", prelist, args, 0, 1);
  		freelinklist(args, (FreeFunc) NULL);
  		errflag = 0;
  	    }
***************
*** 593,598 ****
--- 593,599 ----
      createparamtable();     /* create paramater hash table             */
  
      condtab = NULL;
+     wrappers = NULL;
  
  #ifdef TIOCGWINSZ
      adjustwinsize();
diff -c os/module.c Src/module.c
*** os/module.c	Wed Dec  9 15:36:13 1998
--- Src/module.c	Wed Dec  9 15:17:41 1998
***************
*** 316,321 ****
--- 316,366 ----
      return hadf ? hads : 1;
  }
  
+ /* The list of function wrappers defined. */
+ 
+ /**/
+ FuncWrap wrappers;
+ 
+ /* This adds a definition for a wrapper. Return value is one in case of *
+  * error and zero if all went fine. */
+ 
+ /**/
+ int
+ addwrapper(FuncWrap w)
+ {
+     if (w->flags & WRAPF_ADDED)
+ 	return 1;
+     w->next = wrappers;
+     wrappers = w;
+     w->flags |= WRAPF_ADDED;
+ 
+     return 0;
+ }
+ 
+ /* This removes the given wrapper definition from the list. Returned is *
+  * one in case of error and zero otherwise. */
+ 
+ /**/
+ int
+ deletewrapper(FuncWrap w)
+ {
+     FuncWrap p, q;
+ 
+     if (w->flags & WRAPF_ADDED) {
+ 	for (p = wrappers, q = NULL; p && p != w; q = p, p = p->next);
+ 
+ 	if (p) {
+ 	    if (q)
+ 		q->next = p->next;
+ 	    else
+ 		wrappers = p->next;
+ 	    p->flags &= ~WRAPF_ADDED;
+ 
+ 	    return 0;
+ 	}
+     }
+     return 1;
+ }
  
  #ifdef HAVE_DLFCN_H
  # include <dlfcn.h>
diff -c os/signals.c Src/signals.c
*** os/signals.c	Tue Dec  8 16:31:19 1998
--- Src/signals.c	Wed Dec  9 14:39:54 1998
***************
*** 712,718 ****
  	    addlinknode(args, num);
  	} LASTALLOC;
  	trapreturn = -1;
! 	doshfunc(sigfn, args, 0, 1);
  	freelinklist(args, (FreeFunc) NULL);
  	zsfree(name);
      } else HEAPALLOC {
--- 712,718 ----
  	    addlinknode(args, num);
  	} LASTALLOC;
  	trapreturn = -1;
! 	doshfunc(name, sigfn, args, 0, 1);
  	freelinklist(args, (FreeFunc) NULL);
  	zsfree(name);
      } else HEAPALLOC {
diff -c os/utils.c Src/utils.c
*** os/utils.c	Wed Dec  9 15:36:14 1998
--- Src/utils.c	Wed Dec  9 14:39:41 1998
***************
*** 636,642 ****
      /* If a shell function named "precmd" exists, *
       * then execute it.                           */
      if ((list = getshfunc("precmd")) != &dummy_list)
! 	doshfunc(list, NULL, 0, 1);
      if (errflag)
  	return;
  
--- 636,642 ----
      /* If a shell function named "precmd" exists, *
       * then execute it.                           */
      if ((list = getshfunc("precmd")) != &dummy_list)
! 	doshfunc("precmd", list, NULL, 0, 1);
      if (errflag)
  	return;
  
***************
*** 645,651 ****
       * executed "periodic", then execute it now.                    */
      if (period && (time(NULL) > lastperiodic + period) &&
  	(list = getshfunc("periodic")) != &dummy_list) {
! 	doshfunc(list, NULL, 0, 1);
  	lastperiodic = time(NULL);
      }
      if (errflag)
--- 645,651 ----
       * executed "periodic", then execute it now.                    */
      if (period && (time(NULL) > lastperiodic + period) &&
  	(list = getshfunc("periodic")) != &dummy_list) {
! 	doshfunc("periodic", list, NULL, 0, 1);
  	lastperiodic = time(NULL);
      }
      if (errflag)
diff -c os/zsh.h Src/zsh.h
*** os/zsh.h	Wed Dec  9 15:36:14 1998
--- Src/zsh.h	Wed Dec  9 15:25:52 1998
***************
*** 233,238 ****
--- 233,239 ----
  typedef struct param     *Param;
  typedef struct cmdnam    *Cmdnam;
  typedef struct shfunc    *Shfunc;
+ typedef struct funcwrap  *FuncWrap;
  typedef struct builtin   *Builtin;
  typedef struct nameddir  *Nameddir;
  typedef struct module    *Module;
***************
*** 770,775 ****
--- 771,792 ----
      int flags;			/* various flags          */
      List funcdef;		/* function definition    */
  };
+ 
+ /* node in list of function call wrappers */
+ 
+ typedef void (*WrapBefore) _((FuncWrap, char *));
+ typedef void (*WrapAfter) _((FuncWrap, char *, int));
+ 
+ struct funcwrap {
+     FuncWrap next;
+     int flags;
+     WrapBefore before;
+     WrapAfter after;
+ };
+ 
+ #define WRAPF_ADDED 1
+ 
+ #define WRAPDEF(before, after) { NULL, 0, before, after }
  
  /* node in builtin command hash table (builtintab) */
  
diff -c os/Modules/example.c Src/Modules/example.c
*** os/Modules/example.c	Wed Dec  9 15:36:14 1998
--- Src/Modules/example.c	Wed Dec  9 15:13:58 1998
***************
*** 79,84 ****
--- 79,115 ----
      return !strcmp("example", dyncat(s1, s2));
  }
  
+ struct ogd {
+     struct ogd *next;
+     int val;
+ };
+ 
+ static struct ogd *ogds;
+ 
+ /**/
+ static void
+ wrap_before(FuncWrap w, char *name)
+ {
+     if (!strncmp(name, "example", 7)) {
+ 	struct ogd *n = (struct ogd *) halloc(sizeof(*n));
+ 
+ 	n->next = ogds;
+ 	ogds = n;
+ 	n->val = opts[GLOBDOTS];
+ 	opts[GLOBDOTS] = 1;
+     }
+ }
+ 
+ /**/
+ static void
+ wrap_after(FuncWrap w, char *name, int ret)
+ {
+     if (!strncmp(name, "example", 7)) {
+ 	opts[GLOBDOTS] = ogds->val;
+ 	ogds = ogds->next;
+     }
+ }
+ 
  /*
   * boot_example is executed when the module is loaded.
   */
***************
*** 92,103 ****
      CONDDEF("ex", CONDF_INFIX, 0, 0, cond_i_ex),
  };
  
  /**/
  int
  boot_example(Module m)
  {
      return !(addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)) |
! 	     addconddefs(m->nam, cotab, sizeof(cotab)/sizeof(*cotab)));
  }
  
  #ifdef MODULE
--- 123,140 ----
      CONDDEF("ex", CONDF_INFIX, 0, 0, cond_i_ex),
  };
  
+ static struct funcwrap wrapper[] = {
+     WRAPDEF(wrap_before, wrap_after),
+ };
+ 
  /**/
  int
  boot_example(Module m)
  {
+     ogds = NULL;
      return !(addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)) |
! 	     addconddefs(m->nam, cotab, sizeof(cotab)/sizeof(*cotab)) |
! 	     !addwrapper(wrapper));
  }
  
  #ifdef MODULE
***************
*** 108,113 ****
--- 145,151 ----
  {
      deletebuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab));
      deleteconddefs(m->nam, cotab, sizeof(cotab)/sizeof(*cotab));
+     deletewrapper(wrapper);
      return 0;
  }
  #endif
diff -c os/Zle/zle_main.c Src/Zle/zle_main.c
*** os/Zle/zle_main.c	Tue Dec  8 16:31:51 1998
--- Src/Zle/zle_main.c	Wed Dec  9 14:41:29 1998
***************
*** 593,599 ****
  	} else {
  	  startparamscope();
  	  makezleparams();
! 	  doshfunc(l, NULL, 0, 1);
  	  endparamscope();
  	  lastcmd = 0;
  	}
--- 593,599 ----
  	} else {
  	  startparamscope();
  	  makezleparams();
! 	  doshfunc(w->u.fnnam, l, NULL, 0, 1);
  	  endparamscope();
  	  lastcmd = 0;
  	}
diff -c os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
*** os/Zle/zle_tricky.c	Tue Dec  8 16:31:52 1998
--- Src/Zle/zle_tricky.c	Wed Dec  9 14:41:11 1998
***************
*** 4086,4092 ****
  	    /* This flag allows us to use read -l and -c. */
  	    incompctlfunc = 1;
  	    /* Call the function. */
! 	    doshfunc(list, args, 0, 1);
  	    incompctlfunc = 0;
  	    /* And get the result from the reply parameter. */
  	    if ((r = get_user_var("reply")))
--- 4086,4092 ----
  	    /* This flag allows us to use read -l and -c. */
  	    incompctlfunc = 1;
  	    /* Call the function. */
! 	    doshfunc(cc->func, list, args, 0, 1);
  	    incompctlfunc = 0;
  	    /* And get the result from the reply parameter. */
  	    if ((r = get_user_var("reply")))
***************
*** 4249,4255 ****
  
  	    /* No harm in allowing read -l and -c here, too */
  	    incompctlfunc = 1;
! 	    doshfunc(list, args, 0, 1);
  	    incompctlfunc = 0;
  	    uv = "reply";
  	}
--- 4249,4255 ----
  
  	    /* No harm in allowing read -l and -c here, too */
  	    incompctlfunc = 1;
! 	    doshfunc(cc->ylist, list, args, 0, 1);
  	    incompctlfunc = 0;
  	    uv = "reply";
  	}


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1998-12-11  9:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-10  9:22 PATCH: wrapper functions in modules Sven Wischnowsky
1998-12-10  9:22 ` Peter Stephenson
1998-12-11  6:59   ` Phil Pennock
1998-12-11  8:46     ` Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
1998-12-10 10:28 Sven Wischnowsky
1998-12-09 14:44 Sven Wischnowsky

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).