/ Check-in [5ec2b094]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:add version numbering (CVS 132)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:5ec2b094781bb3c32b0ef0284aa4dc2b26d9e873
User & Date: drh 2000-08-17 10:22:34
Context
2000-08-17
10:25
Version 1.0 (CVS 499) check-in: f37dd18e user: drh tags: trunk
10:22
add version numbering (CVS 132) check-in: 5ec2b094 user: drh tags: trunk
09:50
allow readonly access when write permission denied (CVS 131) check-in: 897b4bc0 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

    60     60     $(TOP)/src/delete.c \
    61     61     $(TOP)/src/expr.c \
    62     62     $(TOP)/src/insert.c \
    63     63     $(TOP)/src/main.c \
    64     64     $(TOP)/src/parse.y \
    65     65     $(TOP)/src/select.c \
    66     66     $(TOP)/src/shell.c \
    67         -  $(TOP)/src/sqlite.h \
           67  +  $(TOP)/src/sqlite.h.in \
    68     68     $(TOP)/src/sqliteInt.h \
    69     69     $(TOP)/src/tclsqlite.c \
    70     70     $(TOP)/src/tokenize.c \
    71     71     $(TOP)/src/update.c \
    72     72     $(TOP)/src/util.c \
    73     73     $(TOP)/src/vdbe.c \
    74     74     $(TOP)/src/vdbe.h \
    75     75     $(TOP)/src/where.c
    76     76   
    77     77   # This is the default Makefile target.  The objects listed here
    78     78   # are what get build when you type just "make" with no arguments.
    79     79   #
    80         -all:	libsqlite.a sqlite.h sqlite 
           80  +all:	sqlite.h libsqlite.a sqlite 
    81     81   
    82     82   # Generate the file "last_change" which contains the date of change
    83     83   # of the most recently modified source code file
    84     84   #
    85     85   last_change:	$(SRC)
    86     86   	cat $(SRC) | grep '$$Id: ' | sort +4 | tail -1 \
    87     87             | awk '{print $$5,$$6}' >last_change
................................................................................
    99     99   lemon:	$(TOP)/tool/lemon.c $(TOP)/tool/lempar.c
   100    100   	$(BCC) -o lemon $(TOP)/tool/lemon.c
   101    101   	cp $(TOP)/tool/lempar.c .
   102    102   
   103    103   # Header files used by all library source files.
   104    104   #
   105    105   HDR = \
   106         -   $(TOP)/src/sqlite.h  \
          106  +   sqlite.h  \
   107    107      $(TOP)/src/sqliteInt.h  \
   108    108      $(TOP)/src/dbbe.h  \
   109    109      $(TOP)/src/vdbe.h  \
   110    110      parse.h
   111    111   
   112    112   build.o:	$(TOP)/src/build.c $(HDR)
   113    113   	$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/build.c
................................................................................
   123    123   
   124    124   parse.h:	parse.c
   125    125   
   126    126   parse.c:	$(TOP)/src/parse.y lemon
   127    127   	cp $(TOP)/src/parse.y .
   128    128   	./lemon parse.y
   129    129   
   130         -sqlite.h:	$(TOP)/src/sqlite.h
   131         -	cp $(TOP)/src/sqlite.h .
          130  +sqlite.h:	$(TOP)/src/sqlite.h.in
          131  +	sed s/--VERS--/`cat ${TOP}/VERSION`/ $(TOP)/src/sqlite.h.in >sqlite.h
   132    132   
   133    133   tokenize.o:	$(TOP)/src/tokenize.c $(HDR)
   134    134   	$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/tokenize.c
   135    135   
   136    136   util.o:	$(TOP)/src/util.c $(HDR)
   137    137   	$(TCC) $(GDBM_FLAGS) -c $(TOP)/src/util.c
   138    138   
