]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
:-) (CVS 6)
authordrh <drh@noemail.net>
Mon, 29 May 2000 20:41:49 +0000 (20:41 +0000)
committerdrh <drh@noemail.net>
Mon, 29 May 2000 20:41:49 +0000 (20:41 +0000)
FossilOrigin-Name: 1517f85243b63511c2ceb73a10453c5ae56d3428

COPYRIGHT [new file with mode: 0644]
Makefile.in
README [new file with mode: 0644]
configure
configure.in
manifest
manifest.uuid
src/parse.y [new file with mode: 0644]
src/tclsqlite.c
test/crttbl.test [new file with mode: 0644]
test/tester.tcl [new file with mode: 0644]

diff --git a/COPYRIGHT b/COPYRIGHT
new file mode 100644 (file)
index 0000000..60549be
--- /dev/null
+++ b/COPYRIGHT
@@ -0,0 +1,340 @@
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
index d3c3f220c15397213763917be00e1bfc8c1ecbde..ff1be06991981765666b69cf7d7ea8d2889e8dc0 100644 (file)
@@ -29,6 +29,14 @@ GDBM_FLAGS = @TARGET_GDBM_INC@
 #
 LIBGDBM = @TARGET_GDBM_LIBS@
 
+# Compiler options needed for programs that use the TCL library.
+#
+TCL_FLAGS = @TARGET_TCL_INC@
+
+# The library that programs using TCL must link against.
+#
+LIBTCL = @TARGET_TCL_LIBS@
+
 # Compiler options needed for programs that use the readline() library.
 #
 READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@
@@ -44,8 +52,7 @@ LIBOBJ = build.o dbbe.o main.o parse.o tokenize.o util.o vdbe.o where.o
 # This is the default Makefile target.  The objects listed here
 # are what get build when you type just "make" with no arguments.
 #
-all:   libsqlite.a sqlite.h sqlite
-# libtclsqlite.a tclsqlite
+all:   libsqlite.a sqlite.h sqlite 
 
 libsqlite.a:   $(LIBOBJ)
        $(AR) libsqlite.a $(LIBOBJ)
@@ -103,7 +110,19 @@ vdbe.o:    $(TOP)/src/vdbe.c $(HDR)
 where.o:       $(TOP)/src/where.c $(HDR)
        $(TCC) $(GDBM_FLAGS) -c $(TOP)/src/where.c
 
