From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24143 invoked from network); 2 Oct 2002 07:37:27 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 2 Oct 2002 07:37:27 -0000 Received: (qmail 10923 invoked by alias); 2 Oct 2002 07:37:17 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17756 Received: (qmail 10907 invoked from network); 2 Oct 2002 07:37:15 -0000 Date: Wed, 2 Oct 2002 03:37:09 -0400 From: Clint Adams To: Oliver Kiddle Cc: Zsh workers Subject: Re: db module Message-ID: <20021002073709.GA17992@dman.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) > Instead of using pm->u.str to store a string value, I think you could > use the u.data field to point to that db handle and then use your own > function instead of strgetfn(). Well, that certainly sounds like a better idea. > How hard would it be to modify 16845 as suggested in 16878 so that we > at least have a short term solution. At the bottom of this message; the include solution is definitely cleaner and more efficient and reliable. Maybe it's worth having configure test whether or not $(MAKE) can handle 'include'. > > zdb_open -c things /tmp/newdb.db > > I would use -A instead because it is what we tend to use for > associations and we might plausibly tie a database to other types in > the future. Well, -c means "create a new file"; it's not taking the parameter name as an argument. > typeset -A things -S db -f /tmp/newdb > typeset string -S mapfile -f /tmp/file I like this concept a lot. Index: zshconfig.ac =================================================================== RCS file: /cvsroot/zsh/zsh/zshconfig.ac,v retrieving revision 1.28 diff -u -r1.28 zshconfig.ac --- zshconfig.ac 6 May 2002 14:50:11 -0000 1.28 +++ zshconfig.ac 2 Oct 2002 07:35:02 -0000 @@ -487,7 +487,7 @@ limits.h fcntl.h libc.h sys/utsname.h sys/resource.h \ locale.h errno.h stdio.h stdlib.h unistd.h sys/capability.h \ utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \ - netinet/in_systm.h pcre.h langinfo.h) + netinet/in_systm.h langinfo.h) if test $dynamic = yes; then AC_CHECK_HEADERS(dlfcn.h) AC_CHECK_HEADERS(dl.h) @@ -655,9 +655,6 @@ AC_CHECK_LIB(socket, socket) -dnl pcre-config should probably be employed here -AC_SEARCH_LIBS(pcre_compile, pcre) - dnl --------------------- dnl CHECK TERMCAP LIBRARY dnl --------------------- @@ -949,7 +946,6 @@ brk sbrk \ pathconf sysconf \ tgetent tigetflag tigetnum tigetstr setupterm \ - pcre_compile pcre_study pcre_exec \ nl_langinfo \ erand48 open_memstream) AC_FUNC_STRCOLL Index: Src/Makefile.in =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Makefile.in,v retrieving revision 1.12 diff -u -r1.12 Makefile.in --- Src/Makefile.in 20 Dec 2001 23:48:39 -0000 1.12 +++ Src/Makefile.in 2 Oct 2002 07:35:05 -0000 @@ -120,6 +120,7 @@ cd $(dir_top) && \ $(SHELL) $$top_srcdir/$(subdir)/mkmakemod.sh $(subdir) Makemod @$(MAKE) -f Makemod $(MAKEDEFS) prep || rm -f Makemod + @$(MAKE) -C Modules $(MAKEDEFS) regenerate || rm -f Makemod .PHONY: prep FORCE: Index: Src/Makemod.in.in =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Makemod.in.in,v retrieving revision 1.5 diff -u -r1.5 Makemod.in.in --- Src/Makemod.in.in 20 Dec 2001 23:48:39 -0000 1.5 +++ Src/Makemod.in.in 2 Oct 2002 07:35:06 -0000 @@ -149,7 +149,8 @@ .PHONY: mostlyclean-here clean-here: - rm -f *.o.c *.syms *.pro *.epro *.mdh *.mdhi *.mdhs *.mdh.tmp + rm -f *.o.c *.syms *.pro *.epro *.mdh *.mdhi *.mdhs *.mdh.tmp \ + *.configure *.ach config.cache config.status config.log *.rules .PHONY: clean-here distclean-here: Index: Src/mkmakemod.sh =================================================================== RCS file: /cvsroot/zsh/zsh/Src/mkmakemod.sh,v retrieving revision 1.12 diff -u -r1.12 mkmakemod.sh --- Src/mkmakemod.sh 6 Jun 2001 08:37:22 -0000 1.12 +++ Src/mkmakemod.sh 2 Oct 2002 07:35:07 -0000 @@ -55,6 +55,7 @@ # in Makemod.in.in, but some of the macros that it creates are needed in the # later rules. # +set -e # sed script to normalise a pathname sed_normalise=' @@ -192,7 +193,7 @@ unset name moddeps nozshdep alwayslink hasexport unset autobins autoinfixconds autoprefixconds autoparams automathfuncs - unset objects proto headers hdrdeps otherincs + unset objects proto headers hdrdeps otherincs autoconf achfile . $top_srcdir/$the_subdir/${mddname}.mdd q_name=`echo $name | sed 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'` test -n "${moddeps+set}" || moddeps= @@ -314,6 +315,24 @@ echo "modobjs.${mddname}: \$(MODOBJS_${mddname})" echo " echo '' \$(MODOBJS_${mddname}) $modobjs_sed>> \$(dir_src)/stamp-modobjs.tmp" echo + if test -n "$autoconf"; then +# echo "include ${mddname}.rules" + if test -r Src/Modules/${mddname}.rules; then + cat Src/Modules/${mddname}.rules + else + regenerate="$regenerate ${mddname}.rules" + fi + echo + echo "${mddname}.ach ${mddname}.rules: ${mddname}.configure" + echo " ./${mddname}.configure" + echo + echo "${mddname}.configure: ${mddname}.configure.in ${mddname}.ach.in" + echo " autoheader ${mddname}.configure.in >${mddname}.ach.in" + echo " autoconf ${mddname}.configure.in >${mddname}.configure" + echo " chmod +x ${mddname}.configure" + achfile="${mddname}.ach" + fi + if test -z "$alwayslink"; then case " $all_modules" in *" ${mddname}."*) echo "install.modules-here: install.modules.${mddname}" @@ -330,7 +349,7 @@ echo echo "${mddname}.\$(DL_EXT): \$(MODDOBJS_${mddname}) ${mddname}.export $exportdeps \$(@LINKMODS@_${mddname})" echo ' rm -f $@' - echo " \$(DLLINK) \$(@E@XPIMP_$mddname) \$(@E@NTRYOPT) \$(MODDOBJS_${mddname}) \$(@LINKMODS@_${mddname}) \$(LIBS) " + echo " \$(DLLINK) \$(@E@XPIMP_$mddname) \$(@E@NTRYOPT) \$(MODDOBJS_${mddname}) \$(@LINKMODS@_${mddname}) \$(LIBS) \$(EXTRALIBS_${mddname})" echo fi echo "${mddname}.mdhi: ${mddname}.mdhs \$(INCS_${mddname})" @@ -416,7 +435,7 @@ echo " echo '#endif /* !have_${q_name}_module */'; \\" echo " ) > \$@" echo - echo "\$(MODOBJS_${mddname}) \$(MODDOBJS_${mddname}): ${mddname}.mdh" + echo "\$(MODOBJS_${mddname}) \$(MODDOBJS_${mddname}): ${mddname}.mdh $achfile" sed -e '/^ *: *<< *\\Make *$/,/^Make$/!d' \ -e 's/^ *: *<< *\\Make *$//; /^Make$/d' \ < $top_srcdir/$the_subdir/${mddname}.mdd @@ -458,6 +477,14 @@ echo fi fi + + echo "regenerate: $regenerate" + if test -n "$regenerate"; then + echo " rm -f ../Makemod Makefile.in Makefile" + echo " make -C .. Makemod" + fi + echo ".PHONY: regenerate" + echo "##### End of ${the_makefile}.in" Index: Src/Modules/.cvsignore =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/.cvsignore,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 .cvsignore --- Src/Modules/.cvsignore 1 Dec 1999 18:36:06 -0000 1.1.1.4 +++ Src/Modules/.cvsignore 2 Oct 2002 07:35:07 -0000 @@ -12,3 +12,4 @@ *.mdhi *.mdhs *.mdh.tmp +*.rules Index: Src/Modules/pcre.ach.in =================================================================== RCS file: Src/Modules/pcre.ach.in diff -N Src/Modules/pcre.ach.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Src/Modules/pcre.ach.in 2 Oct 2002 07:35:07 -0000 @@ -0,0 +1,58 @@ +/* pcre.ach.in. Generated from pcre.configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `pcre_compile' function. */ +#undef HAVE_PCRE_COMPILE + +/* Define to 1 if you have the `pcre_exec' function. */ +#undef HAVE_PCRE_EXEC + +/* Define to 1 if you have the header file. */ +#undef HAVE_PCRE_H + +/* Define to 1 if you have the `pcre_study' function. */ +#undef HAVE_PCRE_STUDY + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS Index: Src/Modules/pcre.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/pcre.c,v retrieving revision 1.5 diff -u -r1.5 pcre.c --- Src/Modules/pcre.c 27 Aug 2002 21:10:34 -0000 1.5 +++ Src/Modules/pcre.c 2 Oct 2002 07:35:07 -0000 @@ -30,6 +30,7 @@ #include "pcre.mdh" #include "pcre.pro" +#include "pcre.ach" /**/ #if defined(HAVE_PCRE_COMPILE) && defined(HAVE_PCRE_EXEC) Index: Src/Modules/pcre.configure.in =================================================================== RCS file: Src/Modules/pcre.configure.in diff -N Src/Modules/pcre.configure.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Src/Modules/pcre.configure.in 2 Oct 2002 07:35:07 -0000 @@ -0,0 +1,38 @@ +dnl +dnl pcre.ac: Configure template for zsh/pcre module. +dnl Process this file with autoconf to produce a configure script. +dnl +dnl Copyright (c) 2002 Peter Stephenson +dnl +dnl Permission is hereby granted, without written agreement and without +dnl license or royalty fees, to use, copy, modify, and distribute this +dnl software and to distribute modified versions of this software for any +dnl purpose, provided that the above copyright notice and the following +dnl two paragraphs appear in all copies of this software. +dnl +dnl In no event shall Peter Stephenson or the Zsh Development Group be liable +dnl to any party for direct, indirect, special, incidental, or consequential +dnl damages arising out of the use of this software and its documentation, +dnl even if Richard Coleman and the Zsh Development Group have been advised of +dnl the possibility of such damage. +dnl +dnl Peter Stephenson and the Zsh Development Group specifically disclaim any +dnl warranties, including, but not limited to, the implied warranties of +dnl merchantability and fitness for a particular purpose. The software +dnl provided hereunder is on an "as is" basis, and Peter Stephenson and the +dnl Zsh Development Group have no obligation to provide maintenance, +dnl support, updates, enhancements, or modifications. +dnl + +AC_INIT(pcre.c) +AC_PREREQ(2.13) + +AC_CONFIG_HEADER(pcre.ach) + +AC_CHECK_HEADERS(pcre.h) + +dnl pcre-config should probably be employed here +AC_SEARCH_LIBS(pcre_compile, pcre) +AC_CHECK_FUNCS(pcre_compile pcre_study pcre_exec) + +AC_OUTPUT(pcre.rules) Index: Src/Modules/pcre.mdd =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/pcre.mdd,v retrieving revision 1.2 diff -u -r1.2 pcre.mdd --- Src/Modules/pcre.mdd 6 Jul 2001 08:32:16 -0000 1.2 +++ Src/Modules/pcre.mdd 2 Oct 2002 07:35:07 -0000 @@ -5,3 +5,5 @@ autobins="pcre_compile pcre_study pcre_match" objects="pcre.o" + +autoconf=yes Index: Src/Modules/pcre.rules.in =================================================================== RCS file: Src/Modules/pcre.rules.in diff -N Src/Modules/pcre.rules.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Src/Modules/pcre.rules.in 2 Oct 2002 07:35:07 -0000 @@ -0,0 +1 @@ +EXTRALIBS_pcre = @LIBS@