................................................................................
   167    167   test:	tclsqlite sqlite
   168    168   	./tclsqlite $(TOP)/test/all.test
   169    169   
   170    170   sqlite.tar.gz:	
   171    171   	pwd=`pwd`; cd $(TOP)/..; tar czf $$pwd/sqlite.tar.gz sqlite
   172    172   
   173    173   index.html:	$(TOP)/www/index.tcl sqlite.tar.gz last_change
   174         -	tclsh $(TOP)/www/index.tcl >index.html
          174  +	tclsh $(TOP)/www/index.tcl `cat $(TOP)/VERSION` >index.html
   175    175   
   176    176   sqlite.html:	$(TOP)/www/sqlite.tcl
   177    177   	tclsh $(TOP)/www/sqlite.tcl >sqlite.html
   178    178   
   179    179   c_interface.html:	$(TOP)/www/c_interface.tcl
   180    180   	tclsh $(TOP)/www/c_interface.tcl >c_interface.html
   181    181   

Added VERSION.

            1  +1.0

Deleted src/sqlite.h.

     1         -/*
     2         -** Copyright (c) 1999, 2000 D. Richard Hipp
     3         -**
     4         -** This program is free software; you can redistribute it and/or
     5         -** modify it under the terms of the GNU General Public
     6         -** License as published by the Free Software Foundation; either
     7         -** version 2 of the License, or (at your option) any later version.
     8         -**
     9         -** This program is distributed in the hope that it will be useful,
    10         -** but WITHOUT ANY WARRANTY; without even the implied warranty of
    11         -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12         -** General Public License for more details.
    13         -** 
    14         -** You should have received a copy of the GNU General Public
    15         -** License along with this library; if not, write to the
    16         -** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    17         -** Boston, MA  02111-1307, USA.
    18         -**
    19         -** Author contact information:
    20         -**   drh@hwaci.com
    21         -**   http://www.hwaci.com/drh/
    22         -**
    23         -*************************************************************************
    24         -** This header file defines the interface that the sqlite library
    25         -** presents to client programs.
    26         -**
    27         -** @(#) $Id: sqlite.h,v 1.4 2000/07/28 14:32:50 drh Exp $
    28         -*/
    29         -#ifndef _SQLITE_H_
    30         -#define _SQLITE_H_
    31         -
    32         -/*
    33         -** Each open sqlite database is represented by an instance of the
    34         -** following opaque structure.
    35         -*/
    36         -typedef struct sqlite sqlite;
    37         -
    38         -/*
    39         -** A function to open a new sqlite database.  
    40         -**
    41         -** If the database does not exist and mode indicates write
    42         -** permission, then a new database is created.  If the database
    43         -** does not exist and mode does not indicate write permission,
    44         -** then the open fails, an error message generated (if errmsg!=0)
    45         -** and the function returns 0.
    46         -** 
    47         -** If mode does not indicates user write permission, then the 
    48         -** database is opened read-only.
    49         -**
    50         -** The Truth:  As currently implemented, all databases are opened
    51         -** for writing all the time.  Maybe someday we will provide the
    52         -** ability to open a database readonly.  The mode parameters is
    53         -** provide in anticipation of that enhancement.
    54         -*/
    55         -sqlite *sqlite_open(const char *filename, int mode, char **errmsg);
    56         -
    57         -/*
    58         -** A function to close the database.
    59         -**
    60         -** Call this function with a pointer to a structure that was previously
    61         -** returned from sqlite_open() and the corresponding database will by closed.
    62         -*/
    63         -void sqlite_close(sqlite *);
    64         -
    65         -/*
    66         -** The type for a callback function.
    67         -*/
    68         -typedef int (*sqlite_callback)(void*,int,char**, char**);
    69         -
    70         -/*
    71         -** A function to executes one or more statements of SQL.
    72         -**
    73         -** If one or more of the SQL statements are queries, then
    74         -** the callback function specified by the 3rd parameter is
    75         -** invoked once for each row of the query result.  This callback
    76         -** should normally return 0.  If the callback returns a non-zero
    77         -** value then the query is aborted, all subsequent SQL statements
    78         -** are skipped and the sqlite_exec() function returns the SQLITE_ABORT.
    79         -**
    80         -** The 4th parameter is an arbitrary pointer that is passed
    81         -** to the callback function as its first parameter.
    82         -**
    83         -** The 2nd parameter to the callback function is the number of
    84         -** columns in the query result.  The 3rd parameter is an array
    85         -** of string holding the values for each column.  The 4th parameter
    86         -** is an array of strings holding the names of each column.
    87         -**
    88         -** The callback function may be NULL, even for queries.  A NULL
    89         -** callback is not an error.  It just means that no callback
    90         -** will be invoked.
    91         -**
    92         -** If an error occurs while parsing or evaluating the SQL (but
    93         -** not while executing the callback) then an appropriate error
    94         -** message is written into memory obtained from malloc() and
    95         -** *errmsg is made to point to that message.  If errmsg==NULL,
    96         -** then no error message is ever written.  The return value is
    97         -** SQLITE_ERROR if an error occurs.  The calling function is
    98         -** responsible for freeing the memory that holds the error
    99         -** message.
   100         -**
   101         -** If the query could not be executed because a database file is
   102         -** locked or busy, then this function returns SQLITE_BUSY.  (This
   103         -** behavior can be modified somewhat using the sqlite_busy_handler()
   104         -** and sqlite_busy_timeout() functions below.) If the query could 
   105         -** not be executed because a file is missing or has incorrect 
   106         -** permissions, this function returns SQLITE_ERROR.
   107         -*/
   108         -int sqlite_exec(
   109         -  sqlite*,                      /* An open database */
   110         -  char *sql,                    /* SQL to be executed */
   111         -  sqlite_callback,              /* Callback function */
   112         -  void *,                       /* 1st argument to callback function */
   113         -  char **errmsg                 /* Error msg written here */
   114         -);
   115         -
   116         -/*
   117         -** Return values fro sqlite_exec()
   118         -*/
   119         -#define SQLITE_OK        0    /* Successful result */
   120         -#define SQLITE_INTERNAL  1    /* An internal logic error in SQLite */
   121         -#define SQLITE_ERROR     2    /* SQL error or missing database */
   122         -#define SQLITE_PERM      3    /* Access permission denied */
   123         -#define SQLITE_ABORT     4    /* Callback routine requested an abort */
   124         -#define SQLITE_BUSY      5    /* One or more database files are locked */
   125         -#define SQLITE_NOMEM     6    /* A malloc() failed */
   126         -#define SQLITE_READONLY  7    /* Attempt to write a readonly database */
   127         -
   128         -/* This function returns true if the given input string comprises
   129         -** one or more complete SQL statements.
   130         -**
   131         -** The algorithm is simple.  If the last token other than spaces
   132         -** and comments is a semicolon, then return true.  otherwise return
   133         -** false.
   134         -*/
   135         -int sqlite_complete(const char *sql);
   136         -
   137         -/*
   138         -** This routine identifies a callback function that is invoked
   139         -** whenever an attempt is made to open a database table that is
   140         -** currently locked by another process or thread.  If the busy callback
   141         -** is NULL, then sqlite_exec() returns SQLITE_BUSY immediately if
   142         -** it finds a locked table.  If the busy callback is not NULL, then
   143         -** sqlite_exec() invokes the callback with three arguments.  The
   144         -** second argument is the name of the locked table and the third
   145         -** argument is the number of times the table has been busy.  If the
   146         -** busy callback returns 0, then sqlite_exec() immediately returns
   147         -** SQLITE_BUSY.  If the callback returns non-zero, then sqlite_exec()
   148         -** tries to open the table again and the cycle repeats.
   149         -**
   150         -** The default busy callback is NULL.
   151         -**
   152         -** Sqlite is re-entrant, so the busy handler may start a new query. 
   153         -** (It is not clear why anyone would every want to do this, but it
   154         -** is allowed, in theory.)  But the busy handler may not close the
   155         -** database.  Closing the database from a busy handler will delete 
   156         -** data structures out from under the executing query and will 
   157         -** probably result in a coredump.
   158         -*/
   159         -void sqlite_busy_handler(sqlite*, int(*)(void*,const char*,int), void*);
   160         -
   161         -/*
   162         -** This routine sets a busy handler that sleeps for a while when a
   163         -** table is locked.  The handler will sleep multiple times until 
   164         -** at least "ms" milleseconds of sleeping have been done.  After
   165         -** "ms" milleseconds of sleeping, the handler returns 0 which
   166         -** causes sqlite_exec() to return SQLITE_BUSY.
   167         -**
   168         -** Calling this routine with an argument less than or equal to zero
   169         -** turns off all busy handlers.
   170         -*/
   171         -void sqlite_busy_timeout(sqlite*, int ms);
   172         -
   173         -#endif /* _SQLITE_H_ */