+gdbmdump:      $(TOP)/tool/gdbmdump.c
+       $(TCC) $(GDBM_FLAGS) -o gdbmdump $(TOP)/tool/gdbmdump.c $(LIBGDBM)
+
+tclsqlite:     $(TOP)/src/tclsqlite.c libsqlite.a
+       $(TCC) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite \
+               $(TOP)/src/tclsqlite.c libsqlite.a $(LIBGDBM) $(LIBTCL)
+
+regression:    tclsqlite
+       for i in $(TOP)/test/*.test; do ./tclsqlite $$i; done
+
+
 TARBALL = \
+  sqlite/COPYRIGHT \
   sqlite/doc/*.html \
   sqlite/src/*.h \
   sqlite/src/*.c \
@@ -144,3 +163,4 @@ publish:    $(PUBLISH)
 clean: 
        rm -f *.o sqlite libsqlite.a sqlite.h
        rm -f lemon lempar.c parse.* sqlite.tar.gz
+       rm -f $(PUBLISH)
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..129674e
--- /dev/null
+++ b/README
@@ -0,0 +1,36 @@
+This directory contains source code to 
+
+    SQLite: An SQL Frontend To GDBM
+
+To compile the project, first create a directory in which to place
+the build products.  The build directory must be separate from the
+source tree.  Cd into the build directory and then from the build
+directory run the configure script found at the root of the source
+tree.  Then run "make".
+
+For example:
+
+    tar xzf sqlite.tar.gz    ;#  Unpack the source tree into "sqlite"
+    mkdir bld                ;#  Build will occur in a sibling directory
+    cd bld                   ;#  Change to the build directory
+    ../sqlite/configure      ;#  Run the configure script
+    make                     ;#  Run the makefile.
+
+The primary build products are left in the build directory.  The
+primary build products are:
+
+    libsqlite.a        The SQLite library file
+
+    sqlite.h           A header file for SQLite
+
+    sqlite             Command line program for accessing SQLite databases
+
+There are some other make targets of interest:
+
+
+   make regression        This runs a regression test on the library.
+
+   make gdbmdump          This builds a utility named "gdbmdump" that
+                          writes out the contents of a GDBM file in a
+                          readable format.  It is useful for testing and
+                          debugging the library.
index dbf4986751300a3d930f3a0cdabf2057f9db0fc0..a9f05bc837ad312db806e59c779367f13edbcb04 100755 (executable)
--- a/configure
+++ b/configure
@@ -525,7 +525,7 @@ fi
 
 
 # The following RCS revision string applies to configure.in
-# $Revision: 1.1 $
+# $Revision: 1.2 $
 
 #########
 # Make sure we are not building in a subdirectory of the source tree.
@@ -540,6 +540,8 @@ if test "$temp" = ""; then
 ** the configure script or any subdirectory of that directory.   Rerun  **
 ** the configure script from a directory that is separate from the      **
 ** source tree.                                                         **
+**                                                                      **
+** See the README file for additional information.                      **
 **************************************************************************" 1>&2; exit 1; }
 fi
 
@@ -598,7 +600,7 @@ if test "$config_BUILD_CC" = ""; then
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:602: checking for $ac_word" >&5
+echo "configure:604: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -628,7 +630,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:632: checking for $ac_word" >&5
+echo "configure:634: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -679,7 +681,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:683: checking for $ac_word" >&5
+echo "configure:685: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -711,7 +713,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:715: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:717: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -722,12 +724,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 726 "configure"
+#line 728 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -753,12 +755,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:757: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:759: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:762: checking whether we are using GNU C" >&5
+echo "configure:764: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -767,7 +769,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -786,7 +788,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:790: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:792: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -825,12 +827,12 @@ fi
 else
   BUILD_CC=$config_BUILD_CC
   echo $ac_n "checking host compiler""... $ac_c" 1>&6
-echo "configure:829: checking host compiler" >&5
+echo "configure:831: checking host compiler" >&5
   CC=$BUILD_CC
   echo "$ac_t""$BUILD_CC" 1>&6
 fi
 echo $ac_n "checking switches for the host compiler""... $ac_c" 1>&6
-echo "configure:834: checking switches for the host compiler" >&5
+echo "configure:836: checking switches for the host compiler" >&5
 if test "$config_BUILD_CFLAGS" != ""; then
   CFLAGS=$config_BUILD_CFLAGS
   BUILD_CFLAGS=$config_BUILD_CFLAGS
@@ -850,7 +852,7 @@ fi
 # the target machine.
 #
 echo $ac_n "checking target compiler""... $ac_c" 1>&6
-echo "configure:854: checking target compiler" >&5
+echo "configure:856: checking target compiler" >&5
 if test "$config_TARGET_CC" != ""; then
   TARGET_CC=$config_TARGET_CC
 else
@@ -858,7 +860,7 @@ else
 fi
 echo "$ac_t""$TARGET_CC" 1>&6
 echo $ac_n "checking switches on the target compiler""... $ac_c" 1>&6
-echo "configure:862: checking switches on the target compiler" >&5
+echo "configure:864: checking switches on the target compiler" >&5
 if test "$config_TARGET_CFLAGS" != ""; then
   TARGET_CFLAGS=$config_TARGET_CFLAGS
 else
@@ -866,7 +868,7 @@ else
 fi
 echo "$ac_t""$TARGET_CFLAGS" 1>&6
 echo $ac_n "checking target linker""... $ac_c" 1>&6
-echo "configure:870: checking target linker" >&5
+echo "configure:872: checking target linker" >&5
 if test "$config_TARGET_LINK" = ""; then
   TARGET_LINK=$TARGET_CC
 else
@@ -874,7 +876,7 @@ else
 fi
 echo "$ac_t""$TARGET_LINK" 1>&6
 echo $ac_n "checking switches on the target compiler""... $ac_c" 1>&6
-echo "configure:878: checking switches on the target compiler" >&5
+echo "configure:880: checking switches on the target compiler" >&5
 if test "$config_TARGET_TFLAGS" != ""; then
   TARGET_TFLAGS=$config_TARGET_TFLAGS
 else
@@ -886,7 +888,7 @@ else
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:890: checking for $ac_word" >&5
+echo "configure:892: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -932,7 +934,7 @@ echo "$ac_t""$TARGET_TFLAGS" 1>&6
 # it 0 if we are not.
 #
 echo $ac_n "checking if host and target compilers are the same""... $ac_c" 1>&6
-echo "configure:936: checking if host and target compilers are the same" >&5
+echo "configure:938: checking if host and target compilers are the same" >&5
 if test "$BUILD_CC" = "$TARGET_CC"; then
   cross=0
   echo "$ac_t""yes" 1>&6
@@ -947,7 +949,7 @@ fi
 # things accordingly.
 #
 echo $ac_n "checking if executables have the .exe suffix""... $ac_c" 1>&6
-echo "configure:951: checking if executables have the .exe suffix" >&5
+echo "configure:953: checking if executables have the .exe suffix" >&5
 if test "$config_BUILD_EXEEXT" = ".exe"; then
   CYGWIN=yes
   echo "$ac_t""yes" 1>&6
@@ -956,12 +958,12 @@ else
 fi
 if test "$CYGWIN" != "yes"; then
   echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:960: checking for Cygwin environment" >&5
+echo "configure:962: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 965 "configure"
+#line 967 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -972,7 +974,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -1036,12 +1038,12 @@ else
   fi
   CC=$TARGET_CC
   echo $ac_n "checking for sin""... $ac_c" 1>&6
-echo "configure:1040: checking for sin" >&5
+echo "configure:1042: checking for sin" >&5
 if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1045 "configure"
+#line 1047 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char sin(); below.  */
@@ -1064,7 +1066,7 @@ sin();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_sin=yes"
 else
@@ -1085,7 +1087,7 @@ LIBS="-lm"
 fi
 
   echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:1089: checking for dlopen in -ldl" >&5
+echo "configure:1091: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1093,7 +1095,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1097 "configure"
+#line 1099 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1104,7 +1106,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:1108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1138,14 +1140,14 @@ fi
     LIBS=""
     
 echo $ac_n "checking for library containing Tcl_Init""... $ac_c" 1>&6
-echo "configure:1142: checking for library containing Tcl_Init" >&5
+echo "configure:1144: checking for library containing Tcl_Init" >&5
 if eval "test \"`echo '$''{'ac_cv_search_Tcl_Init'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_Tcl_Init="no"
 cat > conftest.$ac_ext <<EOF
-#line 1149 "configure"
+#line 1151 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1156,7 +1158,7 @@ int main() {
 Tcl_Init()
 ; return 0; }
 EOF
