From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20613 invoked from network); 28 Dec 1996 00:43:07 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 28 Dec 1996 00:43:07 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id TAA01589; Fri, 27 Dec 1996 19:31:35 -0500 (EST) Resent-Date: Fri, 27 Dec 1996 19:31:35 -0500 (EST) From: Zoltan Hidvegi Message-Id: <199612280006.BAA02285@hzoli.ppp.cs.elte.hu> Subject: Re: improvement in builtin addition/deletion To: zefram@dcs.warwick.ac.uk (Zefram) Date: Sat, 28 Dec 1996 01:06:09 +0100 (MET) In-Reply-To: <6676.199612271120@stone.dcs.warwick.ac.uk> from Zefram at "Dec 27, 96 11:19:59 am" X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: hzoli@cs.elte.hu Resent-Message-ID: <"jSgZI2.0.mO.cf6no"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2650 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Zefram wrote: > This patch adds two new functions, addbuiltins() and deletebuiltins(). > They add and delete several builtins at once, in the manner of the code > I produced for the files module. They are actually helpful even when > adding only one builtin: they ensure that error messages are correctly > generated in all cases. It also makes adding a second builtin to the > module as easy as possible. There is a little bug in that patch, fix is below. Zoltan *** Src/module.c.zefram Sat Dec 28 00:59:10 1996 --- Src/module.c Sat Dec 28 01:00:03 1996 *************** *** 92,101 **** if(addbuiltin(b->nam, b->binf, b->func, b->minargs, b->maxargs, b->funcid, b->optstr, b->defopts)) { zwarnnam(nam, "name clash when adding builtin `%s'", b->nam, 0); - b->flags |= BINL_ADDED; hadf = 1; ! } else hads = 2; } return hadf ? hads : 1; } --- 92,102 ---- if(addbuiltin(b->nam, b->binf, b->func, b->minargs, b->maxargs, b->funcid, b->optstr, b->defopts)) { zwarnnam(nam, "name clash when adding builtin `%s'", b->nam, 0); hadf = 1; ! } else { ! b->flags |= BINL_ADDED; hads = 2; + } } return hadf ? hads : 1; }