Added src/sqlite.h.in.

            1  +/*
            2  +** Copyright (c) 1999, 2000 D. Richard Hipp
            3  +**
            4  +** This program is free software; you can redistribute it and/or
            5  +** modify it under the terms of the GNU General Public
            6  +** License as published by the Free Software Foundation; either
            7  +** version 2 of the License, or (at your option) any later version.
            8  +**
            9  +** This program is distributed in the hope that it will be useful,
           10  +** but WITHOUT ANY WARRANTY; without even the implied warranty of
           11  +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
           12  +** General Public License for more details.
           13  +** 
           14  +** You should have received a copy of the GNU General Public
           15  +** License along with this library; if not, write to the
           16  +** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
           17  +** Boston, MA  02111-1307, USA.
           18  +**
           19  +** Author contact information:
           20  +**   drh@hwaci.com
           21  +**   http://www.hwaci.com/drh/
           22  +**
           23  +*************************************************************************
           24  +** This header file defines the interface that the sqlite library
           25  +** presents to client programs.
           26  +**
           27  +** @(#) $Id: sqlite.h.in,v 1.1 2000/08/17 10:22:34 drh Exp $
           28  +*/
           29  +#ifndef _SQLITE_H_
           30  +#define _SQLITE_H_
           31  +
           32  +/*
           33  +** The version of the SQLite library
           34  +*/
           35  +#define SQLITE_VERSION          --VERS--
           36  +#define SQLITE_VERSION_STRING  "--VERS--"
           37  +
           38  +/*
           39  +** Each open sqlite database is represented by an instance of the
           40  +** following opaque structure.
           41  +*/
           42  +typedef struct sqlite sqlite;
           43  +
           44  +/*
           45  +** A function to open a new sqlite database.  
           46  +**
           47  +** If the database does not exist and mode indicates write
           48  +** permission, then a new database is created.  If the database
           49  +** does not exist and mode does not indicate write permission,
           50  +** then the open fails, an error message generated (if errmsg!=0)
           51  +** and the function returns 0.
           52  +** 
           53  +** If mode does not indicates user write permission, then the 
           54  +** database is opened read-only.
           55  +**
           56  +** The Truth:  As currently implemented, all databases are opened
           57  +** for writing all the time.  Maybe someday we will provide the
           58  +** ability to open a database readonly.  The mode parameters is
           59  +** provide in anticipation of that enhancement.
           60  +*/
           61  +sqlite *sqlite_open(const char *filename, int mode, char **errmsg);
           62  +
           63  +/*
           64  +** A function to close the database.
           65  +**
           66  +** Call this function with a pointer to a structure that was previously
           67  +** returned from sqlite_open() and the corresponding database will by closed.
           68  +*/
           69  +void sqlite_close(sqlite *);
           70  +
           71  +/*
           72  +** The type for a callback function.
           73  +*/
           74  +typedef int (*sqlite_callback)(void*,int,char**, char**);
           75  +
           76  +/*
           77  +** A function to executes one or more statements of SQL.
           78  +**
           79  +** If one or more of the SQL statements are queries, then
           80  +** the callback function specified by the 3rd parameter is
           81  +** invoked once for each row of the query result.  This callback
           82  +** should normally return 0.  If the callback returns a non-zero
           83  +** value then the query is aborted, all subsequent SQL statements
           84  +** are skipped and the sqlite_exec() function returns the SQLITE_ABORT.
           85  +**
           86  +** The 4th parameter is an arbitrary pointer that is passed
           87  +** to the callback function as its first parameter.
           88  +**
           89  +** The 2nd parameter to the callback function is the number of
           90  +** columns in the query result.  The 3rd parameter is an array
           91  +** of string holding the values for each column.  The 4th parameter
           92  +** is an array of strings holding the names of each column.
           93  +**
           94  +** The callback function may be NULL, even for queries.  A NULL
           95  +** callback is not an error.  It just means that no callback
           96  +** will be invoked.
           97  +**
           98  +** If an error occurs while parsing or evaluating the SQL (but
           99  +** not while executing the callback) then an appropriate error
          100  +** message is written into memory obtained from malloc() and
          101  +** *errmsg is made to point to that message.  If errmsg==NULL,
          102  +** then no error message is ever written.  The return value is
          103  +** SQLITE_ERROR if an error occurs.  The calling function is
          104  +** responsible for freeing the memory that holds the error
          105  +** message.
          106  +**
          107  +** If the query could not be executed because a database file is
          108  +** locked or busy, then this function returns SQLITE_BUSY.  (This
          109  +** behavior can be modified somewhat using the sqlite_busy_handler()
          110  +** and sqlite_busy_timeout() functions below.) If the query could 
          111  +** not be executed because a file is missing or has incorrect 
          112  +** permissions, this function returns SQLITE_ERROR.
          113  +*/
          114  +int sqlite_exec(
          115  +  sqlite*,                      /* An open database */
          116  +  char *sql,                    /* SQL to be executed */
          117  +  sqlite_callback,              /* Callback function */
          118  +  void *,                       /* 1st argument to callback function */
          119  +  char **errmsg                 /* Error msg written here */
          120  +);
          121  +
          122  +/*
          123  +** Return values fro sqlite_exec()
          124  +*/
          125  +#define SQLITE_OK        0    /* Successful result */
          126  +#define SQLITE_INTERNAL  1    /* An internal logic error in SQLite */
          127  +#define SQLITE_ERROR     2    /* SQL error or missing database */
          128  +#define SQLITE_PERM      3    /* Access permission denied */
          129  +#define SQLITE_ABORT     4    /* Callback routine requested an abort */
          130  +#define SQLITE_BUSY      5    /* One or more database files are locked */
          131  +#define SQLITE_NOMEM     6    /* A malloc() failed */
          132  +#define SQLITE_READONLY  7    /* Attempt to write a readonly database */
          133  +
          134  +/* This function returns true if the given input string comprises
          135  +** one or more complete SQL statements.
          136  +**
          137  +** The algorithm is simple.  If the last token other than spaces
          138  +** and comments is a semicolon, then return true.  otherwise return
          139  +** false.
          140  +*/
          141  +int sqlite_complete(const char *sql);
          142  +
          143  +/*
          144  +** This routine identifies a callback function that is invoked
          145  +** whenever an attempt is made to open a database table that is
          146  +** currently locked by another process or thread.  If the busy callback
          147  +** is NULL, then sqlite_exec() returns SQLITE_BUSY immediately if
          148  +** it finds a locked table.  If the busy callback is not NULL, then
          149  +** sqlite_exec() invokes the callback with three arguments.  The
          150  +** second argument is the name of the locked table and the third
          151  +** argument is the number of times the table has been busy.  If the
          152  +** busy callback returns 0, then sqlite_exec() immediately returns
          153  +** SQLITE_BUSY.  If the callback returns non-zero, then sqlite_exec()
          154  +** tries to open the table again and the cycle repeats.
          155  +**
          156  +** The default busy callback is NULL.
          157  +**
          158  +** Sqlite is re-entrant, so the busy handler may start a new query. 
          159  +** (It is not clear why anyone would every want to do this, but it
          160  +** is allowed, in theory.)  But the busy handler may not close the
          161  +** database.  Closing the database from a busy handler will delete 
          162  +** data structures out from under the executing query and will 
          163  +** probably result in a coredump.
          164  +*/
          165  +void sqlite_busy_handler(sqlite*, int(*)(void*,const char*,int), void*);
          166  +
          167  +/*
          168  +** This routine sets a busy handler that sleeps for a while when a
          169  +** table is locked.  The handler will sleep multiple times until 
          170  +** at least "ms" milleseconds of sleeping have been done.  After
          171  +** "ms" milleseconds of sleeping, the handler returns 0 which
          172  +** causes sqlite_exec() to return SQLITE_BUSY.
          173  +**
          174  +** Calling this routine with an argument less than or equal to zero
          175  +** turns off all busy handlers.
          176  +*/
          177  +void sqlite_busy_timeout(sqlite*, int ms);
          178  +
          179  +#endif /* _SQLITE_H_ */