-if { (eval echo configure:1160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_Tcl_Init="none required"
 else
@@ -1167,7 +1169,7 @@ rm -f conftest*
 test "$ac_cv_search_Tcl_Init" = "no" && for i in         tcl8.4 tcl8.3 tcl8.2 tcl8.1 tcl8.0 tcl80 tcl; do
 LIBS="-l$i $otherlibs $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1171 "configure"
+#line 1173 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1178,7 +1180,7 @@ int main() {
 Tcl_Init()
 ; return 0; }
 EOF
-if { (eval echo configure:1182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_Tcl_Init="-l$i"
 break
@@ -1207,7 +1209,7 @@ fi
 # Figure out where to get the TCL header files.
 #
 echo $ac_n "checking TCL header files""... $ac_c" 1>&6
-echo "configure:1211: checking TCL header files" >&5
+echo "configure:1213: checking TCL header files" >&5
 found=no
 if test "$config_TARGET_TCL_INC" != ""; then
   TARGET_TCL_INC=$config_TARGET_TCL_INC
@@ -1226,7 +1228,7 @@ if test "$found" = "yes"; then
 else
   echo "$ac_t""not specified: still searching..." 1>&6
   echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1230: checking how to run the C preprocessor" >&5
+echo "configure:1232: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1241,13 +1243,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1245 "configure"
+#line 1247 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1258,13 +1260,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1262 "configure"
+#line 1264 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1275,13 +1277,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1279 "configure"
+#line 1281 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1307,17 +1309,17 @@ echo "$ac_t""$CPP" 1>&6
 
 ac_safe=`echo "tcl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for tcl.h""... $ac_c" 1>&6
-echo "configure:1311: checking for tcl.h" >&5
+echo "configure:1313: checking for tcl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1316 "configure"
+#line 1318 "configure"
 #include "confdefs.h"
 #include <tcl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1344,7 +1346,7 @@ if test "$found" = "no"; then
     
 ac_safe=`echo "$dir/include/tcl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $dir/include/tcl.h""... $ac_c" 1>&6
-echo "configure:1348: checking for $dir/include/tcl.h" >&5
+echo "configure:1350: checking for $dir/include/tcl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1385,14 +1387,14 @@ else
   LIBS=""
   
 echo $ac_n "checking for library containing gdbm_open""... $ac_c" 1>&6
-echo "configure:1389: checking for library containing gdbm_open" >&5
+echo "configure:1391: checking for library containing gdbm_open" >&5
 if eval "test \"`echo '$''{'ac_cv_search_gdbm_open'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_gdbm_open="no"
 cat > conftest.$ac_ext <<EOF
-#line 1396 "configure"
+#line 1398 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1403,7 +1405,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:1407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_gdbm_open="none required"
 else
@@ -1414,7 +1416,7 @@ rm -f conftest*
 test "$ac_cv_search_gdbm_open" = "no" && for i in gdbm; do
 LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1418 "configure"
+#line 1420 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1425,7 +1427,7 @@ int main() {
 gdbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:1429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_gdbm_open="-l$i"
 break
@@ -1453,7 +1455,7 @@ fi
 # Figure out where to get the GDBM header files.
 #
 echo $ac_n "checking GDBM header files""... $ac_c" 1>&6
-echo "configure:1457: checking GDBM header files" >&5
+echo "configure:1459: checking GDBM header files" >&5
 found=no
 if test "$config_TARGET_GDBM_INC" != ""; then
   TARGET_GDBM_INC=$config_TARGET_GDBM_INC
@@ -1465,17 +1467,17 @@ else
   echo "$ac_t""not specified: still searching..." 1>&6
   ac_safe=`echo "gdbm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for gdbm.h""... $ac_c" 1>&6
-echo "configure:1469: checking for gdbm.h" >&5
+echo "configure:1471: checking for gdbm.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1474 "configure"
+#line 1476 "configure"
 #include "confdefs.h"
 #include <gdbm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1479: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1481: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1502,7 +1504,7 @@ if test "$found" = "no"; then
     
 ac_safe=`echo "$dir/include/gdbm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $dir/include/gdbm.h""... $ac_c" 1>&6
-echo "configure:1506: checking for $dir/include/gdbm.h" >&5
+echo "configure:1508: checking for $dir/include/gdbm.h" >&5
 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1543,14 +1545,14 @@ else
   LIBS=""
   
 echo $ac_n "checking for library containing readline""... $ac_c" 1>&6
-echo "configure:1547: checking for library containing readline" >&5
+echo "configure:1549: checking for library containing readline" >&5
 if eval "test \"`echo '$''{'ac_cv_search_readline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_readline="no"
 cat > conftest.$ac_ext <<EOF
-#line 1554 "configure"
+#line 1556 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1561,7 +1563,7 @@ int main() {
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:1565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_readline="none required"
 else
@@ -1572,7 +1574,7 @@ rm -f conftest*
 test "$ac_cv_search_readline" = "no" && for i in readline; do
 LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1576 "configure"
+#line 1578 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1583,7 +1585,7 @@ int main() {
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:1587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_readline="-l$i"
 break
@@ -1611,7 +1613,7 @@ fi
 # Figure out where to get the READLINE header files.
 #
 echo $ac_n "checking readline header files""... $ac_c" 1>&6
-echo "configure:1615: checking readline header files" >&5
+echo "configure:1617: checking readline header files" >&5
 found=no
 if test "$config_TARGET_READLINE_INC" != ""; then
   TARGET_READLINE_INC=$config_TARGET_READLINE_INC
@@ -1623,17 +1625,17 @@ else
   echo "$ac_t""not specified: still searching..." 1>&6
   ac_safe=`echo "readline.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for readline.h""... $ac_c" 1>&6
-echo "configure:1627: checking for readline.h" >&5
+echo "configure:1629: checking for readline.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1632 "configure"
+#line 1634 "configure"
 #include "confdefs.h"
 #include <readline.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1660,7 +1662,7 @@ if test "$found" = "no"; then
     
 ac_safe=`echo "$dir/include/readline.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $dir/include/readline.h""... $ac_c" 1>&6
-echo "configure:1664: checking for $dir/include/readline.h" >&5
+echo "configure:1666: checking for $dir/include/readline.h" >&5
 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1689,7 +1691,7 @@ fi
     
 ac_safe=`echo "$dir/include/readline/readline.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $dir/include/readline/readline.h""... $ac_c" 1>&6
-echo "configure:1693: checking for $dir/include/readline/readline.h" >&5
+echo "configure:1695: checking for $dir/include/readline/readline.h" >&5
 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
index a6f9a3147afe7728f29aa50eeb4890d278c22a7a..3106b43f7701180f8036dea0fa19dc89c6451453 100644 (file)
@@ -151,7 +151,7 @@ AC_INIT(src/sqlite.h)
 dnl Put the RCS revision string after AC_INIT so that it will also
 dnl show in in configure.
 # The following RCS revision string applies to configure.in
-# $Revision: 1.1 $
+# $Revision: 1.2 $
 
 #########
 # Make sure we are not building in a subdirectory of the source tree.
@@ -166,6 +166,8 @@ if test "$temp" = ""; then
 ** the configure script or any subdirectory of that directory.   Rerun  **
 ** the configure script from a directory that is separate from the      **
 ** source tree.                                                         **
+**                                                                      **
+** See the README file for additional information.                      **
 **************************************************************************])
 fi
 
index 300587508ee8f6c7ca72df0f885eec78daec00f9..a19528f38433b3384cc3cabc9090a3e14b8f7b41 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,22 +1,27 @@
-C :-)\s(CVS\s5)
-D 2000-05-29T18:50:16
-F Makefile.in cb1ba563614eae8c4f2261fe464ae4652179cb37
-F configure 8faba4d0194321e5f61a64e842c65eab0f68e6d8 x
-F configure.in 4fc2947d631037bd340b112d6193847d7ac827ae
+C :-)\s(CVS\s6)
+D 2000-05-29T20:41:50
+F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4
+F Makefile.in f5e807375d080405b757239762db8f3b4124e08a
+F README 0200f7787a68917ac55c07b97e3c3a982bccd0bc
+F configure 00a5b5c82147a576fa6e82d7c1b0d55c321d6d2c x
+F configure.in 6ccfd5fc80517f7cfe605a7fc7e0f62d962a233c
 F doc/lemon.html e233a3e97a779c7a87e1bc4528c664a58e49dd47
 F src/build.c 45dc91016e13dec70620b049a53ba785b4a0c76b
 F src/dbbe.c ab05293e89525041eaab8b4aca10516db3648792
 F src/dbbe.h bedeb3a0985bb584458e7849fb59927e99e751e6
 F src/main.c 25cce7bce0eb3ba10bada7c05f4b38dc6dbbc86f
+F src/parse.y 265c8596598afba0a94b94acd9c866d01603dfe5
 F src/shell.c 125f84ea5f8b725ba474d4702b575d062cc94d92
 F src/sqlite.h 2397c17a8f4ca90c09acab0100dc7e2f8f441b69
 F src/sqliteInt.h 0365970442441b5e9b74e1e828afdeac7b0662be
-F src/tclsqlite.c 6eca1c1b8713048245d295ed18dca71c91d4931f
+F src/tclsqlite.c 30f4317e1fc9119b130f29ee5dac4ab9121de68b
 F src/tokenize.c ab578d90ec6ab117b7ade6e6cfbcb5b0f9cad500
 F src/util.c b2e2a4dc55f7cbd41a7d9e0a8473eedd3b2691c8
 F src/vdbe.c 80132b6bb9a744d1990a1c16666d54baaff2dbc3
 F src/vdbe.h e721ad308f2e6ca805cebc4dd0a196ce4419d030
 F src/where.c 67ffea57920e16b33c580e9a9b9855b3ec9dea7b
+F test/crttbl.test 49a73b927ad85bf8edae7e5311fde34bf5b2c1fb
+F test/tester.tcl 31a9077926a5eb54dcae11b2c92abc1263dd675c
 F tool/gdbmdump.c 529e67c78d920606ba196326ea55b57b75fcc82b
 F tool/lemon.c cff35578b3c4d1491021b6418016639ebe21b1a5
 F tool/lempar.c a1eec94d6eacc12332368660ec65f3b248853833
@@ -26,7 +31,7 @@ F tool/renumberOps.awk 6d067177ad5f8d711b79577b462da9b3634bd0a9
 F www/c_interface.tcl f875864edf7974157d1c257ca08de854660882a5
 F www/index.tcl 67b2bee04077377eacede2b11e21fe37ef7e10c6
 F www/sqlite.tcl 947e067bcc347dc767af4c1a6e5a8d47d8404aa3
-P 1d3286702cf267857190e6082db15ba4132453d7
-R df24759e4161832879dbb325c08161a8
+P 9fd0628af897c54c122fdef02f79788385ece39c
+R b39dfec9006cd0b187aa3d6ee1e9799f
 U drh
-Z 3893ca4bcccca2377dab7ed9ed04dee7
+Z ad70bffed13ea99cad14d2118369d246
index e6ad0c1fa6c366a6e216c34c06242e81d444ff5e..e2c8ab7a089e2b2062e71950086e56b307c0db81 100644 (file)
@@ -1 +1 @@
-9fd0628af897c54c122fdef02f79788385ece39c
\ No newline at end of file
+1517f85243b63511c2ceb73a10453c5ae56d3428
\ No newline at end of file
diff --git a/src/parse.y b/src/parse.y
new file mode 100644 (file)
index 0000000..65ee042
--- /dev/null
@@ -0,0 +1,303 @@
+/*
+** Copyright (c) 1999, 2000 D. Richard Hipp
+**
+** This program is free software; you can redistribute it and/or
+** modify it under the terms of the GNU General Public
+** License as published by the Free Software Foundation; either
+** version 2 of the License, or (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+** General Public License for more details.
+** 
+** You should have received a copy of the GNU General Public
+** License along with this library; if not, write to the
+** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+** Boston, MA  02111-1307, USA.
+**
+** Author contact information:
+**   drh@hwaci.com
+**   http://www.hwaci.com/drh/
+**
+*************************************************************************
+** This file contains SQLite's grammar for SQL.  Process this file
+** using the lemon parser generator to generate C code that runs
+** the parser.  Lemon will also generate a header file containing
+** numeric codes for all of the tokens.
+**
+** @(#) $Id: parse.y,v 1.1 2000/05/29 20:42:06 drh Exp $
+*/
+%token_prefix TK_
+%token_type {Token}
+%extra_argument {Parse *pParse}
+%syntax_error {
+  sqliteSetNString(&pParse->zErrMsg,"syntax error near \"",0,TOKEN.z,TOKEN.n,
+                   "\"", 1, 0);
+  pParse->sErrToken = TOKEN;
+}
+%name sqliteParser
+%include {
+#include "sqliteInt.h"
+#include "parse.h"
+}
+
+
+// Input is zero or more commands.
+input ::= cmdlist.
+
+// These are extra tokens used by the lexer but never seen by the
+// parser.  We put them in a rule so that the parser generator will
+// add them to the sqliteTokens.h output file.
+//
+input ::= END_OF_FILE ILLEGAL SPACE UNCLOSED_STRING COMMENT FUNCTION
+          UMINUS FIELD.
+
+// A list of commands is zero or more commands
+//
+cmdlist ::= ecmd.
+cmdlist ::= cmdlist SEMI ecmd.
+ecmd ::= explain cmd.  {sqliteExec(pParse);}
+ecmd ::= cmd.          {sqliteExec(pParse);}
+ecmd ::= .
+explain ::= EXPLAIN.    {pParse->explain = 1;}
+
+// The first form of a command is a CREATE TABLE statement.
+//
+cmd ::= create_table create_table_args.
+create_table ::= CREATE(X) TABLE ID(Y).    {sqliteStartTable(pParse,&X,&Y);}
+create_table_args ::= LP columnlist conslist_opt RP(X).
+                                           {sqliteEndTable(pParse,&X);}
+columnlist ::= columnlist COMMA column.
+columnlist ::= column.
+
+// About the only information used for a column is the name of the
+// column.  The type is always just "text".  But the code will accept
+// an elaborate typename.  Perhaps someday we'll do something with it.
+//
+column ::= columnid type carglist. 
+columnid ::= ID(X).                {sqliteAddColumn(pParse,&X);}
+type ::= typename.
+type ::= typename LP signed RP.
+type ::= typename LP signed COMMA signed RP.
+typename ::= ID.
+typename ::= typename ID.
+signed ::= INTEGER.
+signed ::= PLUS INTEGER.
+signed ::= MINUS INTEGER.
+carglist ::= carglist carg.
+carglist ::= .
+carg ::= CONSTRAINT ID ccons.
+carg ::= ccons.
+carg ::= DEFAULT expr.
+
+// In addition to the type name, we also care about the primary key.
+//
+ccons ::= NOT NULL.
+ccons ::= PRIMARY KEY sortorder.  
+   {sqliteCreateIndex(pParse,0,0,0,0,0);}
+ccons ::= UNIQUE.
+ccons ::= CHECK expr.
+
+// For the time being, the only constraint we care about is the primary
+// key.
+//
+conslist_opt ::= .
+conslist_opt ::= COMMA conslist.
+conslist ::= conslist COMMA tcons.
+conslist ::= tcons.
+tcons ::= CONSTRAINT ID tcons2.
+tcons ::= tcons2.
+tcons2 ::= PRIMARY KEY LP idxlist(X) RP.  
+      {sqliteCreateIndex(pParse,0,0,X,0,0);}
+tcons2 ::= UNIQUE LP idlist RP.
+tcons2 ::= CHECK expr.
+idlist ::= idlist COMMA ID.
+idlist ::= ID.
+
+// The next command format is dropping tables.
+//
+cmd ::= DROP TABLE ID(X).          {sqliteDropTable(pParse,&X);}
+
+// The select statement
+//
+cmd ::= select.
+select ::= SELECT selcollist(W) from(X) where_opt(Y) orderby_opt(Z).
+     {sqliteSelect(pParse, W, X, Y, Z);}
+select ::= SELECT STAR from(X) where_opt(Y) orderby_opt(Z).
+     {sqliteSelect(pParse, 0, X, Y, Z);}
+
+%type selcollist {ExprList*}
+%destructor selcollist {sqliteExprListDelete($$);}
+%type sclp {ExprList*}
+%destructor sclp {sqliteExprListDelete($$);}
+
+sclp(A) ::= selcollist(X) COMMA.             {A = X;}
+sclp(A) ::= .                                {A = 0;}
+selcollist(A) ::= sclp(P) expr(X).           {A = sqliteExprListAppend(P,X,0);}
+selcollist(A) ::= sclp(P) expr(X) AS ID(Y).  {A = sqliteExprListAppend(P,X,&Y);}
+selcollist(A) ::= sclp(P) expr(X) AS STRING(Y).
+  {A = sqliteExprListAppend(P,X,&Y);}
+
+%type seltablist {IdList*}
+%destructor seltablist {sqliteIdListDelete($$);}
+%type stl_prefix {IdList*}
+%destructor stl_prefix {sqliteIdListDelete($$);}
+%type from {IdList*}
+%destructor from {sqliteIdListDelete($$);}
+
+from(A) ::= FROM seltablist(X).               {A = X;}
+stl_prefix(A) ::= seltablist(X) COMMA.        {A = X;}
+stl_prefix(A) ::= .                           {A = 0;}
+seltablist(A) ::= stl_prefix(X) ID(Y).        {A = sqliteIdListAppend(X,&Y);}
+seltablist(A) ::= stl_prefix(X) ID(Y) AS ID(Z).
+   {A = sqliteIdListAppend(X,&Y);
+    sqliteIdListAddAlias(A,&Z);}
+
+%type orderby_opt {ExprList*}
+%destructor orderby_opt {sqliteExprListDelete($$);}
+%type sortlist {ExprList*}
+%destructor sortlist {sqliteExprListDelete($$);}
+%type sortitem {Expr*}
+%destructor sortitem {sqliteExprDelete($$);}
+
+orderby_opt(A) ::= .                          {A = 0;}
+orderby_opt(A) ::= ORDER BY sortlist(X).      {A = X;}
+sortlist(A) ::= sortlist(X) COMMA sortitem(Y) sortorder(Z).  
+  {
+    A = sqliteExprListAppend(X,Y,0);
+    A->a[A->nExpr-1].idx = Z;
+  }
+sortlist(A) ::= sortitem(Y) sortorder(Z).
+  {
+    A = sqliteExprListAppend(0,Y,0);
+    A->a[0].idx = Z;
+  }
+sortitem(A) ::= ID(X).           {A = sqliteExpr(TK_ID, 0, 0, &X);}
+sortitem(A) ::= ID(X) DOT ID(Y). 
+  {
+     Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &X);
+     Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &Y);
+     A = sqliteExpr(TK_DOT, temp1, temp2, 0);
+  }
+
+%type sortorder {int}
+
+sortorder(A) ::= ASC.      {A = 0;}
+sortorder(A) ::= DESC.     {A = 1;}
+sortorder(A) ::= .         {A = 0;}
+
+cmd ::= DELETE FROM ID(X) where_opt(Y).
+    {sqliteDeleteFrom(pParse, &X, Y);}
+
+%type where_opt {Expr*}
+%destructor where_opt {sqliteExprDelete($$);}
+
+where_opt(A) ::= .                    {A = 0;}
+where_opt(A) ::= WHERE expr(X).       {A = X;}
+
+%type setlist {ExprList*}
+%destructor setlist {sqliteExprListDelete($$);}
+
+cmd ::= UPDATE ID(X) SET setlist(Y) where_opt(Z).
+    {sqliteUpdate(pParse,&X,Y,Z);}
+
+setlist(A) ::= ID(X) EQ expr(Y) COMMA setlist(Z).
+    {A = sqliteExprListAppend(Z,Y,&X);}
+setlist(A) ::= ID(X) EQ expr(Y).   {A = sqliteExprListAppend(0,Y,&X);}
+
+cmd ::= INSERT INTO ID(X) fieldlist_opt(F) VALUES LP itemlist(Y) RP.
+               {sqliteInsert(pParse, &X, Y, F);}
+
+
+%type itemlist {ExprList*}
+%destructor itemlist {sqliteExprListDelete($$);}
+%type item {Expr*}
+%destructor item {sqliteExprDelete($$);}
+
+itemlist(A) ::= itemlist(X) COMMA item(Y).  {A = sqliteExprListAppend(X,Y,0);}
+itemlist(A) ::= item(X).     {A = sqliteExprListAppend(0,X,0);}
+item(A) ::= INTEGER(X).      {A = sqliteExpr(TK_INTEGER, 0, 0, &X);}
+item(A) ::= FLOAT(X).        {A = sqliteExpr(TK_FLOAT, 0, 0, &X);}
+item(A) ::= STRING(X).       {A = sqliteExpr(TK_STRING, 0, 0, &X);}
+
+%type fieldlist_opt {IdList*}
+%destructor fieldlist_opt {sqliteIdListDelete($$);}
+%type fieldlist {IdList*}
+%destructor fieldlist {sqliteIdListDelete($$);}
+
+fieldlist_opt(A) ::= .                    {A = 0;}
+fieldlist_opt(A) ::= LP fieldlist(X) RP.  {A = X;}
+fieldlist(A) ::= fieldlist(X) COMMA ID(Y). {A = sqliteIdListAppend(X,&Y);}
+fieldlist(A) ::= ID(Y).                    {A = sqliteIdListAppend(0,&Y);}
+
+%left OR.
+%left AND.
+%left EQ NE ISNULL NOTNULL IS.
+%left GT GE LT LE.
+%left PLUS MINUS.
+%left STAR SLASH PERCENT.
+%right NOT.
+
+%type expr {Expr*}
+%destructor expr {sqliteExprDelete($$);}
+
+expr(A) ::= LP expr(X) RP.   {A = X;}
+expr(A) ::= ID(X).           {A = sqliteExpr(TK_ID, 0, 0, &X);}
+expr(A) ::= NULL.            {A = sqliteExpr(TK_NULL, 0, 0, 0);}
+expr(A) ::= ID(X) DOT ID(Y). {Expr *temp1 = sqliteExpr(TK_ID, 0, 0, &X);
+                              Expr *temp2 = sqliteExpr(TK_ID, 0, 0, &Y);
+                              A = sqliteExpr(TK_DOT, temp1, temp2, 0);}
+expr(A) ::= INTEGER(X).      {A = sqliteExpr(TK_INTEGER, 0, 0, &X);}
+expr(A) ::= FLOAT(X).        {A = sqliteExpr(TK_FLOAT, 0, 0, &X);}
+expr(A) ::= STRING(X).       {A = sqliteExpr(TK_STRING, 0, 0, &X);}
+// expr(A) ::= ID(X) LP exprlist(Y) RP.  {A = sqliteExprFunction(Y, &X);}
+// expr(A) ::= ID(X) LP STAR RP.         {A = sqliteExprFunction(0, &X);}
+expr(A) ::= expr(X) AND expr(Y).   {A = sqliteExpr(TK_AND, X, Y, 0);}
+expr(A) ::= expr(X) OR expr(Y).    {A = sqliteExpr(TK_OR, X, Y, 0);}
+expr(A) ::= expr(X) LT expr(Y).    {A = sqliteExpr(TK_LT, X, Y, 0);}
+expr(A) ::= expr(X) GT expr(Y).    {A = sqliteExpr(TK_GT, X, Y, 0);}
+expr(A) ::= expr(X) LE expr(Y).    {A = sqliteExpr(TK_LE, X, Y, 0);}
+expr(A) ::= expr(X) GE expr(Y).    {A = sqliteExpr(TK_GE, X, Y, 0);}
+expr(A) ::= expr(X) NE expr(Y).    {A = sqliteExpr(TK_NE, X, Y, 0);}
+expr(A) ::= expr(X) EQ expr(Y).    {A = sqliteExpr(TK_EQ, X, Y, 0);}
+expr(A) ::= expr(X) IS expr(Y).    {A = sqliteExpr(TK_EQ, X, Y, 0);}
+expr(A) ::= expr(X) PLUS expr(Y).  {A = sqliteExpr(TK_PLUS, X, Y, 0);}
+expr(A) ::= expr(X) MINUS expr(Y). {A = sqliteExpr(TK_MINUS, X, Y, 0);}
+expr(A) ::= expr(X) STAR expr(Y).  {A = sqliteExpr(TK_STAR, X, Y, 0);}
+expr(A) ::= expr(X) SLASH expr(Y). {A = sqliteExpr(TK_SLASH, X, Y, 0);}
+expr(A) ::= expr(X) ISNULL.        {A = sqliteExpr(TK_ISNULL, X, 0, 0);}
+expr(A) ::= expr(X) NOTNULL.       {A = sqliteExpr(TK_NOTNULL, X, 0, 0);}
+expr(A) ::= NOT expr(X).           {A = sqliteExpr(TK_NOT, X, 0, 0);}
+expr(A) ::= MINUS expr(X). [NOT]   {A = sqliteExpr(TK_UMINUS, X, 0, 0);}
+expr(A) ::= PLUS expr(X). [NOT]    {A = X;}
+
+%type exprlist {ExprList*}
+%destructor exprlist {sqliteExprListDelete($$);}
+%type expritem {Expr*}
+%destructor expritem {sqliteExprDelete($$);}
+
+/*
+exprlist(A) ::= exprlist(X) COMMA expritem(Y). 
+   {A = sqliteExprListAppend(X,Y,0);}
+exprlist(A) ::= expritem(X).            {A = sqliteExprListAppend(0,X,0);}
+expritem(A) ::= expr(X).                {A = X;}
+expritem(A) ::= .                       {A = 0;}
+*/
+
+cmd ::= CREATE(S) uniqueflag INDEX ID(X) ON ID(Y) LP idxlist(Z) RP(E).
+    {sqliteCreateIndex(pParse, &X, &Y, Z, &S, &E);}
+uniqueflag ::= UNIQUE.
+uniqueflag ::= .
+
+%type idxlist {IdList*}
+%destructor idxlist {sqliteIdListDelete($$);}
+%type idxitem {Token}
+
+idxlist(A) ::= idxlist(X) COMMA idxitem(Y).  
+     {A = sqliteIdListAppend(X,&Y);}
+idxlist(A) ::= idxitem(Y).
+     {A = sqliteIdListAppend(0,&Y);}
+idxitem(A) ::= ID(X).           {A = X;}
+
+cmd ::= DROP INDEX ID(X).       {sqliteDropIndex(pParse, &X);}
index 55e9a855705ea0f4afe2179f176ce6306edd3cfd..2d4d154ebcec5aaccb602647e9dd9cae7a61b146 100644 (file)
@@ -23,7 +23,7 @@
 *************************************************************************
 ** A TCL Interface to SQLite
 **
-** $Id: tclsqlite.c,v 1.1 2000/05/29 14:26:01 drh Exp $
+** $Id: tclsqlite.c,v 1.2 2000/05/29 20:41:51 drh Exp $
 */
 #include "sqlite.h"
 #include <tcl.h>
@@ -239,3 +239,57 @@ int Sqlite_SafeInit(Tcl_Interp *interp){
 int Et_AppInit(Tcl_Interp *interp){
   return Sqlite_Init(interp);
 }
+
+/*
+** If the macro TCLSH is defined and is one, then put in code for the
+** "main" routine that will initialize Tcl.
+*/
+#if defined(TCLSH) && TCLSH==1
+static char zMainloop[] =
+  "set line {}\n"
+  "while {![eof stdin]} {\n"
+    "if {$line!=\"\"} {\n"
+      "puts -nonewline \"> \"\n"
+    "} else {\n"
+      "puts -nonewline \"% \"\n"
+    "}\n"
+    "flush stdout\n"
+    "append line [gets stdin]\n"
+    "if {[info complete $line]} {\n"
+      "if {[catch {uplevel #0 $line} result]} {\n"
+        "puts stderr \"Error: $result\"\n"
+      "} elseif {$result!=\"\"} {\n"
+        "puts $result\n"
+      "}\n"
+      "set line {}\n"
+    "} else {\n"
+      "append line \\n\n"
+    "}\n"
+  "}\n"
+;
+
+#define TCLSH_MAIN main   /* Needed to fake out mktclapp */
+int TCLSH_MAIN(int argc, char **argv){
+  Tcl_Interp *interp;
+  interp = Tcl_CreateInterp();
+  Sqlite_Init(interp);
+  if( argc>=2 ){
+    int i;
+    Tcl_SetVar(interp,"argv0",argv[1],TCL_GLOBAL_ONLY);
+    Tcl_SetVar(interp,"argv", "", TCL_GLOBAL_ONLY);
+    for(i=2; i<argc; i++){
+      Tcl_SetVar(interp, "argv", argv[i],
+          TCL_GLOBAL_ONLY | TCL_LIST_ELEMENT | TCL_APPEND_VALUE);
+    }
+    if( Tcl_EvalFile(interp, argv[1])!=TCL_OK ){
+      fprintf(stderr,"%s: %s\n", *argv, 
+         Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY)
+      );
+      return 1;
+    }
+  }else{
+    Tcl_GlobalEval(interp, zMainloop);
+  }
+  return 0;
+}
+#endif /* TCLSH */
diff --git a/test/crttbl.test b/test/crttbl.test
new file mode 100644 (file)
index 0000000..93f1eb4
--- /dev/null
@@ -0,0 +1,92 @@
+# Copyright (c) 1999, 2000 D. Richard Hipp
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA  02111-1307, USA.
+#
+# Author contact information:
+#   drh@hwaci.com
+#   http://www.hwaci.com/drh/
+#
+#***********************************************************************
+# This file implements regression tests for SQLite library.  The
+# focus of this file is testing the CREATE TABLE statement.
+#
+# $Id: crttbl.test,v 1.1 2000/05/29 20:41:51 drh Exp $
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+# Create a basic table and verify it is added to sqlite_master
+#
+do_test crttbl-1.1 {
+  execsql {
+    CREATE TABLE test1 (
+      one varchar(10),
+      two text
+    )
+  }
+  execsql {
+    SELECT sql FROM sqlite_master
+  }
+} {{CREATE TABLE test1 (
+      one varchar(10),
+      two text
+    )}}
+
+# Verify that both table files exists in the database directory
+#
+do_test crttbl-1.2 {
+  execsql {INSERT INTO test1 VALUES('hi', 'y''all')}
+  lsort [glob -nocomplain testdb/*.tbl]
+} {testdb/sqlite_master.tbl testdb/test1.tbl}
+
+# Verify the other fields of the sqlite_master file.
+#
+do_test crttbl-1.3 {
+  execsql {SELECT name, tbl_name, type FROM sqlite_master}
+} {test1 test1 table}
+
+# Close and reopen the database.  Verify that everything is
+# still the same.
+#
+do_test crttbl-1.4 {
+  db close
+  sqlite db testdb
+  execsql {SELECT name, tbl_name, type from sqlite_master}
+} {test1 test1 table}
+
+# Drop the database and make sure it disappears.
+#
+do_test crttbl-1.5 {
+  execsql {DROP TABLE test1}
+  execsql {SELECT * FROM sqlite_master}
+} {}
+
+# Verify that the file associated with the database is gone.
+#
+do_test crttbl-1.5 {
+  lsort [glob -nocomplain testdb/*.tbl]
+} {testdb/sqlite_master.tbl}
+
+# Close and reopen the database.  Verify that the table is
+# still gone.
+#
+do_test crttbl-1.6 {
+  db close
+  sqlite db testdb
+  execsql {SELECT name FROM sqlite_master}
+} {}
+
+finish_test
diff --git a/test/tester.tcl b/test/tester.tcl
new file mode 100644 (file)
index 0000000..25454e5
--- /dev/null
@@ -0,0 +1,86 @@
+# Copyright (c) 1999, 2000 D. Richard Hipp
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA  02111-1307, USA.
+#
+# Author contact information:
+#   drh@hwaci.com
+#   http://www.hwaci.com/drh/
+#
+#***********************************************************************
+# This file implements some common TCL routines used for regression
+# testing the SQLite library
+#
+# $Id: tester.tcl,v 1.1 2000/05/29 20:41:51 drh Exp $
+
+set nErr 0
+set nTest 0
+
+# Invoke the do_test procedure to run a single test 
+#
+proc do_test {name cmd expected} {
+  global argv nErr nTest
+  if {[llength $argv]==0} {
+    set go 1
+  } else {
+    set go 0
+    foreach pattern $argv {
+      if {[string match $pattern $name]} {
+        set go 1
+        break
+      }
+    }
+  }
+  if {!$go} return
+  incr nTest
+  puts -nonewline $name...
+  flush stdout
+  if {[catch {uplevel #0 "$cmd;\n"} result]} {
+    puts "\nError: $result"
+    incr nErr
+  } elseif {[string compare $result $expected]} {
+    puts "\nExpected: \[$expected\]\n     Got: \[$result\]"
+    incr nErr
+  } else {
+    puts " Ok"
+  }
+}
+
+# Run this routine last
+#
+proc finish_test {} {
+  global nTest nErr
+  puts "$nErr errors out of $nTest tests"
+  exit $nErr
+}
+
+# Create a test database
+#
+file delete -force testdb
+file mkdir testdb
+sqlite db testdb
+
+# A procedure to execute SQL
+#
+proc execsql {sql} {
+  set result {}
+  db eval $sql data {
+    foreach f [lsort [array names data]] {
+      if {$f=="*"} continue
+      lappend result $data($f)
+    }
+  }
+  return $result
+}