You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(447) |
Nov
(163) |
Dec
(57) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(172) |
Feb
|
Mar
(123) |
Apr
(64) |
May
(1) |
Jun
(278) |
Jul
(89) |
Aug
(97) |
Sep
(62) |
Oct
(53) |
Nov
(119) |
Dec
(60) |
| 2006 |
Jan
(76) |
Feb
(1094) |
Mar
(363) |
Apr
(163) |
May
(57) |
Jun
(43) |
Jul
(39) |
Aug
(15) |
Sep
(33) |
Oct
(62) |
Nov
(8) |
Dec
|
| 2007 |
Jan
(9) |
Feb
(34) |
Mar
(2) |
Apr
(14) |
May
(8) |
Jun
(40) |
Jul
(21) |
Aug
(1) |
Sep
(20) |
Oct
(15) |
Nov
(26) |
Dec
|
| 2008 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
(1) |
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(32) |
Jun
|
Jul
|
Aug
(3) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: David G. <dav...@us...> - 2006-03-24 01:32:37
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2299/Common/source Added Files: Tag: sqlite-embedded-experimental langsqlite.c Log Message: --- NEW FILE: langsqlite.c --- /* $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 "langexternal.h" #include "langsqlite.h" #include <sqlite3.h> typedef enum tysqliteverbtoken { /* verbs that are processed by langsqlite.c */ openfunc, execfunc, 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 execfunc: { /* 2006-03-15 gewirtz: execute an SQLite statement */ return (sqliteexecverb (hp1, v, bserror)); } /* execfunc */ 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 h = nil; Handle returnH = nil; sqlite3 *db; /* the SQLite DB handle, be careful to not pass this across threads */ int returnCode; /* return code from SQLite call */ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */ /* This routine takes one parameter: the filename. It returns a handle and a result code. See: http://www.sqlite.org/capi3ref.html#sqlite3_open */ /* Enter the verb, convert the param to null-terminated string */ if (!getexempttextvalue (hparam1, 1, &h)) return (false); pushcharhandle (0x00, h); /* this should convert *h to a string */ /* Process the SQLite sequence */ returnCode = sqlite3_open(*h, &db); if(returnCode) { sqliteOpenError(sqlite3_errmsg(db), bserror); /* send database open error */ disposehandle(h); /* get rid of the provided, original handle */ sqlite3_close(db); return (false); } return (setheapvalue ((Handle) db, longvaluetype, vreturned)); /* return the db address to the scripter */ /* for now, close the database, simply because we don't have any other code */ /* sqlite3_close(db); */ /* Exit the verb, converting string back to Frontier handle */ /* newfilledhandle (*h, strlen (*h), &returnH); */ /* disposehandle (h); */ /* get rid of the provided, original handle */ /* return (setheapvalue (returnH, stringvaluetype, vreturned)); */ } /* sqliteopenverb */ boolean sqlitecloseverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { Handle h = nil; Handle returnH = nil; sqlite3 *db; /* the SQLite DB handle, be careful to not pass this across threads */ int returnCode; /* return code from SQLite call */ flnextparamislast = true; /* makes sure Frontier throws an error if more than one param is passed */ /* This routine takes one parameter: the database. It true if the file closed successfully, or throws a script error if not. See: http://www.sqlite.org/capi3ref.html#sqlite3_close */ if (!getlongvalue (hparam1, 1, &db)) /* Get the long value, which becomes the db pointer */ return (false); /* Process the SQLite sequence */ returnCode = sqlite3_close(db); if(returnCode != SQLITE_OK) { sqliteDatabaseError(sqlite3_errmsg(db), bserror); /* send database error */ disposehandle(h); /* get rid of the provided, original handle */ return (false); } return setbooleanvalue (true, vreturned); } /* sqlitecloseverb */ boolean sqliteexecverb (hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) { Handle h = nil; Handle returnH = nil; char *zErrMsg = 0; /* SQLite's error message */ sqlite3 *db; /* the SQLite DB handle, be careful to not pass this across threads */ int returnCode; /* return code from SQLite call */ /* This routine takes one parameter: the filename. It returns a handle and a result code. See: http://www.sqlite.org/capi3ref.html#sqlite3_exec We're not going to use the SQLite callback mechanism for the sqlite3_exec function. The most obvious approach inside Frontier would be to pass a script into SQLite, but the potential problems, bugs, and difficulty in debugging makes this an unnecessary exercise. The sqlite3_exec function will return data, which can then be munged by a script once it leaves SQLite. So sayeth the coder. -- DG */ if (!getlongvalue (hparam1, 1, &db)) /* 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 */ /* Enter the verb, convert the param to null-terminated string */ if (!getexempttextvalue (hparam1, 2, &h)) return (false); pushcharhandle (0x00, h); /* this should convert *h to a string */ /* Process the SQLite sequence */ returnCode = sqlite3_exec(db, *h, 0, 0, &zErrMsg); if(returnCode != SQLITE_OK) { sqliteDatabaseError(zErrMsg, bserror); /* send database open error */ disposehandle(h); /* get rid of the provided, original handle */ sqlite3_close(db); return (false); } return (setheapvalue ((Handle) db, longvaluetype, vreturned)); /* return the db address to the scripter */ /* for now, close the database, simply because we don't have any other code */ /* sqlite3_close(db); */ /* Exit the verb, converting string back to Frontier handle */ /* newfilledhandle (*h, strlen (*h), &returnH); */ /* disposehandle (h); */ /* get rid of the provided, original handle */ /* return (setheapvalue (returnH, stringvaluetype, vreturned)); */ } /* sqliteexecverb */ /* boolean hmacmd5 (unsigned char * text, int text_len, unsigned char * key, int key_len, unsigned char * digest) function code went here */ /* boolean hmacsha1 (unsigned char * text, int text_len, unsigned char * key, int key_len, unsigned char * digest) function code went here */ |
|
From: David G. <dav...@us...> - 2006-03-24 01:31:43
|
Update of /cvsroot/frontierkernel/Frontier/Common/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1842/Common/headers Added Files: Tag: sqlite-embedded-experimental langsqlite.h Log Message: --- NEW FILE: langsqlite.h --- /* $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 sqliteexecverb (hdltreenode, tyvaluerecord *, bigstring); /* 2006-03-18 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 */ |
Update of /cvsroot/frontierkernel/Frontier/Common/sqlite3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv458/Common/sqlite3 Added Files: Tag: sqlite-embedded-experimental alter.c analyze.c attach.c auth.c btree.c btree.h build.c callback.c complete.c date.c delete.c expr.c func.c hash.c hash.h insert.c keywordhash.h legacy.c main.c opcodes.c opcodes.h os.c os.h os_common.h os_unix.c os_win.c pager.c pager.h parse.c parse.h pragma.c prepare.c printf.c random.c select.c shell.c sqlite3.def sqlite3.h sqliteInt.h table.c tclsqlite.c tokenize.c trigger.c update.c utf.c util.c vacuum.c vdbe.c vdbe.h vdbeInt.h vdbeapi.c vdbeaux.c vdbefifo.c vdbemem.c where.c Log Message: SQLite distribution --- NEW FILE: pager.h --- /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the sqlite page cache ** subsystem. The page cache subsystem reads and writes a file a page ** at a time and provides a journal for rollback. ** ** @(#) $Id: pager.h,v 1.1.2.1 2006/03/24 01:29:46 davidgewirtz Exp $ */ #ifndef _PAGER_H_ #define _PAGER_H_ /* ** The default size of a database page. */ #ifndef SQLITE_DEFAULT_PAGE_SIZE # define SQLITE_DEFAULT_PAGE_SIZE 1024 #endif /* Maximum page size. The upper bound on this value is 32768. This a limit ** imposed by necessity of storing the value in a 2-byte unsigned integer ** and the fact that the page size must be a power of 2. ** ** This value is used to initialize certain arrays on the stack at ** various places in the code. On embedded machines where stack space ** is limited and the flexibility of having large pages is not needed, ** it makes good sense to reduce the maximum page size to something more ** reasonable, like 1024. */ #ifndef SQLITE_MAX_PAGE_SIZE # define SQLITE_MAX_PAGE_SIZE 32768 #endif /* ** Maximum number of pages in one database. */ #define SQLITE_MAX_PAGE 1073741823 /* ** The type used to represent a page number. The first page in a file ** is called page 1. 0 is used to represent "not a page". */ typedef unsigned int Pgno; /* ** Each open file is managed by a separate instance of the "Pager" structure. */ typedef struct Pager Pager; /* ** Allowed values for the flags parameter to sqlite3pager_open(). ** ** NOTE: This values must match the corresponding BTREE_ values in btree.h. */ #define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */ #define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */ /* ** See source code comments for a detailed description of the following ** routines: */ int sqlite3pager_open(Pager **ppPager, const char *zFilename, int nExtra, int flags); void sqlite3pager_set_busyhandler(Pager*, BusyHandler *pBusyHandler); void sqlite3pager_set_destructor(Pager*, void(*)(void*,int)); void sqlite3pager_set_reiniter(Pager*, void(*)(void*,int)); int sqlite3pager_set_pagesize(Pager*, int); void sqlite3pager_read_fileheader(Pager*, int, unsigned char*); void sqlite3pager_set_cachesize(Pager*, int); int sqlite3pager_close(Pager *pPager); int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage); void *sqlite3pager_lookup(Pager *pPager, Pgno pgno); int sqlite3pager_ref(void*); int sqlite3pager_unref(void*); Pgno sqlite3pager_pagenumber(void*); int sqlite3pager_write(void*); int sqlite3pager_iswriteable(void*); int sqlite3pager_overwrite(Pager *pPager, Pgno pgno, void*); int sqlite3pager_pagecount(Pager*); int sqlite3pager_truncate(Pager*,Pgno); int sqlite3pager_begin(void*, int exFlag); int sqlite3pager_commit(Pager*); int sqlite3pager_sync(Pager*,const char *zMaster, Pgno); int sqlite3pager_rollback(Pager*); int sqlite3pager_isreadonly(Pager*); int sqlite3pager_stmt_begin(Pager*); int sqlite3pager_stmt_commit(Pager*); int sqlite3pager_stmt_rollback(Pager*); void sqlite3pager_dont_rollback(void*); void sqlite3pager_dont_write(Pager*, Pgno); int *sqlite3pager_stats(Pager*); void sqlite3pager_set_safety_level(Pager*,int,int); const char *sqlite3pager_filename(Pager*); const char *sqlite3pager_dirname(Pager*); const char *sqlite3pager_journalname(Pager*); int sqlite3pager_nosync(Pager*); int sqlite3pager_rename(Pager*, const char *zNewName); void sqlite3pager_set_codec(Pager*,void(*)(void*,void*,Pgno,int),void*); int sqlite3pager_movepage(Pager*,void*,Pgno); int sqlite3pager_reset(Pager*); int sqlite3pager_release_memory(int); #if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) int sqlite3pager_lockstate(Pager*); #endif #ifdef SQLITE_TEST void sqlite3pager_refdump(Pager*); int pager3_refinfo_enable; #endif #endif /* _PAGER_H_ */ --- NEW FILE: update.c --- /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle UPDATE statements. ** ** $Id: update.c,v 1.1.2.1 2006/03/24 01:29:46 davidgewirtz Exp $ */ #include "sqliteInt.h" /* ** The most recently coded instruction was an OP_Column to retrieve the ** i-th column of table pTab. This routine sets the P3 parameter of the ** OP_Column to the default value, if any. ** ** The default value of a column is specified by a DEFAULT clause in the ** column definition. This was either supplied by the user when the table ** was created, or added later to the table definition by an ALTER TABLE ** command. If the latter, then the row-records in the table btree on disk ** may not contain a value for the column and the default value, taken ** from the P3 parameter of the OP_Column instruction, is returned instead. ** If the former, then all row-records are guaranteed to include a value ** for the column and the P3 value is not required. ** ** Column definitions created by an ALTER TABLE command may only have ** literal default values specified: a number, null or a string. (If a more ** complicated default expression value was provided, it is evaluated ** when the ALTER TABLE is executed and one of the literal values written ** into the sqlite_master table.) ** ** Therefore, the P3 parameter is only required if the default value for ** the column is a literal number, string or null. The sqlite3ValueFromExpr() ** function is capable of transforming these types of expressions into ** sqlite3_value objects. */ void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i){ if( pTab && !pTab->pSelect ){ sqlite3_value *pValue; u8 enc = ENC(sqlite3VdbeDb(v)); Column *pCol = &pTab->aCol[i]; sqlite3ValueFromExpr(pCol->pDflt, enc, pCol->affinity, &pValue); if( pValue ){ sqlite3VdbeChangeP3(v, -1, (const char *)pValue, P3_MEM); }else{ VdbeComment((v, "# %s.%s", pTab->zName, pCol->zName)); } } } /* ** Process an UPDATE statement. ** ** UPDATE OR IGNORE table_wxyz SET a=b, c=d WHERE e<5 AND f NOT NULL; ** \_______/ \________/ \______/ \________________/ * onError pTabList pChanges pWhere */ void sqlite3Update( Parse *pParse, /* The parser context */ SrcList *pTabList, /* The table in which we should change things */ ExprList *pChanges, /* Things to be changed */ Expr *pWhere, /* The WHERE clause. May be null */ int onError /* How to handle constraint errors */ ){ int i, j; /* Loop counters */ Table *pTab; /* The table to be updated */ int addr = 0; /* VDBE instruction address of the start of the loop */ WhereInfo *pWInfo; /* Information about the WHERE clause */ Vdbe *v; /* The virtual database engine */ Index *pIdx; /* For looping over indices */ int nIdx; /* Number of indices that need updating */ int nIdxTotal; /* Total number of indices */ int iCur; /* VDBE Cursor number of pTab */ sqlite3 *db; /* The database structure */ Index **apIdx = 0; /* An array of indices that need updating too */ char *aIdxUsed = 0; /* aIdxUsed[i]==1 if the i-th index is used */ int *aXRef = 0; /* aXRef[i] is the index in pChanges->a[] of the ** an expression for the i-th column of the table. ** aXRef[i]==-1 if the i-th column is not changed. */ int chngRowid; /* True if the record number is being changed */ Expr *pRowidExpr = 0; /* Expression defining the new record number */ int openAll = 0; /* True if all indices need to be opened */ AuthContext sContext; /* The authorization context */ NameContext sNC; /* The name-context to resolve expressions in */ int iDb; /* Database containing the table being updated */ #ifndef SQLITE_OMIT_TRIGGER int isView; /* Trying to update a view */ int triggers_exist = 0; /* True if any row triggers exist */ #endif int newIdx = -1; /* index of trigger "new" temp table */ int oldIdx = -1; /* index of trigger "old" temp table */ sContext.pParse = 0; if( pParse->nErr || sqlite3MallocFailed() ){ goto update_cleanup; } db = pParse->db; assert( pTabList->nSrc==1 ); /* Locate the table which we want to update. */ pTab = sqlite3SrcListLookup(pParse, pTabList); if( pTab==0 ) goto update_cleanup; iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema); /* Figure out if we have any triggers and if the table being ** updated is a view */ #ifndef SQLITE_OMIT_TRIGGER triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_UPDATE, pChanges); isView = pTab->pSelect!=0; #else # define triggers_exist 0 # define isView 0 #endif #ifdef SQLITE_OMIT_VIEW # undef isView # define isView 0 #endif if( sqlite3IsReadOnly(pParse, pTab, triggers_exist) ){ goto update_cleanup; } if( isView ){ if( sqlite3ViewGetColumnNames(pParse, pTab) ){ goto update_cleanup; } } aXRef = sqliteMallocRaw( sizeof(int) * pTab->nCol ); if( aXRef==0 ) goto update_cleanup; for(i=0; i<pTab->nCol; i++) aXRef[i] = -1; /* If there are FOR EACH ROW triggers, allocate cursors for the ** special OLD and NEW tables */ if( triggers_exist ){ newIdx = pParse->nTab++; oldIdx = pParse->nTab++; } /* Allocate a cursors for the main database table and for all indices. ** The index cursors might not be used, but if they are used they ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ pTabList->a[0].iCursor = iCur = pParse->nTab++; for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ pParse->nTab++; } /* Initialize the name-context */ memset(&sNC, 0, sizeof(sNC)); sNC.pParse = pParse; sNC.pSrcList = pTabList; /* Resolve the column names in all the expressions of the ** of the UPDATE statement. Also find the column index ** for each column to be updated in the pChanges array. For each ** column to be updated, make sure we have authorization to change ** that column. */ chngRowid = 0; for(i=0; i<pChanges->nExpr; i++){ if( sqlite3ExprResolveNames(&sNC, pChanges->a[i].pExpr) ){ goto update_cleanup; } for(j=0; j<pTab->nCol; j++){ if( sqlite3StrICmp(pTab->aCol[j].zName, pChanges->a[i].zName)==0 ){ if( j==pTab->iPKey ){ chngRowid = 1; pRowidExpr = pChanges->a[i].pExpr; } aXRef[j] = i; break; } } if( j>=pTab->nCol ){ if( sqlite3IsRowid(pChanges->a[i].zName) ){ chngRowid = 1; pRowidExpr = pChanges->a[i].pExpr; }else{ sqlite3ErrorMsg(pParse, "no such column: %s", pChanges->a[i].zName); goto update_cleanup; } } #ifndef SQLITE_OMIT_AUTHORIZATION { int rc; rc = sqlite3AuthCheck(pParse, SQLITE_UPDATE, pTab->zName, pTab->aCol[j].zName, db->aDb[iDb].zName); if( rc==SQLITE_DENY ){ goto update_cleanup; }else if( rc==SQLITE_IGNORE ){ aXRef[j] = -1; } } #endif } /* Allocate memory for the array apIdx[] and fill it with pointers to every ** index that needs to be updated. Indices only need updating if their ** key includes one of the columns named in pChanges or if the record ** number of the original table entry is changing. */ for(nIdx=nIdxTotal=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdxTotal++){ if( chngRowid ){ i = 0; }else { for(i=0; i<pIdx->nColumn; i++){ if( aXRef[pIdx->aiColumn[i]]>=0 ) break; } } if( i<pIdx->nColumn ) nIdx++; } if( nIdxTotal>0 ){ apIdx = sqliteMallocRaw( sizeof(Index*) * nIdx + nIdxTotal ); if( apIdx==0 ) goto update_cleanup; aIdxUsed = (char*)&apIdx[nIdx]; } for(nIdx=j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ if( chngRowid ){ i = 0; }else{ for(i=0; i<pIdx->nColumn; i++){ if( aXRef[pIdx->aiColumn[i]]>=0 ) break; } } if( i<pIdx->nColumn ){ apIdx[nIdx++] = pIdx; aIdxUsed[j] = 1; }else{ aIdxUsed[j] = 0; } } /* Resolve the column names in all the expressions in the ** WHERE clause. */ if( sqlite3ExprResolveNames(&sNC, pWhere) ){ goto update_cleanup; } /* Start the view context */ if( isView ){ sqlite3AuthContextPush(pParse, &sContext, pTab->zName); } /* Begin generating code. */ v = sqlite3GetVdbe(pParse); if( v==0 ) goto update_cleanup; if( pParse->nested==0 ) sqlite3VdbeCountChanges(v); sqlite3BeginWriteOperation(pParse, 1, iDb); /* If we are trying to update a view, realize that view into ** a ephemeral table. */ if( isView ){ Select *pView; pView = sqlite3SelectDup(pTab->pSelect); sqlite3Select(pParse, pView, SRT_VirtualTab, iCur, 0, 0, 0, 0); sqlite3SelectDelete(pView); } /* Begin the database scan */ pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0); if( pWInfo==0 ) goto update_cleanup; /* Remember the index of every item to be updated. */ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); sqlite3VdbeAddOp(v, OP_FifoWrite, 0, 0); /* End the database scan loop. */ sqlite3WhereEnd(pWInfo); /* Initialize the count of updated rows */ if( db->flags & SQLITE_CountRows && !pParse->trigStack ){ sqlite3VdbeAddOp(v, OP_Integer, 0, 0); } if( triggers_exist ){ /* Create pseudo-tables for NEW and OLD */ sqlite3VdbeAddOp(v, OP_OpenPseudo, oldIdx, 0); sqlite3VdbeAddOp(v, OP_SetNumColumns, oldIdx, pTab->nCol); sqlite3VdbeAddOp(v, OP_OpenPseudo, newIdx, 0); sqlite3VdbeAddOp(v, OP_SetNumColumns, newIdx, pTab->nCol); /* The top of the update loop for when there are triggers. */ addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, 0); if( !isView ){ sqlite3VdbeAddOp(v, OP_Dup, 0, 0); sqlite3VdbeAddOp(v, OP_Dup, 0, 0); /* Open a cursor and make it point to the record that is ** being updated. */ sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenRead); } sqlite3VdbeAddOp(v, OP_MoveGe, iCur, 0); /* Generate the OLD table */ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); sqlite3VdbeAddOp(v, OP_RowData, iCur, 0); sqlite3VdbeAddOp(v, OP_Insert, oldIdx, 0); /* Generate the NEW table */ if( chngRowid ){ sqlite3ExprCodeAndCache(pParse, pRowidExpr); }else{ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); } for(i=0; i<pTab->nCol; i++){ if( i==pTab->iPKey ){ sqlite3VdbeAddOp(v, OP_Null, 0, 0); continue; } j = aXRef[i]; if( j<0 ){ sqlite3VdbeAddOp(v, OP_Column, iCur, i); sqlite3ColumnDefault(v, pTab, i); }else{ sqlite3ExprCodeAndCache(pParse, pChanges->a[j].pExpr); } } sqlite3VdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0); if( !isView ){ sqlite3TableAffinityStr(v, pTab); } if( pParse->nErr ) goto update_cleanup; sqlite3VdbeAddOp(v, OP_Insert, newIdx, 0); if( !isView ){ sqlite3VdbeAddOp(v, OP_Close, iCur, 0); } /* Fire the BEFORE and INSTEAD OF triggers */ if( sqlite3CodeRowTrigger(pParse, TK_UPDATE, pChanges, TRIGGER_BEFORE, pTab, newIdx, oldIdx, onError, addr) ){ goto update_cleanup; } } if( !isView ){ /* ** Open every index that needs updating. Note that if any ** index could potentially invoke a REPLACE conflict resolution ** action, then we need to open all indices because we might need ** to be deleting some records. */ sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenWrite); if( onError==OE_Replace ){ openAll = 1; }else{ openAll = 0; for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ if( pIdx->onError==OE_Replace ){ openAll = 1; break; } } } for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ if( openAll || aIdxUsed[i] ){ KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx); sqlite3VdbeAddOp(v, OP_Integer, iDb, 0); sqlite3VdbeOp3(v, OP_OpenWrite, iCur+i+1, pIdx->tnum, (char*)pKey, P3_KEYINFO_HANDOFF); assert( pParse->nTab>iCur+i+1 ); } } /* Loop over every record that needs updating. We have to load ** the old data for each record to be updated because some columns ** might not change and we will need to copy the old value. ** Also, the old data is needed to delete the old index entires. ** So make the cursor point at the old record. */ if( !triggers_exist ){ addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, 0); sqlite3VdbeAddOp(v, OP_Dup, 0, 0); } sqlite3VdbeAddOp(v, OP_NotExists, iCur, addr); /* If the record number will change, push the record number as it ** will be after the update. (The old record number is currently ** on top of the stack.) */ if( chngRowid ){ sqlite3ExprCode(pParse, pRowidExpr); sqlite3VdbeAddOp(v, OP_MustBeInt, 0, 0); } /* Compute new data for this record. */ for(i=0; i<pTab->nCol; i++){ if( i==pTab->iPKey ){ sqlite3VdbeAddOp(v, OP_Null, 0, 0); continue; } j = aXRef[i]; if( j<0 ){ sqlite3VdbeAddOp(v, OP_Column, iCur, i); sqlite3ColumnDefault(v, pTab, i); }else{ sqlite3ExprCode(pParse, pChanges->a[j].pExpr); } } /* Do constraint checks */ sqlite3GenerateConstraintChecks(pParse, pTab, iCur, aIdxUsed, chngRowid, 1, onError, addr); /* Delete the old indices for the current record. */ sqlite3GenerateRowIndexDelete(db, v, pTab, iCur, aIdxUsed); /* If changing the record number, delete the old record. */ if( chngRowid ){ sqlite3VdbeAddOp(v, OP_Delete, iCur, 0); } /* Create the new index entries and the new record. */ sqlite3CompleteInsertion(pParse, pTab, iCur, aIdxUsed, chngRowid, 1, -1); } /* Increment the row counter */ if( db->flags & SQLITE_CountRows && !pParse->trigStack){ sqlite3VdbeAddOp(v, OP_AddImm, 1, 0); } /* If there are triggers, close all the cursors after each iteration ** through the loop. The fire the after triggers. */ if( triggers_exist ){ if( !isView ){ for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ if( openAll || aIdxUsed[i] ) sqlite3VdbeAddOp(v, OP_Close, iCur+i+1, 0); } sqlite3VdbeAddOp(v, OP_Close, iCur, 0); } if( sqlite3CodeRowTrigger(pParse, TK_UPDATE, pChanges, TRIGGER_AFTER, pTab, newIdx, oldIdx, onError, addr) ){ goto update_cleanup; } } /* Repeat the above with the next record to be updated, until ** all record selected by the WHERE clause have been updated. */ sqlite3VdbeAddOp(v, OP_Goto, 0, addr); sqlite3VdbeJumpHere(v, addr); /* Close all tables if there were no FOR EACH ROW triggers */ if( !triggers_exist ){ for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ if( openAll || aIdxUsed[i] ){ sqlite3VdbeAddOp(v, OP_Close, iCur+i+1, 0); } } sqlite3VdbeAddOp(v, OP_Close, iCur, 0); }else{ sqlite3VdbeAddOp(v, OP_Close, newIdx, 0); sqlite3VdbeAddOp(v, OP_Close, oldIdx, 0); } /* ** Return the number of rows that were changed. If this routine is ** generating code because of a call to sqlite3NestedParse(), do not ** invoke the callback function. */ if( db->flags & SQLITE_CountRows && !pParse->trigStack && pParse->nested==0 ){ sqlite3VdbeAddOp(v, OP_Callback, 1, 0); sqlite3VdbeSetNumCols(v, 1); sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows updated", P3_STATIC); } update_cleanup: sqlite3AuthContextPop(&sContext); sqliteFree(apIdx); sqliteFree(aXRef); sqlite3SrcListDelete(pTabList); sqlite3ExprListDelete(pChanges); sqlite3ExprDelete(pWhere); return; } --- NEW FILE: table.c --- /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains the sqlite3_get_table() and sqlite3_free_table() ** interface routines. These are just wrappers around the main ** interface routine of sqlite3_exec(). ** ** These routines are in a separate files so that they will not be linked ** if they are not used. */ #include "sqliteInt.h" #include <stdlib.h> #include <string.h> #ifndef SQLITE_OMIT_GET_TABLE /* ** This structure is used to pass data from sqlite3_get_table() through ** to the callback function is uses to build the result. */ typedef struct TabResult { char **azResult; char *zErrMsg; int nResult; int nAlloc; int nRow; int nColumn; int nData; int rc; } TabResult; /* ** This routine is called once for each row in the result table. Its job ** is to fill in the TabResult structure appropriately, allocating new ** memory as necessary. */ static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){ TabResult *p = (TabResult*)pArg; int need; int i; char *z; /* Make sure there is enough space in p->azResult to hold everything ** we need to remember from this invocation of the callback. */ if( p->nRow==0 && argv!=0 ){ need = nCol*2; }else{ need = nCol; } if( p->nData + need >= p->nAlloc ){ char **azNew; p->nAlloc = p->nAlloc*2 + need + 1; azNew = realloc( p->azResult, sizeof(char*)*p->nAlloc ); if( azNew==0 ) goto malloc_failed; p->azResult = azNew; } /* If this is the first row, then generate an extra row containing ** the names of all columns. */ if( p->nRow==0 ){ p->nColumn = nCol; for(i=0; i<nCol; i++){ if( colv[i]==0 ){ z = 0; }else{ z = malloc( strlen(colv[i])+1 ); if( z==0 ) goto malloc_failed; strcpy(z, colv[i]); } p->azResult[p->nData++] = z; } }else if( p->nColumn!=nCol ){ sqlite3SetString(&p->zErrMsg, "sqlite3_get_table() called with two or more incompatible queries", (char*)0); p->rc = SQLITE_ERROR; return 1; } /* Copy over the row data */ if( argv!=0 ){ for(i=0; i<nCol; i++){ if( argv[i]==0 ){ z = 0; }else{ z = malloc( strlen(argv[i])+1 ); if( z==0 ) goto malloc_failed; strcpy(z, argv[i]); } p->azResult[p->nData++] = z; } p->nRow++; } return 0; malloc_failed: p->rc = SQLITE_NOMEM; return 1; } /* ** Query the database. But instead of invoking a callback for each row, ** malloc() for space to hold the result and return the entire results ** at the conclusion of the call. ** ** The result that is written to ***pazResult is held in memory obtained ** from malloc(). But the caller cannot free this memory directly. ** Instead, the entire table should be passed to sqlite3_free_table() when ** the calling procedure is finished using it. */ int sqlite3_get_table( sqlite3 *db, /* The database on which the SQL executes */ const char *zSql, /* The SQL to be executed */ char ***pazResult, /* Write the result table here */ int *pnRow, /* Write the number of rows in the result here */ int *pnColumn, /* Write the number of columns of result here */ char **pzErrMsg /* Write error messages here */ ){ int rc; TabResult res; if( pazResult==0 ){ return SQLITE_ERROR; } *pazResult = 0; if( pnColumn ) *pnColumn = 0; if( pnRow ) *pnRow = 0; res.zErrMsg = 0; res.nResult = 0; res.nRow = 0; res.nColumn = 0; res.nData = 1; res.nAlloc = 20; res.rc = SQLITE_OK; res.azResult = malloc( sizeof(char*)*res.nAlloc ); if( res.azResult==0 ) return SQLITE_NOMEM; res.azResult[0] = 0; rc = sqlite3_exec(db, zSql, sqlite3_get_table_cb, &res, pzErrMsg); if( res.azResult ){ assert( sizeof(res.azResult[0])>= sizeof(res.nData) ); res.azResult[0] = (char*)res.nData; } if( rc==SQLITE_ABORT ){ sqlite3_free_table(&res.azResult[1]); if( res.zErrMsg ){ if( pzErrMsg ){ free(*pzErrMsg); *pzErrMsg = sqlite3_mprintf("%s",res.zErrMsg); } sqliteFree(res.zErrMsg); } db->errCode = res.rc; return res.rc; } sqliteFree(res.zErrMsg); if( rc!=SQLITE_OK ){ sqlite3_free_table(&res.azResult[1]); return rc; } if( res.nAlloc>res.nData ){ char **azNew; azNew = realloc( res.azResult, sizeof(char*)*(res.nData+1) ); if( azNew==0 ){ sqlite3_free_table(&res.azResult[1]); return SQLITE_NOMEM; } res.nAlloc = res.nData+1; res.azResult = azNew; } *pazResult = &res.azResult[1]; if( pnColumn ) *pnColumn = res.nColumn; if( pnRow ) *pnRow = res.nRow; return rc; } /* ** This routine frees the space the sqlite3_get_table() malloced. */ void sqlite3_free_table( char **azResult /* Result returned from from sqlite3_get_table() */ ){ if( azResult ){ int i, n; azResult--; if( azResult==0 ) return; n = (int)azResult[0]; for(i=1; i<n; i++){ if( azResult[i] ) free(azResult[i]); } free(azResult); } } #endif /* SQLITE_OMIT_GET_TABLE */ --- NEW FILE: pager.c --- /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the implementation of the page cache subsystem or "pager". ** ** The pager is used to access a database disk file. It implements ** atomic commit and rollback through the use of a journal file that ** is separate from the database file. The pager also implements file ** locking to prevent two processes from writing the same database ** file simultaneously, or one process from reading the database while ** another is writing. [...3767 lines suppressed...] int sqlite3pager_lockstate(Pager *pPager){ return sqlite3OsLockState(pPager->fd); } #endif #ifdef SQLITE_DEBUG /* ** Print a listing of all referenced pages and their ref count. */ void sqlite3pager_refdump(Pager *pPager){ PgHdr *pPg; for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ if( pPg->nRef<=0 ) continue; sqlite3DebugPrintf("PAGE %3d addr=%p nRef=%d\n", pPg->pgno, PGHDR_TO_DATA(pPg), pPg->nRef); } } #endif #endif /* SQLITE_OMIT_DISKIO */ --- NEW FILE: prepare.c --- /* ** 2005 May 25 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains the implementation of the sqlite3_prepare() ** interface, and routines that contribute to loading the database schema ** from disk. ** ** $Id: prepare.c,v 1.1.2.1 2006/03/24 01:29:46 davidgewirtz Exp $ */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> /* ** Fill the InitData structure with an error message that indicates ** that the database is corrupt. */ static void corruptSchema(InitData *pData, const char *zExtra){ if( !sqlite3MallocFailed() ){ sqlite3SetString(pData->pzErrMsg, "malformed database schema", zExtra!=0 && zExtra[0]!=0 ? " - " : (char*)0, zExtra, (char*)0); } } /* ** This is the callback routine for the code that initializes the ** database. See sqlite3Init() below for additional information. ** This routine is also called from the OP_ParseSchema opcode of the VDBE. ** ** Each callback contains the following information: ** ** argv[0] = name of thing being created ** argv[1] = root page number for table or index. NULL for trigger or view. ** argv[2] = SQL text for the CREATE statement. ** argv[3] = "1" for temporary files, "0" for main database, "2" or more ** for auxiliary database files. ** */ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){ InitData *pData = (InitData*)pInit; sqlite3 *db = pData->db; int iDb; if( sqlite3MallocFailed() ){ return SQLITE_NOMEM; } assert( argc==4 ); if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */ if( argv[1]==0 || argv[3]==0 ){ corruptSchema(pData, 0); return 1; } iDb = atoi(argv[3]); assert( iDb>=0 && iDb<db->nDb ); if( argv[2] && argv[2][0] ){ /* Call the parser to process a CREATE TABLE, INDEX or VIEW. ** But because db->init.busy is set to 1, no VDBE code is generated ** or executed. All the parser does is build the internal data ** structures that describe the table, index, or view. */ char *zErr; int rc; assert( db->init.busy ); db->init.iDb = iDb; db->init.newTnum = atoi(argv[1]); rc = sqlite3_exec(db, argv[2], 0, 0, &zErr); db->init.iDb = 0; if( SQLITE_OK!=rc ){ if( rc==SQLITE_NOMEM ){ sqlite3FailedMalloc(); }else{ corruptSchema(pData, zErr); } sqlite3_free(zErr); return rc; } }else{ /* If the SQL column is blank it means this is an index that ** was created to be the PRIMARY KEY or to fulfill a UNIQUE ** constraint for a CREATE TABLE. The index should have already ** been created when we processed the CREATE TABLE. All we have ** to do here is record the root page number for that index. */ Index *pIndex; pIndex = sqlite3FindIndex(db, argv[0], db->aDb[iDb].zName); if( pIndex==0 || pIndex->tnum!=0 ){ /* This can occur if there exists an index on a TEMP table which ** has the same name as another index on a permanent index. Since ** the permanent table is hidden by the TEMP table, we can also ** safely ignore the index on the permanent table. */ /* Do Nothing */; }else{ pIndex->tnum = atoi(argv[1]); } } return 0; } /* ** Attempt to read the database schema and initialize internal ** data structures for a single database file. The index of the ** database file is given by iDb. iDb==0 is used for the main ** database. iDb==1 should never be used. iDb>=2 is used for ** auxiliary databases. Return one of the SQLITE_ error codes to ** indicate success or failure. */ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ int rc; BtCursor *curMain; int size; Table *pTab; Db *pDb; char const *azArg[5]; char zDbNum[30]; int meta[10]; InitData initData; char const *zMasterSchema; char const *zMasterName = SCHEMA_TABLE(iDb); /* ** The master database table has a structure like this */ static const char master_schema[] = "CREATE TABLE sqlite_master(\n" " type text,\n" " name text,\n" " tbl_name text,\n" " rootpage integer,\n" " sql text\n" ")" ; #ifndef SQLITE_OMIT_TEMPDB static const char temp_master_schema[] = "CREATE TEMP TABLE sqlite_temp_master(\n" " type text,\n" " name text,\n" " tbl_name text,\n" " rootpage integer,\n" " sql text\n" ")" ; #else #define temp_master_schema 0 #endif assert( iDb>=0 && iDb<db->nDb ); assert( db->aDb[iDb].pSchema ); /* zMasterSchema and zInitScript are set to point at the master schema ** and initialisation script appropriate for the database being ** initialised. zMasterName is the name of the master table. */ if( !OMIT_TEMPDB && iDb==1 ){ zMasterSchema = temp_master_schema; }else{ zMasterSchema = master_schema; } zMasterName = SCHEMA_TABLE(iDb); /* Construct the schema tables. */ sqlite3SafetyOff(db); azArg[0] = zMasterName; azArg[1] = "1"; azArg[2] = zMasterSchema; sprintf(zDbNum, "%d", iDb); azArg[3] = zDbNum; azArg[4] = 0; initData.db = db; initData.pzErrMsg = pzErrMsg; rc = sqlite3InitCallback(&initData, 4, (char **)azArg, 0); if( rc!=SQLITE_OK ){ sqlite3SafetyOn(db); return rc; } pTab = sqlite3FindTable(db, zMasterName, db->aDb[iDb].zName); if( pTab ){ pTab->readOnly = 1; } sqlite3SafetyOn(db); /* Create a cursor to hold the database open */ pDb = &db->aDb[iDb]; if( pDb->pBt==0 ){ if( !OMIT_TEMPDB && iDb==1 ){ DbSetProperty(db, 1, DB_SchemaLoaded); } return SQLITE_OK; } rc = sqlite3BtreeCursor(pDb->pBt, MASTER_ROOT, 0, 0, 0, &curMain); if( rc!=SQLITE_OK && rc!=SQLITE_EMPTY ){ sqlite3SetString(pzErrMsg, sqlite3ErrStr(rc), (char*)0); return rc; } /* Get the database meta information. ** ** Meta values are as follows: ** meta[0] Schema cookie. Changes with each schema change. ** meta[1] File format of schema layer. ** meta[2] Size of the page cache. ** meta[3] Use freelist if 0. Autovacuum if greater than zero. ** meta[4] Db text encoding. 1:UTF-8 3:UTF-16 LE 4:UTF-16 BE ** meta[5] The user cookie. Used by the application. ** meta[6] ** meta[7] ** meta[8] ** meta[9] ** ** Note: The #defined SQLITE_UTF* symbols in sqliteInt.h correspond to ** the possible values of meta[4]. */ if( rc==SQLITE_OK ){ int i; for(i=0; rc==SQLITE_OK && i<sizeof(meta)/sizeof(meta[0]); i++){ rc = sqlite3BtreeGetMeta(pDb->pBt, i+1, (u32 *)&meta[i]); } if( rc ){ sqlite3SetString(pzErrMsg, sqlite3ErrStr(rc), (char*)0); sqlite3BtreeCloseCursor(curMain); return rc; } }else{ memset(meta, 0, sizeof(meta)); } pDb->pSchema->schema_cookie = meta[0]; /* If opening a non-empty database, check the text encoding. For the ** main database, set sqlite3.enc to the encoding of the main database. ** For an attached db, it is an error if the encoding is not the same ** as sqlite3.enc. */ if( meta[4] ){ /* text encoding */ if( iDb==0 ){ /* If opening the main database, set ENC(db). */ ENC(db) = (u8)meta[4]; db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 6, 0); }else{ /* If opening an attached database, the encoding much match ENC(db) */ if( meta[4]!=ENC(db) ){ sqlite3BtreeCloseCursor(curMain); sqlite3SetString(pzErrMsg, "attached databases must use the same" " text encoding as main database", (char*)0); return SQLITE_ERROR; } } }else{ DbSetProperty(db, iDb, DB_Empty); } pDb->pSchema->enc = ENC(db); size = meta[2]; if( size==0 ){ size = MAX_PAGES; } pDb->pSchema->cache_size = size; sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size); /* ** file_format==1 Version 3.0.0. ** file_format==2 Version 3.1.3. // ALTER TABLE ADD COLUMN ** file_format==3 Version 3.1.4. // ditto but with non-NULL defaults ** file_format==4 Version 3.3.0. // DESC indices. Boolean constants */ pDb->pSchema->file_format = meta[1]; if( pDb->pSchema->file_format==0 ){ pDb->pSchema->file_format = 1; } if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){ sqlite3BtreeCloseCursor(curMain); sqlite3SetString(pzErrMsg, "unsupported file format", (char*)0); return SQLITE_ERROR; } /* Read the schema information out of the schema tables */ assert( db->init.busy ); if( rc==SQLITE_EMPTY ){ /* For an empty database, there is nothing to read */ rc = SQLITE_OK; }else{ char *zSql; zSql = sqlite3MPrintf( "SELECT name, rootpage, sql, '%s' FROM '%q'.%s", zDbNum, db->aDb[iDb].zName, zMasterName); sqlite3SafetyOff(db); rc = sqlite3_exec(db, zSql, sqlite3InitCallback, &initData, 0); sqlite3SafetyOn(db); sqliteFree(zSql); #ifndef SQLITE_OMIT_ANALYZE if( rc==SQLITE_OK ){ sqlite3AnalysisLoad(db, iDb); } #endif sqlite3BtreeCloseCursor(curMain); } if( sqlite3MallocFailed() ){ /* sqlite3SetString(pzErrMsg, "out of memory", (char*)0); */ rc = SQLITE_NOMEM; sqlite3ResetInternalSchema(db, 0); } if( rc==SQLITE_OK ){ DbSetProperty(db, iDb, DB_SchemaLoaded); }else{ sqlite3ResetInternalSchema(db, iDb); } return rc; } /* ** Initialize all database files - the main database file, the file ** used to store temporary tables, and any additional database files ** created using ATTACH statements. Return a success code. If an ** error occurs, write an error message into *pzErrMsg. ** ** After a database is initialized, the DB_SchemaLoaded bit is set ** bit is set in the flags field of the Db structure. If the database ** file was of zero-length, then the DB_Empty flag is also set. */ int sqlite3Init(sqlite3 *db, char **pzErrMsg){ int i, rc; int called_initone = 0; if( db->init.busy ) return SQLITE_OK; rc = SQLITE_OK; db->init.busy = 1; for(i=0; rc==SQLITE_OK && i<db->nDb; i++){ if( DbHasProperty(db, i, DB_SchemaLoaded) || i==1 ) continue; rc = sqlite3InitOne(db, i, pzErrMsg); if( rc ){ sqlite3ResetInternalSchema(db, i); } called_initone = 1; } /* Once all the other databases have been initialised, load the schema ** for the TEMP database. This is loaded last, as the TEMP database ** schema may contain references to objects in other databases. */ #ifndef SQLITE_OMIT_TEMPDB if( rc==SQLITE_OK && db->nDb>1 && !DbHasProperty(db, 1, DB_SchemaLoaded) ){ rc = sqlite3InitOne(db, 1, pzErrMsg); if( rc ){ sqlite3ResetInternalSchema(db, 1); } called_initone = 1; } #endif db->init.busy = 0; if( rc==SQLITE_OK && called_initone ){ sqlite3CommitInternalChanges(db); } return rc; } /* ** This routine is a no-op if the database schema is already initialised. ** Otherwise, the schema is loaded. An error code is returned. */ int sqlite3ReadSchema(Parse *pParse){ int rc = SQLITE_OK; sqlite3 *db = pParse->db; if( !db->init.busy ){ rc = sqlite3Init(db, &pParse->zErrMsg); } if( rc!=SQLITE_OK ){ pParse->rc = rc; pParse->nErr++; } return rc; } /* ** Check schema cookies in all databases. If any cookie is out ** of date, return 0. If all schema cookies are current, return 1. */ static int schemaIsValid(sqlite3 *db){ int iDb; int rc; BtCursor *curTemp; int cookie; int allOk = 1; for(iDb=0; allOk && iDb<db->nDb; iDb++){ Btree *pBt; pBt = db->aDb[iDb].pBt; if( pBt==0 ) continue; rc = sqlite3BtreeCursor(pBt, MASTER_ROOT, 0, 0, 0, &curTemp); if( rc==SQLITE_OK ){ rc = sqlite3BtreeGetMeta(pBt, 1, (u32 *)&cookie); if( rc==SQLITE_OK && cookie!=db->aDb[iDb].pSchema->schema_cookie ){ allOk = 0; } sqlite3BtreeCloseCursor(curTemp); } } return allOk; } /* ** Free all resources held by the schema structure. The void* argument points ** at a Schema struct. This function does not call sqliteFree() on the ** pointer itself, it just cleans up subsiduary resources (i.e. the contents ** of the schema hash tables). */ void sqlite3SchemaFree(void *p){ Hash temp1; Hash temp2; HashElem *pElem; Schema *pSchema = (Schema *)p; temp1 = pSchema->tblHash; temp2 = pSchema->trigHash; sqlite3HashInit(&pSchema->trigHash, SQLITE_HASH_STRING, 0); sqlite3HashClear(&pSchema->aFKey); sqlite3HashClear(&pSchema->idxHash); for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){ sqlite3DeleteTrigger((Trigger*)sqliteHashData(pElem)); } sqlite3HashClear(&temp2); sqlite3HashInit(&pSchema->tblHash, SQLITE_HASH_STRING, 0); for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){ Table *pTab = sqliteHashData(pElem); sqlite3DeleteTable(0, pTab); } sqlite3HashClear(&temp1); pSchema->pSeqTab = 0; pSchema->flags &= ~DB_SchemaLoaded; } /* ** Find and return the schema associated with a BTree. Create ** a new one if necessary. */ Schema *sqlite3SchemaGet(Btree *pBt){ Schema * p; if( pBt ){ p = (Schema *)sqlite3BtreeSchema(pBt,sizeof(Schema),sqlite3SchemaFree); }else{ p = (Schema *)sqliteMalloc(sizeof(Schema)); } if( p && 0==p->file_format ){ sqlite3HashInit(&p->tblHash, SQLITE_HASH_STRING, 0); sqlite3HashInit(&p->idxHash, SQLITE_HASH_STRING, 0); sqlite3HashInit(&p->trigHash, SQLITE_HASH_STRING, 0); sqlite3HashInit(&p->aFKey, SQLITE_HASH_STRING, 1); } return p; } /* ** Convert a schema pointer into the iDb index that indicates ** which database file in db->aDb[] the schema refers to. ** ** If the same database is attached more than once, the first ** attached database is returned. */ int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){ int i = -1000000; /* If pSchema is NULL, then return -1000000. This happens when code in ** expr.c is trying to resolve a reference to a transient table (i.e. one ** created by a sub-select). In this case the return value of this ** function should never be used. ** ** We return -1000000 instead of the more usual -1 simply because using ** -1000000 as incorrectly using -1000000 index into db->aDb[] is much ** more likely to cause a segfault than -1 (of course there are assert() ** statements too, but it never hurts to play the odds). */ if( pSchema ){ for(i=0; i<db->nDb; i++){ if( db->aDb[i].pSchema==pSchema ){ break; } } assert( i>=0 &&i>=0 && i<db->nDb ); } return i; } /* ** Compile the UTF-8 encoded SQL statement zSql into a statement handle. */ int sqlite3_prepare( sqlite3 *db, /* Database handle. */ const char *zSql, /* UTF-8 encoded SQL statement. */ int nBytes, /* Length of zSql in bytes. */ sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ const char** pzTail /* OUT: End of parsed string */ ){ Parse sParse; char *zErrMsg = 0; int rc = SQLITE_OK; int i; /* Assert that malloc() has not failed */ assert( !sqlite3MallocFailed() ); assert( ppStmt ); *ppStmt = 0; if( sqlite3SafetyOn(db) ){ return SQLITE_MISUSE; } /* If any attached database schemas are locked, do not proceed with ** compilation. Instead return SQLITE_LOCKED immediately. */ for(i=0; i<db->nDb; i++) { Btree *pBt = db->aDb[i].pBt; if( pBt && sqlite3BtreeSchemaLocked(pBt) ){ const char *zDb = db->aDb[i].zName; sqlite3Error(db, SQLITE_LOCKED, "database schema is locked: %s", zDb); sqlite3SafetyOff(db); return SQLITE_LOCKED; } } memset(&sParse, 0, sizeof(sParse)); sParse.db = db; if( nBytes>=0 && zSql[nBytes]!=0 ){ char *zSqlCopy = sqlite3StrNDup(zSql, nBytes); sqlite3RunParser(&sParse, zSqlCopy, &zErrMsg); sParse.zTail += zSql - zSqlCopy; sqliteFree(zSqlCopy); }else{ sqlite3RunParser(&sParse, zSql, &zErrMsg); } if( sqlite3MallocFailed() ){ sParse.rc = SQLITE_NOMEM; } if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK; if( sParse.checkSchema && !schemaIsValid(db) ){ sParse.rc = SQLITE_SCHEMA; } if( sParse.rc==SQLITE_SCHEMA ){ sqlite3ResetInternalSchema(db, 0); } if( pzTail ) *pzTail = sParse.zTail; rc = sParse.rc; #ifndef SQLITE_OMIT_EXPLAIN if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){ if( sParse.explain==2 ){ sqlite3VdbeSetNumCols(sParse.pVdbe, 3); sqlite3VdbeSetColName(sParse.pVdbe, 0, COLNAME_NAME, "order", P3_STATIC); sqlite3VdbeSetColName(sParse.pVdbe, 1, COLNAME_NAME, "from", P3_STATIC); sqlite3VdbeSetColName(sParse.pVdbe, 2, COLNAME_NAME, "detail", P3_STATIC); }else{ sqlite3VdbeSetNumCols(sParse.pVdbe, 5); sqlite3VdbeSetColName(sParse.pVdbe, 0, COLNAME_NAME, "addr", P3_STATIC); sqlite3VdbeSetColName(sParse.pVdbe, 1, COLNAME_NAME, "opcode", P3_STATIC); sqlite3VdbeSetColName(sParse.pVdbe, 2, COLNAME_NAME, "p1", P3_STATIC); sqlite3VdbeSetColName(sParse.pVdbe, 3, COLNAME_NAME, "p2", P3_STATIC); sqlite3VdbeSetColName(sParse.pVdbe, 4, COLNAME_NAME, "p3", P3_STATIC); } } #endif if( sqlite3SafetyOff(db) ){ rc = SQLITE_MISUSE; } if( rc==SQLITE_OK ){ *ppStmt = (sqlite3_stmt*)sParse.pVdbe; }else if( sParse.pVdbe ){ sqlite3_finalize((sqlite3_stmt*)sParse.pVdbe); } if( zErrMsg ){ sqlite3Error(db, rc, "%s", zErrMsg); sqliteFree(zErrMsg); }else{ sqlite3Error(db, rc, 0); } rc = sqlite3ApiExit(db, rc); sqlite3ReleaseThreadData(); return rc; } #ifndef SQLITE_OMIT_UTF16 /* ** Compile the UTF-16 encoded SQL statement zSql into a statement handle. */ int sqlite3_prepare16( sqlite3 *db, /* Database handle. */ const void *zSql, /* UTF-8 encoded SQL statement. */ int nBytes, /* Length of zSql in bytes. */ sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ const void **pzTail /* OUT: End of parsed string */ ){ /* This function currently works by first transforming the UTF-16 ** encoded string to UTF-8, then invoking sqlite3_prepare(). The ** tricky bit is figuring out the pointer to return in *pzTail. */ char *zSql8; const char *zTail8 = 0; int rc = SQLITE_OK; if( sqlite3SafetyCheck(db) ){ return SQLITE_MISUSE; } zSql8 = sqlite3utf16to8(zSql, nBytes); if( zSql8 ){ rc = sqlite3_prepare(db, zSql8, -1, ppStmt, &zTail8); } if( zTail8 && pzTail ){ /* If sqlite3_prepare returns a tail pointer, we calculate the ** equivalent pointer into the UTF-16 string by counting the unicode ** characters between zSql8 and zTail8, and then returning a pointer ** the same number of characters into the UTF-16 string. */ int chars_parsed = sqlite3utf8CharLen(zSql8, zTail8-zSql8); *pzTail = (u8 *)zSql + sqlite3utf16ByteLen(zSql, chars_parsed); } sqliteFree(zSql8); return sqlite3ApiExit(db, rc); } #endif /* SQLITE_OMIT_UTF16 */ --- NEW FILE: shell.c --- /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code to implement the "sqlite" command line ** utility for accessing SQLite databases. ** ** $Id: shell.c,v 1.1.2.1 2006/03/24 01:29:46 davidgewirtz Exp $ */ #include <stdlib.h> #include <string.h> #include <stdio.h> [...1750 lines suppressed...] zHome = find_home_dir(); if( zHome && (zHistory = malloc(strlen(zHome)+20))!=0 ){ sprintf(zHistory,"%s/.sqlite_history", zHome); } #if defined(HAVE_READLINE) && HAVE_READLINE==1 if( zHistory ) read_history(zHistory); #endif process_input(&data, 0); if( zHistory ){ stifle_history(100); write_history(zHistory); } }else{ process_input(&data, stdin); } } set_table_name(&data, 0); if( db ) sqlite3_close(db); return 0; } --- NEW FILE: legacy.c --- /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Main file for the SQLite library. The routines in this file ** implement the programmer interface to the library. Routines in ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** ** $Id: legacy.c,v 1.1.2.1 2006/03/24 01:29:46 davidgewirtz Exp $ */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> /* ** Execute SQL code. Return one of the SQLITE_ success/failure ** codes. Also write an error message into memory obtained from ** malloc() and make *pzErrMsg point to that message. ** ** If the SQL is a query, then for each row in the query result ** the xCallback() function is called. pArg becomes the first ** argument to xCallback(). If xCallback=NULL then no callback ** is invoked, even for queries. */ int sqlite3_exec( sqlite3 *db, /* The database on which the SQL executes */ const char *zSql, /* The SQL to be executed */ sqlite3_callback xCallback, /* Invoke this callback routine */ void *pArg, /* First argument to xCallback() */ char **pzErrMsg /* Write error messages here */ ){ int rc = SQLITE_OK; const char *zLeftover; sqlite3_stmt *pStmt = 0; char **azCols = 0; int nRetry = 0; int nChange = 0; int nCallback; if( zSql==0 ) return SQLITE_OK; while( (rc==SQLITE_OK || (rc==SQLITE_SCHEMA && (++nRetry)<2)) && zSql[0] ){ int nCol; char **azVals = 0; pStmt = 0; rc = sqlite3_prepare(db, zSql, -1, &pStmt, &zLeftover); if( rc!=SQLITE_OK ){ if( pStmt ) sqlite3_finalize(pStmt); continue; } if( !pStmt ){ /* this happens for a comment or white-space */ zSql = zLeftover; continue; } db->nChange += nChange; nCallback = 0; nCol = sqlite3_column_count(pStmt); azCols = sqliteMalloc(2*nCol*sizeof(const char *) + 1); if( azCols==0 ){ goto exec_out; } while( 1 ){ int i; rc = sqlite3_step(pStmt); /* Invoke the callback function if required */ if( xCallback && (SQLITE_ROW==rc || (SQLITE_DONE==rc && !nCallback && db->flags&SQLITE_NullCallback)) ){ if( 0==nCallback ){ for(i=0; i<nCol; i++){ azCols[i] = (char *)sqlite3_column_name(pStmt, i); } nCallback++; } if( rc==SQLITE_ROW ){ azVals = &azCols[nCol]; for(i=0; i<nCol; i++){ azVals[i] = (char *)sqlite3_column_text(pStmt, i); } } if( xCallback(pArg, nCol, azVals, azCols) ){ rc = SQLITE_ABORT; goto exec_out; } } if( rc!=SQLITE_ROW ){ rc = sqlite3_finalize(pStmt); pStmt = 0; if( db->pVdbe==0 ){ nChange = db->nChange; } if( rc!=SQLITE_SCHEMA ){ nRetry = 0; zSql = zLeftover; while( isspace((unsigned char)zSql[0]) ) zSql++; } break; } } sqliteFree(azCols); azCols = 0; } exec_out: if( pStmt ) sqlite3_finalize(pStmt); if( azCols ) sqliteFree(azCols); rc = sqlite3ApiExit(0, rc); if( rc!=SQLITE_OK && rc==sqlite3_errcode(db) && pzErrMsg ){ *pzErrMsg = malloc(1+strlen(sqlite3_errmsg(db))); if( *pzErrMsg ){ strcpy(*pzErrMsg, sqlite3_errmsg(db)); } }else if( pzErrMsg ){ *pzErrMsg = 0; } return rc; } --- NEW FILE: keywordhash.h --- /* Hash score: 159 */ static int keywordCode(const char *z, int n){ static const char zText[537] = "ABORTABLEFTEMPORARYADDATABASELECTHENDEFAULTRANSACTIONATURALTER" "AISEACHECKEYAFTEREFERENCESCAPELSEXCEPTRIGGEREGEXPLAINITIALLYANALYZE" "XCLUSIVEXISTSTATEMENTANDEFERRABLEATTACHAVINGLOBEFOREIGNOREINDEX" "AUTOINCREMENTBEGINNERENAMEBETWEENOTNULLIKEBYCASCADEFERREDELETE" "CASECASTCOLLATECOLUMNCOMMITCONFLICTCONSTRAINTERSECTCREATECROSS" "CURRENT_DATECURRENT_TIMESTAMPLANDESCDETACHDISTINCTDROPRAGMATCH" "FAILIMITFROMFULLGROUPDATEIFIMMEDIATEINSERTINSTEADINTOFFSETISNULL" "JOINORDEREPLACEOUTERESTRICTPRIMARYQUERYRIGHTROLLBACKROWHENUNION" "UNIQUEUSINGVACUUMVALUESVIEWHERE"; static const unsigned char aHash[127] = { 92, 80, 107, 91, 0, 4, 0, 0, 114, 0, 83, 0, 0, 95, 44, 76, 93, 0, 106, 109, 97, 90, 0, 10, 0, 0, 113, 0, 110, 103, 0, 28, 48, 0, 41, 0, 0, 65, 71, 0, 63, 19, 0, 105, 36, 104, 0, 108, 74, 0, 0, 33, 0, 61, 37, 0, 8, 0, 115, 38, 12, 0, 77, 40, 25, 66, 0, 0, 31, 81, 53, 30, 50, 20, 88, 0, 34, 0, 75, 26, 0, 72, 0, 0, 0, 64, 47, 67, 22, 87, 29, 69, 86, 0, 1, 0, 9, 101, 58, 18, 0, 112, 82, 99, 54, 6, 85, 0, 0, 49, 94, 0, 102, 0, 70, 0, 0, 15, 0, 116, 51, 56, 0, 2, 55, 0, 111, }; static const unsigned char aNext[116] = { 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 5, 13, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 16, 0, 23, 52, 0, 0, 0, 0, 45, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, 73, 42, 0, 24, 60, 21, 0, 79, 0, 0, 68, 0, 0, 84, 46, 0, 0, 0, 0, 0, 0, 0, 0, 39, 96, 98, 0, 0, 100, 0, 32, 0, 14, 27, 78, 0, 57, 89, 0, 35, 0, 62, 0, }; static const unsigned char aLen[116] = { 5, 5, 4, 4, 9, 2, 3, 8, 2, 6, 4, 3, 7, 11, 2, 7, 5, 5, 4, 5, 3, 5, 10, 6, 4, 6, 7, 6, 7, 9, 3, 7, 9, 6, 9, 3, 10, 6, 6, 4, 6, 3, 7, 6, 7, 5, 13, 2, 2, 5, 5, 6, 7, 3, 7, 4, 4, 2, 7, 3, 8, 6, 4, 4, 7, 6, 6, 8, 10, 9, 6, 5, 12, 12, 17, 4, 4, 6, 8, 2, 4, 6, 5, 4, 5, 4, 4, 5, 6, 2, 9, 6, 7, 4, 2, 6, 3, 6, 4, 5, 7, 5, 8, 7, 5, 5, 8, 3, 4, 5, 6, 5, 6, 6, 4, 5, }; static const unsigned short int aOffset[116] = { 0, 4, 7, 10, 10, 14, 19, 21, 26, 27, 32, 34, 36, 42, 51, 52, 57, 61, 65, 67, 71, 74, 78, 86, 91, 94, 99, 105, 108, 113, 118, 122, 128, 136, 141, 150, 152, 162, 167, 172, 175, 177, 177, 181, 185, 187, 192, 194, 196, 205, 208, 212, 218, 224, 224, 227, 230, 234, 236, 237, 241, 248, 254, 258, 262, 269, 275, 281, 289, 296, 305, 311, 316, 328, 328, 344, 348, 352, 358, 359, 366, 369, 373, 378, 381, 386, 390, 394, 397, 403, 405, 414, 420, 427, 430, 430, 433, 436, 442, 446, 450, 457, 461, 469, 476, 481, 486, 494, 496, 500, 505, 511, 516, 522, 528, 531, }; static const unsigned char aCode[116] = { TK_ABORT, TK_TABLE, TK_JOIN_KW, TK_TEMP, TK_TEMP, TK_OR, TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, TK_THEN, TK_END, TK_DEFAULT, TK_TRANSACTION,TK_ON, TK_JOIN_KW, TK_ALTER, TK_RAISE, TK_EACH, TK_CHECK, TK_KEY, TK_AFTER, TK_REFERENCES, TK_ESCAPE, TK_ELSE, TK_EXCEPT, TK_TRIGGER, TK_LIKE_KW, TK_EXPLAIN, TK_INITIALLY, TK_ALL, TK_ANALYZE, TK_EXCLUSIVE, TK_EXISTS, TK_STATEMENT, TK_AND, TK_DEFERRABLE, TK_ATTACH, TK_HAVING, TK_LIKE_KW, TK_BEFORE, TK_FOR, TK_FOREIGN, TK_IGNORE, TK_REINDEX, TK_INDEX, TK_AUTOINCR, TK_TO, TK_IN, TK_BEGIN, TK_JOIN_KW, TK_RENAME, TK_BETWEEN, TK_NOT, TK_NOTNULL, TK_NULL, TK_LIKE_KW, TK_BY, TK_CASCADE, TK_ASC, TK_DEFERRED, TK_DELETE, TK_CASE, TK_CAST, TK_COLLATE, TK_COLUMNKW, TK_COMMIT, TK_CONFLICT, TK_CONSTRAINT, TK_INTERSECT, TK_CREATE, TK_JOIN_KW, TK_CTIME_KW, TK_CTIME_KW, TK_CTIME_KW, TK_PLAN, TK_DESC, TK_DETACH, TK_DISTINCT, TK_IS, TK_DROP, TK_PRAGMA, TK_MATCH, TK_FAIL, TK_LIMIT, TK_FROM, TK_JOIN_KW, TK_GROUP, TK_UPDATE, TK_IF, TK_IMMEDIATE, TK_INSERT, TK_INSTEAD, TK_INTO, TK_OF, TK_OFFSET, TK_SET, TK_ISNULL, TK_JOIN, TK_ORDER, TK_REPLACE, TK_JOIN_KW, TK_RESTRICT, TK_PRIMARY, TK_QUERY, TK_JOIN_KW, TK_ROLLBACK, TK_ROW, TK_WHEN, TK_UNION, TK_UNIQUE, TK_USING, TK_VACUUM, TK_VALUES, TK_VIEW, TK_WHERE, }; int h, i; if( n<2 ) return TK_ID; h = ((sqlite3UpperToLower[((unsigned char*)z)[0]]*4) ^ (sqlite3UpperToLower[((unsigned char*)z)[n-1]]*3) ^ n) % 127; for(i=((int)aHash[h])-1; i>=0; i=((int)aNext[i])-1){ if( aLen[i]==n && sqlite3StrNICmp(&zText[aOffset[i]],z,n)==0 ){ return aCode[i]; } } return TK_ID; } int sqlite3KeywordCode(const unsigned char *z, int n){ return keywordCode((char*)z, n); } --- NEW FILE: util.c --- /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** Utility functions used throughout sqlite. ** ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** ** $Id: util.c,v 1.1.2.1 2006/03/24 01:29:46 davidgewirtz Exp $ */ #include "sqliteInt.h" [...1391 lines suppressed...] #ifdef SQLITE_MEMDEBUG /* ** This function sets a flag in the thread-specific-data structure that will ** cause an assert to fail if sqliteMalloc() or sqliteRealloc() is called. */ void sqlite3MallocDisallow(){ assert( sqlite3_mallocDisallowed>=0 ); sqlite3_mallocDisallowed++; } /* ** This function clears the flag set in the thread-specific-data structure set ** by sqlite3MallocDisallow(). */ void sqlite3MallocAllow(){ assert( sqlite3_mallocDisallowed>0 ); sqlite3_mallocDisallowed--; } #endif --- NEW FILE: date.c --- /* ** 2003 October 31 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains the C functions that implement date and time ** functions for SQLite. ** ** There is only one exported symbol in this file - the function ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. ** All other code has file scope. ** ** $Id: date.c,v 1.1.2.1 2006/03/24 01:29:46 davidgewirtz Exp $ ** ** NOTES: ** ** SQLite processes all times and dates as Julian Day numbers. The ** dates and times are stored as the number of days since noon ** in Greenwich on November 24, 4714 B.C. according to the Gregorian ** calendar system. ** ** 1970-01-01 00:00:00 is JD 2440587.5 ** 2000-01-01 00:00:00 is JD 2451544.5 ** ** This implemention requires years... [truncated message content] |
|
From: David G. <dav...@us...> - 2006-03-24 01:28:24
|
Update of /cvsroot/frontierkernel/Frontier/Common/sqlite3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32710/sqlite3 Log Message: Directory /cvsroot/frontierkernel/Frontier/Common/sqlite3 added to the repository --> Using per-directory sticky tag `sqlite-embedded-experimental' |
|
From: Karsten W. <kar...@us...> - 2006-03-22 09:11:34
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16359/Common/source Modified Files: Tag: pre_int64_branch icon.c kb.c langdll.c langpack.c langvalue.c menu.c oplist.c scripts.c serialnumber.c shellverbs.c Log Message: update before switch Index: langpack.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langpack.c,v retrieving revision 1.4.6.1 retrieving revision 1.4.6.2 diff -C2 -d -r1.4.6.1 -r1.4.6.2 *** langpack.c 10 Mar 2006 22:26:57 -0000 1.4.6.1 --- langpack.c 22 Mar 2006 09:11:28 -0000 1.4.6.2 *************** *** 42,45 **** --- 42,46 ---- #include "tablestructure.h" + extern boolean getwinparam (hdltreenode, short, hdlwindowinfo *); // shellwindowverbs.c Index: oplist.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/oplist.c,v retrieving revision 1.7.4.2 retrieving revision 1.7.4.3 diff -C2 -d -r1.7.4.2 -r1.7.4.3 *** oplist.c 19 Mar 2006 10:51:05 -0000 1.7.4.2 --- oplist.c 22 Mar 2006 09:11:28 -0000 1.7.4.3 *************** *** 56,70 **** #ifdef MACVERSION ! #define unconditionallongswap(x) ((((x) >> 24) & 0x000000ff) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) ! #define unconditionalshortswap(x) ((((x) >> 8) & 0x00ff) | (((x) << 8) & 0xff00)) ! #define unconditionallyswaplong(x) do {(x) = unconditionallongswap(x);} while (0) ! #define unconditionallyswapshort(x) do {(x) = unconditionalshortswap(x);} while (0) #endif #ifdef WIN95VERSION ! #define unconditionallongswap(x) dolongswap(x) [...1207 lines suppressed...] nomad = (**ho).hsummit; ! while (true) ! { nextnomad = (**nomad).headlinkdown; ! opgetheadstring (nomad, bskey); ! if (!(*visit) ((**nomad).hrefcon, bskey, refcon)) return (false); ! if (nextnomad == nomad) break; ! nomad = nextnomad; ! } /*while*/ return (true); ! } /*opvisitlist*/ Index: langdll.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langdll.c,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 *** langdll.c 24 Jan 2005 03:02:37 -0000 1.6 --- langdll.c 22 Mar 2006 09:11:28 -0000 1.6.4.1 *************** *** 353,357 **** grabthreadglobals (); ! if (((value->valuetype == odb_recordvaluetype) || (value->valuetype == odb_listvaluetype)) && (value->data.listvalue != NULL)) { *cnt = opcountlistitems ((hdllistrecord) value->data.listvalue); --- 353,360 ---- grabthreadglobals (); ! if ( ( (value->valuetype == odb_recordvaluetype) ! || (value->valuetype == odb_listvaluetype)) ! && (value->data.listvalue != NULL)) ! { *cnt = opcountlistitems ((hdllistrecord) value->data.listvalue); Index: scripts.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/scripts.c,v retrieving revision 1.4.6.1 retrieving revision 1.4.6.2 diff -C2 -d -r1.4.6.1 -r1.4.6.2 *** scripts.c 2 Feb 2006 18:39:59 -0000 1.4.6.1 --- scripts.c 22 Mar 2006 09:11:28 -0000 1.4.6.2 *************** *** 1445,1449 **** static pascal OSErr handlerecordedtext (const AppleEvent *event, AppleEvent *reply, SInt32 refcon) { ! #pragma unused(refcon) /* 2.1b3 dmb: ignore extra syntax/lines needed for text-based recording --- 1445,1449 ---- static pascal OSErr handlerecordedtext (const AppleEvent *event, AppleEvent *reply, SInt32 refcon) { ! #pragma unused(refcon, reply) /* 2.1b3 dmb: ignore extra syntax/lines needed for text-based recording *************** *** 1676,1680 **** static pascal OSErr handlestoprecording (const AppleEvent *event, AppleEvent *reply, SInt32 refcon) { ! #pragma unused(refcon, event) /* 2.1b5 dmb: special event handler for QuicKeys recording panel --- 1676,1680 ---- static pascal OSErr handlestoprecording (const AppleEvent *event, AppleEvent *reply, SInt32 refcon) { ! #pragma unused(refcon, event, reply) /* 2.1b5 dmb: special event handler for QuicKeys recording panel Index: kb.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/kb.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -C2 -d -r1.4 -r1.4.6.1 *** kb.c 11 Jan 2005 22:48:05 -0000 1.4 --- kb.c 22 Mar 2006 09:11:28 -0000 1.4.6.1 *************** *** 99,116 **** */ ! #ifdef MACVERSION ! KeyMap keys; ! ! GetKeys (keys); ! ! return (BitTst (&keys, keycode) != 0); ! #endif ! #ifdef WIN95VERSION ! if (flasync) ! return ((GetAsyncKeyState (keycode) & 0x8000) == 0x8000); ! else ! return ((GetKeyState (keycode) & 0x8000) == 0x8000); ! #endif ! } /*keydown*/ --- 99,117 ---- */ ! #ifdef MACVERSION ! #pragma unused(flasync) ! KeyMap keys; ! ! GetKeys (keys); ! ! return (BitTst (&keys, keycode) != 0); ! #endif ! #ifdef WIN95VERSION ! if (flasync) ! return ((GetAsyncKeyState (keycode) & 0x8000) == 0x8000); ! else ! return ((GetKeyState (keycode) & 0x8000) == 0x8000); ! #endif ! } /*keydown*/ Index: icon.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/icon.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -C2 -d -r1.4 -r1.4.6.1 *** icon.c 11 Jan 2005 22:48:05 -0000 1.4 --- icon.c 22 Mar 2006 09:11:28 -0000 1.4.6.1 *************** *** 669,690 **** #if TARGET_API_MAC_CARBON == 1 ! static void MyThemeButtonDrawCallback (const Rect *bounds, ThemeButtonKind kind, const ThemeButtonDrawInfo *info, ! UInt32 refcon, SInt16 depth, Boolean isColorDev) { ! ! /* ! 7.0b48 PBS: draw the arrow for a pushbutton. It will be centered. ! */ ! ! Rect rarrow; ! //ptrstring bsptr = (ptrstring) refcon; ! ! setrect (&rarrow, 0, 0, 9, 9); ! ! centerrect (&rarrow, *bounds); ! ! rarrow.left++; /*it appears to need it*/ ! ! DrawThemePopupArrow (&rarrow, kThemeArrowRight, kThemeArrow9pt, kThemeStateActive, NULL, NULL); ! } /*MyThemeButtonDrawCallback*/ #endif --- 669,697 ---- #if TARGET_API_MAC_CARBON == 1 ! static void ! MyThemeButtonDrawCallback ( ! const Rect *bounds, ! ThemeButtonKind kind, ! const ThemeButtonDrawInfo *info, ! UInt32 refcon, ! SInt16 depth, ! Boolean isColorDev) ! { ! #pragma unused(kind, info, refcon, depth, isColorDev) ! /* ! 7.0b48 PBS: draw the arrow for a pushbutton. It will be centered. ! */ ! ! Rect rarrow; ! //ptrstring bsptr = (ptrstring) refcon; ! ! setrect (&rarrow, 0, 0, 9, 9); ! ! centerrect (&rarrow, *bounds); ! ! rarrow.left++; /*it appears to need it*/ ! ! DrawThemePopupArrow (&rarrow, kThemeArrowRight, kThemeArrow9pt, kThemeStateActive, NULL, NULL); ! } /*MyThemeButtonDrawCallback*/ #endif Index: langvalue.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langvalue.c,v retrieving revision 1.8.2.4 retrieving revision 1.8.2.5 diff -C2 -d -r1.8.2.4 -r1.8.2.5 *** langvalue.c 19 Mar 2006 10:51:04 -0000 1.8.2.4 --- langvalue.c 22 Mar 2006 09:11:28 -0000 1.8.2.5 *************** *** 2228,2232 **** return (false); ! x = LLONG_MAX; break; --- 2228,2232 ---- return (false); ! x = 0; //LLONG_MAX; break; *************** *** 2330,2334 **** } return(true); // have a happy compiler ! } /* coercetolong */ --- 2330,2334 ---- } return(true); // have a happy compiler ! } /* coercetolonglong */ Index: serialnumber.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/serialnumber.c,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** serialnumber.c 11 Jan 2005 22:48:10 -0000 1.3 --- serialnumber.c 22 Mar 2006 09:11:28 -0000 1.3.6.1 *************** *** 36,39 **** --- 36,40 ---- boolean isvalidserialnumber (bigstring bsserialnumber) { + #pragma unused(bsserialnumber) /* Index: shellverbs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/shellverbs.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** shellverbs.c 1 Nov 2005 19:11:57 -0000 1.6 --- shellverbs.c 22 Mar 2006 09:11:28 -0000 1.6.2.1 *************** *** 65,68 **** --- 65,69 ---- #include "langregexp.h" + extern boolean getwinparam (hdltreenode, short, hdlwindowinfo *); // shellwindowverbs.c typedef enum tysearchtoken { /*search verbs*/ Index: menu.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/menu.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** menu.c 20 Dec 2005 22:30:35 -0000 1.6 --- menu.c 22 Mar 2006 09:11:28 -0000 1.6.2.1 *************** *** 551,560 **** boolean inserthierarchicmenu (hdlmenu hmenu, short idmenu) { ! ! #ifdef MACVERSION ! InsertMenu (hmenu, insertsubmenu); ! return (true); ! #endif #if WIN95VERSION --- 551,560 ---- boolean inserthierarchicmenu (hdlmenu hmenu, short idmenu) { ! #ifdef MACVERSION ! #pragma unused(idmenu) ! InsertMenu (hmenu, insertsubmenu); ! return (true); ! #endif #if WIN95VERSION *************** *** 726,743 **** //Code change by Timothy Paustian Friday, June 9, 2000 9:44:07 PM //Changed to Modern calls for Enabling and Disabling menu items ! #ifdef MACVERSION ! if (fl) ! #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 ! EnableMenuItem (hmenu, 0); ! #else ! EnableItem (hmenu, 0); ! #endif ! else ! #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 ! DisableMenuItem (hmenu, 0); ! #else ! DisableItem (hmenu, 0); ! #endif ! #endif #if WIN95VERSION --- 726,744 ---- //Code change by Timothy Paustian Friday, June 9, 2000 9:44:07 PM //Changed to Modern calls for Enabling and Disabling menu items ! #ifdef MACVERSION ! #pragma unused(idmenu) ! if (fl) ! #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 ! EnableMenuItem (hmenu, 0); ! #else ! EnableItem (hmenu, 0); ! #endif ! else ! #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 ! DisableMenuItem (hmenu, 0); ! #else ! DisableItem (hmenu, 0); ! #endif ! #endif #if WIN95VERSION *************** *** 799,802 **** --- 800,804 ---- #ifdef MACVERSION + #pragma unused(idmenu) #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 return IsMenuItemEnabled(hmenu, 0); *************** *** 1480,1483 **** --- 1482,1486 ---- #ifdef MACVERSION + #pragma unused(idmenu) bigstring bsspace; *************** *** 1530,1533 **** --- 1533,1538 ---- #ifdef MACVERSION + #pragma unused(idmenu) + //Code change by Timothy Paustian Wednesday, June 28, 2000 4:27:19 PM //You can't do this in carbon. |
|
From: Karsten W. <kar...@us...> - 2006-03-22 09:11:32
|
Update of /cvsroot/frontierkernel/Frontier/Common/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16359/Common/headers Modified Files: Tag: pre_int64_branch frontierdefs.h Log Message: update before switch Index: frontierdefs.h =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/headers/frontierdefs.h,v retrieving revision 1.7.6.4 retrieving revision 1.7.6.5 diff -C2 -d -r1.7.6.4 -r1.7.6.5 *** frontierdefs.h 19 Mar 2006 10:49:37 -0000 1.7.6.4 --- frontierdefs.h 22 Mar 2006 09:11:28 -0000 1.7.6.5 *************** *** 88,92 **** // kw - 2006-02-15 --- oplanglist accelerator - set to 1 to turn on ! #define OPLANGLISTACCEL 1 --- 88,92 ---- // kw - 2006-02-15 --- oplanglist accelerator - set to 1 to turn on ! #define OPLANGLISTACCEL 0 |
|
From: Karsten W. <kar...@us...> - 2006-03-22 09:11:32
|
Update of /cvsroot/frontierkernel/Frontier/Common/IowaRuntime/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16359/Common/IowaRuntime/Source Modified Files: Tag: pre_int64_branch iowacore.c iowaruntime.c Log Message: update before switch Index: iowaruntime.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/IowaRuntime/Source/iowaruntime.c,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.2 diff -C2 -d -r1.5.4.1 -r1.5.4.2 *** iowaruntime.c 14 Feb 2006 11:35:56 -0000 1.5.4.1 --- iowaruntime.c 22 Mar 2006 09:11:28 -0000 1.5.4.2 *************** *** 338,345 **** #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 { ! CGrafPtr thePort; RgnHandle visRgn = NewRgn(); ! thePort = GetWindowPort(w); ! visRgn = GetPortVisibleRegion(thePort, visRgn); GetRegionBounds(visRgn, &(**hc).updaterect); DisposeRgn(visRgn); --- 338,345 ---- #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 { ! CGrafPtr lthePort; RgnHandle visRgn = NewRgn(); ! lthePort = GetWindowPort(w); ! visRgn = GetPortVisibleRegion(lthePort, visRgn); GetRegionBounds(visRgn, &(**hc).updaterect); DisposeRgn(visRgn); *************** *** 361,367 **** #if TARGET_API_MAC_CARBON == 1 { ! CGrafPtr thePort; ! thePort = GetWindowPort(w); ! QDFlushPortBuffer(thePort, nil); } #endif --- 361,367 ---- #if TARGET_API_MAC_CARBON == 1 { ! CGrafPtr lthePort; ! lthePort = GetWindowPort(w); ! QDFlushPortBuffer(lthePort, nil); } #endif *************** *** 2356,2367 **** if ((flcallback) && (pCallback != nil)) { ! hdlcard oldiowadata = iowadata; ! hdlruntimerecord oldruntimedata = runtimedata; (*pCallback) (&ev); ! iowadata = oldiowadata; ! runtimedata = oldruntimedata; thePort = getmacwindowport(modalwindow); --- 2356,2367 ---- if ((flcallback) && (pCallback != nil)) { ! hdlcard loldiowadata = iowadata; ! hdlruntimerecord loldruntimedata = runtimedata; (*pCallback) (&ev); ! iowadata = loldiowadata; ! runtimedata = loldruntimedata; thePort = getmacwindowport(modalwindow); Index: iowacore.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/IowaRuntime/Source/iowacore.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -C2 -d -r1.4 -r1.4.6.1 *** iowacore.c 11 Jan 2005 22:47:40 -0000 1.4 --- iowacore.c 22 Mar 2006 09:11:28 -0000 1.4.6.1 *************** *** 909,919 **** if ((**h).objecthasframe) { ! Rect robject; ! robject = (**h).objectrect; ! if (!EmptyRect (&robject)) { /*user has changed its rect, it takes precedence*/ ! rgroup = robject; goto exit; --- 909,919 ---- if ((**h).objecthasframe) { ! Rect lrobject; ! lrobject = (**h).objectrect; ! if (!EmptyRect (&lrobject)) { /*user has changed its rect, it takes precedence*/ ! rgroup = lrobject; goto exit; |
|
From: Karsten W. <kar...@us...> - 2006-03-22 09:11:32
|
Update of /cvsroot/frontierkernel/Frontier/Common/IOAToolkit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16359/Common/IOAToolkit Modified Files: Tag: pre_int64_branch ioa.c Log Message: update before switch Index: ioa.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/IOAToolkit/ioa.c,v retrieving revision 1.4.6.1 retrieving revision 1.4.6.2 diff -C2 -d -r1.4.6.1 -r1.4.6.2 *** ioa.c 14 Feb 2006 11:34:22 -0000 1.4.6.1 --- ioa.c 22 Mar 2006 09:11:28 -0000 1.4.6.2 *************** *** 588,626 **** ! static void callsetuproutine (setupcallback callback, tyioaconfigrecord *config) { ! IOAclearbytes (config, longsizeof (tyioaconfigrecord)); ! (*config).setValueFromScriptCallback = IOAsetobjectvalue; ! (*config).getObjectInvalRectCallback = defaultGetObjectInvalRectCallback; ! (*config).recalcObjectCallback = defaultRecalcObjectCallback; ! (*config).debugObjectCallback = defaultDebugObjectCallback; ! (*config).clickObjectCallback = defaultClickObjectCallback; ! (*config).setObjectCursorCallback = defaultSetObjectCursorCallback; ! (*config).catchReturnCallback = defaultCatchReturnCallback; ! (*config).getAttributesCallback = defaultAppleEventCallback; ! (*config).setAttributesCallback = defaultAppleEventCallback; ! (*config).packDataCallback = defaultPackDataCallback; ! (*config).unpackDataCallback = defaultUnpackDataCallback; ! (*config).disposeDataCallback = defaultDisposeDataCallback; ! (*config).handlesMouseTrack = false; ! (*config).editableInRunMode = false; ! (*config).isFontAware = true; ! (*callback) (config); } /*callsetuproutine*/ --- 588,626 ---- ! static void callsetuproutine (setupcallback pcallback, tyioaconfigrecord *pconfig) { ! IOAclearbytes (pconfig, longsizeof (tyioaconfigrecord)); ! (*pconfig).setValueFromScriptCallback = IOAsetobjectvalue; ! (*pconfig).getObjectInvalRectCallback = defaultGetObjectInvalRectCallback; ! (*pconfig).recalcObjectCallback = defaultRecalcObjectCallback; ! (*pconfig).debugObjectCallback = defaultDebugObjectCallback; ! (*pconfig).clickObjectCallback = defaultClickObjectCallback; ! (*pconfig).setObjectCursorCallback = defaultSetObjectCursorCallback; ! (*pconfig).catchReturnCallback = defaultCatchReturnCallback; ! (*pconfig).getAttributesCallback = defaultAppleEventCallback; ! (*pconfig).setAttributesCallback = defaultAppleEventCallback; ! (*pconfig).packDataCallback = defaultPackDataCallback; ! (*pconfig).unpackDataCallback = defaultUnpackDataCallback; ! (*pconfig).disposeDataCallback = defaultDisposeDataCallback; ! (*pconfig).handlesMouseTrack = false; ! (*pconfig).editableInRunMode = false; ! (*pconfig).isFontAware = true; ! (*pcallback) (pconfig); } /*callsetuproutine*/ *************** *** 1295,1298 **** --- 1295,1301 ---- //I changed this to plain pascal instead of static. Will this shoot things? static pascal ComponentResult IOAmain (ComponentParameters *params, Handle hstorage) { + #if TARGET_API_MAC_CARBON + #pragma unused(hstorage) + #endif #endif *************** *** 1812,1816 **** ! static boolean IOAregister (short ixarray, OSType subtype, ComponentRoutine main, setupcallback callback) { ComponentDescription desc; --- 1815,1819 ---- ! static boolean IOAregister (short ixarray, OSType subtype, ComponentRoutine main, setupcallback pcallback) { ComponentDescription desc; *************** *** 1818,1822 **** ComponentRoutineUPP routinePtr; ! callsetuproutine (callback, &configarray [ixarray]); IOAclearbytes (&desc, longsizeof (desc)); --- 1821,1825 ---- ComponentRoutineUPP routinePtr; ! callsetuproutine (pcallback, &configarray [ixarray]); IOAclearbytes (&desc, longsizeof (desc)); |
|
From: Andre R. <and...@us...> - 2006-03-21 22:13:48
|
Update of /cvsroot/frontierkernel/Frontier/build_VC2K5 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5907 Added Files: .cvsignore Removed Files: Frontier.ncb Frontier.suo Log Message: Ignore redundant Visual Studio 2005 files. --- NEW FILE: .cvsignore --- *.plg *.opt *.ncb *.suo --- Frontier.suo DELETED --- --- Frontier.ncb DELETED --- |
|
From: Karsten W. <kar...@us...> - 2006-03-19 10:51:18
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8383 Modified Files: Tag: pre_int64_branch langhash.c langvalue.c mouse.c oplist.c ops.c strings.c Log Message: longlonginttostring - longlongs can be displayed Index: ops.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/ops.c,v retrieving revision 1.7 retrieving revision 1.7.6.1 diff -C2 -d -r1.7 -r1.7.6.1 *** ops.c 11 Jan 2005 22:48:09 -0000 1.7 --- ops.c 19 Mar 2006 10:51:05 -0000 1.7.6.1 *************** *** 258,261 **** --- 258,304 ---- + #if LONGINT_LONGDATE == 1 + boolean + longlonginttostring(tylonglongint theInt, bigstring bs, int radix) + { + SInt8 isNegative = 0; + UInt64 theUnsignedNumber; + + int stringIndex = 0; + ptrbyte t = stringbaseaddress(bs); + + if (theInt < 0) + { + theUnsignedNumber = -theInt; + isNegative = 1; + } + else + { + theUnsignedNumber = theInt; + } + + do + { + SInt32 currentDigit = theUnsignedNumber % radix; + + if (currentDigit > 9) + t[stringIndex++] = currentDigit + 'A' - 10; + else + t[stringIndex++] = currentDigit + '0'; + + theUnsignedNumber /= radix; + } while (theUnsignedNumber); + + if (isNegative) + t[stringIndex++] = '-'; + + if (!setstringlength(bs, stringIndex)) + return(false); + + return stringreverse(bs); + } + #endif + + boolean stringtonumber (bigstring bs, long *longval) { Index: oplist.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/oplist.c,v retrieving revision 1.7.4.1 retrieving revision 1.7.4.2 diff -C2 -d -r1.7.4.1 -r1.7.4.2 *** oplist.c 10 Mar 2006 22:26:57 -0000 1.7.4.1 --- oplist.c 19 Mar 2006 10:51:05 -0000 1.7.4.2 *************** *** 74,78 **** { Handle oplistindex; ! long start, end, --- 74,78 ---- { Handle oplistindex; ! SInt32 start, end, *************** *** 130,134 **** #if OPLANGLISTACCEL == 1 ! // a try at accelerating indexed list access. currently getnthlistitem has time complexity O(n). // I want O(1) static boolean growlistindex(tylistindexptr theIndex); --- 130,135 ---- #if OPLANGLISTACCEL == 1 ! // a try at accelerating list access by use of an index. ! // currently getnthlistitem has time complexity O(n). // I want O(1) static boolean growlistindex(tylistindexptr theIndex); *************** *** 138,141 **** --- 139,143 ---- initlistindex(tylistindexptr plistidx) { + /* init a new handlecache for a list*/ if (!newclearhandle (sizeof (Handle) * 1024, (Handle *) &(plistidx->oplistindex) )) return (false); *************** *** 154,157 **** --- 156,163 ---- checklistindexlimits(tylistindexptr plistidx) { + /* + check the remaining space in the cache + grow it if only to free places on either side + */ // total push array long limit = plistidx->size - plistidx->start; *************** *** 173,178 **** { disposehandle(theIndex->oplistindex); - // return(false); - return(true); } --- 179,182 ---- *************** *** 181,189 **** --- 185,206 ---- growlistindex(tylistindexptr theIndex) { + // growth rate = 25% + // index sizes are 1024, 1280, 1600, 2000, 2500, 3125 long thesize = theIndex->size + (theIndex->size >> 2); + + // ptrs to start & end of used area void *s, *e; if (!sethandlesize(theIndex->oplistindex, thesize)) + { + // growing failed somehow + // turn index off + disposehandle(theIndex->oplistindex); + theIndex->oplistindex = nil; + theIndex->size = -1; + theIndex->start = -1; + theIndex->end = -1; return(false); + } theIndex->size = thesize; *************** *** 202,206 **** { Handle *dst; ! dst = theIndex->oplistindex; --- 219,226 ---- { Handle *dst; ! ! // check for valid index here ! ! dst = theIndex->oplistindex; *************** *** 217,220 **** --- 237,241 ---- Handle *dst; + // grows when needed if (!checklistindexlimits(theIndex)) return (false); *************** *** 276,280 **** if (!initlistindex(&((**h).listindex))) return(false); - #endif --- 297,300 ---- *************** *** 317,326 **** opdisposeoutline (ho, false); #if OPLANGLISTACCEL == 1 if (!disposelistindex(&((**hlist).listindex))) ; #endif - hcurrentlist = nil; - disposehandle ((Handle) hlist); } /*opdisposelist*/ --- 337,346 ---- opdisposeoutline (ho, false); + hcurrentlist = nil; + #if OPLANGLISTACCEL == 1 if (!disposelistindex(&((**hlist).listindex))) ; #endif disposehandle ((Handle) hlist); } /*opdisposelist*/ Index: strings.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/strings.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** strings.c 5 Dec 2005 21:49:20 -0000 1.8 --- strings.c 19 Mar 2006 10:51:05 -0000 1.8.2.1 *************** *** 2671,2674 **** --- 2671,2702 ---- } /*pullsuffix*/ + #if LONGINT_LONGDATE == 1 + boolean stringreverse (bigstring bs) + { + // 2006-03-17 - kw --- initial write; needed for longlonginttostring + // reverse a bigstring by swapping bytes 0 & len, 1 & len-1,... + + unsigned char e, s, i, t; + + ptrbyte t1, t2; + + if (!bs) + return (false); + + e = stringlength(bs); + i = e >> 1; + t1 = stringbaseaddress(bs); + t2 = t1 + e - 1; // first char counts; like zero based + + while(i) + { + t = *t1; + *t1++ = *t2; + *t2-- = t; + i--; + } + return (true); + } + #endif void initstrings (void) { Index: mouse.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/mouse.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -C2 -d -r1.4 -r1.4.6.1 *** mouse.c 11 Jan 2005 22:48:09 -0000 1.4 --- mouse.c 19 Mar 2006 10:51:04 -0000 1.4.6.1 *************** *** 388,391 **** --- 388,393 ---- break; } + #else + #pragma unused(eventwhat) #endif Index: langvalue.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langvalue.c,v retrieving revision 1.8.2.3 retrieving revision 1.8.2.4 diff -C2 -d -r1.8.2.3 -r1.8.2.4 *** langvalue.c 14 Feb 2006 11:43:57 -0000 1.8.2.3 --- langvalue.c 19 Mar 2006 10:51:04 -0000 1.8.2.4 *************** *** 2228,2232 **** return (false); ! x = 0; break; --- 2228,2232 ---- return (false); ! x = LLONG_MAX; break; *************** *** 2433,2437 **** disablelangerror (); ! fl = coercetolong (v); enablelangerror (); --- 2433,2437 ---- disablelangerror (); ! fl = coercetolong (v); enablelangerror (); *************** *** 3469,3476 **** case longvaluetype: numbertostring ((*v).data.longvalue, bs); ! break; ! case ostypevaluetype: case enumvaluetype: --- 3469,3485 ---- case longvaluetype: + { + static UInt32 ncalls = 0; + ncalls++; numbertostring ((*v).data.longvalue, bs); ! } break; ! #if LONGINT_LONGDATE == 1 ! case longlongintvaluetype: ! longlonginttostring(**(*v).data.longlongintvalue, bs, 16); ! ! break; ! #endif ! case ostypevaluetype: case enumvaluetype: *************** *** 3545,3562 **** tyfilespec fs; ! ! #if TARGET_API_MAC_CARBON == 1 ! ! fs.vRefNum = (**(*v).data.filespecvalue).vRefNum; ! ! fs.parID = (**(*v).data.filespecvalue).parID; ! ! copystring ((**(*v).data.filespecvalue).name, fs.name); ! ! #else ! ! fs = **(*v).data.filespecvalue; ! ! #endif filespectopath (&fs, bs); --- 3554,3571 ---- tyfilespec fs; ! ! #if TARGET_API_MAC_CARBON == 1 ! ! fs.vRefNum = (**(*v).data.filespecvalue).vRefNum; ! ! fs.parID = (**(*v).data.filespecvalue).parID; ! ! copystring ((**(*v).data.filespecvalue).name, fs.name); ! ! #else ! ! fs = **(*v).data.filespecvalue; ! ! #endif filespectopath (&fs, bs); Index: langhash.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langhash.c,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -C2 -d -r1.5 -r1.5.6.1 *** langhash.c 11 Jan 2005 22:48:06 -0000 1.5 --- langhash.c 19 Mar 2006 10:51:03 -0000 1.5.6.1 *************** *** 3638,3641 **** --- 3638,3644 ---- case listvaluetype: case recordvaluetype: + #if LONGINT_LONGDATE == 1 + case longlongintvaluetype: + #endif if (copyvaluerecord (val, &val) && coercetostring (&val)) { *************** *** 3726,3732 **** break; ! ! #if !flruntime ! case codevaluetype: parsenumberstring (langmiscstringlist, treesizestring, langcounttreenodes (val.data.codevalue), bs); --- 3729,3735 ---- break; ! ! #if !flruntime ! case codevaluetype: parsenumberstring (langmiscstringlist, treesizestring, langcounttreenodes (val.data.codevalue), bs); *************** *** 3741,3746 **** break; ! #endif ! default: langgetmiscstring (unknownstring, bs); --- 3744,3756 ---- break; ! #endif ! #if LONGINT_LONGDATE == 1 ! # if defined (WIN95VERSION) ! ! # endif ! # if defined (MACVERSION) ! ! # endif ! #endif default: langgetmiscstring (unknownstring, bs); |
|
From: Karsten W. <kar...@us...> - 2006-03-19 10:49:42
|
Update of /cvsroot/frontierkernel/Frontier/Common/headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7877 Modified Files: Tag: pre_int64_branch frontierdefs.h ops.h strings.h Log Message: longlonginttostring - longlongs can be displayed Index: strings.h =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/headers/strings.h,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** strings.h 11 Jan 2005 22:48:02 -0000 1.6 --- strings.h 19 Mar 2006 10:49:37 -0000 1.6.6.1 *************** *** 247,250 **** --- 247,253 ---- extern boolean pullstringsuffix (bigstring, bigstring, unsigned char); /*7.0.2b1 Radio PBS*/ + #if LONGINT_LONGDATE == 1 + extern boolean stringreverse (bigstring bs); + #endif extern void initstrings (void); Index: ops.h =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/headers/ops.h,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** ops.h 11 Jan 2005 22:48:02 -0000 1.6 --- ops.h 19 Mar 2006 10:49:37 -0000 1.6.6.1 *************** *** 26,31 **** --- 26,37 ---- ******************************************************************************/ + + #ifndef opsinclude + #define opsinclude + #ifndef langinclude + #include "lang.h" + #endif /*typedefs*/ *************** *** 65,68 **** --- 71,78 ---- extern boolean stringtoshort (bigstring, short *); + #if LONGINT_LONGDATE == 1 + extern boolean longlonginttostring(tylonglongint theInt, bigstring bs, int radix); + #endif + extern boolean stringtonumber (bigstring, long *); *************** *** 111,113 **** extern void getsizestring (unsigned long, bigstring); ! extern unsigned long bcdtolong (unsigned long); /* 2004-11-16 creedon */ \ No newline at end of file --- 121,125 ---- extern void getsizestring (unsigned long, bigstring); ! extern unsigned long bcdtolong (unsigned long); /* 2004-11-16 creedon */ ! ! #endif \ No newline at end of file Index: frontierdefs.h =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/headers/frontierdefs.h,v retrieving revision 1.7.6.3 retrieving revision 1.7.6.4 diff -C2 -d -r1.7.6.3 -r1.7.6.4 *** frontierdefs.h 10 Mar 2006 22:26:58 -0000 1.7.6.3 --- frontierdefs.h 19 Mar 2006 10:49:37 -0000 1.7.6.4 *************** *** 87,92 **** #define AEDISPOSAL 1 ! // kw - 2006-02-15 --- oplanglist accelerator ! #define OPLANGLISTACCEL 0 --- 87,92 ---- #define AEDISPOSAL 1 ! // kw - 2006-02-15 --- oplanglist accelerator - set to 1 to turn on ! #define OPLANGLISTACCEL 1 |
|
From: Andre R. <and...@us...> - 2006-03-16 22:12:46
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29420/Common/source Modified Files: shellsysverbs.c Log Message: Fix potential memory leak in unixshellcommandfunc case of sysfunctionvalue: Don't allocate return value until after we successfully obtained the input parameters. Index: shellsysverbs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/shellsysverbs.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shellsysverbs.c 10 Mar 2006 13:44:15 -0000 1.10 --- shellsysverbs.c 16 Mar 2006 22:12:32 -0000 1.11 *************** *** 665,674 **** Handle hcommand, hreturn; - newemptyhandle (&hreturn); - flnextparamislast = true; if (!getexempttextvalue (hparam1, 1, &hcommand)) return (false); if (!unixshellcall (hcommand, hreturn)) { --- 665,674 ---- Handle hcommand, hreturn; flnextparamislast = true; if (!getexempttextvalue (hparam1, 1, &hcommand)) return (false); + + newemptyhandle (&hreturn); if (!unixshellcall (hcommand, hreturn)) { |
|
From: David G. <dav...@us...> - 2006-03-15 17:45:39
|
Update of /cvsroot/frontierkernel/Frontier/build_VC2K5 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12569/build_VC2K5 Added Files: Frontier.ncb Frontier.suo Log Message: Updated, added the Intellisense file and suo file. --- NEW FILE: Frontier.suo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Frontier.ncb --- (This appears to be a binary file; contents omitted.) |
|
From: David G. <dav...@us...> - 2006-03-15 17:19:58
|
Update of /cvsroot/frontierkernel/Frontier/build_VC2K5 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2792/build_VC2K5 Added Files: Frontier.sln Frontier.vcproj Log Message: Microsoft Visual Studio 2005 build --- NEW FILE: Frontier.sln --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Frontier.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="Frontier" ProjectGUID="{D834EFC1-8805-4046-9A49-F9925A0808EF}" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="DbTracker|Win32" OutputDirectory=".\DbTracker" IntermediateDirectory=".\_build\DbTracker" [...9112 lines suppressed...] RelativePath="..\Common\headers\wpverbs.h" > </File> <File RelativePath="..\Common\SystemHeaders\WSE.h" > </File> <File RelativePath="..\Common\headers\yytab.h" > </File> <File RelativePath="..\Common\headers\zoom.h" > </File> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> |
|
From: David G. <dav...@us...> - 2006-03-15 17:18:44
|
Update of /cvsroot/frontierkernel/Frontier/build_VC2K5 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2092/build_VC2K5 Log Message: Directory /cvsroot/frontierkernel/Frontier/build_VC2K5 added to the repository |
|
From: creecode <icr...@us...> - 2006-03-13 21:12:04
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/startup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24747 Modified Files: startupScript Log Message: install DLLs added init of user.callbacks.fileSetModified on first root run upon first root run alert user that Frontier is going to use web browser to complete install, first time users may find it confusing to launch Frontier then have it immediately disappear on them. script formatting tweaks minor tweaks to startup.license window formatting code Index: startupScript =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/startup/startupScript,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** startupScript 15 Feb 2006 05:18:22 -0000 1.19 --- startupScript 13 Mar 2006 21:11:48 -0000 1.20 *************** *** 1,3 **** ! FrontierVcsFile:1:scpt:system.startup.startupScript ! ÇChanges Ç2/14/06; 9:03:23 PM by TAC Çmoved tools.startup to after html.init Çuse improved Frontier.installApp to open prefs.root Çwhen opening databases make copy of user.databases in case startup scripts add entries to it, that way we don't lose track of what were opening Çmove webBrowser.init before html.init so html.init can call webBrowser.getDefaultBrowser without error Çwhen opening all databases, check if already open, prevents error on Windows Çwork around relative path issue on Windows Çon set up of quickscript window on windows, use Frontier.showApplication, Frontier.bringToFront alone doesn't do the trick Ç2/6/06; 12:04:50 PM by TAC Çbring frontier to front before setting quickscript text for first root run Ç2/5/06; 9:45:01 AM by TAC Çremoved prefs.root startup script code when doing a first root run, no need to run it there as it is run later in the script Ç2/1/06; 1:27:51 PM by TAC Çdeleted some unneeded commented code Ç1/20/06; 1:54:05 PM by TAC Çdisable agents for all startups, not just for first root run Çthere was a problem with Tools starting up and its agent manipulating menus at the same time and causing a crash Ç12/24/05; 12:33:32 PM by TAC Çprefs.root now has a #startup script, deal with it Ç11/10/05; 4:24:48 PM by TAC Çmoved system.temp.Frontier/starting up after first if firstRootRun check was causing startup problem Ç11/5/05; 12:00:32 PM by TAC Çmoved system.temp.Frontier check back to top of script Ç10/9/05; 3:39:07 PM by TAC Çwhen storing prefs.root path, store realative path Çuse table.copyUndefinedContents to copy some item Çmove some of the user prefs initializations into Frontier.data.userPrefs Çrearrange script so that some initializations can happen outside of the first root run, this should make it easier to add new items and not have them get missed because the first root run had already been run once Ç10/4/05; 7:26:36 PM by TAC Çupon check for presence of Psapi.dll, don't use hard coded application name Ç9/26/05; 4:30:14 PM by TAC Çadded user.prefs.flReplaceDialogExpertMode Ç8/23/05; 7:22:18 PM by TAC Çadded user.prefs.flCompactModalMenus Ç7/14/05; 10:35:39 AM by TAC Çsystem.menus.data.currentMenuType set to nil so agent will update modal menu properly upon relaunch Ç7/6/05; 12:21:38 PM by TAC Çchanged user.callbacks.sendmail to user.callbacks.tcpSendMail Çadded user.prefs.mailHostPort Ç6/15/05; 6:52:11 PM by TAC Çrewrite for Open Source release, bring in code from startup.startupScript, userland.firstRootRun, userland.finishInstall, and userland.cleanRoot ÇOld code Çstartup.startupScript <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/startup/startupScript?rev=1.1> Çuserland.firstRootRun <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/firstRootRun?rev=1.1> Çuserland.finishInstall <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/finishInstall?rev=1.1> Çuserland.cleanRoot <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/cleanRoot?rev=1.1> Ç06/08/01; 11:24:35 PM by JES ÇWhen opening databases defined at user.databases, skip objects which aren't tables. This avoids the condition where startup wouldn't complete, if there's an item #1 in the user.databases table. Ç06/02/01; 8:34:20 PM by PBS ÇDo the web-based install and open the Control Panel if this is the first root run. Ç04/28/01; 7:48:46 PM by JES ÇCall Frontier.tools.startup in a try block, so that the startup process will finish even if Tools installation fails. Ç04/20/01; 4:49:05 PM by JES ÇCall tools.startup to install Tools at startup. Ç10/7/99; 4:20:26 PM by PBS ÇOnly run the #startup script in a guest database if runStartupScript exists and is true. Previously, it would be run whether runStartupScript was true or false. Çhttp://frontier.userland.com/stories/storyReader$1760 Ç10/6/99; 10:21:35 PM by PBS ÇOnly set the taskTime for the overnight task if it's in the past. This fixes a bug when the taskTime was before midnight, but it was being set for the next day, so the overnight task wouldn't run. Çhttp://frontier.userland.com/stories/storyReader$1761 Ç8/19/99; 6:44:48 AM by DW ÇMake sure that taskTimes in user.scheduler.tasks are in the future. ÇWe do this much more quickly than scheduler.monitor would. Çhttp://discuss.userland.com/msgReader$9658 ÇThis script runs when Frontier opens the Frontier.root file. if defined (system.temp.Frontier) { // only run the startup script once return}; local (flEnableAgents = true, flOpenDatabases = true, flEnableHttpServer = true); // can be set by the external startup script local (flFirstRootRun = true); bundle { // miscellaneous initializations, checks, and etc., phase 1 of 2 Frontier.enableAgents (false); // try to keep agents from reporting errors and causing problems Frontier.pathString = file.folderFromPath (Frontier.getFilePath ()); if defined (user.prefs.firstRootRun) { flFirstRootRun = user.prefs.firstRootRun}}; if flFirstRootRun { while window.frontmost () != "" { // open windows can mess things up later on window.hide (window.frontmost ())}; Çreturn (false) // enable for testing new (tableType, @system.temp); new (tableType, @root.user)}; bundle { // system.temp.Frontier, we are starting up new (tableType, @system.temp.Frontier); system.temp.Frontier.startupTime = clock.now (); system.temp.Frontier.startingUp = true}; backups.init (); batchExporter.init (); export.init (); rootUpdates.init (); // set up user.rootUpdates, even though root updates uses tcp, its ok to set up here as no tcp calls are made at this time webEdit.init (); bundle { // set up user.prefs if flFirstRootRun { new (tableType, @user.prefs); bundle { // set up user.prefs.commonStyles case sys.os () { "MacOS" { if system.environment.isCarbon { user.prefs.commonStyles = Frontier.data.commonStylesMacCarbon} else { user.prefs.commonStyles = Frontier.data.commonStylesMac}}; "Win95"; "WinNT" { user.prefs.commonStyles = Frontier.data.commonStylesWin}}}}; table.copyUndefinedContents (@Frontier.data.userPrefs, @user.prefs); bundle { // set up user.prefs.dialogs if flFirstRootRun { new (tableType, @user.prefs.dialogs)}; table.copyUndefinedContents (@Frontier.data.userPrefs.dialogs, @user.prefs.dialogs)}; bundle { // set up user.prefs.search if flFirstRootRun { new (tableType, @user.prefs.search)}; table.copyUndefinedContents (@Frontier.data.userPrefs.search, @user.prefs.search); if not (defined (user.prefs.search.replaceWith)) { user.prefs.search.replaceWith = Frontier.version ()}}; Frontier.setupUserPrefsFonts ()}; if flFirstRootRun { bundle { // set up the quick script window if system.environment.isWindows { Frontier.showApplication ()}; Frontier.bringToFront (); clipboard.putvalue ("dialog.notify (\"Hello World!\")"); window.quickScript (); editmenu.selectAll (); editmenu.paste (); window.close ("Quick Script")}; bundle { // set up root window local (w = "root"); window.open (w); window.setPosition (w, 0, 0); editMenu.setFont (user.prefs.fonts.tableFont); editMenu.setFontSize (user.prefs.fonts.tableFontSize); window.zoom (w)}; bundle { // set up user.callbacks new (tableType, @user.callbacks); new (tableType, @user.callbacks.closeWindow); new (tableType, @user.callbacks.cmd2click); new (tableType, @user.callbacks.compileChangedScript); new (tableType, @user.callbacks.control2click); new (tableType, @user.callbacks.fileWriteWholeFile); new (tableType, @user.callbacks.opCollapse); new (tableType, @user.callbacks.opCursorMoved); new (tableType, @user.callbacks.openWindow); new (tableType, @user.callbacks.opExpand); new (tableType, @user.callbacks.opInsert); new (tableType, @user.callbacks.opReturnKey); new (tableType, @user.callbacks.opRightClick); new (tableType, @user.callbacks.opStruct2Click); new (tableType, @user.callbacks.option2click); new (tableType, @user.callbacks.resume); new (tableType, @user.callbacks.saveWindow); new (tableType, @user.callbacks.shutdown); new (tableType, @user.callbacks.startup); new (tableType, @user.callbacks.statusMessage); new (tableType, @user.callbacks.suspend); new (tableType, @user.callbacks.systemTrayIcon2Click); new (tableType, @user.callbacks.systemTrayIconRightClick); new (tableType, @user.callbacks.tcpSendMail)}; bundle { // clear applications paths in system.verbs.apps local (adrAppsTable = @system.verbs.apps, i); for i = 1 to sizeof (adrAppsTable^) { local (adrAppInfo = @adrAppsTable^ [i].appInfo); if defined (adrAppInfo^) { adrAppInfo^.path = ""}}}; bundle { // set up Frontier.tools.thread Frontier.tools.thread.ct = 0; Frontier.tools.thread.enabled = true}; bundle { // set up workspace new (tableType, @root.workspace); new (outlineType, @workspace.notepad)}; bundle { // miscellaneous new (tableType, @root.scratchpad); new (tableType, @system.deskscripts); new (tableType, @user.databases); new (tableType, @user.protocols)}}; Çnew (tableType, @websites.["#data"]) bundle { // set up user.menus if flFirstRootRun { new (tableType, @user.menus)}; Çuser.menus.bookmarkMenu = userland.virginBookmarkMenu if not (defined (user.menus.customMenu)) { user.menus.customMenu = Frontier.data.virginCustomMenu}}; if flFirstRootRun { Çwe don't run startup scripts at this time because they are run later in the open all databases section of the scrpt Frontier.installApp ("mainResponder.root", false); // open mainResponder.root, hidden and add to user.databases Frontier.installApp ("prefs.root", false, "www"); // open prefs.root, hidden and add to user.databases }; Çbundle // open prefs.root, hidden and add to user.databases Çlocal (f = file.getPathChar () + ((Frontier.getSubFolder ("www") + "prefs.root") - Frontier.pathString), s = f) Ç Çif system.environment.isWindows Çif s [1] == '\\' Çdelete (@s [1]) Ç Çif not (defined ([string (fileSpec (s))])) ÇfileMenu.open (f, true); //open hidden Ç ÇAdd an entry to the user.databases table. Çlocal (adrTable = @user.databases.["prefs.root"]) Ç Çnew (tableType, adrTable) Ç ÇadrTable^.f = f ÇadrTable^.openOnStartup = true ÇadrTable^.runStartupScript = true ÇadrTable^.supportsSubscribe = false Çbundle //initialize responders Çuser.webserver.responders.websiteFramework.data.docTree.samples = @websites.samples Çtry Çdelete (@user.webserver.responders.websiteFramework.data.docTree.allSites) Çtry Çdelete (@user.webserver.responders.websiteFramework.data.docTree.contents) Ç Çif defined (user.webserver.responders.manilaEdit) Çdelete (@user.webserver.responders.manilaEdit) ÇfileMenu.save () bundle { // miscellaneous variable initializations and checks, phase 2 of 2 system.menus.data.currentsuite = ""; system.menus.data.currentMenuType = nil; system.menus.data.currentmenu = 0; bundle { // check for presence of Psapi.dll if sys.os () == "WinNT" { if not (sys.appIsRunning (file.fileFromPath (Frontier.getProgramPath ()))) { // 11/27/04; 12:14:40 PM by TAC - would it be possible for Frontier to install this on its own? dialog.alert ("You need to run the Frontier Psapi Installer for certain Frontier verbs to work properly.")}}}}; bundle { //open the about window if the pref says we should Çadded 12/16/98; 6:47:28 PM by DW if not defined (user.prefs.openAboutWindow) { user.prefs.openAboutWindow = true}; if user.prefs.openAboutWindow { window.about ()}}; bundle { //initialize the log, next bit of code could add a log item Çadded 12/16/98; 6:52:40 PM by DW if defined (log.startup) { log.startup ()}}; bundle { //run the external startup script local (fname = "frontierStartupCommands.txt"); local (f = file.folderFromPath (Frontier.getProgramPath ()) + fname); if file.exists (f) { try { evaluate (string (file.readWholeFile (f)))} else { log.add ("Error running " + fname + ": \"" + tryError + "\"", "startupError", flwptext:true)}}}; bundle { // tcp based services webserver.init (); // needs to load first betty.init (); // needs to load second soap.init ()}; bundle { // people based services people.init (); // needs to load first custody.init (); webEditServer.init ()}; bundle { //open all the databases that have openOnStartup true Çadded 12/16/98; 6:23:16 PM by DW if defined (user.databases) { if flOpenDatabases { local (i, flMsg = false, t = user.databases); for i = 1 to sizeOf (t) { if typeOf (t [i]) == tableType { //06/08/01 JES: avert item #1 errors with t [i] { local (flOpened = false, s); try { if openOnStartup { msg (this + ": Opening " + file.fileFromPath (f)); flMsg = true; s = f; if system.environment.isWindows { if s [1] == '\\' { delete (@s [1])}}; s = string (fileSpec (s)); if not (defined ([s])) { fileMenu.open (f, hidden:true)}; flOpened = true}} else { log.add ("Startup error opening guest database " + nameof (t [i]) + ": \"" + tryError + "\"", "startupError", flwptext:true)}; if flOpened { if defined (runStartupScript) { if runStartupScript { //PBS 10/7/99: check the value of runStartupScript: only run the script if the boolean is true local (adrScript = @[s].["#startup"]); if defined (adrScript^) { try { adrScript^ ()} else { log.add ("Error running #startup script in guest database " + nameOf (t [i]) + ": \"" + tryError + "\"", "startupError", flwptext: true)}}}}}}}}; if flMsg { msg ("")}}}}; scheduler.init (); bundle { // webBrowser webBrowser.init (); if system.environment.isMac { try {new (tableType, @user.odbEditors.data.openFiles)}}}; //Empty out the list of externally-edited files. Çif system.environment.isWindows Çuser.webBrowser.winDefaultBrowserApp = file.findApplication ("htm") html.init (); try { //04/28/2001 JES: prevent startup from failing if Tool installation fails. Frontier.tools.startup ()}; if flFirstRootRun { bundle { // set up websites table and related with websites.["#ftpSite"] { folder = file.folderFromPath (Frontier.getProgramPath ()) + "Websites" + file.getPathChar (); Çfile.sureFolder (folder) url = file.fileToURL (folder); isLocal = true}; user.html.sites.default = websites.["#ftpSite"]}; bundle { // personalize this copy of Frontier, configure network settings, and complete the installation local (flWebBasedInstall = true); if flWebBasedInstall { Ç11/29/04; 11:17:45 AM by TAC - the following seems like it should be done as part of mainRepsonder startup, init. IIRC, members.root is a feature of mainResponder bundle { //create the Admin membership group if needed local (adrRoot = @[system.temp.mainResponder.membersRootFile]); local (adrGroup = @adrRoot^.admin); if not defined (adrGroup^) { new (tableType, adrGroup)}; if not defined (adrGroup^.callbacks) { new (tableType, @adrGroup^.callbacks)}; if not defined (adrGroup^.cookieDomain) { adrGroup^.cookieDomain = ""}; if not defined (adrGroup^.cookieExpires) { adrGroup^.cookieExpires = "Mon, 01 Apr 2030 07:00:00 GMT"}; if not defined (adrGroup^.cookieName) { adrGroup^.cookieName = "Admin"}; if not defined (adrGroup^.mailReturnAddress) { adrGroup^.mailReturnAddress = user.prefs.mailAddress}; if not defined (adrGroup^.mailSubject) { adrGroup^.mailSubject = "Admin"}; if not defined (adrGroup^.mailTemplate) { wp.newTextObject ("", @adrGroup^.mailTemplate)}; if not defined (adrGroup^.openToPublic) { adrGroup^.openToPublic = false}; if not defined (adrGroup^.users) { new (tableType, @adrGroup^.users)}}; bundle { // prep for web based install via mainResponder admin website local (portString = ""); if user.inetd.config.http2.port != 80 { portString = ":" + user.inetd.config.http2.port}; if not defined (system.temp.Frontier.setupFrontier) { new (tableType, @system.temp.Frontier.setupFrontier)}; system.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage = true; local (setupUrl = "http://127.0.0.1" + portString + "/setupFrontier"); if not defined (system.temp.installer) { new (tableType, @system.temp.installer)}; system.temp.installer.urlToOpen = setupUrl}} else { on infoDialog () { //prompt the user for name, org and initials on kernelCall (adrName, adrInitials, adrOrg, adrEmail) { kernel (dialog.getUserInfo)}; local (name, initials, organization, email); case sys.os () { "Win95"; "WinNT" { if not (kernelCall (@name, @initials, @organization, @email)) { return (false)}; if initials == "" { dialog.alert ("You must specify your initials."); infoDialog ()}; user.prefs.name = name; user.prefs.initials = initials; user.prefs.organization = organization; user.prefs.mailAddress = email}; "MacOS" { bundle { //initialize user.prefs.name etc using info from Internet Config try { name = ic.geticpreference (ic.eventinfo.realName)}; try { organization = ic.geticpreference (ic.eventinfo.organization)}; try { email = ic.geticpreferece (ic.eventinfo.emailAddress)}; user.prefs.name = name; user.prefs.organization = organization; if name != "" { local (i); user.prefs.initials = name [1]; for i = 3 to sizeof (name) { if name [i] == ' ' { user.prefs.initials = user.prefs.initials + name [i+1]}}}}; card.run (@system.cards.userInfoDialog)}}; return (true)}; infoDialog ()}}; //AR 09/27/04 : personalize install ÇrootUpdates.getCurrent ("Frontier") // 11/29/04; 6:57:54 PM by TAC - if we get a root update then we'll need to use rootUpdates.update bundle { // about window local (w); window.about (); w = window.frontMost (); window.zoom (w); menus.scripts.styleCommand ("medium"); window.setPosition (w, 25, 75)}; Çwindow.close (s) bundle { // license edit (@system.startup.license); // 12/4/04; 9:26:35 PM by TAC - i rather do this near the beginning of phase 1 firstRootRun but had a problem with this window and setting up the quick script window wp.setSelect (0, 0)}}; system.callbacks.startup (); //call user's startup scripts bundle { // build menu bar system.menus.buildMenuBar (); system.menus.buildSuitesSubmenu ()}; //5.0 Frontier.enableAgents (flEnableAgents); if flEnableHttpServer { //6.0, daemons don't start up until all the startup code has run new (tableType, @user.inetd.listens); inetd.start ()}; //start up all daemons with startup set true if flFirstRootRun { if defined (system.temp.installer.urlToOpen) { Çwindow.update ("About Frontier") webBrowser.openUrl (system.temp.installer.urlToOpen); webBrowser.bringToFront ()}; user.prefs.firstRootRun = false}; system.temp.Frontier.startingUp = false; //signal to all who care, let the hits begin! msg (""); fileMenu.save () \ No newline at end of file --- 1,508 ---- ! FrontierVcsFile:2:scpt:system.startup.startupScript ! «Changes ! «3/13/06; 12:38:30 PM by TAC ! «install DLLs ! «added init of user.callbacks.fileSetModified on first root run ! «upon first root run alert user that Frontier is going to use web browser to complete install, first time users may find it confusing to launch Frontier then have it immediately disappear on them. ! «script formatting tweaks ! «minor tweaks to startup.license window formatting code ! «2/14/06; 9:03:23 PM by TAC ! «moved tools.startup to after html.init ! «use improved Frontier.installApp to open prefs.root ! «when opening databases make copy of user.databases in case startup scripts add entries to it, that way we don't lose track of what were opening ! «move webBrowser.init before html.init so html.init can call webBrowser.getDefaultBrowser without error ! «when opening all databases, check if already open, prevents error on Windows ! «work around relative path issue on Windows ! «on set up of quickscript window on windows, use Frontier.showApplication, Frontier.bringToFront alone doesn't do the trick ! «2/8/06: 12:00:00 AM by SSL ! «use of mainResponder.root and prefs.root are new optional ! «upon first root run, set flWebBasedInstall from defined (system.temp.mainResponder) ! «got rid of some of the tests around mainResponder.root; they are already in Frontier.installApp ! «upon first root run set up root and startup.license windows in the background ! «2/6/06; 12:04:50 PM by TAC ! «bring frontier to front before setting quickscript text for first root run ! «2/5/06; 9:45:01 AM by TAC ! «removed prefs.root startup script code when doing a first root run, no need to run it there as it is run later in the script ! «2/1/06; 1:27:51 PM by TAC ! «deleted some unneeded commented code ! «1/20/06; 1:54:05 PM by TAC ! «disable agents for all startups, not just for first root run ! «there was a problem with Tools starting up and its agent manipulating menus at the same time and causing a crash ! «12/24/05; 12:33:32 PM by TAC ! «prefs.root now has a #startup script, deal with it ! «11/10/05; 4:24:48 PM by TAC ! «moved system.temp.Frontier/starting up after first if firstRootRun check was causing startup problem ! «11/5/05; 12:00:32 PM by TAC ! «moved system.temp.Frontier check back to top of script ! «10/9/05; 3:39:07 PM by TAC ! «when storing prefs.root path, store realative path ! «use table.copyUndefinedContents to copy some item ! «move some of the user prefs initializations into Frontier.data.userPrefs ! «rearrange script so that some initializations can happen outside of the first root run, this should make it easier to add new items and not have them get missed because the first root run had already been run once ! «10/4/05; 7:26:36 PM by TAC ! «upon check for presence of Psapi.dll, don't use hard coded application name ! «9/26/05; 4:30:14 PM by TAC ! «added user.prefs.flReplaceDialogExpertMode ! «8/23/05; 7:22:18 PM by TAC ! «added user.prefs.flCompactModalMenus ! «7/14/05; 10:35:39 AM by TAC ! «system.menus.data.currentMenuType set to nil so agent will update modal menu properly upon relaunch ! «7/6/05; 12:21:38 PM by TAC ! «changed user.callbacks.sendmail to user.callbacks.tcpSendMail ! «added user.prefs.mailHostPort ! «6/15/05; 6:52:11 PM by TAC ! «rewrite for Open Source release, bring in code from startup.startupScript, userland.firstRootRun, userland.finishInstall, and userland.cleanRoot ! «Old code ! «startup.startupScript <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/startup/startupScript?rev=1.1> ! «userland.firstRootRun <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/firstRootRun?rev=1.1> ! «userland.finishInstall <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/finishInstall?rev=1.1> ! «userland.cleanRoot <http://cvs.sourceforge.net/viewcvs.py/frontierkernel/odbs/frontierRoot/system/verbs/builtins/userland/Attic/cleanRoot?rev=1.1> ! «06/08/01; 11:24:35 PM by JES ! «When opening databases defined at user.databases, skip objects which aren't tables. This avoids the condition where startup wouldn't complete, if there's an item #1 in the user.databases table. ! «06/02/01; 8:34:20 PM by PBS ! «Do the web-based install and open the Control Panel if this is the first root run. ! «04/28/01; 7:48:46 PM by JES ! «Call Frontier.tools.startup in a try block, so that the startup process will finish even if Tools installation fails. ! «04/20/01; 4:49:05 PM by JES ! «Call tools.startup to install Tools at startup. ! «10/7/99; 4:20:26 PM by PBS ! «Only run the #startup script in a guest database if runStartupScript exists and is true. Previously, it would be run whether runStartupScript was true or false. ! «http://frontier.userland.com/stories/storyReader$1760 ! «10/6/99; 10:21:35 PM by PBS ! «Only set the taskTime for the overnight task if it's in the past. This fixes a bug when the taskTime was before midnight, but it was being set for the next day, so the overnight task wouldn't run. ! «http://frontier.userland.com/stories/storyReader$1761 ! «8/19/99; 6:44:48 AM by DW ! «Make sure that taskTimes in user.scheduler.tasks are in the future. ! «We do this much more quickly than scheduler.monitor would. ! «http://discuss.userland.com/msgReader$9658 ! «This script runs when Frontier opens the Frontier.root file. ! ! if defined (system.temp.Frontier) { // only run the startup script once ! return}; ! ! local (flEnableAgents = true, flOpenDatabases = true, flEnableHttpServer = true); // can be set by the external startup script ! local (flFirstRootRun = true); ! ! bundle { // miscellaneous initializations, checks, and etc., phase 1 of 2 ! Frontier.enableAgents (false); // try to keep agents from reporting errors and causing problems ! ! Frontier.pathString = file.folderFromPath (Frontier.getFilePath ()); ! ! if defined (user.prefs.firstRootRun) { ! flFirstRootRun = user.prefs.firstRootRun}}; ! ! if flFirstRootRun { ! ! while window.frontmost () != "" { // open windows can mess things up later on ! window.hide (window.frontmost ())}; ! ! «return (false) // enable for testing ! ! new (tableType, @system.temp); ! new (tableType, @root.user)}; ! ! bundle { // system.temp.Frontier, we are starting up ! new (tableType, @system.temp.Frontier); ! system.temp.Frontier.startupTime = clock.now (); ! system.temp.Frontier.startingUp = true}; ! ! backups.init (); ! batchExporter.init (); ! export.init (); ! rootUpdates.init (); // set up user.rootUpdates, even though root updates uses tcp, its ok to set up here as no tcp calls are made at this time ! webEdit.init (); ! ! bundle { // set up user.prefs ! if flFirstRootRun { ! new (tableType, @user.prefs); ! ! bundle { // set up user.prefs.commonStyles ! case sys.os () { ! "MacOS" { ! if system.environment.isCarbon { ! user.prefs.commonStyles = Frontier.data.commonStylesMacCarbon} ! else { ! user.prefs.commonStyles = Frontier.data.commonStylesMac}}; ! "Win95"; ! "WinNT" { ! user.prefs.commonStyles = Frontier.data.commonStylesWin}}}}; ! ! table.copyUndefinedContents (@Frontier.data.userPrefs, @user.prefs); ! ! bundle { // set up user.prefs.dialogs ! if flFirstRootRun { ! new (tableType, @user.prefs.dialogs)}; ! ! table.copyUndefinedContents (@Frontier.data.userPrefs.dialogs, @user.prefs.dialogs)}; ! ! bundle { // set up user.prefs.search ! if flFirstRootRun { ! new (tableType, @user.prefs.search)}; ! ! table.copyUndefinedContents (@Frontier.data.userPrefs.search, @user.prefs.search); ! ! if not (defined (user.prefs.search.replaceWith)) { ! user.prefs.search.replaceWith = Frontier.version ()}}; ! ! Frontier.setupUserPrefsFonts ()}; ! ! if flFirstRootRun { ! bundle { // set up the quick script window ! if system.environment.isWindows { ! Frontier.showApplication ()}; ! Frontier.bringToFront (); ! clipboard.putvalue ("dialog.notify (\"Hello World!\")"); ! window.quickScript (); ! editmenu.selectAll (); ! editmenu.paste (); ! window.close ("Quick Script")}; ! ! bundle { // set up root window ! local (w = "root"); ! target.set (w); ! window.setPosition (w, 0, 0); ! editMenu.setFont (user.prefs.fonts.tableFont); ! editMenu.setFontSize (user.prefs.fonts.tableFontSize); ! window.zoom (w); ! window.open (w)}; ! ! bundle { // set up user.callbacks ! new (tableType, @user.callbacks); ! new (tableType, @user.callbacks.closeWindow); ! new (tableType, @user.callbacks.cmd2click); ! new (tableType, @user.callbacks.compileChangedScript); ! new (tableType, @user.callbacks.control2click); ! new (tableType, @user.callbacks.fileSetModified); ! new (tableType, @user.callbacks.fileWriteWholeFile); ! new (tableType, @user.callbacks.opCollapse); ! new (tableType, @user.callbacks.opCursorMoved); ! new (tableType, @user.callbacks.openWindow); ! new (tableType, @user.callbacks.opExpand); ! new (tableType, @user.callbacks.opInsert); ! new (tableType, @user.callbacks.opReturnKey); ! new (tableType, @user.callbacks.opRightClick); ! new (tableType, @user.callbacks.opStruct2Click); ! new (tableType, @user.callbacks.option2click); ! new (tableType, @user.callbacks.resume); ! new (tableType, @user.callbacks.saveWindow); ! new (tableType, @user.callbacks.shutdown); ! new (tableType, @user.callbacks.startup); ! new (tableType, @user.callbacks.statusMessage); ! new (tableType, @user.callbacks.suspend); ! new (tableType, @user.callbacks.systemTrayIcon2Click); ! new (tableType, @user.callbacks.systemTrayIconRightClick); ! new (tableType, @user.callbacks.tcpSendMail)}; ! ! bundle { // clear applications paths in system.verbs.apps ! local (adrAppsTable = @system.verbs.apps, i); ! for i = 1 to sizeof (adrAppsTable^) { ! local (adrAppInfo = @adrAppsTable^ [i].appInfo); ! if defined (adrAppInfo^) { ! adrAppInfo^.path = ""}}}; ! ! bundle { // set up Frontier.tools.thread ! Frontier.tools.thread.ct = 0; ! Frontier.tools.thread.enabled = true}; ! ! bundle { // set up workspace ! new (tableType, @root.workspace); ! new (outlineType, @workspace.notepad)}; ! ! bundle { // miscellaneous ! new (tableType, @root.scratchpad); ! new (tableType, @system.deskscripts); ! new (tableType, @user.databases); ! new (tableType, @user.protocols)}}; ! «new (tableType, @websites.["#data"]) ! ! Frontier.data.DLLs.install (); ! ! bundle { // set up user.menus ! if flFirstRootRun { ! new (tableType, @user.menus)}; ! ! «user.menus.bookmarkMenu = userland.virginBookmarkMenu ! if not (defined (user.menus.customMenu)) { ! user.menus.customMenu = Frontier.data.virginCustomMenu}}; ! ! if flFirstRootRun { ! «we don't run startup scripts at this time because they are run later in the open all databases section of the scrpt ! Frontier.installApp ("mainResponder.root", false); // open mainResponder.root, hidden and add to user.databases ! Frontier.installApp ("prefs.root", false, "www"); // open prefs.root, hidden and add to user.databases ! }; ! «bundle // open prefs.root, hidden and add to user.databases ! «local (f = file.getPathChar () + ((Frontier.getSubFolder ("www") + "prefs.root") - Frontier.pathString), s = f) ! « ! «if system.environment.isWindows ! «if s [1] == '\\' ! «delete (@s [1]) ! « ! «if not (defined ([string (fileSpec (s))])) ! «fileMenu.open (f, true); //open hidden ! « ! «Add an entry to the user.databases table. ! «local (adrTable = @user.databases.["prefs.root"]) ! « ! «new (tableType, adrTable) ! « ! «adrTable^.f = f ! «adrTable^.openOnStartup = true ! «adrTable^.runStartupScript = true ! «adrTable^.supportsSubscribe = false ! ! «bundle //initialize responders ! «user.webserver.responders.websiteFramework.data.docTree.samples = @websites.samples ! «try ! «delete (@user.webserver.responders.websiteFramework.data.docTree.allSites) ! «try ! «delete (@user.webserver.responders.websiteFramework.data.docTree.contents) ! « ! «if defined (user.webserver.responders.manilaEdit) ! «delete (@user.webserver.responders.manilaEdit) ! ! «fileMenu.save () ! ! bundle { // miscellaneous variable initializations and checks, phase 2 of 2 ! system.menus.data.currentsuite = ""; ! system.menus.data.currentMenuType = nil; ! system.menus.data.currentmenu = 0; ! ! bundle { // check for presence of Psapi.dll ! if sys.os () == "WinNT" { ! if not (sys.appIsRunning (file.fileFromPath (Frontier.getProgramPath ()))) { // 11/27/04; 12:14:40 PM by TAC - would it be possible for Frontier to install this on its own? ! dialog.alert ("You need to run the Frontier Psapi Installer for certain Frontier verbs to work properly.")}}}}; ! ! bundle { //open the about window if the pref says we should ! «added 12/16/98; 6:47:28 PM by DW ! if not defined (user.prefs.openAboutWindow) { ! user.prefs.openAboutWindow = true}; ! if user.prefs.openAboutWindow { ! window.about ()}}; ! ! bundle { //initialize the log, next bit of code could add a log item ! «added 12/16/98; 6:52:40 PM by DW ! if defined (log.startup) { ! log.startup ()}}; ! ! bundle { //run the external startup script ! local (fname = "frontierStartupCommands.txt"); ! local (f = file.folderFromPath (Frontier.getProgramPath ()) + fname); ! if file.exists (f) { ! try { ! evaluate (string (file.readWholeFile (f)))} ! else { ! log.add ("Error running " + fname + ": \"" + tryError + "\"", "startupError", flwptext:true)}}}; ! ! bundle { // tcp based services ! webserver.init (); // needs to load first ! betty.init (); // needs to load second ! soap.init ()}; ! ! bundle { // people based services ! people.init (); // needs to load first ! custody.init (); ! webEditServer.init ()}; ! ! bundle { //open all the databases that have openOnStartup true ! «added 12/16/98; 6:23:16 PM by DW ! if defined (user.databases) { ! if flOpenDatabases { ! local (i, flMsg = false, t = user.databases); ! ! for i = 1 to sizeOf (t) { ! if typeOf (t [i]) == tableType { //06/08/01 JES: avert item #1 errors ! with t [i] { ! local (flOpened = false, s); ! ! try { ! if openOnStartup { ! msg (this + ": Opening " + file.fileFromPath (f)); ! ! flMsg = true; ! s = f; ! ! if system.environment.isWindows { ! if s [1] == '\\' { ! delete (@s [1])}}; ! ! s = string (fileSpec (s)); ! ! if not (defined ([s])) { ! fileMenu.open (f, hidden:true)}; ! ! flOpened = true}} ! else { ! log.add ("Startup error opening guest database " + nameof (t [i]) + ": \"" + tryError + "\"", "startupError", flwptext:true)}; ! ! if flOpened { ! if defined (runStartupScript) { ! if runStartupScript { //PBS 10/7/99: check the value of runStartupScript: only run the script if the boolean is true ! local (adrScript = @[s].["#startup"]); ! ! if defined (adrScript^) { ! try { ! adrScript^ ()} ! else { ! log.add ("Error running #startup script in guest database " + nameOf (t [i]) + ": \"" + tryError + "\"", "startupError", flwptext: true)}}}}}}}}; ! ! if flMsg { ! msg ("")}}}}; ! ! scheduler.init (); ! ! bundle { // webBrowser ! webBrowser.init (); ! ! if system.environment.isMac { ! try {new (tableType, @user.odbEditors.data.openFiles)}}}; //Empty out the list of externally-edited files. ! «if system.environment.isWindows ! «user.webBrowser.winDefaultBrowserApp = file.findApplication ("htm") ! ! html.init (); ! ! try { //04/28/2001 JES: prevent startup from failing if Tool installation fails. ! Frontier.tools.startup ()}; ! ! if flFirstRootRun { ! bundle { // set up websites table and related ! with websites.["#ftpSite"] { ! folder = file.folderFromPath (Frontier.getProgramPath ()) + "Websites" + file.getPathChar (); ! «file.sureFolder (folder) ! url = file.fileToURL (folder); ! isLocal = true}; ! user.html.sites.default = websites.["#ftpSite"]}; ! ! bundle { // personalize this copy of Frontier, configure network settings, and complete the installation ! local (flWebBasedInstall = defined (system.temp.mainResponder)); ! ! if flWebBasedInstall { ! ! «11/29/04; 11:17:45 AM by TAC - the following seems like it should be done as part of mainRepsonder startup, init. IIRC, members.root is a feature of mainResponder ! bundle { //create the Admin membership group if needed ! local (adrRoot = @[system.temp.mainResponder.membersRootFile]); ! local (adrGroup = @adrRoot^.admin); ! ! if not defined (adrGroup^) { ! new (tableType, adrGroup)}; ! if not defined (adrGroup^.callbacks) { ! new (tableType, @adrGroup^.callbacks)}; ! if not defined (adrGroup^.cookieDomain) { ! adrGroup^.cookieDomain = ""}; ! if not defined (adrGroup^.cookieExpires) { ! adrGroup^.cookieExpires = "Mon, 01 Apr 2030 07:00:00 GMT"}; ! if not defined (adrGroup^.cookieName) { ! adrGroup^.cookieName = "Admin"}; ! if not defined (adrGroup^.mailReturnAddress) { ! adrGroup^.mailReturnAddress = user.prefs.mailAddress}; ! if not defined (adrGroup^.mailSubject) { ! adrGroup^.mailSubject = "Admin"}; ! if not defined (adrGroup^.mailTemplate) { ! wp.newTextObject ("", @adrGroup^.mailTemplate)}; ! if not defined (adrGroup^.openToPublic) { ! adrGroup^.openToPublic = false}; ! if not defined (adrGroup^.users) { ! new (tableType, @adrGroup^.users)}}; ! ! bundle { // prep for web based install via mainResponder admin website ! local (portString = ""); ! ! if user.inetd.config.http2.port != 80 { ! portString = ":" + user.inetd.config.http2.port}; ! ! if not defined (system.temp.Frontier.setupFrontier) { ! new (tableType, @system.temp.Frontier.setupFrontier)}; ! ! system.temp.Frontier.setupFrontier.flAllowLocalAccessToSetupPage = true; ! ! local (setupUrl = "http://127.0.0.1" + portString + "/setupFrontier"); ! ! if not defined (system.temp.installer) { ! new (tableType, @system.temp.installer)}; ! system.temp.installer.urlToOpen = setupUrl}} ! else { ! on infoDialog () { //prompt the user for name, org and initials ! on kernelCall (adrName, adrInitials, adrOrg, adrEmail) { ! kernel (dialog.getUserInfo)}; ! ! local (name, initials, organization, email); ! ! case sys.os () { ! "Win95"; ! "WinNT" { ! if not (kernelCall (@name, @initials, @organization, @email)) { ! return (false)}; ! if initials == "" { ! dialog.alert ("You must specify your initials."); ! infoDialog ()}; ! user.prefs.name = name; ! user.prefs.initials = initials; ! user.prefs.organization = organization; ! user.prefs.mailAddress = email}; ! "MacOS" { ! bundle { //initialize user.prefs.name etc using info from Internet Config ! try { ! name = ic.geticpreference (ic.eventinfo.realName)}; ! try { ! organization = ic.geticpreference (ic.eventinfo.organization)}; ! try { ! email = ic.geticpreferece (ic.eventinfo.emailAddress)}; ! ! user.prefs.name = name; ! user.prefs.organization = organization; ! if name != "" { ! local (i); ! user.prefs.initials = name [1]; ! for i = 3 to sizeof (name) { ! if name [i] == ' ' { ! user.prefs.initials = user.prefs.initials + name [i+1]}}}}; ! card.run (@system.cards.userInfoDialog)}}; ! return (true)}; ! infoDialog ()}}; //AR 09/27/04 : personalize install ! ! «rootUpdates.getCurrent ("Frontier") // 11/29/04; 6:57:54 PM by TAC - if we get a root update then we'll need to use rootUpdates.update ! ! bundle { // about window ! local (w); ! ! window.about (); ! w = window.frontMost (); ! window.zoom (w); ! menus.scripts.styleCommand ("medium"); ! window.setPosition (w, 25, 75)}; ! «window.close (s) ! ! bundle { // license ! local (adrWindow = @system.startup.license); ! target.set (adrWindow); ! window.setPosition (adrWindow, 50, 100); ! window.setSize (adrWindow, infinity, infinity); ! window.zoom (adrWindow); ! wp.setSelect (0, 0); ! edit (adrWindow)}}; // 12/4/04; 9:26:35 PM by TAC - i rather do this near the beginning of phase 1 firstRootRun but had a problem with this window and setting up the quick script window ! ! system.callbacks.startup (); //call user's startup scripts ! ! bundle { // build menu bar ! system.menus.buildMenuBar (); ! system.menus.buildSuitesSubmenu ()}; //5.0 ! ! Frontier.enableAgents (flEnableAgents); ! ! if flEnableHttpServer { //6.0, daemons don't start up until all the startup code has run ! new (tableType, @user.inetd.listens); ! inetd.start ()}; //start up all daemons with startup set true ! ! if flFirstRootRun { ! if defined (system.temp.installer.urlToOpen) { ! dialog.alert ("Frontier is going to use your web browser to complete its installation."); ! webBrowser.openUrl (system.temp.installer.urlToOpen); ! webBrowser.bringToFront ()}; ! ! user.prefs.firstRootRun = false}; ! ! system.temp.Frontier.startingUp = false; //signal to all who care, let the hits begin! ! ! msg (""); ! ! fileMenu.save () \ No newline at end of file |
|
From: creecode <icr...@us...> - 2006-03-13 20:44:34
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/Frontier/data/DLLs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11827 Added Files: macCarbon install Log Message: support for Frontier to install DLLs instead of having to distribute the DLLs in the folder install --- NEW FILE: macCarbon --- FrontierVcsFile:2:tabl:system.verbs.builtins.Frontier.data.DLLs.macCarbon --- NEW FILE: install --- (This appears to be a binary file; contents omitted.) |
|
From: creecode <icr...@us...> - 2006-03-13 18:52:27
|
Update of /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23620 Modified Files: setupFrontier Log Message: added CRAM-SHA1 for SMTP -AUTH pop-up menu Index: setupFrontier =================================================================== RCS file: /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/website/setupFrontier,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** setupFrontier 10 Mar 2006 22:01:14 -0000 1.8 --- setupFrontier 13 Mar 2006 18:52:22 -0000 1.9 *************** *** 3,6 **** --- 3,8 ---- on setupFrontier () { «Changes + «3/13/06; 10:09:35 AM by TAC + «added CRAM-SHA1 for SMTP -AUTH pop-up menu «3/6/06; 7:50:35 PM by TAC «added local programName *************** *** 295,299 **** bundle { // smtp auth ! local (item, s, smtpAuthMethods = {"", "CRAM-MD5", "LOGIN", "PLAIN"}); s = "<select name=\"smtpAuth\">\r"; --- 297,301 ---- bundle { // smtp auth ! local (item, s, smtpAuthMethods = {"", "CRAM-MD5", "CRAM-SHA1", "LOGIN", "PLAIN"}); s = "<select name=\"smtpAuth\">\r"; |
|
From: creecode <icr...@us...> - 2006-03-13 08:19:13
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/tcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7765 Modified Files: sendMail Log Message: added support for SMTP-AUTH CRAM-SHA1 Index: sendMail =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/tcp/sendMail,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sendMail 12 Mar 2006 04:32:06 -0000 1.5 --- sendMail 13 Mar 2006 08:19:10 -0000 1.6 *************** *** 3,6 **** --- 3,8 ---- on sendMail (recipient = "", subject = "", message = "", sender = user.prefs.mailAddress, cc = "", bcc = "", host = user.prefs.mailHost, mimeType = "text/plain", adrHdrTable = nil, timeOutTicks = 60 * 60, flMessages = true, port = user.prefs.mailHostPort, smtpAuth = user.prefs.mailSmtpAuth, senderPassword = user.prefs.mailPassword) { «Changes + «3/12/06; 12:12:32 PM by TAC + «added support for SMTP-AUTH CRAM-SHA1 «3/11/06; 8:25:21 PM by TAC «when adding AUTH= xtext the sender *************** *** 239,242 **** --- 241,258 ---- flAuthenticated = true}; + "CRAM-SHA1" { + local (s); + + executeCommand ("AUTH " + smtpAuth, "334", @s); + + s = s - "334 "; + s = base64.decode (s); + + s = crypt.cramSHA1 (string.nthField (sender, '@', 1), string (senderPassword), s); + s = base64.encode (s, 0); + + executeCommand (s, "235"); + + flAuthenticated = true}; "LOGIN" { local (s); |
|
From: creecode <icr...@us...> - 2006-03-13 08:16:48
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6725 Modified Files: testCrypt Log Message: added test for crypt.SHA1, crypt.hmacSHA1 Index: testCrypt =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress/testCrypt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testCrypt 10 Mar 2006 21:37:43 -0000 1.1 --- testCrypt 13 Mar 2006 08:16:43 -0000 1.2 *************** *** 3,6 **** --- 3,8 ---- on testCrypt () { «Changes + «3/11/06; 4:09:17 PM by TAC + «added test for crypt.SHA1, crypt.hmacSHA1 «3/10/06; 11:30:10 AM by TAC «created *************** *** 11,25 **** assertEqual (crypt.cramMD5 ("tim", "tanstaaftanstaaf", base64.decode ("PDE4OTYuNjk3MTcwOTUyQHBvc3RvZmZpY2UucmVzdG9uLm1jaS5uZXQ+")), "tim b913a602c7eda7a495b4e6e7334d3890", "crypt.cramMD5 is broken")}; ! bundle { // crypt.hashWhirlpool «see < http://en.wikipedia.org/wiki/WHIRLPOOL >, < http://paginas.terra.com.br/informatica/paulobarreto/WhirlpoolPage.html > ! assertEqual (crypt.hashWhirlpool (""), "19fa61d75522a4669b44e39c1d2e1726c530232130d407f89afee0964997f7a73e83be698b288febcf88e3e03c4f0757ea8964e59b63d93708b138cc42a66eb3", "crypt.hashWhirlpool is broken"); ! assertEqual (crypt.hashWhirlpool ("a"), "8aca2602792aec6f11a67206531fb7d7f0dff59413145e6973c45001d0087b42d11bc645413aeff63a42391a39145a591a92200d560195e53b478584fdae231a", "crypt.hashWhirlpool is broken"); ! assertEqual (crypt.hashWhirlpool ("abc"), "4e2448a4c6f486bb16b6562c73b4020bf3043e3a731bce721ae1b303d97e6d4c7181eebdb6c57e277d0e34957114cbd6c797fc9d95d8b582d225292076d4eef5", "crypt.hashWhirlpool is broken"); ! assertEqual (crypt.hashWhirlpool ("message digest"), "378c84a4126e2dc6e56dcc7458377aac838d00032230f53ce1f5700c0ffb4d3b8421557659ef55c106b4b52ac5a4aaa692ed920052838f3362e86dbd37a8903e", "crypt.hashWhirlpool is broken"); ! assertEqual (crypt.hashWhirlpool ("abcdefghijklmnopqrstuvwxyz"), "f1d754662636ffe92c82ebb9212a484a8d38631ead4238f5442ee13b8054e41b08bf2a9251c30b6a0b8aae86177ab4a6f68f673e7207865d5d9819a3dba4eb3b", "crypt.hashWhirlpool is broken"); ! assertEqual (crypt.hashWhirlpool ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"), "dc37e008cf9ee69bf11f00ed9aba26901dd7c28cdec066cc6af42e40f82f3a1e08eba26629129d8fb7cb57211b9281a65517cc879d7b962142c65f5a7af01467", "crypt.hashWhirlpool is broken"); ! assertEqual (crypt.hashWhirlpool ("12345678901234567890123456789012345678901234567890123456789012345678901234567890"), "466ef18babb0154d25b9d38a6414f5c08784372bccb204d6549c4afadb6014294d5bd8df2a6c44e538cd047b2681a51a2c60481e88c5a20b2c2a80cf3a9a083b", "crypt.hashWhirlpool is broken"); ! assertEqual (crypt.hashWhirlpool ("abcdbcdecdefdefgefghfghighijhijk"), "2a987ea40f917061f5d6f0a0e4644f488a7a5a52deee656207c562f988e95c6916bdc8031bc5be1b7b947639fe050b56939baaa0adff9ae6745b7b181c3be3fd", "crypt.hashWhirlpool is broken")}; bundle { // crypt.hmacMD5 --- 13,27 ---- assertEqual (crypt.cramMD5 ("tim", "tanstaaftanstaaf", base64.decode ("PDE4OTYuNjk3MTcwOTUyQHBvc3RvZmZpY2UucmVzdG9uLm1jaS5uZXQ+")), "tim b913a602c7eda7a495b4e6e7334d3890", "crypt.cramMD5 is broken")}; ! bundle { // crypt.whirlpool «see < http://en.wikipedia.org/wiki/WHIRLPOOL >, < http://paginas.terra.com.br/informatica/paulobarreto/WhirlpoolPage.html > ! assertEqual (crypt.whirlpool (""), "19fa61d75522a4669b44e39c1d2e1726c530232130d407f89afee0964997f7a73e83be698b288febcf88e3e03c4f0757ea8964e59b63d93708b138cc42a66eb3", "crypt.whirlpool is broken"); ! assertEqual (crypt.whirlpool ("a"), "8aca2602792aec6f11a67206531fb7d7f0dff59413145e6973c45001d0087b42d11bc645413aeff63a42391a39145a591a92200d560195e53b478584fdae231a", "crypt.whirlpool is broken"); ! assertEqual (crypt.whirlpool ("abc"), "4e2448a4c6f486bb16b6562c73b4020bf3043e3a731bce721ae1b303d97e6d4c7181eebdb6c57e277d0e34957114cbd6c797fc9d95d8b582d225292076d4eef5", "crypt.whirlpool is broken"); ! assertEqual (crypt.whirlpool ("message digest"), "378c84a4126e2dc6e56dcc7458377aac838d00032230f53ce1f5700c0ffb4d3b8421557659ef55c106b4b52ac5a4aaa692ed920052838f3362e86dbd37a8903e", "crypt.whirlpool is broken"); ! assertEqual (crypt.whirlpool ("abcdefghijklmnopqrstuvwxyz"), "f1d754662636ffe92c82ebb9212a484a8d38631ead4238f5442ee13b8054e41b08bf2a9251c30b6a0b8aae86177ab4a6f68f673e7207865d5d9819a3dba4eb3b", "crypt.whirlpool is broken"); ! assertEqual (crypt.whirlpool ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"), "dc37e008cf9ee69bf11f00ed9aba26901dd7c28cdec066cc6af42e40f82f3a1e08eba26629129d8fb7cb57211b9281a65517cc879d7b962142c65f5a7af01467", "crypt.whirlpool is broken"); ! assertEqual (crypt.whirlpool ("12345678901234567890123456789012345678901234567890123456789012345678901234567890"), "466ef18babb0154d25b9d38a6414f5c08784372bccb204d6549c4afadb6014294d5bd8df2a6c44e538cd047b2681a51a2c60481e88c5a20b2c2a80cf3a9a083b", "crypt.whirlpool is broken"); ! assertEqual (crypt.whirlpool ("abcdbcdecdefdefgefghfghighijhijk"), "2a987ea40f917061f5d6f0a0e4644f488a7a5a52deee656207c562f988e95c6916bdc8031bc5be1b7b947639fe050b56939baaa0adff9ae6745b7b181c3be3fd", "crypt.whirlpool is broken")}; bundle { // crypt.hmacMD5 *************** *** 28,32 **** assertEqual (crypt.hmacMD5 ("Hi There", string.hexStringToBinary ("0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b")), "9294727a3638bb1c13f48ef8158bfc9d", "crypt.hmacMD5 is broken"); assertEqual (crypt.hmacMD5 ("what do ya want for nothing?", "Jefe"), "750c783e6ab0b503eaa86e310a5db738", "crypt.hmacMD5 is broken"); ! assertEqual (crypt.hmacMD5 (string.hexStringToBinary ("0xDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"), string.hexStringToBinary ("0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")), "56be34521d144c88dbb8c733f0e8b3f6", "crypt.hmacMD5 is broken")}}; callScript (@fUnit.testSuperStress.testCrypt, {}, @fUnit.contextForTests) \ No newline at end of file --- 30,185 ---- assertEqual (crypt.hmacMD5 ("Hi There", string.hexStringToBinary ("0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b")), "9294727a3638bb1c13f48ef8158bfc9d", "crypt.hmacMD5 is broken"); assertEqual (crypt.hmacMD5 ("what do ya want for nothing?", "Jefe"), "750c783e6ab0b503eaa86e310a5db738", "crypt.hmacMD5 is broken"); ! assertEqual (crypt.hmacMD5 (string.hexStringToBinary ("0xDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"), string.hexStringToBinary ("0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")), "56be34521d144c88dbb8c733f0e8b3f6", "crypt.hmacMD5 is broken")}; ! ! bundle { // crypt.SHA1 ! bundle { // < http://en.wikipedia.org/wiki/Sha1#SHA1_hashes > ! assertEqual (crypt.SHA1 ("The quick brown fox jumps over the lazy dog"), "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 ("The quick brown fox jumps over the lazy cog"), "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (""), "da39a3ee5e6b4b0d3255bfef95601890afd80709", "crypt.SHA1 is broken")}; ! ! bundle { // < http://csrc.ncsl.nist.gov/cryptval/ >, short messages ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("")), "da39a3ee5e6b4b0d3255bfef95601890afd80709", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("a8")), "99f2aa95e36f95c2acb0eaf23998f030638f3f15", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("3000")), "f944dcd635f9801f7ac90a407fbc479964dec024", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("42749e")), "a444319e9b6cc1e8464c511ec0969c37d6bb2619", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("9fc3fe08")), "16a0ff84fcc156fd5d3ca3a744f20a232d172253", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("b5c1c6f1af")), "fec9deebfcdedaf66dda525e1be43597a73a1f93", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("e47571e5022e")), "8ce051181f0ed5e9d0c498f6bc4caf448d20deb5", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("3e1b28839fb758")), "67da53837d89e03bf652ef09c369a3415937cfd3", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("a81350cbb224cb90")), "305e4ff9888ad855a78573cddf4c5640cce7e946", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("c243d167923dec3ce1")), "5902b77b3265f023f9bbc396ba1a93fa3509bde7", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("50ac18c59d6a37a29bf4")), "fcade5f5d156bf6f9af97bdfa9c19bccfb4ff6ab", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("98e2b611ad3b1cccf634f6")), "1d20fbe00533c10e3cbd6b27088a5de0c632c4b5", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("73fe9afb68e1e8712e5d4eec")), "7e1b7e0f7a8f3455a9c03e9580fd63ae205a2d93", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("9e701ed7d412a9226a2a130e66")), "706f0677146307b20bb0e8d6311e329966884d13", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("6d3ee90413b0a7cbf69e5e6144ca")), "a7241a703aaf0d53fe142f86bf2e849251fa8dff", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("fae24d56514efcb530fd4802f5e71f")), "400f53546916d33ad01a5e6df66822dfbdc4e9e6", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("c5a22dd6eda3fe2bdc4ddb3ce6b35fd1")), "fac8ab93c1ae6c16f0311872b984f729dc928ccd", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("d98cded2adabf08fda356445c781802d95")), "fba6d750c18da58f6e2aab10112b9a5ef3301b3b", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("bcc6d7087a84f00103ccb32e5f5487a751a2")), "29d27c2d44c205c8107f0351b05753ac708226b6", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("36ecacb1055434190dbbc556c48bafcb0feb0d")), "b971bfc1ebd6f359e8d74cb7ecfe7f898d0ba845", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("5ff9edb69e8f6bbd498eb4537580b7fba7ad31d0")), "96d08c430094b9fcc164ad2fb6f72d0a24268f68", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("c95b441d8270822a46a798fae5defcf7b26abace36")), "a287ea752a593d5209e287881a09c49fa3f0beb1", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("83104c1d8a55b28f906f1b72cb53f68cbb097b44f860")), "a06c713779cbd88519ed4a585ac0cb8a5e9d612b", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("755175528d55c39c56493d697b790f099a5ce741f7754b")), "bff7d52c13a3688132a1d407b1ab40f5b5ace298", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("088fc38128bbdb9fd7d65228b3184b3faac6c8715f07272f")), "c7566b91d7b6f56bdfcaa9781a7b6841aacb17e9", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("a4a586eb9245a6c87e3adf1009ac8a49f46c07e14185016895")), "ffa30c0b5c550ea4b1e34f8a60ec9295a1e06ac1", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("8e7c555270c006092c2a3189e2a526b873e2e269f0fb28245256")), "29e66ed23e914351e872aa761df6e4f1a07f4b81", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("a5f3bfa6bb0ba3b59f6b9cbdef8a558ec565e8aa3121f405e7f2f0")), "b28cf5e5b806a01491d41f69bd9248765c5dc292", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("589054f0d2bd3c2c85b466bfd8ce18e6ec3e0b87d944cd093ba36469")), "60224fb72c46069652cd78bcd08029ef64da62f3", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("a0abb12083b5bbc78128601bf1cbdbc0fdf4b862b24d899953d8da0ff3")), "b72c4a86f72608f24c05f3b9088ef92fba431df7", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("82143f4cea6fadbf998e128a8811dc75301cf1db4f079501ea568da68eeb")), "73779ad5d6b71b9b8328ef7220ff12eb167076ac", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("9f1231dd6df1ff7bc0b0d4f989d048672683ce35d956d2f57913046267e6f3")), "a09671d4452d7cf50015c914a1e31973d20cc1a0", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("041c512b5eed791f80d3282f3a28df263bb1df95e1239a7650e5670fc2187919")), "e88cdcd233d99184a6fd260b8fca1b7f7687aee0", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("17e81f6ae8c2e5579d69dafa6e070e7111461552d314b691e7a3e7a4feb3fae418")), "010def22850deb1168d525e8c84c28116cb8a269", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("d15976b23a1d712ad28fad04d805f572026b54dd64961fda94d5355a0cc98620cf77")), "aeaa40ba1717ed5439b1e6ea901b294ba500f9ad", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("09fce4d434f6bd32a44e04b848ff50ec9f642a8a85b37a264dc73f130f22838443328f")), "c6433791238795e34f080a5f1f1723f065463ca0", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("f17af27d776ec82a257d8d46d2b46b639462c56984cc1be9c1222eadb8b26594a25c709d")), "e21e22b89c1bb944a32932e6b2a2f20d491982c3", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("b13ce635d6f8758143ffb114f2f601cb20b6276951416a2f94fbf4ad081779d79f4f195b22")), "575323a9661f5d28387964d2ba6ab92c17d05a8a", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("5498793f60916ff1c918dde572cdea76da8629ba4ead6d065de3dfb48de94d234cc1c5002910")), "feb44494af72f245bfe68e86c4d7986d57c11db7", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("498a1e0b39fa49582ae688cd715c86fbaf8a81b8b11b4d1594c49c902d197c8ba8a621fd6e3be5")), "cff2290b3648ba2831b98dde436a72f9ebf51eee", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("3a36ae71521f9af628b3e34dcb0d4513f84c78ee49f10416a98857150b8b15cb5c83afb4b570376e")), "9b4efe9d27b965905b0c3dab67b8d7c9ebacd56c", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("dcc76b40ae0ea3ba253e92ac50fcde791662c5b6c948538cffc2d95e9de99cac34dfca38910db2678f")), "afedb0ff156205bcd831cbdbda43db8b0588c113", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("5b5ec6ec4fd3ad9c4906f65c747fd4233c11a1736b6b228b92e90cddabb0c7c2fcf9716d3fad261dff33")), "8deb1e858f88293a5e5e4d521a34b2a4efa70fc4", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("df48a37b29b1d6de4e94717d60cdb4293fcf170bba388bddf7a9035a15d433f20fd697c3e4c8b8c5f590ab")), "95cbdac0f74afa69cebd0e5c7defbc6faf0cbeaf", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("1f179b3b82250a65e1b0aee949e218e2f45c7a8dbfd6ba08de05c55acfc226b48c68d7f7057e5675cd96fcfc")), "f0307bcb92842e5ae0cd4f4f14f3df7f877fbef2", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("ee3d72da3a44d971578972a8e6780ce64941267e0f7d0179b214fa97855e1790e888e09fbe3a70412176cb3b54")), "7b13bb0dbf14964bd63b133ac85e22100542ef55", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("d4d4c7843d312b30f610b3682254c8be96d5f6684503f8fbfbcd15774fc1b084d3741afb8d24aaa8ab9c104f7258")), "c314d2b6cf439be678d2a74e890d96cfac1c02ed", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("32c094944f5936a190a0877fb9178a7bf60ceae36fd530671c5b38c5dbd5e6a6c0d615c2ac8ad04b213cc589541cf6")), "4d0be361e410b47a9d67d8ce0bb6a8e01c53c078", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("e5d3180c14bf27a5409fa12b104a8fd7e9639609bfde6ee82bbf9648be2546d29688a65e2e3f3da47a45ac14343c9c02")), "e5353431ffae097f675cbf498869f6fbb6e1c9f2", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("e7b6e4b69f724327e41e1188a37f4fe38b1dba19cbf5a7311d6e32f1038e97ab506ee05aebebc1eed09fc0e357109818b9")), "b8720a7068a085c018ab18961de2765aa6cd9ac4", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("bc880cb83b8ac68ef2fedc2da95e7677ce2aa18b0e2d8b322701f67af7d5e7a0d96e9e33326ccb7747cfff0852b961bfd475")), "b0732181568543ba85f2b6da602b4b065d9931aa", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("235ea9c2ba7af25400f2e98a47a291b0bccdaad63faa2475721fda5510cc7dad814bce8dabb611790a6abe56030b798b75c944")), "9c22674cf3222c3ba921672694aafee4ce67b96b", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("07e3e29fed63104b8410f323b975fd9fba53f636af8c4e68a53fb202ca35dd9ee07cb169ec5186292e44c27e5696a967f5e67709")), "d128335f4cecca9066cdae08958ce656ff0b4cfc", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("65d2a1dd60a517eb27bfbf530cf6a5458f9d5f4730058bd9814379547f34241822bf67e6335a6d8b5ed06abf8841884c636a25733f")), "0b67c57ac578de88a2ae055caeaec8bb9b0085a0", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("dcc86b3bd461615bab739d8daafac231c0f462e819ad29f9f14058f3ab5b75941d4241ea2f17ebb8a458831b37a9b16dead4a76a9b0e")), "c766f912a89d4ccda88e0cce6a713ef5f178b596", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("4627d54f0568dc126b62a8c35fb46a9ac5024400f2995e51635636e1afc4373dbb848eb32df23914230560b82477e9c3572647a7f2bb92")), "9aa3925a9dcb177b15ccff9b78e70cf344858779", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("ba531affd4381168ef24d8b275a84d9254c7f5cc55fded53aa8024b2c5c5c8aa7146fe1d1b83d62b70467e9a2e2cb67b3361830adbab28d7")), "4811fa30042fc076acf37c8e2274d025307e5943", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("8764dcbcf89dcf4282eb644e3d568bdccb4b13508bfa7bfe0ffc05efd1390be22109969262992d377691eb4f77f3d59ea8466a74abf57b2ef4")), "6743018450c9730761ee2b130df9b91c1e118150", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("497d9df9ddb554f3d17870b1a31986c1be277bc44feff713544217a9f579623d18b5ffae306c25a45521d2759a72c0459b58957255ab592f3be4")), "71ad4a19d37d92a5e6ef3694ddbeb5aa61ada645", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("72c3c2e065aefa8d9f7a65229e818176eef05da83f835107ba90ec2e95472e73e538f783b416c04654ba8909f26a12db6e5c4e376b7615e4a25819")), "a7d9dc68dacefb7d6116186048cb355cc548e11d", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("7cc9894454d0055ab5069a33984e2f712bef7e3124960d33559f5f3b81906bb66fe64da13c153ca7f5cabc89667314c32c01036d12ecaf5f9a78de98")), "142e429f0522ba5abf5131fa81df82d355b96909", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("74e8404d5a453c5f4d306f2cfa338ca65501c840ddab3fb82117933483afd6913c56aaf8a0a0a6b2a342fc3d9dc7599f4a850dfa15d06c61966d74ea59")), "ef72db70dcbcab991e9637976c6faf00d22caae9", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("46fe5ed326c8fe376fcc92dc9e2714e2240d3253b105adfbb256ff7a19bc40975c604ad7c0071c4fd78a7cb64786e1bece548fa4833c04065fe593f6fb10")), "f220a7457f4588d639dc21407c942e9843f8e26b", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("836dfa2524d621cf07c3d2908835de859e549d35030433c796b81272fd8bc0348e8ddbc7705a5ad1fdf2155b6bc48884ac0cd376925f069a37849c089c8645")), "ddd2117b6e309c233ede85f962a0c2fc215e5c69", "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary ("7e3a4c325cb9c52b88387f93d01ae86d42098f5efa7f9457388b5e74b6d28b2438d42d8b64703324d4aa25ab6aad153ae30cd2b2af4d5e5c00a8a2d0220c6116")), "a3054427cdb13f164a610b348702724c808a0dcc", "crypt.SHA1 is broken")}; ! ! bundle { // < http://csrc.ncsl.nist.gov/cryptval/ >, long messages ! with fUnit.testSuperStress.data.crypt.testVectors.SHA1LongMsg { ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["1304"].Msg)), ["1304"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["2096"].Msg)), ["2096"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["2888"].Msg)), ["2888"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["3680"].Msg)), ["3680"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["4472"].Msg)), ["4472"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["5264"].Msg)), ["5264"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["6056"].Msg)), ["6056"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["6848"].Msg)), ["6848"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["7640"].Msg)), ["7640"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["8432"].Msg)), ["8432"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["9224"].Msg)), ["9224"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["10016"].Msg)), ["10016"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["10808"].Msg)), ["10808"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["11600"].Msg)), ["11600"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["12392"].Msg)), ["12392"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["13184"].Msg)), ["13184"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["13976"].Msg)), ["13976"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["14768"].Msg)), ["14768"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["15560"].Msg)), ["15560"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["16352"].Msg)), ["16352"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["17144"].Msg)), ["17144"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["17936"].Msg)), ["17936"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["18728"].Msg)), ["18728"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["19520"].Msg)), ["19520"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["20312"].Msg)), ["20312"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["21104"].Msg)), ["21104"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["21896"].Msg)), ["21896"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["22688"].Msg)), ["22688"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["23480"].Msg)), ["23480"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["24272"].Msg)), ["24272"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["25064"].Msg)), ["25064"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["25856"].Msg)), ["25856"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["26648"].Msg)), ["26648"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["27440"].Msg)), ["27440"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["28232"].Msg)), ["28232"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["29024"].Msg)), ["29024"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["29816"].Msg)), ["29816"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["30608"].Msg)), ["30608"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["31400"].Msg)), ["31400"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["32192"].Msg)), ["32192"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["32984"].Msg)), ["32984"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["33776"].Msg)), ["33776"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["34568"].Msg)), ["34568"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["35360"].Msg)), ["35360"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["36152"].Msg)), ["36152"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["36944"].Msg)), ["36944"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["37736"].Msg)), ["37736"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["38528"].Msg)), ["38528"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["39320"].Msg)), ["39320"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["40112"].Msg)), ["40112"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["40904"].Msg)), ["40904"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["41696"].Msg)), ["41696"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["42488"].Msg)), ["42488"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["43280"].Msg)), ["43280"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["44072"].Msg)), ["44072"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["44864"].Msg)), ["44864"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["45656"].Msg)), ["45656"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["46448"].Msg)), ["46448"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["47240"].Msg)), ["47240"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["48032"].Msg)), ["48032"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["48824"].Msg)), ["48824"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["49616"].Msg)), ["49616"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["50408"].Msg)), ["50408"].MD, "crypt.SHA1 is broken"); ! assertEqual (crypt.SHA1 (string.hexStringToBinary (["51200"].Msg)), ["51200"].MD, "crypt.SHA1 is broken")}}}; ! ! bundle { // crypt.hmacSHA1 ! «see < ftp://ftp.rfc-editor.org/in-notes/rfc2104.txt > for test vectors ! ! assertEqual (crypt.hmacSHA1 ("Hi There", string.hexStringToBinary ("0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b")), "b617318655057264e28bc0b6fb378c8ef146be00", "crypt.hmacSHA1 is broken"); ! assertEqual (crypt.hmacSHA1 ("what do ya want for nothing?", "Jefe"), "effcdf6ae5eb2fa2d27416d5f184df9c259a7c79", "crypt.hmacSHA1 is broken"); ! assertEqual (crypt.hmacSHA1 (string.hexStringToBinary ("0xdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"), string.hexStringToBinary ("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")), "125d7342b9ac11cd91a39af48aa17b4f63f175d3", "crypt.hmacSHA1 is broken"); ! assertEqual (crypt.hmacSHA1 (string.hexStringToBinary ("0xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd"), string.hexStringToBinary ("0x0102030405060708090a0b0c0d0e0f10111213141516171819")), "4c9007f4026250c6bc8414f9bf50c86c2d7235da", "crypt.hmacSHA1 is broken"); ! assertEqual (crypt.hmacSHA1 ("Test With Truncation", string.hexStringToBinary ("0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c")), "4c1a03424b55e07fe7f27be1d58bb9324a9a5a04", "crypt.hmacSHA1 is broken"); ! assertEqual (crypt.hmacSHA1 ("Test Using Larger Than Block-Size Key - Hash Key First", string.hexStringToBinary ("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")), "aa4ae5e15272d00e95705637ce8a3b55ed402112", "crypt.hmacSHA1 is broken"); ! assertEqual (crypt.hmacSHA1 ("Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", string.hexStringToBinary ("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")), "e8e99d0f45237d786d6bbaa7965c7808bbff1a91", "crypt.hmacSHA1 is broken")}}; callScript (@fUnit.testSuperStress.testCrypt, {}, @fUnit.contextForTests) \ No newline at end of file |
|
From: creecode <icr...@us...> - 2006-03-13 08:16:17
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6614 Modified Files: testString Log Message: added string.xtext(De/En)code Index: testString =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress/testString,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testString 18 Feb 2006 22:51:11 -0000 1.2 --- testString 13 Mar 2006 08:16:13 -0000 1.3 *************** *** 1,3 **** ! FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testString ! on testString () { Çthe following verbs are not tested by this script: Çstring.memAvailString () Çstring.timeString () Çstring.dateString () local (s, i); bundle { Çstring.isAlpha, etc assert(string.isAlpha('a'), "string.isAlpha is broken."); assert(string.isAlpha('Z'), "string.isAlpha is broken."); assert(!string.isAlpha(' '), "string.isAlpha is broken."); assert(!string.isAlpha('0'), "string.isAlpha is broken."); assert(!string.isAlpha(','), "string.isAlpha is broken."); assert(!string.isNumeric('A'), "string.isNumeric is broken."); assert(!string.isNumeric('Z'), "string.isNumeric is broken."); assert(!string.isNumeric(' '), "string.isNumeric is broken."); assert(string.isNumeric('0'), "string.isNumeric is broken."); assert(!string.isNumeric(','), "string.isNumeric is broken."); assert(!string.isPunctuation('a'), "string.isPunctuation is broken."); assert(!string.isPunctuation('Z'), "string.isPunctuation is broken."); assert(!string.isPunctuation(' '), "string.isPunctuation is broken."); assert(!string.isPunctuation('0'), "string.isPunctuation is broken."); assert(string.isPunctuation(','), "string.isPunctuation is broken.")}; bundle { Çstring.addCommas s = string.addCommas (10249); assertEqual(s, "10,249", "string.addCommas is broken.")}; bundle { Çstring.commentDelete assertEqual(string.commentDelete("helloÇthis is a comment"), "hello", "string.commentDelete is broken"); assertEqual(string.commentDelete("hello//this is a comment"), "hello", "string.commentDelete is broken")}; bundle { Çstring.filledString s = string.filledString ('-', 25); assertEqual(sizeof(s), 25, "string.filledString is broken"); assertEqual(s, "-------------------------", "string.filledString is broken"); for i = 1 to 25 { assertEqual(string.nthChar(s, i), '-', "string.nthChar is broken.")}}; bundle { Çstring.firstSentence assertEqual(string.firstSentence ("Oh the. Buzzing of the. Bees."), "Oh the.", "string.firstSentence is broken")}; bundle { Çthe word verbs ch = string.getWordChar (); assertEqual(ch, ' ', "string.getWordChar didn't return a blank."); string.setWordChar ('#'); assertEqual(string.getWordChar(), '#', "the string word verbs are broken"); assertEqual(string.firstWord("oh#the#buzzing"), "oh", "string.firstWord is broken."); assertEqual(string.lastWord("oh#the#buzzing"), "buzzing", "string.lastWord is broken."); string.setWordChar (ch); Çrestore the old char assertEqual(string.countWords("one two three four five six seven eight"), 8, "string.countWords is broken"); s = "1 2 3 4 5 6 7 8 9"; loop (i = 1; i <= string.countWords (s); i++) { assertEqual(string.nthWord(s, i), i, "string.nthWord is broken.")}}; bundle { Çthe field verbs assertEqual(string.countFields ("oh#the##buzzing", '#'), 4, "string.countFields is broken."); s = "1,,3,,5,,7,,9"; for i = 1 to string.countFields (s, ',') { if i % 2 == 0 { assertEqual(string.nthField (s, ',', i), "", "string.nthField is broken.")} else { assertEqual(string.nthField (s, ',', i), i, "string.nthField is broken.")}}}; bundle { Çstring.upper, lower, length, nthChar s = string.upper ("OhtheBuzzingoftheBees"); assertEqual(string.length (s), sizeof (s), "string.length is broken"); for i = 1 to string.length (s) { ch = string.nthChar (s, i); assert((ch >= 'A') and (ch <= 'Z'), "string.upper is broken.")}; s = string.lower ("OhtheBuzzingoftheBees"); for i = 1 to sizeof (s) { ch = string.nthChar (s, i); assert((ch >= 'a') and (ch <= 'z'), "string.lower is broken.")}}; bundle { Çstring.popLeading, popTrailing s = "ÖÖÖÖxxx"; Çuse extended ascii range assertEqual(string.popLeading (s, 'Ö'), "xxx", "string.popLeading is broken."); assertEqual(string.popTrailing (s, 'x'), "ÖÖÖÖ", "string.popTrailing is broken.")}; bundle { Çstring.hex assertEqual(string.hex (16), "0x0010", "string.hex is broken."); assertEqual(string.hex (10), "0x000A", "string.hex is broken."); assertEqual(string.hex (infinity), "0x7FFFFFFF", "string.hex is broken."); assertEqual(string.hex (-infinity), "0x80000001", "string.hex is broken."); assertEqual(string.hex (33), "0x0021", "string.hex is broken."); assertEqual(string.hex (1000000), "0x000F4240", "string.hex is broken.")}; bundle { Çstring.kBytes assertEqual(string.kBytes (98219), "96K", "string.kBytes is broken.")}; bundle { Çstring.patternMatch assertEqual(string.patternMatch ("a", "abcdefg"), 1, "string.patternMatch is broken."); assertEqual(string.patternMatch ("d", "abcdefg"), 4, "string.patternMatch is broken."); assertEqual(string.patternMatch ("x", "abcdefg"), 0, "string.patternMatch is broken."); assertEqual(string.patternMatch ("def", "abcdefg"), 4, "string.patternMatch is broken.")}; bundle { Çstring.hasSuffix assert(string.hasSuffix (".text", "biography.text"), "string.hasSuffix is broken."); assert(not string.hasSuffix (".data", "biography.text"), "string.hasSuffix is broken.")}; bundle { ÇbeginsWith, contains, endsWith s = "fun with strings"; assert((s beginsWith "fun") and not (s beginsWith "with"), "beginsWith is broken"); assert((s contains "fun") and (s contains "with"), "contains is broken"); assert(not (s endsWith "with") and (s endsWith "strings"), "endsWith is broken")}; bundle { Çstring.mid, insert, delete, replace, replaceAll s = "more fun with strings"; assertEqual(string.mid (s, 10, infinity), "with strings", "string.mid is broken"); assertEqual(string.delete (s, 1, 9), "with strings", "string.delete is broken"); assertEqual(string.delete ("oh the buzzing", 3, 5), "ohbuzzing", "string.delete is broken"); assertEqual(string.insert ("test ", s,15), "more fun with test strings", "string.insert is broken"); assertEqual(string.replace (s, "fun", "???"), "more ??? with strings", "string.replace is broken"); assertEqual(string.replaceAll (s, "i", ""), "more fun wth strngs", "string.replaceAll is broken"); assertEqual(string.replaceAll ("aaa", "a", "bb"), "bbbbbb", "string.replaceAll is broken")}; bundle { Çstrings as arrays s = "strings are arrays or characters"; assertEqual(s [string.length (s)], 's', "string array indexing is broken"); delete (@s [1]); assert(not (s beginsWith 's'), "delete of a string item is broken"); s [2] = 'o'; assertEqual(string.firstWord (s), "toings", "string array assignment is broken")}; bundle { Çescape sequences assertEqual(tab + cr, "\t\r", "escape sequences are broken"); assertEqual(number ('\x1B'), 27, "escape sequences are broken")}}; callScript(@fUnit.testSuperStress.testString, {}, @fUnit.contextForTests) \ No newline at end of file --- 1,150 ---- ! FrontierVcsFile:2:scpt:suites.fUnit.testSuperStress.testString ! on testString () { ! «Changes ! «3/11/06; 9:05:12 PM by TAC ! «added string.xtext(De/En)code ! ! «the following verbs are not tested by this script: ! «string.memAvailString () ! «string.timeString () ! «string.dateString () ! ! local (s, i); ! ! bundle { // string.isAlpha, etc ! assert(string.isAlpha('a'), "string.isAlpha is broken."); ! assert(string.isAlpha('Z'), "string.isAlpha is broken."); ! assert(!string.isAlpha(' '), "string.isAlpha is broken."); ! assert(!string.isAlpha('0'), "string.isAlpha is broken."); ! assert(!string.isAlpha(','), "string.isAlpha is broken."); ! assert(!string.isNumeric('A'), "string.isNumeric is broken."); ! assert(!string.isNumeric('Z'), "string.isNumeric is broken."); ! assert(!string.isNumeric(' '), "string.isNumeric is broken."); ! assert(string.isNumeric('0'), "string.isNumeric is broken."); ! assert(!string.isNumeric(','), "string.isNumeric is broken."); ! assert(!string.isPunctuation('a'), "string.isPunctuation is broken."); ! assert(!string.isPunctuation('Z'), "string.isPunctuation is broken."); ! assert(!string.isPunctuation(' '), "string.isPunctuation is broken."); ! assert(!string.isPunctuation('0'), "string.isPunctuation is broken."); ! assert(string.isPunctuation(','), "string.isPunctuation is broken.")}; ! ! bundle { // string.addCommas ! s = string.addCommas (10249); ! assertEqual(s, "10,249", "string.addCommas is broken.")}; ! ! bundle { // string.commentDelete ! assertEqual(string.commentDelete("hello«this is a comment"), "hello", "string.commentDelete is broken"); ! assertEqual(string.commentDelete("hello//this is a comment"), "hello", "string.commentDelete is broken")}; ! ! bundle { // string.filledString ! s = string.filledString ('-', 25); ! assertEqual(sizeof(s), 25, "string.filledString is broken"); ! assertEqual(s, "-------------------------", "string.filledString is broken"); ! for i = 1 to 25 { ! assertEqual(string.nthChar(s, i), '-', "string.nthChar is broken.")}}; ! ! bundle { // string.firstSentence ! assertEqual(string.firstSentence ("Oh the. Buzzing of the. Bees."), "Oh the.", "string.firstSentence is broken")}; ! ! bundle { // the word verbs ! ch = string.getWordChar (); ! assertEqual(ch, ' ', "string.getWordChar didn't return a blank."); ! string.setWordChar ('#'); ! assertEqual(string.getWordChar(), '#', "the string word verbs are broken"); ! assertEqual(string.firstWord("oh#the#buzzing"), "oh", "string.firstWord is broken."); ! assertEqual(string.lastWord("oh#the#buzzing"), "buzzing", "string.lastWord is broken."); ! string.setWordChar (ch); // restore the old char ! assertEqual(string.countWords("one two three four five six seven eight"), 8, "string.countWords is broken"); ! s = "1 2 3 4 5 6 7 8 9"; ! loop (i = 1; i <= string.countWords (s); i++) { ! assertEqual(string.nthWord(s, i), i, "string.nthWord is broken.")}}; ! ! bundle { // the field verbs ! assertEqual(string.countFields ("oh#the##buzzing", '#'), 4, "string.countFields is broken."); ! s = "1,,3,,5,,7,,9"; ! for i = 1 to string.countFields (s, ',') { ! if i % 2 == 0 { ! assertEqual(string.nthField (s, ',', i), "", "string.nthField is broken.")} ! else { ! assertEqual(string.nthField (s, ',', i), i, "string.nthField is broken.")}}}; ! ! bundle { // string.upper, lower, length, nthChar ! s = string.upper ("OhtheBuzzingoftheBees"); ! assertEqual(string.length (s), sizeof (s), "string.length is broken"); ! for i = 1 to string.length (s) { ! ch = string.nthChar (s, i); ! assert((ch >= 'A') and (ch <= 'Z'), "string.upper is broken.")}; ! s = string.lower ("OhtheBuzzingoftheBees"); ! for i = 1 to sizeof (s) { ! ch = string.nthChar (s, i); ! assert((ch >= 'a') and (ch <= 'z'), "string.lower is broken.")}}; ! ! bundle { // string.popLeading, popTrailing ! s = "÷÷÷÷xxx"; // use extended ascii range ! assertEqual(string.popLeading (s, '÷'), "xxx", "string.popLeading is broken."); ! assertEqual(string.popTrailing (s, 'x'), "÷÷÷÷", "string.popTrailing is broken.")}; ! ! bundle { // string.hex ! assertEqual(string.hex (16), "0x0010", "string.hex is broken."); ! assertEqual(string.hex (10), "0x000A", "string.hex is broken."); ! assertEqual(string.hex (infinity), "0x7FFFFFFF", "string.hex is broken."); ! assertEqual(string.hex (-infinity), "0x80000001", "string.hex is broken."); ! assertEqual(string.hex (33), "0x0021", "string.hex is broken."); ! assertEqual(string.hex (1000000), "0x000F4240", "string.hex is broken.")}; ! ! bundle { // string.kBytes ! assertEqual(string.kBytes (98219), "96K", "string.kBytes is broken.")}; ! ! bundle { // string.patternMatch ! assertEqual(string.patternMatch ("a", "abcdefg"), 1, "string.patternMatch is broken."); ! assertEqual(string.patternMatch ("d", "abcdefg"), 4, "string.patternMatch is broken."); ! assertEqual(string.patternMatch ("x", "abcdefg"), 0, "string.patternMatch is broken."); ! assertEqual(string.patternMatch ("def", "abcdefg"), 4, "string.patternMatch is broken.")}; ! ! bundle { // string.hasSuffix ! assert(string.hasSuffix (".text", "biography.text"), "string.hasSuffix is broken."); ! assert(not string.hasSuffix (".data", "biography.text"), "string.hasSuffix is broken.")}; ! ! bundle { // beginsWith, contains, endsWith ! s = "fun with strings"; ! assert((s beginsWith "fun") and not (s beginsWith "with"), "beginsWith is broken"); ! assert((s contains "fun") and (s contains "with"), "contains is broken"); ! assert(not (s endsWith "with") and (s endsWith "strings"), "endsWith is broken")}; ! ! bundle { // string.mid, insert, delete, replace, replaceAll ! s = "more fun with strings"; ! assertEqual(string.mid (s, 10, infinity), "with strings", "string.mid is broken"); ! assertEqual(string.delete (s, 1, 9), "with strings", "string.delete is broken"); ! assertEqual(string.delete ("oh the buzzing", 3, 5), "ohbuzzing", "string.delete is broken"); ! assertEqual(string.insert ("test ", s,15), "more fun with test strings", "string.insert is broken"); ! assertEqual(string.replace (s, "fun", "???"), "more ??? with strings", "string.replace is broken"); ! assertEqual(string.replaceAll (s, "i", ""), "more fun wth strngs", "string.replaceAll is broken"); ! assertEqual(string.replaceAll ("aaa", "a", "bb"), "bbbbbb", "string.replaceAll is broken")}; ! ! bundle { // strings as arrays ! s = "strings are arrays or characters"; ! assertEqual(s [string.length (s)], 's', "string array indexing is broken"); ! delete (@s [1]); ! assert(not (s beginsWith 's'), "delete of a string item is broken"); ! s [2] = 'o'; ! assertEqual(string.firstWord (s), "toings", "string array assignment is broken")}; ! ! bundle { // escape sequences ! assertEqual(tab + cr, "\t\r", "escape sequences are broken"); ! assertEqual(number ('\x1B'), 27, "escape sequences are broken")}; ! ! bundle { // string.xtext(Encode/Decode) ! bundle { // encoding ! assertEqual (string.xtextEncode ("Hello world"), "Hello+20world", "string.xtextEncode is broken"); ! assertEqual (string.xtextEncode ("Hello+world"), "Hello+2Bworld", "string.xtextEncode is broken"); ! assertEqual (string.xtextEncode ("\x0\x1\x2\x3\x4\x5"), "+00+01+02+03+04+05", "string.xtextEncode is broken"); ! assertEqual (string.xtextEncode ("e=...@ex..."), "e+...@ex...", "string.xtextEncode is broken")}; ! ! bundle { // decoding ! assertEqual (string.xtextDecode ("Hello+20world"), "Hello world", "string.xtextDecode is broken"); ! assertEqual (string.xtextDecode ("Hello+2Bworld"), "Hello+world", "string.xtextDecode is broken"); ! assertEqual (string.xtextDecode ("+00+01+02+03+04+05"), "\x0\x1\x2\x3\x4\x5", "string.xtextDecode is broken"); ! assertEqual (string.xtextDecode ("e+...@ex..."), "e=...@ex...", "string.xtextDecode is broken")}}}; ! ! callScript(@fUnit.testSuperStress.testString, {}, @fUnit.contextForTests) \ No newline at end of file |
|
From: creecode <icr...@us...> - 2006-03-13 08:14:35
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress/data/crypt/testVectors/SHA1LongMsg/8432 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5798 Added Files: MD Log Message: data for SHA1 test vectors --- NEW FILE: MD --- FrontierVcsFile:2:TEXT:suites.fUnit.testSuperStress.data.crypt.testVectors.SHA1LongMsg.["8432"].MD ee976e4ad3cad933b283649eff9ffdb41fcccb18 |
|
From: creecode <icr...@us...> - 2006-03-13 08:14:28
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress/data/crypt/testVectors/SHA1LongMsg/48824 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5778 Added Files: MD Log Message: data for SHA1 test vectors --- NEW FILE: MD --- FrontierVcsFile:2:TEXT:suites.fUnit.testSuperStress.data.crypt.testVectors.SHA1LongMsg.["48824"].MD 6943ed24792e16c0e13bdd1c1a92ea97ed67c0de |
|
From: creecode <icr...@us...> - 2006-03-13 08:14:23
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress/data/crypt/testVectors/SHA1LongMsg/43280 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5748 Added Files: MD Log Message: data for SHA1 test vectors --- NEW FILE: MD --- FrontierVcsFile:2:TEXT:suites.fUnit.testSuperStress.data.crypt.testVectors.SHA1LongMsg.["43280"].MD 79ae813b206659416d28f0ffce61c5360fc186b0 |
|
From: creecode <icr...@us...> - 2006-03-13 08:14:16
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress/data/crypt/testVectors/SHA1LongMsg/29024 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5699 Added Files: MD Log Message: data for SHA1 test vectors --- NEW FILE: MD --- FrontierVcsFile:2:TEXT:suites.fUnit.testSuperStress.data.crypt.testVectors.SHA1LongMsg.["29024"].MD eb444c416dfed22b1c9aba2c4b32daeffa6a5938 |