Changes to www/changes.tcl.

    13     13   
    14     14   
    15     15   proc chng {date desc} {
    16     16     puts "<DT><B>$date</B></DT>"
    17     17     puts "<DD><P><UL>$desc</UL></P></DD>"
    18     18   }
    19     19   
    20         -chng {2000 Aug 17} {
           20  +chng {2000 Aug 17 (Version 1.0)} {
    21     21   <li>Change the <b>sqlite</b> program so that it can read
    22     22       databases for which it lacks write permission.  (It used to
    23     23       refuse all access if it could not write.)</li>
    24     24   }
    25     25   
    26     26   chng {2000 Aug 9} {
    27     27   <li>Treat carriage returns as white space.</li>

Changes to www/index.tcl.

     1      1   #
     2      2   # Run this TCL script to generate HTML for the index.html file.
     3      3   #
     4         -set rcsid {$Id: index.tcl,v 1.26 2000/08/04 13:49:03 drh Exp $}
            4  +set rcsid {$Id: index.tcl,v 1.27 2000/08/17 10:22:34 drh Exp $}
     5      5   
     6      6   puts {<html>
     7      7   <head><title>SQLite: An SQL Database Engine Built Atop GDBM</title></head>
     8      8   <body bgcolor=white>
     9      9   <h1 align=center>SQLite: An SQL Database Engine Built Atop
    10     10   <a href="http://www.gnu.org/software/gdbm/gdbm.html">GDBM</a></h1>
    11     11   <p align=center>}
    12     12   puts "This page was last modified on [lrange $rcsid 3 4] GMT<br>"
    13         -puts "The SQLite source code was last modifed on [exec cat last_change] GMT"
           13  +set vers [lindex $argv 0]
           14  +puts "The latest SQLite version is <b>$vers</b>"
           15  +puts " created on [exec cat last_change] GMT"
    14     16   puts {</p>}
    15     17   
    16     18   puts {<h2>Introduction</h2>
    17     19   
    18     20   <p>SQLite is an SQL database engine built on top of the
    19     21   <a href="http://www.gnu.org/software/gdbm/gdbm.html">GDBM library</a>.
    20     22   SQLite includes a standalone command-line
................................................................................
   122    124   <img src="http://www.egroups.com/img/ui/join.gif" border=0 /><br />
   123    125   Click to subscribe to sqlite</a>
   124    126   </center>}
   125    127   
   126    128   puts {<h2>Download</h2>
   127    129   
   128    130   <p>You can download a tarball containing all source
   129         -code for SQLite (including the TCL scripts that generate the
          131  +code for SQLite
          132  +}
          133  +puts "version $vers"
          134  +puts {
          135  +(including the TCL scripts that generate the
   130    136   HTML files for this website) at <a href="sqlite.tar.gz">sqlite.tar.gz</a>.}
   131         -puts "This is a [file size sqlite.tar.gz] byte download.  The
   132         -tarball was last modified at [clock format [file mtime sqlite.tar.gz]]"
          137  +puts "This is a [file size sqlite.tar.gz] byte download."
   133    138   puts {</p>
   134    139   
   135    140   <p>To build sqlite under Unix, just unwrap the tarball, create a separate
   136    141   build directory, run configure from the build directory and then
   137    142   type "make".  For example:</p>
   138    143   
   139    144   <blockquote><pre>