|
From: <cre...@us...> - 2006-10-12 23:35:26
|
Revision: 1555
http://svn.sourceforge.net/frontierkernel/?rev=1555&view=rev
Author: creecode
Date: 2006-10-12 16:35:14 -0700 (Thu, 12 Oct 2006)
Log Message:
-----------
ported r1393:1553 (sqlite) from trunk. part 2
Modified Paths:
--------------
Frontier/branches/FSRef_Migration/Common/headers/kernelverbdefs.h
Frontier/branches/FSRef_Migration/Common/headers/kernelverbs.h
Frontier/branches/FSRef_Migration/Common/headers/langinternal.h
Frontier/branches/FSRef_Migration/Common/headers/versions.h
Frontier/branches/FSRef_Migration/Common/resources/Mac/kernelverbs.r
Frontier/branches/FSRef_Migration/Common/resources/Win32/WinLand.rc
Frontier/branches/FSRef_Migration/Common/resources/Win32/kernelverbs.rc
Frontier/branches/FSRef_Migration/Common/source/shell.c
Frontier/branches/FSRef_Migration/build_XCode/Frontier.xcodeproj/project.pbxproj
Added Paths:
-----------
Frontier/branches/FSRef_Migration/Common/headers/langsqlite.h
Frontier/branches/FSRef_Migration/Common/source/langsqlite.c
Modified: Frontier/branches/FSRef_Migration/Common/headers/kernelverbdefs.h
===================================================================
--- Frontier/branches/FSRef_Migration/Common/headers/kernelverbdefs.h 2006-10-12 23:32:33 UTC (rev 1554)
+++ Frontier/branches/FSRef_Migration/Common/headers/kernelverbdefs.h 2006-10-12 23:35:14 UTC (rev 1555)
@@ -51,4 +51,4 @@
#define idregexpverbs 1023 /*2003-04-22 AR: regular expression verbs*/
#define idmathverbs 1024 /*2004-12-29 SMD: extended math verbs*/
#define idcryptverbs 1025 /* 2006-03-07 creedon: crypt verbs */
-
+#define idsqliteverbs 1026 /* 2006-03-15 gewirtz sqlite verbs */
Modified: Frontier/branches/FSRef_Migration/Common/headers/kernelverbs.h
===================================================================
--- Frontier/branches/FSRef_Migration/Common/headers/kernelverbs.h 2006-10-12 23:32:33 UTC (rev 1554)
+++ Frontier/branches/FSRef_Migration/Common/headers/kernelverbs.h 2006-10-12 23:35:14 UTC (rev 1555)
@@ -56,3 +56,4 @@
extern boolean cryptinitverbs (void); /* langcrypt.c */
+extern boolean sqliteinitverbs (void); /* langsqlite.c */
\ No newline at end of file
Modified: Frontier/branches/FSRef_Migration/Common/headers/langinternal.h
===================================================================
--- Frontier/branches/FSRef_Migration/Common/headers/langinternal.h 2006-10-12 23:32:33 UTC (rev 1554)
+++ Frontier/branches/FSRef_Migration/Common/headers/langinternal.h 2006-10-12 23:35:14 UTC (rev 1555)
@@ -202,6 +202,8 @@
#define frnonexistantgroupnameerror 160
#define replaceitemerror 161 /* 2005-09-26 creedon */
#define cmdshellnotfounderror 162 /* 2006-03-10 aradke */
+#define sqliteopenerror 163 /* 2006-03-17 gewirtz */
+#define sqlitedberror 164 /* 2006-03-17 gewirtz */
#define langstacklist 137
Copied: Frontier/branches/FSRef_Migration/Common/headers/langsqlite.h (from rev 1553, Frontier/trunk/Common/headers/langsqlite.h)
===================================================================
--- Frontier/branches/FSRef_Migration/Common/headers/langsqlite.h (rev 0)
+++ Frontier/branches/FSRef_Migration/Common/headers/langsqlite.h 2006-10-12 23:35:14 UTC (rev 1555)
@@ -0,0 +1,69 @@
+
+/* $Id: langsqlite.h,v 1.1.2.1 2006/03/24 01:31:35 davidgewirtz Exp $ */
+
+/******************************************************************************
+
+ UserLand Frontier(tm) -- High performance Web content management,
+ object database, system-level and Internet scripting environment,
+ including source code editing and debugging.
+
+ Copyright (C) 1992-2004 UserLand Software, Inc.
+
+ 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
+
+******************************************************************************/
+
+/* prototypes */
+
+extern boolean sqliteopenverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-03-15 gewirtz */
+
+extern boolean sqlitecloseverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-03-17 gewirtz */
+
+extern boolean sqlitecompilequeryverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */
+
+extern boolean sqliteclearqueryverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */
+
+extern boolean sqliteresetqueryverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-08-31 gewirtz */
+
+extern boolean sqlitestepqueryverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-08-31 gewirtz */
+
+extern boolean sqlitegetcolumncountverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */
+
+extern boolean sqlitegetcolumntypeverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */
+
+extern boolean sqlitegetcolumnintverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */
+
+extern boolean sqlitegetcolumndoubleverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */
+
+extern boolean sqlitegetcolumntextverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */
+
+extern boolean sqlitegetcolumnnameverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-18 gewirtz */
+
+extern boolean sqlitegetcolumnverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-20 gewirtz */
+
+extern boolean sqlitegetrowverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-08-31 gewirtz */
+
+extern boolean sqlitegeterrormessageverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-04-20 gewirtz */
+
+extern boolean sqliteinitverbs (void); /* 2006-03-15 gewirtz */
+
+/* boolean hmacmd5 (unsigned char *, int, unsigned char *, int, unsigned char *);*/ /* 2006-03-05 creedon */
+
+/* boolean hmacsha1 (unsigned char *, int, unsigned char *, int, unsigned char *);*/ /* 2006-03-12 creedon */
+
+/* SQLITE MESSAGES */
+#define SQLITE_COLUMN_ERROR_0 "\xe9""SQLite column error. Frontier uses a base-1 index. Columns must be specified with 1 indicating the first column. This is different from the SQLite API, which requires that columns must be specified with 0 indicating the first column."
+#define SQLITE_COLUMN_ERROR_MAX "\x50""SQLite column error. An attempt was made to access a column that does not exist."
+#define SQLITE_COLUMN_ERROR_UNDEFINED "\x29""SQLite returned an undefined column type."
\ No newline at end of file
Modified: Frontier/branches/FSRef_Migration/Common/headers/versions.h
===================================================================
--- Frontier/branches/FSRef_Migration/Common/headers/versions.h 2006-10-12 23:32:33 UTC (rev 1554)
+++ Frontier/branches/FSRef_Migration/Common/headers/versions.h 2006-10-12 23:35:14 UTC (rev 1555)
@@ -69,10 +69,10 @@
#define APP_SUBMINOR_VERSION_BCD 0x10 /* sub and minor version in BCD notation */
#define APP_STAGE_CODE 0x40 /* dev = 0x20, alpha = 0x40, beta = 0x60, final = 0x80 */
- #define APP_REVISION_LEVEL 10 /* for non-final releases only */
- #define APP_BUILD_NUMBER 10 /* increment by one for every release, final or not */
+ #define APP_REVISION_LEVEL 11 /* for non-final releases only */
+ #define APP_BUILD_NUMBER 11 /* increment by one for every release, final or not */
- #define APP_VERSION_STRING "10.1a10"
+ #define APP_VERSION_STRING "10.1a11"
#else
@@ -95,10 +95,10 @@
#define APP_SUBMINOR_VERSION_BCD 0x10 /* sub and minor version in BCD notation */
#define APP_STAGE_CODE 0x40 /* dev = 0x20, alpha = 0x40, beta = 0x60, final = 0x80 */
- #define APP_REVISION_LEVEL 10 /* for non-final releases only */
- #define APP_BUILD_NUMBER 10 /* increment by one for every release, final or not */
+ #define APP_REVISION_LEVEL 11 /* for non-final releases only */
+ #define APP_BUILD_NUMBER 11 /* increment by one for every release, final or not */
- #define APP_VERSION_STRING "10.1a10"
+ #define APP_VERSION_STRING "10.1a11"
#endif
#else
@@ -121,10 +121,10 @@
#define APP_SUBMINOR_VERSION_BCD 0x10 /* sub and minor version in BCD notation */
#define APP_STAGE_CODE 0x40 /* dev = 0x20, alpha = 0x40, beta = 0x60, final = 0x80 */
- #define APP_REVISION_LEVEL 10 /* for non-final releases only */
- #define APP_BUILD_NUMBER 10 /* increment by one for every release, final or not */
+ #define APP_REVISION_LEVEL 11 /* for non-final releases only */
+ #define APP_BUILD_NUMBER 11 /* increment by one for every release, final or not */
- #define APP_VERSION_STRING "10.1a10"
+ #define APP_VERSION_STRING "10.1a11"
#endif
Modified: Frontier/branches/FSRef_Migration/Common/resources/Mac/kernelverbs.r
===================================================================
--- Frontier/branches/FSRef_Migration/Common/resources/Mac/kernelverbs.r 2006-10-12 23:32:33 UTC (rev 1554)
+++ Frontier/branches/FSRef_Migration/Common/resources/Mac/kernelverbs.r 2006-10-12 23:35:14 UTC (rev 1555)
@@ -1143,3 +1143,26 @@
}
};
+resource 'EFP#' (idsqliteverbs, "sqlite") { /* 2006-08-31 gewirtz sqlite verbs */
+ {
+ "sqlite", false, {
+
+ "open",
+ "compileQuery",
+ "clearQuery",
+ "resetQuery",
+ "stepQuery",
+ "getColumnCount",
+ "getColumnType",
+ "getColumnInt",
+ "getColumnDouble",
+ "getColumnText",
+ "getColumnName",
+ "getColumn",
+ "getRow",
+ "getErrorMessage",
+ "close" // 2006-09-07 - kw - renamed from getClose
+ }
+ }
+};
+
Modified: Frontier/branches/FSRef_Migration/Common/resources/Win32/WinLand.rc
===================================================================
--- Frontier/branches/FSRef_Migration/Common/resources/Win32/WinLand.rc 2006-10-12 23:32:33 UTC (rev 1554)
+++ Frontier/branches/FSRef_Migration/Common/resources/Win32/WinLand.rc 2006-10-12 23:35:14 UTC (rev 1555)
@@ -1533,6 +1533,8 @@
160 Lang_Errors DISCARDABLE BEGIN "Can't execute command because the replacement string contains a non-existant group name at character #^0.\0" END
161 Lang_Errors DISCARDABLE BEGIN "An item named \042^0\042 already exists.\0" END // Replace it or create a duplicate?" /* 2005-09-26 creedon */
162 Lang_Errors DISCARDABLE BEGIN "Can't run shell command because the shell \042^0\042 was not found.\0" END /* 2006-03-10 aradke */
+ 163 Lang_Errors DISCARDABLE BEGIN "Can't open database: ^0.\0" END /* 2006-03-17 gewirtz */
+ 164 Lang_Errors DISCARDABLE BEGIN "Database error: ^0.\0" END /* 2006-03-17 gewirtz */
1 Mac_Errors DISCARDABLE BEGIN "The \042^0\042 folder is full.\0" END
2 Mac_Errors DISCARDABLE BEGIN "The disk is full.\0" END
Modified: Frontier/branches/FSRef_Migration/Common/resources/Win32/kernelverbs.rc
===================================================================
--- Frontier/branches/FSRef_Migration/Common/resources/Win32/kernelverbs.rc 2006-10-12 23:32:33 UTC (rev 1554)
+++ Frontier/branches/FSRef_Migration/Common/resources/Win32/kernelverbs.rc 2006-10-12 23:35:14 UTC (rev 1555)
@@ -1078,3 +1078,26 @@
"hmacSHA1\0",
END
+1026 /* sqliteverbs */ EFP DISCARDABLE
+ BEGIN
+ 1, // Number of "blocks" in this resource
+ "sqlite\0", // Function Processor name
+ false, // Window required
+ 15, // Count of verbs
+ "open\0",
+ "compileQuery\0",
+ "clearQuery\0",
+ "resetQuery\0",
+ "stepQuery\0",
+ "getColumnCount\0",
+ "getColumnType\0",
+ "getColumnInt\0",
+ "getColumnDouble\0",
+ "getColumnText\0",
+ "getColumnName\0",
+ "getColumn\0",
+ "getRow\0",
+ "getErrorMessage\0",
+ "close\0"
+ END
+
Copied: Frontier/branches/FSRef_Migration/Common/source/langsqlite.c (from rev 1553, Frontier/trunk/Common/source/langsqlite.c)
===================================================================
--- Frontier/branches/FSRef_Migration/Common/source/langsqlite.c (rev 0)
+++ Frontier/branches/FSRef_Migration/Common/source/langsqlite.c 2006-10-12 23:35:14 UTC (rev 1555)
@@ -0,0 +1,920 @@
+
+/* $Id: langsqlite.c,v 1.1.2.1 2006/03/24 01:32:31 davidgewirtz Exp $ */
+
+/******************************************************************************
+
+ UserLand Frontier(tm) -- High performance Web content management,
+ object database, system-level and Internet scripting environment,
+ including source code editing and debugging.
+
+ Copyright (C) 1992-2004 UserLand Software, Inc.
+
+ 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
+
+******************************************************************************/
+
+#include "frontier.h"
+#include "standard.h"
+
+#include "frontierconfig.h"
+
+#include "error.h"
+#include "ops.h"
+#include "langinternal.h"
+#include "kernelverbs.h"
+#include "kernelverbdefs.h"
+#include "resources.h"
+#include "strings.h"
+#include "tablestructure.h"
+#include "lang.h"
+#include "oplist.h"
+#include "langsystem7.h"
+#include "langexternal.h"
+
+#include "langsqlite.h"
+#include <sqlite3.h>
+
+/* Building SQLite into Frontier
+
+The SQLite source distribution is compiled into the Frontier code as part of this
+module. A key goal in this implementation was to avoid touching any of the SQLite
+source files. SQLite is pretty complex in its coding, and I didn't want to take a
+chance that any changes to the original SQLite code would muck up the database
+functionality.
+
+To include the latest SQLite distribution (we're implementing SQLite 3 here),
+download the SQLite source code from http://www.sqlite.org/download.html.
+
+Move all the SQLite source files into the \Common\sqlite3 folder. If you need to
+include new files in the SQLite project, be sure that shell.c and tclsqlite.c are
+NOT included in the Frontier project.
+
+That's it. For further tips, see the Frontier Lab Notebook article at:
+
+http://manila.zatz.com/frontierkernel/stories/storyReader$29
+
+-- DG
+
+*/
+
+typedef enum tysqliteverbtoken { /* verbs that are processed by langsqlite.c */
+
+ openfunc,
+ compilequeryfunc,
+ clearqueryfunc,
+ resetqueryfunc,
+ stepqueryfunc,
+ getcolumncountfunc,
+ getcolumntypefunc,
+ getcolumnintfunc,
+ getcolumndoublefunc,
+ getcolumntextfunc,
+ getcolumnnamefunc,
+ getcolumnfunc,
+ getrowfunc,
+ geterrormessagefunc,
+ closefunc,
+ ctsqliteverbs
+ } tysqliteverbtoken;
+
+
+static boolean sqlitefunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+
+ /*
+ 2006-03-15 gewirtz: created, cribbed from langcrypt, itself cribbed from htmlfunctionvalue
+ */
+
+ hdltreenode hp1 = hparam1;
+ tyvaluerecord *v = vreturned;
+
+ setbooleanvalue (false, v); /* by default, sqlite functions return false */
+
+ switch (token) {
+
+ case openfunc: { /* 2006-03-14 gewirtz: open an SQLite db */
+
+ return (sqliteopenverb (hp1, v, bserror));
+ } /* openfunc */
+
+ case compilequeryfunc: { /* 2006-04-18 gewirtz: prepare an SQLite statement */
+
+ return (sqlitecompilequeryverb (hp1, v, bserror));
+ } /* compilequeryfunc */
+
+ case clearqueryfunc: { /* 2006-04-18 gewirtz: finalize an SQLite statement */
+
+ return (sqliteclearqueryverb (hp1, v, bserror));
+ } /* clearqueryfunc */
+
+ case resetqueryfunc: { /* 2006-08-31 gewirtz: reset an SQLite query statement */
+
+ return (sqliteresetqueryverb (hp1, v, bserror));
+ } /* resetqueryfunc */
+
+ case stepqueryfunc: { /* 2006-08-31 gewirtz: move the cursor one step after the query */
+
+ return (sqlitestepqueryverb (hp1, v, bserror));
+ } /* stepqueryfunc */
+
+ case getcolumncountfunc: { /* 2006-04-18 gewirtz: get the number of columns */
+
+ return (sqlitegetcolumncountverb (hp1, v, bserror));
+ } /* getcolumncountfunc */
+
+ case getcolumntypefunc: { /* 2006-04-18 gewirtz: get the type of the referenced column */
+ /* this version returns Frontier strings */
+ return (sqlitegetcolumntypeverb (hp1, v, bserror));
+ } /* getcolumntypefunc */
+
+ case getcolumnintfunc: { /* 2006-04-18 gewirtz: get an int value from the column */
+
+ return (sqlitegetcolumnintverb (hp1, v, bserror));
+ } /* getcolumnintfunc */
+
+ case getcolumndoublefunc: { /* 2006-04-18 gewirtz: get a double value from the column */
+
+ return (sqlitegetcolumndoubleverb (hp1, v, bserror));
+ } /* getcolumndoublefunc */
+
+ case getcolumntextfunc: { /* 2006-04-18 gewirtz: get a text value from the column */
+
+ return (sqlitegetcolumntextverb (hp1, v, bserror));
+ } /* getcolumntextfunc */
+
+ case getcolumnnamefunc: { /* 2006-04-18 gewirtz: get the field name of the column */
+
+ return (sqlitegetcolumnnameverb (hp1, v, bserror));
+ } /* getcolumnnamefunc */
+
+ case getcolumnfunc: { /* 2006-04-20 gewirtz: get the value of the column */
+
+ return (sqlitegetcolumnverb (hp1, v, bserror));
+ } /* getcolumnfunc */
+
+ case getrowfunc: { /* 2006-08-31 gewirtz: get the values in a row */
+
+ return (sqlitegetrowverb (hp1, v, bserror));
+ } /* getrowfunc */
+
+ case geterrormessagefunc: { /* 2006-04-20 gewirtz: get the SQLite error message */
+
+ return (sqlitegeterrormessageverb (hp1, v, bserror));
+ } /* geterrormessagefunc */
+
+ case closefunc: { /* 2006-03-15 gewirtz: close an SQLite db */
+
+ return (sqlitecloseverb (hp1, v, bserror));
+ } /* closefunc */
+
+ default:
+ getstringlist (langerrorlist, unimplementedverberror, bserror);
+
+ return (false);
+ } /* switch */
+ } /* sqlitefunctionvalue */
+
+
+boolean sqliteinitverbs (void) {
+
+ /* 2006-03-15 gewirtz: created, cribbed from cryptinitverbs */
+
+ return (loadfunctionprocessor (idsqliteverbs, &sqlitefunctionvalue));
+ } /* sqliteinitverbs */
+
+static void sqliteOpenError (const char *errmsg, bigstring bserror) {
+ bigstring bserrmsg;
+
+ copyctopstring (errmsg, bserrmsg); /* This creates a pstring at bserrmsg */
+ getstringlist (langerrorlist, sqliteopenerror, bserror);
+ parsedialogstring (bserror, bserrmsg, nil, nil, nil, bserror);
+
+ return;
+ } /*sqliteOpenError*/
+
+static void sqliteDatabaseError (const char *errmsg, bigstring bserror) {
+ bigstring bserrmsg;
+
+ copyctopstring (errmsg, bserrmsg); /* This creates a pstring at bserrmsg */
+ getstringlist (langerrorlist, sqlitedberror, bserror);
+ parsedialogstring (bserror, bserrmsg, nil, nil, nil, bserror);
+
+ return;
+ } /*sqliteDatabaseError*/
+
+static void sqliteScriptError (const char *errmsg, bigstring bserror) {
+ bigstring bserrmsg;
+
+ copyctopstring (errmsg, bserrmsg); /* This creates a pstring at bserrmsg */
+ getstringlist (langerrorlist, notfunctionerror, bserror);
+ parsedialogstring (bserror, bserrmsg, nil, nil, nil, bserror);
+
+ return;
+ } /*sqliteScriptError*/
+
+
+boolean sqliteopenverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ Handle dbfile; /* path to database file */
+ sqlite3 *dbid; /* the SQLite database handle */
+ int returnCode; /* return code from SQLite call */
+
+ /*
+ sqlite.open(dbfile)
+
+ Action: opens a SQLite database
+ Params: a file path to the database file
+ Returns: a value that corresponds to the opened database ID
+ Usage: call in a try statement
+ Notes: do not pass the opened database ID across threads
+
+ SQLite docs: http://www.sqlite.org/capi3ref.html#sqlite3_open.
+ */
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ if (!gettextvalue (hparam1, 1, &dbfile)) /* get the param */
+ return (false);
+
+ pushcharhandle (0x00, dbfile); /* convert *dbfile to a string */
+
+ /* Process the SQLite sequence */
+ returnCode = sqlite3_open(*dbfile, &dbid);
+ if(returnCode) {
+ sqliteOpenError(sqlite3_errmsg(dbid), bserror); /* send database open error */
+ sqlite3_close(dbid);
+ return (false);
+ }
+
+ /* return the db address to the scripter */
+// return (setheapvalue ((Handle) dbid, longvaluetype, vreturned));
+ // 2006-09-06 - kw - simply return a long
+ return (setlongvalue ((long) dbid, vreturned));
+
+} /* sqliteopenverb */
+
+boolean sqlitecloseverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ sqlite3 *dbid; /* the SQLite database handle */
+ int returnCode; /* return code from SQLite call */
+
+ /*
+ sqlite.close(dbid)
+
+ Action: close an SQLite database
+ Params: a database id
+ Returns: an SQLite result code
+ Usage: check result code for success or failure
+ Notes: do not pass the opened database ID across threads.
+
+ SQLite docs: http://www.sqlite.org/capi3ref.html#sqlite3_close.
+ */
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ if (!getlongvalue (hparam1, 1, (long *) &dbid)) /* Get the long value, which becomes the db pointer */
+ return (false);
+
+ /* Process the SQLite sequence */
+ returnCode = sqlite3_close(dbid);
+
+ return setlongvalue (returnCode, vreturned);
+
+} /* sqlitecloseverb */
+
+boolean sqlitecompilequeryverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ Handle query; /* the SQL query passed to the SQLite engine */
+ sqlite3 *dbid; /* the SQLite database handle */
+ sqlite3_stmt *queryid = 0; /* the compiled query */
+ int returnCode; /* return code from SQLite call */
+
+ /*
+ sqlite.compileQuery(dbid, query)
+
+ Action: compile an SQLite query
+ Params: a database id and a query string
+ Returns: a query id
+ Usage: call in a try statement
+ Notes: do not pass the opened database ID across threads.
+
+ SQLite docs: http://www.sqlite.org/capi3ref.html#sqlite3_prepare.
+
+ Code that is a good example of prepare in use:
+ http://souptonuts.sourceforge.net/code/eatblob.c.html
+ */
+
+ if (!getlongvalue (hparam1, 1, (long *) &dbid)) /* Get the long value, which becomes the db pointer */
+ return (false);
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ if (!getreadonlytextvalue (hparam1, 2, &query)) /* get the query param */
+ return (false);
+
+ /* Process the SQLite sequence */
+ returnCode = sqlite3_prepare(dbid, *query, gethandlesize(query), &queryid, 0);
+ if(returnCode != SQLITE_OK || queryid == NULL) {
+ sqliteDatabaseError(sqlite3_errmsg(dbid), bserror); /* send database error */
+ return (false);
+ }
+
+ return (setlongvalue ((long) queryid, vreturned)); /* return the db address to the scripter */
+
+} /* sqlitecompilequeryverb */
+
+boolean sqliteclearqueryverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ sqlite3_stmt *queryid; /* query id */
+ int returnCode; /* return code from SQLite call */
+
+ /*
+ sqlite.clearQuery(queryid)
+
+ Action: clear an SQLite query
+ Params: a query id
+ Returns: an SQLite result code
+ Notes: do not pass the opened database ID across threads.
+
+ SQLite docs: http://www.sqlite.org/capi3ref.html#sqlite3_finalize.
+ */
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ if (!getlongvalue (hparam1, 1, (long *) &queryid)) /* Get the long value, which becomes the queryid pointer */
+ return (false);
+
+ /* Process the SQLite sequence */
+ returnCode = sqlite3_finalize(queryid);
+
+ return setlongvalue (returnCode, vreturned);
+
+} /* sqliteclearqueryverb */
+
+boolean sqliteresetqueryverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ sqlite3_stmt *queryid; /* query id */
+ int returnCode; /* return code from SQLite call */
+
+ /*
+ sqlite.resetQuery(queryid)
+
+ Action: reset an SQLite query, so you can scan again from the beginning
+ Params: a query id
+ Returns: an SQLite result code
+ Notes: do not pass the opened database ID across threads.
+
+ SQLite docs: http://www.sqlite.org/capi3ref.html#sqlite3_reset.
+ */
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ if (!getlongvalue (hparam1, 1, (long *) &queryid)) /* Get the long value, which becomes the queryid pointer */
+ return (false);
+
+ /* Process the SQLite sequence */
+ returnCode = sqlite3_reset(queryid);
+
+ return setlongvalue (returnCode, vreturned);
+
+} /* sqliteresetqueryverb */
+
+boolean sqlitestepqueryverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ sqlite3_stmt *queryid; /* query id */
+ int returnCode; /* return code from SQLite call */
+
+ /*
+ sqlite.stepQuery(queryid)
+
+ Action: perform the query, moving the query cursor to the next row of results
+ Params: a query id
+ Returns: an SQLite result code
+ Notes: do not pass the opened database ID across threads.
+
+ SQLite docs: http://www.sqlite.org/capi3ref.html#sqlite3_step.
+ */
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ if (!getlongvalue (hparam1, 1, (long *) &queryid)) /* Get the long value, which becomes the pline pointer */
+ return (false);
+
+ /* Process the SQLite sequence */
+ returnCode = sqlite3_step(queryid);
+
+ return setlongvalue (returnCode, vreturned);
+
+} /* sqlitestepqueryverb */
+
+boolean sqlitegetcolumntypeverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ long columnNumber; /* column number */
+ sqlite3_stmt *queryid; /* query id */
+ int returnCode; /* return code from SQLite call */
+ int columnCount;
+
+ /*
+ sqlite.getColumnType(queryid, columnNumber)
+
+ Action: Retrieve the type of the specified column
+ Params: a query id and the number of the column (1 base)
+ Returns: an SQLite result code
+ Notes: do not pass the opened database ID across threads.
+
+ SQLite docs: http://www.sqlite.org/capi3ref.html#sqlite3_column_type.
+ */
+
+ if (!getlongvalue (hparam1, 1, (long *) &queryid)) /* Get the long value, which becomes the queryid pointer */
+ return (false);
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ /* Enter the verb, convert the param to null-terminated string */
+ if (!getlongvalue (hparam1, 2, &columnNumber))
+ return (false);
+
+ /* Validate the column number */
+ if (columnNumber < 1) {
+ langerrormessage (SQLITE_COLUMN_ERROR_0);
+ return (false);
+ }
+ columnCount = sqlite3_column_count(queryid);
+ if (columnNumber > columnCount) {
+ langerrormessage (SQLITE_COLUMN_ERROR_MAX);
+ return (false);
+ }
+
+ /* Process the SQLite sequence */
+ --columnNumber; /* Frontier uses base 1, but SQLite uses a base of 0 for its column numbering */
+ returnCode = sqlite3_column_type(queryid, (int) columnNumber);
+
+ switch(returnCode) {
+
+ case SQLITE_INTEGER: {
+ return setostypevalue (langgettypeid (longvaluetype), vreturned);
+ }
+ case SQLITE_FLOAT: {
+ return setostypevalue (langgettypeid (doublevaluetype), vreturned);
+ }
+ case SQLITE_TEXT: {
+ return setostypevalue (langgettypeid (stringvaluetype), vreturned);
+ }
+ case SQLITE_BLOB: {
+ return setostypevalue (langgettypeid (binaryvaluetype), vreturned);
+ }
+ case SQLITE_NULL: {
+ return setostypevalue (langgettypeid (novaluetype), vreturned);
+ }
+ default: {
+ /* SQLite spec says sqlite3_column_type only returns the above 5 types. But,
+ just in case it lied, we'll return an error type to help Frontier avoid
+ getting a case of return value indigestion. */
+ langerrormessage (SQLITE_COLUMN_ERROR_UNDEFINED);
+ return (false);
+ }
+ } /* switch */
+
+} /* sqlitegetcolumntypeverb */
+
+boolean sqlitegetcolumnnameverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ long columnNumber; /* column number */
+ Handle returnH;
+ const char *column_name;
+ sqlite3_stmt *queryid;
+ int columnCount;
+
+ /*
+ sqlite.getColumnName(queryid, columnNumber)
+
+ Action: Retrieve the name of the specified column
+ Params: a query id and the number of the column (1 base)
+ Returns: an SQLite result code
+ Notes: do not pass the opened database ID across threads.
+
+ SQLite docs: http://www.sqlite.org/capi3ref.html#sqlite3_column_name.
+ */
+
+ if (!getlongvalue (hparam1, 1, (long *) &queryid)) /* Get the long value, which becomes the pline pointer */
+ return (false);
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ /* Enter the verb, convert the param to null-terminated string */
+ if (!getlongvalue (hparam1, 2, &columnNumber))
+ return (false);
+
+ /* Validate the column number */
+ if (columnNumber < 1) {
+ langerrormessage (SQLITE_COLUMN_ERROR_0);
+ return (false);
+ }
+ columnCount = sqlite3_column_count(queryid);
+ if (columnNumber > columnCount) {
+ langerrormessage (SQLITE_COLUMN_ERROR_MAX);
+ return (false);
+ }
+
+ /* Process the SQLite sequence */
+ --columnNumber; /* Frontier uses base 1, but SQLite uses a base of 0 for its column numbering */
+ column_name = sqlite3_column_name(queryid, (int) columnNumber);
+
+ /* Exit the verb, converting column_name back to Frontier handle */
+ if (!newfilledhandle ((ptrvoid) column_name, strlen (column_name), &returnH))
+ return false; /* Allocation failed */
+
+ return (setheapvalue (returnH, stringvaluetype, vreturned));
+
+} /* sqlitegetcolumnnameverb */
+
+boolean sqlitegetcolumncountverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ sqlite3_stmt *queryid;
+ int returnCode; /* return code from SQLite call */
+
+ /*
+ sqlite.getColumnCount(queryid)
+
+ Action: Retrieve number of columns returned in a query
+ Params: a query id
+ Returns: the number of columns in the result set returned by the prepared SQL statement.
+ Notes: do not pass the opened database ID across threads.
+ returns 0 if pStmt is an SQL statement that does not return data (for example an UPDATE).
+
+ SQLite docs: http://www.sqlite.org/capi3ref.html#sqlite3_column_count.
+ */
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ if (!getlongvalue (hparam1, 1, (long *) &queryid)) /* Get the long value, which becomes the pline pointer */
+ return (false);
+
+ /* Process the SQLite sequence */
+ returnCode = sqlite3_column_count(queryid);
+
+ return setlongvalue (returnCode, vreturned);
+
+} /* sqlitegetcolumncountverb */
+
+boolean sqlitegetcolumnintverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ long columnNumber;
+ sqlite3_stmt *queryid;
+ long returnCode; /* return code from SQLite call */
+ int columnCount;
+
+ /*
+ sqlite.getColumnInt(queryid, columnNumber)
+
+ Action: Retrieve the value of the specified integer-type column
+ Params: a query id and the number of the column (1 base)
+ Returns: an SQLite result code
+ Notes: do not pass the opened database ID across threads.
+
+ SQLite docs: http://www.sqlite.org/capi3ref.html#sqlite3_column_int.
+ */
+
+ if (!getlongvalue (hparam1, 1, (long *) &queryid)) /* Get the long value, which becomes the pline pointer */
+ return (false);
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ /* Enter the verb, convert the param to null-terminated string */
+ if (!getlongvalue (hparam1, 2, &columnNumber))
+ return (false);
+
+ /* Validate the column number */
+ if (columnNumber < 1) {
+ langerrormessage (SQLITE_COLUMN_ERROR_0);
+ return (false);
+ }
+ columnCount = sqlite3_column_count(queryid);
+ if (columnNumber > columnCount) {
+ langerrormessage (SQLITE_COLUMN_ERROR_MAX);
+ return (false);
+ }
+
+ /* Process the SQLite sequence */
+ --columnNumber; /* Frontier uses base 1, but SQLite uses a base of 0 for its column numbering */
+ returnCode = sqlite3_column_int(queryid, (int) columnNumber);
+
+ return (setlongvalue ((long) returnCode, vreturned));
+
+} /* sqlitegetcolumnintverb */
+
+boolean sqlitegetcolumndoubleverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ long columnNumber;
+ sqlite3_stmt *queryid;
+ double returnDouble; /* double value returned from SQLite call */
+ int columnCount;
+
+ /*
+ sqlite.getColumnDouble(queryid, columnNumber)
+
+ Action: Retrieve the value of the specified double-type column
+ Params: a query id and the number of the column (1 base)
+ Returns: an SQLite result code
+ Notes: do not pass the opened database ID across threads.
+
+ SQLite docs: http://www.sqlite.org/capi3ref.html#sqlite3_column_double.
+ */
+
+ if (!getlongvalue (hparam1, 1, (long *) &queryid)) /* Get the long value, which becomes the pline pointer */
+ return (false);
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ /* Enter the verb, convert the param to null-terminated string */
+ if (!getlongvalue (hparam1, 2, &columnNumber))
+ return (false);
+
+ /* Validate the column number */
+ if (columnNumber < 1) {
+ langerrormessage (SQLITE_COLUMN_ERROR_0);
+ return (false);
+ }
+ columnCount = sqlite3_column_count(queryid);
+ if (columnNumber > columnCount) {
+ langerrormessage (SQLITE_COLUMN_ERROR_MAX);
+ return (false);
+ }
+
+ /* Process the SQLite sequence */
+ --columnNumber; /* Frontier uses base 1, but SQLite uses a base of 0 for its column numbering */
+ returnDouble = sqlite3_column_double(queryid, (int) columnNumber);
+
+ return (setdoublevalue (returnDouble, vreturned));
+
+} /* sqlitegetcolumndoubleverb */
+
+boolean sqlitegetcolumntextverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ long columnNumber;
+ sqlite3_stmt *queryid;
+ Handle returnH;
+ const unsigned char *column_text;
+ int columnCount;
+
+ /*
+ sqlite.getColumnText(queryid, columnNumber)
+
+ Action: Retrieve the value of the specified text-type column
+ Params: a query id and the number of the column (1 base)
+ Returns: an SQLite result code
+ Notes: do not pass the opened database ID across threads.
+
+ SQLite docs: http://www.sqlite.org/capi3ref.html#sqlite3_column_text.
+ */
+
+ if (!getlongvalue (hparam1, 1, (long *) &queryid)) /* Get the long value, which becomes the pline pointer */
+ return (false);
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ /* Enter the verb, convert the param to null-terminated string */
+ if (!getlongvalue (hparam1, 2, &columnNumber))
+ return (false);
+
+ /* Validate the column number */
+ if (columnNumber < 1) {
+ langerrormessage (SQLITE_COLUMN_ERROR_0);
+ return (false);
+ }
+ columnCount = sqlite3_column_count(queryid);
+ if (columnNumber > columnCount) {
+ langerrormessage (SQLITE_COLUMN_ERROR_MAX);
+ return (false);
+ }
+
+ /* Process the SQLite sequence */
+ --columnNumber; /* Frontier uses base 1, but SQLite uses a base of 0 for its column numbering */
+ column_text = sqlite3_column_text(queryid, (int) columnNumber);
+
+ /* Exit the verb, converting column_name back to Frontier handle */
+ if (!newfilledhandle ((ptrvoid) column_text, strlen (column_text), &returnH))
+ return false; /* Allocation failed */
+
+ return (setheapvalue (returnH, stringvaluetype, vreturned));
+
+} /* sqlitegetcolumntextverb */
+
+boolean sqlitegetcolumnverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ long columnNumber; /* column number */
+ sqlite3_stmt *queryid; /* query id */
+ int returnCode; /* return code from SQLite call */
+ double returnDouble; /* double value returned from SQLite call */
+ Handle returnH;
+ int columnCount;
+ const unsigned char *column_text;
+ /* const unsigned char *column_blob; */
+
+ /*
+ sqlite.getColumn(queryid, columnNumber)
+
+ Action: Retrieve the value of the specified column element
+ Params: a query id and the number of the column (1 base)
+ Returns: an SQLite result code
+ Notes: do not pass the opened database ID across threads.
+ this implementation does not support blobs. If a blob column is requested, 0 is returned.
+ */
+
+ if (!getlongvalue (hparam1, 1, (long *) &queryid)) /* Get the long value, which becomes the queryid pointer */
+ return (false);
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ /* Enter the verb, convert the param to null-terminated string */
+ if (!getlongvalue (hparam1, 2, &columnNumber))
+ return (false);
+
+ /* Validate the column number */
+ if (columnNumber < 1) {
+ langerrormessage (SQLITE_COLUMN_ERROR_0);
+ return (false);
+ }
+ columnCount = sqlite3_column_count(queryid);
+ if (columnNumber > columnCount) {
+ langerrormessage (SQLITE_COLUMN_ERROR_MAX);
+ return (false);
+ }
+
+ /* Process the SQLite sequence */
+ --columnNumber; /* Frontier uses base 1, but SQLite uses a base of 0 for its column numbering */
+ returnCode = sqlite3_column_type(queryid, (int) columnNumber);
+
+ switch(returnCode) {
+
+ case SQLITE_INTEGER: {
+ returnCode = sqlite3_column_int(queryid, (int) columnNumber);
+ return (setlongvalue ((long) returnCode, vreturned));
+ }
+ case SQLITE_FLOAT: {
+ returnDouble = sqlite3_column_double(queryid, (int) columnNumber);
+ return (setdoublevalue (returnDouble, vreturned));
+ }
+ case SQLITE_TEXT: {
+ column_text = sqlite3_column_text(queryid, (int) columnNumber);
+
+ /* Exit the verb, converting column_name back to Frontier handle */
+ if (!newfilledhandle ((ptrvoid) column_text, strlen (column_text), &returnH))
+ return false; /* Allocation failed */
+ return (setheapvalue (returnH, stringvaluetype, vreturned));
+ }
+ case SQLITE_BLOB: {
+ return (setlongvalue ((long) 0, vreturned));
+
+ /* The following code is ignored. Andre suggested returning actual binary
+ data to Frontier, but I'm concerned about reliability, moving that data
+ back and forth, so in this implementation, I'm explicitly making blob
+ data not supported -- DG */
+
+ // column_blob = sqlite3_column_blob(queryid, (int) columnNumber);
+
+ /* Exit the verb, converting column_name back to Frontier handle */
+ //if (!newfilledhandle ((ptrvoid) column_blob, strlen (column_blob), &returnH))
+ // return false; /* Allocation failed */
+ //return (setbinaryvalue (returnH, '\?\?\?\?', vreturned));
+ }
+ case SQLITE_NULL: {
+ return (setlongvalue ((long) 0, vreturned));
+ }
+ default: {
+ /* SQLite spec says sqlite3_column_type only returns the above 5 types. But,
+ just in case it lied, we'll return an error type to help Frontier avoid
+ getting a case of return value indigestion. */
+ langerrormessage ("\x29""SQLite returned an undefined column type.");
+ return (false);
+ }
+ } /* switch */
+
+} /* sqlitegetcolumn */
+
+boolean sqlitegetrowverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ long columnNumber; /* column number */
+ int columnCount; /* number of columns */
+ sqlite3_stmt *queryid; /* query id */
+ int returnCode; /* return code from SQLite call */
+ double returnDouble; /* double value returned from SQLite call */
+ Handle returnH;
+ const unsigned char *column_text;
+ hdllistrecord hlist;
+ tyvaluerecord val;
+
+ /*
+ sqlite.getRow(queryid)
+
+ Action: Retrieve a row as a list
+ Params: a query id
+ Returns: an SQLite result code
+ Notes: do not pass the opened database ID across threads.
+ this implementation does not support blobs. If a blob column is requested, 0 is returned.
+ */
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ if (!getlongvalue (hparam1, 1, (long *) &queryid)) /* Get the long value, which becomes the queryid pointer */
+ return (false);
+
+ /* Process the SQLite sequence */
+ columnCount = sqlite3_column_count(queryid); /* first, figure out how many columns we've got */
+
+ if (columnCount == 0) {
+ langerrormessage ("\x2F""SQLite.getRow requires a minimum of one column.");
+ return (false);
+ }
+
+ if (!opnewlist (&hlist, false)) /* fail out if we can't create the list */
+ return (false);
+
+ for (columnNumber = 0 ; columnNumber < columnCount ; ++columnNumber) {
+
+ returnCode = sqlite3_column_type(queryid, (int) columnNumber);
+
+ switch(returnCode) {
+
+ case SQLITE_INTEGER: {
+ returnCode = sqlite3_column_int(queryid, (int) columnNumber);
+ if (!langpushlistlong (hlist, (long) returnCode))
+ goto error;
+ break;
+ }
+ case SQLITE_FLOAT: {
+ returnDouble = sqlite3_column_double(queryid, (int) columnNumber);
+ if (!setdoublevalue (returnDouble, &val))
+ goto error;
+ if (!langpushlistval (hlist, nil, &val))
+ goto error;
+ break;
+ }
+ case SQLITE_TEXT: {
+ column_text = sqlite3_column_text(queryid, (int) columnNumber);
+
+ /* Exit the verb, converting column_name back to Frontier handle */
+ if (!newfilledhandle ((ptrvoid) column_text, strlen (column_text), &returnH))
+ return false; /* Allocation failed */
+ if (!setheapvalue (returnH, stringvaluetype, &val)) /* convert handle to value */
+ goto error;
+ if (!langpushlistval (hlist, nil, &val))
+ goto error;
+ break;
+ }
+ case SQLITE_BLOB: {
+ if (!langpushlistlong (hlist, (long) 0))
+ goto error;
+ break;
+ }
+ case SQLITE_NULL: {
+ if (!langpushlistlong (hlist, (long) 0))
+ goto error;
+ break;
+ }
+ default: {
+ /* SQLite spec says sqlite3_column_type only returns the above 5 types. But,
+ just in case it lied, this time we return a 0, so the rest of the fields
+ can be read properly. */
+ if (!langpushlistlong (hlist, (long) 0))
+ goto error;
+ }
+ } /* switch */
+ } /* for */
+
+ return (setheapvalue ((Handle) hlist, listvaluetype, vreturned));
+
+ error: {
+ opdisposelist (hlist);
+ return (false);
+ }
+
+} /* sqlitegetrow */
+
+boolean sqlitegeterrormessageverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+ const char *sqliteError; /* pointer to the error message */
+ sqlite3 *db; /* the SQLite database handle */
+ Handle returnH = nil; /* The handle being returned back to Frontier */
+
+ /*
+ Frontier verb: sqlite.getErrorMessage(dbfile)
+
+ Returns the error message for the most recent SQLite API call.
+ Takes a database ID.
+ Returns a string containing the error message.
+ NOTE: do not pass the opened database ID across threads.
+
+ SQLite docs: http://www.sqlite.org/capi3ref.html#sqlite3_errmsg.
+ */
+
+ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */
+
+ if (!getlongvalue (hparam1, 1, (long *) &db)) /* Get the long value, which becomes the db pointer */
+ return (false);
+
+ /* Process the SQLite sequence */
+ sqliteError = sqlite3_errmsg(db);
+
+ /* Exit the verb, converting errMsg back to Frontier handle */
+ if(!newfilledhandle ((ptrvoid) sqliteError, strlen (sqliteError), &returnH))
+ return false; /* Allocation failed */
+
+ return (setheapvalue (returnH, stringvaluetype, vreturned));
+
+} /* sqlitegeterrormessageverb */
\ No newline at end of file
Modified: Frontier/branches/FSRef_Migration/Common/source/shell.c
===================================================================
--- Frontier/branches/FSRef_Migration/Common/source/shell.c 2006-10-12 23:32:33 UTC (rev 1554)
+++ Frontier/branches/FSRef_Migration/Common/source/shell.c 2006-10-12 23:35:14 UTC (rev 1555)
@@ -1314,6 +1314,8 @@
htmlinitverbs ();
+ sqliteinitverbs (); /* 2006-03-15 gewirtz: langsqlite.c */
+
#ifdef flregexpverbs
regexpinitverbs (); /* 2003-04-23 AR: langregexp.c */
#endif
Modified: Frontier/branches/FSRef_Migration/build_XCode/Frontier.xcodeproj/project.pbxproj
===================================================================
--- Frontier/branches/FSRef_Migration/build_XCode/Frontier.xcodeproj/project.pbxproj 2006-10-12 23:32:33 UTC (rev 1554)
+++ Frontier/branches/FSRef_Migration/build_XCode/Frontier.xcodeproj/project.pbxproj 2006-10-12 23:35:14 UTC (rev 1555)
@@ -7,18 +7,68 @@
objects = {
/* Begin PBXBuildFile section */
- 5D14D06C0AA3B0EE00D5E977 /* Frontier FTsc.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5D14D06B0AA3B0EE00D5E977 /* Frontier FTsc.icns */; };
- 5D14D0820AA3B61C00D5E977 /* Frontier FTwp.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5D14D0810AA3B61C00D5E977 /* Frontier FTwp.icns */; };
- 5D14D08E0AA3BAC100D5E977 /* Frontier FTds.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5D14D08A0AA3BAC100D5E977 /* Frontier FTds.icns */; };
- 5D14D08F0AA3BAC100D5E977 /* Frontier FTmb.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5D14D08B0AA3BAC100D5E977 /* Frontier FTmb.icns */; };
- 5D14D0900AA3BAC100D5E977 /* Frontier FTop.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5D14D08C0AA3BAC100D5E977 /* Frontier FTop.icns */; };
- 5D14D0910AA3BAC100D5E977 /* Frontier FTtb.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5D14D08D0AA3BAC100D5E977 /* Frontier FTtb.icns */; };
- 5D14D0990AA3BD5F00D5E977 /* Frontier TABL.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5D14D0980AA3BD5F00D5E977 /* Frontier TABL.icns */; };
- 5D14D0A40AA3C04400D5E977 /* Frontier FATP.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5D14D0A30AA3C04300D5E977 /* Frontier FATP.icns */; };
- 5D2A49B40A2E4A3B00BC885B /* FSCopyObject.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D2A49B00A2E4A3B00BC885B /* FSCopyObject.c */; };
- 5D2A49B50A2E4A3B00BC885B /* FSCopyObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D2A49B10A2E4A3B00BC885B /* FSCopyObject.h */; };
- 5D2A49B60A2E4A3B00BC885B /* GenLinkedList.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D2A49B20A2E4A3B00BC885B /* GenLinkedList.c */; };
- 5D2A49B70A2E4A3B00BC885B /* GenLinkedList.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D2A49B30A2E4A3B00BC885B /* GenLinkedList.h */; };
+ 5D0D91040ADEDFA80000E67B /* FSCopyObject.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D0D91000ADEDFA80000E67B /* FSCopyObject.c */; };
+ 5D0D91050ADEDFA80000E67B /* FSCopyObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D0D91010ADEDFA80000E67B /* FSCopyObject.h */; };
+ 5D0D91060ADEDFA80000E67B /* GenLinkedList.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D0D91020ADEDFA80000E67B /* GenLinkedList.c */; };
+ 5D0D91070ADEDFA80000E67B /* GenLinkedList.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D0D91030ADEDFA80000E67B /* GenLinkedList.h */; };
+ 5D18A8070AD3AD5700613FDB /* alter.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7DC0AD3AD5600613FDB /* alter.c */; };
+ 5D18A8080AD3AD5700613FDB /* analyze.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7DD0AD3AD5600613FDB /* analyze.c */; };
+ 5D18A8090AD3AD5700613FDB /* attach.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7DE0AD3AD5600613FDB /* attach.c */; };
+ 5D18A80A0AD3AD5700613FDB /* auth.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7DF0AD3AD5600613FDB /* auth.c */; };
+ 5D18A80B0AD3AD5700613FDB /* btree.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7E00AD3AD5600613FDB /* btree.c */; };
+ 5D18A80C0AD3AD5700613FDB /* build.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7E10AD3AD5600613FDB /* build.c */; };
+ 5D18A80D0AD3AD5700613FDB /* callback.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7E20AD3AD5600613FDB /* callback.c */; };
+ 5D18A80E0AD3AD5700613FDB /* complete.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7E30AD3AD5600613FDB /* complete.c */; };
+ 5D18A80F0AD3AD5700613FDB /* date.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7E40AD3AD5600613FDB /* date.c */; };
+ 5D18A8100AD3AD5700613FDB /* delete.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7E50AD3AD5600613FDB /* delete.c */; };
+ 5D18A8110AD3AD5700613FDB /* expr.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7E60AD3AD5600613FDB /* expr.c */; };
+ 5D18A8120AD3AD5700613FDB /* func.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7E70AD3AD5600613FDB /* func.c */; };
+ 5D18A8130AD3AD5700613FDB /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7E80AD3AD5600613FDB /* hash.c */; };
+ 5D18A8140AD3AD5700613FDB /* insert.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7E90AD3AD5600613FDB /* insert.c */; };
+ 5D18A8150AD3AD5700613FDB /* legacy.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7EA0AD3AD5600613FDB /* legacy.c */; };
+ 5D18A8160AD3AD5700613FDB /* loadext.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7EB0AD3AD5600613FDB /* loadext.c */; };
+ 5D18A8170AD3AD5700613FDB /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7EC0AD3AD5600613FDB /* main.c */; };
+ 5D18A8180AD3AD5700613FDB /* opcodes.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7ED0AD3AD5600613FDB /* opcodes.c */; };
+ 5D18A8190AD3AD5700613FDB /* os_os2.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7EE0AD3AD5600613FDB /* os_os2.c */; };
+ 5D18A81A0AD3AD5700613FDB /* os_unix.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7EF0AD3AD5600613FDB /* os_unix.c */; };
+ 5D18A81B0AD3AD5700613FDB /* os_win.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7F00AD3AD5600613FDB /* os_win.c */; };
+ 5D18A81C0AD3AD5700613FDB /* os.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7F10AD3AD5600613FDB /* os.c */; };
+ 5D18A81D0AD3AD5700613FDB /* pager.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7F20AD3AD5600613FDB /* pager.c */; };
+ 5D18A81E0AD3AD5700613FDB /* parse.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7F30AD3AD5600613FDB /* parse.c */; };
+ 5D18A81F0AD3AD5700613FDB /* pragma.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7F40AD3AD5600613FDB /* pragma.c */; };
+ 5D18A8200AD3AD5700613FDB /* prepare.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7F50AD3AD5600613FDB /* prepare.c */; };
+ 5D18A8210AD3AD5700613FDB /* printf.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7F60AD3AD5600613FDB /* printf.c */; };
+ 5D18A8220AD3AD5700613FDB /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7F70AD3AD5600613FDB /* random.c */; };
+ 5D18A8230AD3AD5700613FDB /* select.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7F80AD3AD5600613FDB /* select.c */; };
+ 5D18A8240AD3AD5700613FDB /* table.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7F90AD3AD5700613FDB /* table.c */; };
+ 5D18A8250AD3AD5700613FDB /* tokenize.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7FA0AD3AD5700613FDB /* tokenize.c */; };
+ 5D18A8260AD3AD5700613FDB /* trigger.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7FB0AD3AD5700613FDB /* trigger.c */; };
+ 5D18A8270AD3AD5700613FDB /* update.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7FC0AD3AD5700613FDB /* update.c */; };
+ 5D18A8280AD3AD5700613FDB /* utf.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7FD0AD3AD5700613FDB /* utf.c */; };
+ 5D18A8290AD3AD5700613FDB /* util.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7FE0AD3AD5700613FDB /* util.c */; };
+ 5D18A82A0AD3AD5700613FDB /* vacuum.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A7FF0AD3AD5700613FDB /* vacuum.c */; };
+ 5D18A82B0AD3AD5700613FDB /* vdbe.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A8000AD3AD5700613FDB /* vdbe.c */; };
+ 5D18A82C0AD3AD5700613FDB /* vdbeapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A8010AD3AD5700613FDB /* vdbeapi.c */; };
+ 5D18A82D0AD3AD5700613FDB /* vdbeaux.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A8020AD3AD5700613FDB /* vdbeaux.c */; };
+ 5D18A82E0AD3AD5700613FDB /* vdbefifo.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A8030AD3AD5700613FDB /* vdbefifo.c */; };
+ 5D18A82F0AD3AD5700613FDB /* vdbemem.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A8040AD3AD5700613FDB /* vdbemem.c */; };
+ 5D18A8300AD3AD5700613FDB /* vtab.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A8050AD3AD5700613FDB /* vtab.c */; };
+ 5D18A8310AD3AD5700613FDB /* where.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D18A8060AD3AD5700613FDB /* where.c */; };
+ 5D18A83F0AD3AD9900613FDB /* btree.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D18A8320AD3AD9900613FDB /* btree.h */; };
+ 5D18A8400AD3AD9900613FDB /* hash.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D18A8330AD3AD9900613FDB /* hash.h */; };
+ 5D18A8410AD3AD9900613FDB /* keywordhash.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D18A8340AD3AD9900613FDB /* keywordhash.h */; };
+ 5D18A8420AD3AD9900613FDB /* opcodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D18A8350AD3AD9900613FDB /* opcodes.h */; };
+ 5D18A8430AD3AD9900613FDB /* os_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D18A8360AD3AD9900613FDB /* os_common.h */; };
+ 5D18A8440AD3AD9900613FDB /* os.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D18A8370AD3AD9900613FDB /* os.h */; };
+ 5D18A8450AD3AD9900613FDB /* pager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D18A8380AD3AD9900613FDB /* pager.h */; };
+ 5D18A8460AD3AD9900613FDB /* parse.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D18A8390AD3AD9900613FDB /* parse.h */; };
+ 5D18A8470AD3AD9900613FDB /* sqlite3.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D18A83A0AD3AD9900613FDB /* sqlite3.h */; };
+ 5D18A8480AD3AD9900613FDB /* sqlite3ext.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D18A83B0AD3AD9900613FDB /* sqlite3ext.h */; };
+ 5D18A8490AD3AD9900613FDB /* sqliteInt.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D18A83C0AD3AD9900613FDB /* sqliteInt.h */; };
+ 5D18A84A0AD3AD9900613FDB /* vdbe.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D18A83D0AD3AD9900613FDB /* vdbe.h */; };
+ 5D18A84B0AD3AD9900613FDB /* vdbeInt.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D18A83E0AD3AD9900613FDB /* vdbeInt.h */; };
+ 5D4E1E490AAA17E900DF6890 /* langsqlite.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D4E1E470AAA17E900DF6890 /* langsqlite.c */; };
+ 5D4E1E4A0AAA17E900DF6890 /* langsqlite.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D4E1E480AAA17E900DF6890 /* langsqlite.h */; };
6505996409968C1400410571 /* ioascrollbar.h in Headers */ = {isa = PBXBuildFile; fileRef = 651525AB072BFC6700411831 /* ioascrollbar.h */; };
6505996509968C1400410571 /* ioapopup.h in Headers */ = {isa = PBXBuildFile; fileRef = 651525A7072BFC6700411831 /* ioapopup.h */; };
6505996609968C1400410571 /* ioaicon.h in Headers */ = {isa = PBXBuildFile; fileRef = 651525A4072BFC6700411831 /* ioaicon.h */; };
@@ -1005,11 +1055,12 @@
65F9C22309C4CD9800DCC29E /* sha.h in Headers */ = {isa = PBXBuildFile; fileRef = 65F9C21F09C4CD9700DCC29E /* sha.h */; };
65F9C22709C4CDDE00DCC29E /* sha1dgst.c in Sources */ = {isa = PBXBuildFile; fileRef = 65F9C22609C4CDDE00DCC29E /* sha1dgst.c */; };
65F9C22809C4CDDE00DCC29E /* sha1dgst.c in Sources */ = {isa = PBXBuildFile; fileRef = 65F9C22609C4CDDE00DCC29E /* sha1dgst.c */; };
+ BB37A31B0AB828010077C6A1 /* libSQLite3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BB37A29C0AB826540077C6A1 /* libSQLite3.a */; };
DEA58AB407435A9500BAB271 /* Frontier.icns in Resources */ = {isa = PBXBuildFile; fileRef = DEA58AB307435A9500BAB271 /* Frontier.icns */; };
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
- 5DA7A4BA0A2789C20078C0A3 /* PBXBuildRule */ = {
+ 5D18A84C0AD3AE1200613FDB /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = com.apple.compilers.gcc.3_3;
fileType = sourcecode.c;
@@ -1017,7 +1068,7 @@
outputFiles = (
);
};
- 5DA7A4BB0A2789CC0078C0A3 /* PBXBuildRule */ = {
+ 5D18A84D0AD3AE1900613FDB /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = com.apple.compilers.gcc.3_3;
fileType = sourcecode.asm;
@@ -1025,50 +1076,130 @@
outputFiles = (
);
};
+ 5D4E1E3F0AAA0E1800DF6890 /* PBXBuildRule */ = {
+ isa = PBXBuildRule;
+ compilerSpec = com.apple.compilers.gcc.3_3;
+ fileType = sourcecode.c;
+ isEditable = 1;
+ outputFiles = (
+ );
+ };
+ 5D4E1E400AAA0E3200DF6890 /* PBXBuildRule */ = {
+ isa = PBXBuildRule;
+ compilerSpec = com.apple.compilers.gcc.3_3;
+ fileType = sourcecode.asm;
+ isEditable = 1;
+ outputFiles = (
+ );
+ };
+ BB37A3C80AB82E200077C6A1 /* PBXBuildRule */ = {
+ isa = PBXBuildRule;
+ compilerSpec = com.apple.compilers.gcc.3_3;
+ fileType = sourcecode.asm.asm;
+ isEditable = 1;
+ outputFiles = (
+ );
+ };
+ BB37A3C90AB82E270077C6A1 /* PBXBuildRule */ = {
+ isa = PBXBuildRule;
+ compilerSpec = com.apple.compilers.gcc.3_3;
+ fileType = sourcecode.c;
+ isEditable = 1;
+ outputFiles = (
+ );
+ };
/* End PBXBuildRule section */
/* Begin PBXBuildStyle section */
- 6515255E072BFC6500411831 /* Development */ = {
+ 5D18A7BB0AD3AB5B00613FDB /* Development */ = {
isa = PBXBuildStyle;
buildSettings = {
COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_WARN_UNKNOWN_PRAGMAS = YES;
- REZ_PREPROCESSOR_DEFINITIONS = "";
- ZERO_LINK = NO;
};
name = Development;
};
- 6515255F072BFC6500411831 /* Deployment */ = {
+ 5D18A7BC0AD3AB5B00613FDB /* Deployment */ = {
isa = PBXBuildStyle;
buildSettings = {
COPY_PHASE_STRIP = YES;
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- GCC_OPTIMIZATION_LEVEL = 2;
- GCC_PREPROCESSOR_DEFINITIONS = NDEBUG;
- ZERO_LINK = NO;
};
name = Deployment;
};
/* End PBXBuildStyle section */
+/* Begin PBXContainerItemProxy section */
+ BB37A3170AB827EA0077C6A1 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 65152560072BFC6500411831 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BB37A29B0AB826540077C6A1;
+ remoteInfo = sqlite3_static;
+ };
+/* End PBXContainerItemProxy section */
+
/* Begin PBXFileReference section */
- 5D14D06B0AA3B0EE00D5E977 /* Frontier FTsc.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = "Frontier FTsc.icns"; path = "../resources/Frontier/Frontier FTsc.icns"; sourceTree = SOURCE_ROOT; };
- 5D14D0810AA3B61C00D5E977 /* Frontier FTwp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = "Frontier FTwp.icns"; path = "../resources/Frontier/Frontier FTwp.icns"; sourceTree = SOURCE_ROOT; };
- 5D14D08A0AA3BAC100D5E977 /* Frontier FTds.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = "Frontier FTds.icns"; path = "../resources/Frontier/Frontier FTds.icns"; sourceTree = SOURCE_ROOT; };
- 5D14D08B0AA3BAC100D5E977 /* Frontier FTmb.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = "Frontier FTmb.icns"; path = "../resources/Frontier/Frontier FTmb.icns"; sourceTree = SOURCE_ROOT; };
- 5D14D08C0AA3BAC100D5E977 /* Frontier FTop.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = "Frontier FTop.icns"; path = "../resources/Frontier/Frontier FTop.icns"; sourceTree = SOURCE_ROOT; };
- 5D14D08D0AA3BAC100D5E977 /* Frontier FTtb.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = "Frontier FTtb.icns"; path = "../resources/Frontier/Frontier FTtb.icns"; sourceTree = SOURCE_ROOT; };
- 5D14D0980AA3BD5F00D5E977 /* Frontier TABL.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = "Frontier TABL.icns"; path = "../resources/Frontier/Frontier TABL.icns"; sourceTree = SOURCE_ROOT; };
- 5D14D0A30AA3C04300D5E977 /* Frontier FATP.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = "Frontier FATP.icns"; path = "../resources/Frontier/Frontier FATP.icns"; sourc...
[truncated message content] |