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: <and...@us...> - 2006-04-09 13:50:42
|
Revision: 1239 Author: andreradke Date: 2006-04-09 06:50:27 -0700 (Sun, 09 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1239&view=rev Log Message: ----------- Removed byteorder.c from VC2K3 and VC2K5 project files, already obsolete. Modified Paths: -------------- Frontier/trunk/build_VC2K3/Frontier.vcproj Frontier/trunk/build_VC2K5/Frontier.vcproj Modified: Frontier/trunk/build_VC2K3/Frontier.vcproj =================================================================== (Binary files differ) Modified: Frontier/trunk/build_VC2K5/Frontier.vcproj =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-09 13:12:12
|
Revision: 1238 Author: andreradke Date: 2006-04-09 06:11:39 -0700 (Sun, 09 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1238&view=rev Log Message: ----------- Moved byte swapping code to byteorder.h from byteorder.c, making the latter obsolete, in order to inline the code for performance. Modified Paths: -------------- Frontier/trunk/Common/headers/byteorder.h Frontier/trunk/Common/source/byteorder.c Frontier/trunk/build_GNU/Makefile Frontier/trunk/build_XCode/Frontier.xcode/project.pbxproj Property Changed: ---------------- Frontier/trunk/Common/headers/byteorder.h Modified: Frontier/trunk/Common/headers/byteorder.h =================================================================== --- Frontier/trunk/Common/headers/byteorder.h 2006-04-09 11:48:40 UTC (rev 1237) +++ Frontier/trunk/Common/headers/byteorder.h 2006-04-09 13:11:39 UTC (rev 1238) @@ -1,77 +1,152 @@ - -/* $Id: $ */ - -/****************************************************************************** - - 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 - -******************************************************************************/ - -#ifndef byteorderinclude -#define byteorderinclude - -/* - 2006-04-08 aradke: determine native byte order and define byte swapping macros -*/ - -#if (defined(WIN32) || defined(__i386) || defined(__i386__)) && !defined(__LITTLE_ENDIAN__) - #define __LITTLE_ENDIAN__ 1 -#endif - - -#if defined(__LITTLE_ENDIAN__) && ((__LITTLE_ENDIAN__ == 1) || !defined (__BIG_ENDIAN__)) - #define conditionallongswap(x) dolongswap(x) - #define conditionalshortswap(x) doshortswap(x) - #define conditionalenumswap(x) doshortswap(x) - #define disklong(x) dolongswap(x) - #define memlong(x) dolongswap(x) - #define diskshort(x) doshortswap(x) - #define memshort(x) doshortswap(x) - #define disktomemshort(x) shortswap(x) - #define disktomemlong(x) longswap(x) - #define memtodiskshort(x) shortswap(x) - #define memtodisklong(x) longswap(x) -#elif defined(__BIG_ENDIAN__) && ((__BIG_ENDIAN__ == 1) || !defined (__LITTLE_ENDIAN__)) - #define conditionallongswap(x) x - #define conditionalshortswap(x) x - #define conditionalenumswap(x) x - #define disklong(x) x - #define memlong(x) x - #define diskshort(x) x - #define memshort(x) x - #define disktomemshort(x) - #define disktomemlong(x) - #define memtodiskshort(x) - #define memtodisklong(x) -#else - #error "Couldn't determine byte order of target architecture, update osincludes.h" -#endif - - -#define longswap(foo) do {foo = dolongswap(foo);} while (0) -#define shortswap(foo) do {foo = doshortswap(foo);} while (0) - - -long dolongswap (long); /* byteorder.c */ -short doshortswap (short); - - -#endif /* byteorderinclude */ + +/* $Id$ */ + +/****************************************************************************** + + 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 + +******************************************************************************/ + +#ifndef byteorderinclude +#define byteorderinclude + +/* + 2006-04-08 aradke: determine native byte order and define byte swapping macros +*/ + +#if (defined(WIN32) || defined(__i386) || defined(__i386__)) && !defined(__LITTLE_ENDIAN__) + #define __LITTLE_ENDIAN__ 1 +#endif + + +#if defined(__LITTLE_ENDIAN__) && ((__LITTLE_ENDIAN__ == 1) || !defined (__BIG_ENDIAN__)) + #define conditionallongswap(x) dolongswap(x) + #define conditionalshortswap(x) doshortswap(x) + #define conditionalenumswap(x) doshortswap(x) + #define disklong(x) dolongswap(x) + #define memlong(x) dolongswap(x) + #define diskshort(x) doshortswap(x) + #define memshort(x) doshortswap(x) + #define disktomemshort(x) shortswap(x) + #define disktomemlong(x) longswap(x) + #define memtodiskshort(x) shortswap(x) + #define memtodisklong(x) longswap(x) +#elif defined(__BIG_ENDIAN__) && ((__BIG_ENDIAN__ == 1) || !defined (__LITTLE_ENDIAN__)) + #define conditionallongswap(x) x + #define conditionalshortswap(x) x + #define conditionalenumswap(x) x + #define disklong(x) x + #define memlong(x) x + #define diskshort(x) x + #define memshort(x) x + #define disktomemshort(x) + #define disktomemlong(x) + #define memtodiskshort(x) + #define memtodisklong(x) +#else + #error "Couldn't determine byte order of target architecture, update osincludes.h" +#endif + + +#define longswap(foo) do {foo = dolongswap(foo);} while (0) +#define shortswap(foo) do {foo = doshortswap(foo);} while (0) + + +#if (defined(TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON == 1) && defined(__GNUC__)) + + /* using system sdk functions from CFByteOrder.h */ + + #define dolongswap(foo) CFSwapInt32(foo) + #define doshortswap(foo) CFSwapInt16(foo) + +#elif (defined(__i386__) && defined(__GNUC__)) + + /* using AT&T x86 assembly code syntax */ + + inline long dolongswap (long foo) { + + __asm__("mov foo,%eax\nbswap %eax\nmov %eax,foo\n"); + + return (foo); + } /*dolongswap*/ + + inline short doshortswap (short foo) { + + __asm__("mov foo,%ax\n mov %al,%bh\nmov %ah,%bl\nmov %bx,foo"); + + return (foo); + } /*doshortswap*/ + +#elif defined(WIN32) + + /* using Intel x86 assembly code syntax */ + + __inline long dolongswap (long foo) { + + _asm + { + mov eax,foo + bswap eax + mov foo,eax + } + + return (foo); + } /*dolongswap*/ + + __inline short doshortswap (short foo) { + + _asm + { + mov ax,foo + mov bh,al + mov bl,ah + mov foo,bx + } + + return (foo); + } /*doshortswap*/ + +#else + + /* portable code using only C operators */ + + inline long dolongswap (long foo) { + + foo = ((((foo) >> 24) & 0x000000ff) + | (((foo) & 0x00ff0000) >> 8) + | (((foo) & 0x0000ff00) << 8) + | (((foo) & 0x000000ff) << 24)); + + return (foo); + } /*dolongswap*/ + + inline short doshortswap (short foo) { + + foo = ((((foo) >> 8) & 0x00ff) + | (((foo) << 8) & 0xff00)); + + return (foo); + } /*doshortswap*/ + +#endif + + +#endif /* byteorderinclude */ Property changes on: Frontier/trunk/Common/headers/byteorder.h ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: Frontier/trunk/Common/source/byteorder.c =================================================================== --- Frontier/trunk/Common/source/byteorder.c 2006-04-09 11:48:40 UTC (rev 1237) +++ Frontier/trunk/Common/source/byteorder.c 2006-04-09 13:11:39 UTC (rev 1238) @@ -30,99 +30,5 @@ #include "byteorder.h" -//#if (defined(TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON == 1)) -//#include <CoreFoundation/CoreFoundation.h> -//#include <CFByteOrder.h> -//#endif - -long dolongswap (long foo) { - - /* - 2006-04-09 aradke: utility function for swapping the byte order - of 32-bit integers from big endian to little endian and vice versa. - */ - -#if (defined(TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON == 1)) - - foo = CFSwapInt32 (foo); - -#elif (defined(__i386__) && defined(__GNUC__)) - - /* - 10.0a5 - TRT - 29 Dec 2004 - GNU by default uses the AT&T assembly code syntax; - MSC/MWERKS uses the Intel assembly code syntax; - some versions of 'gcc' accept -masm=att|intel to - specify which syntax to use; but for those that don't... - */ - __asm__("mov foo,%eax\nbswap %eax\nmov %eax,foo\n"); - -#elif defined(WIN32) /* intel x86 assembler code */ - - _asm - { - mov eax,foo - bswap eax - mov foo,eax - } - -#else /* default implementation using just C operators, should work with all compilers */ - - #pragma warning "Using default implementation of dolongswap, edit byteorder.c to implement faster native implementation" - - foo = ((((foo) >> 24) & 0x000000ff) /* if all else fails, do it the slow way */ - | (((foo) & 0x00ff0000) >> 8) - | (((foo) & 0x0000ff00) << 8) - | (((foo) & 0x000000ff) << 24)); - -#endif - - return (foo); - } /*dolongswap*/ - - -short doshortswap (short foo) { - - /* - 2006-04-09 aradke: utility function for swapping the byte order - of 16-bit integers from big endian to little endian and vice versa. - */ - -#if (defined(TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON == 1)) - - foo = CFSwapInt16 (foo); - -#elif (defined(__i386__) && defined(__GNUC__)) - - /* - 10.0a5 - TRT - 29 Dec 2004 - GNU by default uses the AT&T assembly code syntax; - MSC/MWERKS uses the Intel assembly code syntax; - some versions of 'gcc' accept -masm=att|intel to - specify which syntax to use; but for those that don't... - */ - __asm__("mov foo,%ax\n mov %al,%bh\nmov %ah,%bl\nmov %bx,foo"); - -#elif defined(WIN32) /* intel x86 assembler code */ - - _asm - { - mov ax,foo - mov bh,al - mov bl,ah - mov foo,bx - } - -#else /* default implementation using just C operators, should work with all compilers */ - - #pragma warning "Using default implementation of doshortswap, edit byteorder.c to implement faster native implementation" - - foo = ((((foo) >> 8) & 0x00ff) /* if all else fails, do it the slow way */ - | (((foo) << 8) & 0xff00)); - -#endif - - return (foo); - } /*doshortswap*/ - +/* now empty, code moved to byteorder.h so it can be inlined */ Modified: Frontier/trunk/build_GNU/Makefile =================================================================== --- Frontier/trunk/build_GNU/Makefile 2006-04-09 11:48:40 UTC (rev 1237) +++ Frontier/trunk/build_GNU/Makefile 2006-04-09 13:11:39 UTC (rev 1238) @@ -408,7 +408,8 @@ $(SRCDIR)/Common/Paige/headers/PGERRORS.h \ $(SRCDIR)/Common/headers/frontierdefs.h \ $(SRCDIR)/Common/headers/langmath.h \ - $(SRCDIR)/Common/headers/FastTimes.h + $(SRCDIR)/Common/headers/FastTimes.h \ + $(SRCDIR)/Common/headers/byteorder.h #================================================================================================ # Sources and Objects Definitions Modified: Frontier/trunk/build_XCode/Frontier.xcode/project.pbxproj =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-09 11:48:56
|
Revision: 1237 Author: andreradke Date: 2006-04-09 04:48:40 -0700 (Sun, 09 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1237&view=rev Log Message: ----------- Added byteorder.h and byteorder.c to Xcode 1.5 project file. Modified Paths: -------------- Frontier/trunk/build_XCode/Frontier.xcode/project.pbxproj Modified: Frontier/trunk/build_XCode/Frontier.xcode/project.pbxproj =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-09 11:29:51
|
Revision: 1236 Author: andreradke Date: 2006-04-09 04:28:08 -0700 (Sun, 09 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1236&view=rev Log Message: ----------- Reorganized macros and code for byte swapping in preparation for MacIntel build. The byte swapping macros moved to their own header file, byteorder.h. The byte order swapping code moved to the corresponding byteorder.c. The VC2K3 and VC2K5 projects have been updated to include the new files, the remaining projects will be updated shortly. The byte swapping functions in byteorder.c should now work with all compilers and for all target platforms. Modified Paths: -------------- Frontier/trunk/Common/SystemHeaders/standard.h Frontier/trunk/Common/headers/macconv.h Frontier/trunk/Common/headers/osincludes.h Frontier/trunk/Common/source/cancoon.c Frontier/trunk/Common/source/claylinelayout.c Frontier/trunk/Common/source/db.c Frontier/trunk/Common/source/langexternal.c Frontier/trunk/Common/source/langhash.c Frontier/trunk/Common/source/langhtml.c Frontier/trunk/Common/source/langpack.c Frontier/trunk/Common/source/langregexp.c Frontier/trunk/Common/source/langscan.c Frontier/trunk/Common/source/langtree.c Frontier/trunk/Common/source/langvalue.c Frontier/trunk/Common/source/memory.c Frontier/trunk/Common/source/menupack.c Frontier/trunk/Common/source/odbengine.c Frontier/trunk/Common/source/oplist.c Frontier/trunk/Common/source/oppack.c Frontier/trunk/Common/source/pict.c Frontier/trunk/Common/source/quickdraw.c Frontier/trunk/Common/source/shellsysverbs.c Frontier/trunk/Common/source/strings.c Frontier/trunk/Common/source/tableformats.c Frontier/trunk/Common/source/tablepack.c Frontier/trunk/Common/source/tablestructure.c Frontier/trunk/Common/source/wpengine.c Frontier/trunk/build_VC2K3/Frontier.vcproj Frontier/trunk/build_VC2K5/Frontier.vcproj Added Paths: ----------- Frontier/trunk/Common/headers/byteorder.h Frontier/trunk/Common/source/byteorder.c Modified: Frontier/trunk/Common/SystemHeaders/standard.h =================================================================== --- Frontier/trunk/Common/SystemHeaders/standard.h 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/SystemHeaders/standard.h 2006-04-09 11:28:08 UTC (rev 1236) @@ -40,32 +40,6 @@ #include "FastTimes.h" #endif -#ifdef PACKFLIPPED - #define conditionallongswap(x) dolongswap(x) - #define conditionalshortswap(x) doshortswap(x) - #define conditionalenumswap(x) doshortswap(x) - #define disklong(x) dolongswap(x) - #define memlong(x) dolongswap(x) - #define diskshort(x) doshortswap(x) - #define memshort(x) doshortswap(x) - #define disktomemshort(x) shortswap(x) - #define disktomemlong(x) longswap(x) - #define memtodiskshort(x) shortswap(x) - #define memtodisklong(x) longswap(x) -#else - #define conditionallongswap(x) x - #define conditionalshortswap(x) x - #define conditionalenumswap(x) x - #define disklong(x) x - #define memlong(x) x - #define diskshort(x) x - #define memshort(x) x - #define disktomemshort(x) - #define disktomemlong(x) - #define memtodiskshort(x) - #define memtodisklong(x) -#endif - #include "stringdefs.h" /* embedded string definitions */ #ifndef appletdefsinclude Added: Frontier/trunk/Common/headers/byteorder.h =================================================================== --- Frontier/trunk/Common/headers/byteorder.h (rev 0) +++ Frontier/trunk/Common/headers/byteorder.h 2006-04-09 11:28:08 UTC (rev 1236) @@ -0,0 +1,77 @@ + +/* $Id: $ */ + +/****************************************************************************** + + 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 + +******************************************************************************/ + +#ifndef byteorderinclude +#define byteorderinclude + +/* + 2006-04-08 aradke: determine native byte order and define byte swapping macros +*/ + +#if (defined(WIN32) || defined(__i386) || defined(__i386__)) && !defined(__LITTLE_ENDIAN__) + #define __LITTLE_ENDIAN__ 1 +#endif + + +#if defined(__LITTLE_ENDIAN__) && ((__LITTLE_ENDIAN__ == 1) || !defined (__BIG_ENDIAN__)) + #define conditionallongswap(x) dolongswap(x) + #define conditionalshortswap(x) doshortswap(x) + #define conditionalenumswap(x) doshortswap(x) + #define disklong(x) dolongswap(x) + #define memlong(x) dolongswap(x) + #define diskshort(x) doshortswap(x) + #define memshort(x) doshortswap(x) + #define disktomemshort(x) shortswap(x) + #define disktomemlong(x) longswap(x) + #define memtodiskshort(x) shortswap(x) + #define memtodisklong(x) longswap(x) +#elif defined(__BIG_ENDIAN__) && ((__BIG_ENDIAN__ == 1) || !defined (__LITTLE_ENDIAN__)) + #define conditionallongswap(x) x + #define conditionalshortswap(x) x + #define conditionalenumswap(x) x + #define disklong(x) x + #define memlong(x) x + #define diskshort(x) x + #define memshort(x) x + #define disktomemshort(x) + #define disktomemlong(x) + #define memtodiskshort(x) + #define memtodisklong(x) +#else + #error "Couldn't determine byte order of target architecture, update osincludes.h" +#endif + + +#define longswap(foo) do {foo = dolongswap(foo);} while (0) +#define shortswap(foo) do {foo = doshortswap(foo);} while (0) + + +long dolongswap (long); /* byteorder.c */ +short doshortswap (short); + + +#endif /* byteorderinclude */ Modified: Frontier/trunk/Common/headers/macconv.h =================================================================== --- Frontier/trunk/Common/headers/macconv.h 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/headers/macconv.h 2006-04-09 11:28:08 UTC (rev 1236) @@ -87,60 +87,6 @@ #define HiWord(x) HIWORD(x) -static long dolongswap(long foo) - { -#if defined(__i386__) && defined(__GNUC__) - /* - 10.0a5 - TRT - 29 Dec 2004 - GNU by default uses the AT&T assembly code syntax; - MSC/MWERKS uses the Intel assembly code syntax; - some versions of 'gcc' accept -masm=att|intel to - specify which syntax to use; but for those that don't... - */ - __asm__("mov foo,%eax\nbswap %eax\nmov %eax,foo\n"); -#elif defined(__powerpc__) && defined(__GNUC__) - foo = Endian32_Swap(foo); -#else - _asm - { - mov eax,foo - bswap eax - mov foo,eax - } -#endif - return (foo); - } - -static short doshortswap(short foo) - { -#if defined(__i386__) && defined(__GNUC__) - /* - 10.0a5 - TRT - 29 Dec 2004 - GNU by default uses the AT&T assembly code syntax; - MSC/MWERKS uses the Intel assembly code syntax; - some versions of 'gcc' accept -masm=att|intel to - specify which syntax to use; but for those that don't... - */ - __asm__("mov foo,%ax\n mov %al,%bh\nmov %ah,%bl\nmov %bx,foo"); -#elif defined(__powerpc__) && defined(__GNUC__) - foo = Endian16_Swap(foo); -#else - _asm - { - mov ax,foo - mov bh,al - mov bl,ah - mov foo,bx - } -#endif - return (foo); - } - -#define longswap(foo) do {foo = dolongswap(foo);} while (0) - -#define shortswap(foo) do {foo = doshortswap(foo);} while (0) - - enum { /* Apple event descriptor types */ typeBoolean = 'bool', Modified: Frontier/trunk/Common/headers/osincludes.h =================================================================== --- Frontier/trunk/Common/headers/osincludes.h 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/headers/osincludes.h 2006-04-09 11:28:08 UTC (rev 1236) @@ -307,19 +307,5 @@ #include <string.h> #include <assert.h> -/* - 2006-04-07 aradke: determine native byte order. - checking whether WIN32 is defined is rather crude, - but I haven't found a better way yet. -*/ -#if defined(__LITTLE_ENDIAN__) || defined(WIN32) - #define PACKFLIPPED 1 /* enable little endian / big endian conversion for database file functions */ -#elif defined(__BIG_ENDIAN__) - #undef PACKFLIPPED /* big endian is native database format, no need to convert */ -#else - #error Failed to determine native byte order of target architecture, update osincludes.h -#endif - - #endif /* __osincludes_h__ */ Added: Frontier/trunk/Common/source/byteorder.c =================================================================== --- Frontier/trunk/Common/source/byteorder.c (rev 0) +++ Frontier/trunk/Common/source/byteorder.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -0,0 +1,128 @@ + +/* $Id: $ */ + +/****************************************************************************** + + 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 "byteorder.h" + +//#if (defined(TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON == 1)) +//#include <CoreFoundation/CoreFoundation.h> +//#include <CFByteOrder.h> +//#endif + + +long dolongswap (long foo) { + + /* + 2006-04-09 aradke: utility function for swapping the byte order + of 32-bit integers from big endian to little endian and vice versa. + */ + +#if (defined(TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON == 1)) + + foo = CFSwapInt32 (foo); + +#elif (defined(__i386__) && defined(__GNUC__)) + + /* + 10.0a5 - TRT - 29 Dec 2004 + GNU by default uses the AT&T assembly code syntax; + MSC/MWERKS uses the Intel assembly code syntax; + some versions of 'gcc' accept -masm=att|intel to + specify which syntax to use; but for those that don't... + */ + __asm__("mov foo,%eax\nbswap %eax\nmov %eax,foo\n"); + +#elif defined(WIN32) /* intel x86 assembler code */ + + _asm + { + mov eax,foo + bswap eax + mov foo,eax + } + +#else /* default implementation using just C operators, should work with all compilers */ + + #pragma warning "Using default implementation of dolongswap, edit byteorder.c to implement faster native implementation" + + foo = ((((foo) >> 24) & 0x000000ff) /* if all else fails, do it the slow way */ + | (((foo) & 0x00ff0000) >> 8) + | (((foo) & 0x0000ff00) << 8) + | (((foo) & 0x000000ff) << 24)); + +#endif + + return (foo); + } /*dolongswap*/ + + +short doshortswap (short foo) { + + /* + 2006-04-09 aradke: utility function for swapping the byte order + of 16-bit integers from big endian to little endian and vice versa. + */ + +#if (defined(TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON == 1)) + + foo = CFSwapInt16 (foo); + +#elif (defined(__i386__) && defined(__GNUC__)) + + /* + 10.0a5 - TRT - 29 Dec 2004 + GNU by default uses the AT&T assembly code syntax; + MSC/MWERKS uses the Intel assembly code syntax; + some versions of 'gcc' accept -masm=att|intel to + specify which syntax to use; but for those that don't... + */ + __asm__("mov foo,%ax\n mov %al,%bh\nmov %ah,%bl\nmov %bx,foo"); + +#elif defined(WIN32) /* intel x86 assembler code */ + + _asm + { + mov ax,foo + mov bh,al + mov bl,ah + mov foo,bx + } + +#else /* default implementation using just C operators, should work with all compilers */ + + #pragma warning "Using default implementation of doshortswap, edit byteorder.c to implement faster native implementation" + + foo = ((((foo) >> 8) & 0x00ff) /* if all else fails, do it the slow way */ + | (((foo) << 8) & 0xff00)); + +#endif + + return (foo); + } /*doshortswap*/ + Modified: Frontier/trunk/Common/source/cancoon.c =================================================================== --- Frontier/trunk/Common/source/cancoon.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/cancoon.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -65,6 +65,7 @@ #include "serialnumber.h" #include "WinSockNetEvents.h" /*6.2a14 AR*/ +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ Modified: Frontier/trunk/Common/source/claylinelayout.c =================================================================== --- Frontier/trunk/Common/source/claylinelayout.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/claylinelayout.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -44,6 +44,7 @@ #include "tablestructure.h" #include "claybrowser.h" //#include "clayicons.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ typedef struct tydisklinelayout { Modified: Frontier/trunk/Common/source/db.c =================================================================== --- Frontier/trunk/Common/source/db.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/db.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -39,6 +39,7 @@ #include "db.h" #include "dbinternal.h" #include "ops.h" //6.2b3 AR: for numbertostring +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #include "frontierdebug.h" //6.2b7 AR Modified: Frontier/trunk/Common/source/langexternal.c =================================================================== --- Frontier/trunk/Common/source/langexternal.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langexternal.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -57,9 +57,9 @@ #include "tableformats.h" /*7.0b6 PBS*/ #include "menuverbs.h" /*7.0b6 PBS*/ #include "op.h" /*7.0b6 PBS*/ +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ - /* boolean langexternalload (hdlexternalvariable hvariable, Handle *h) { Modified: Frontier/trunk/Common/source/langhash.c =================================================================== --- Frontier/trunk/Common/source/langhash.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langhash.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -44,6 +44,7 @@ #include "tableverbs.h" #include "oplist.h" #include "timedate.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #if TARGET_API_MAC_CARBON == 1 /*PBS 03/14/02: AE OS X fix.*/ #include "aeutils.h" /*PBS 03/14/02: AE OS X fix.*/ Modified: Frontier/trunk/Common/source/langhtml.c =================================================================== --- Frontier/trunk/Common/source/langhtml.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langhtml.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -65,6 +65,7 @@ #endif #include "tableverbs.h" //6.1b8 AR: we need gettablevalue +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #include "iso8859.c" Modified: Frontier/trunk/Common/source/langpack.c =================================================================== --- Frontier/trunk/Common/source/langpack.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langpack.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -40,6 +40,7 @@ #include "langexternal.h" #include "langsystem7.h" #include "tablestructure.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ Modified: Frontier/trunk/Common/source/langregexp.c =================================================================== --- Frontier/trunk/Common/source/langregexp.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langregexp.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -48,6 +48,7 @@ #include "kernelverbs.h" #include "kernelverbdefs.h" #include "search.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #include "langregexp.h" Modified: Frontier/trunk/Common/source/langscan.c =================================================================== --- Frontier/trunk/Common/source/langscan.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langscan.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -35,10 +35,10 @@ #include "lang.h" #include "langinternal.h" #include "langparser.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ - #define chstartcomment (byte) chcomment #define chendscanstring (byte)0 /*returned when we've run out of text*/ Modified: Frontier/trunk/Common/source/langtree.c =================================================================== --- Frontier/trunk/Common/source/langtree.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langtree.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -33,6 +33,7 @@ #include "lang.h" #include "langinternal.h" #include "tablestructure.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ typedef struct tydisktreenode { Modified: Frontier/trunk/Common/source/langvalue.c =================================================================== --- Frontier/trunk/Common/source/langvalue.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/langvalue.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -56,6 +56,7 @@ #endif #include "timedate.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ Modified: Frontier/trunk/Common/source/memory.c =================================================================== --- Frontier/trunk/Common/source/memory.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/memory.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -33,6 +33,7 @@ #include "ops.h" #include "shellhooks.h" #include "strings.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #define safetycushionsize 0x2800 /*10K*/ @@ -1814,7 +1815,7 @@ *hmerged = nil; /*default return value*/ sizefirsthandle = gethandlesize (h1); - storesizefirsthandle = conditionallongswap (sizefirsthandle); + storesizefirsthandle = disklong (sizefirsthandle); sizesecondhandle = gethandlesize (h2); @@ -1924,9 +1925,7 @@ moveleft (*h, &sizefirsthandle, sizeof (long)); -#ifdef PACKFLIPPED - longswap (sizefirsthandle); -#endif + disktomemlong (sizefirsthandle); ix = sizeof (long); @@ -1978,7 +1977,7 @@ memoryerror (); return (false); - } /*unmergehandles*/ + } /*debugunmergehandles*/ boolean debugnewintarray (char * filename, unsigned long linenumber, unsigned long threadid, short ct, hdlintarray *harray) { @@ -2061,7 +2060,7 @@ *hmerged = nil; /*default return value*/ sizefirsthandle = gethandlesize (h1); - storesizefirsthandle = conditionallongswap (sizefirsthandle); + storesizefirsthandle = disklong (sizefirsthandle); sizesecondhandle = gethandlesize (h2); @@ -2171,9 +2170,7 @@ moveleft (*h, &sizefirsthandle, sizeof (long)); -#ifdef PACKFLIPPED - longswap (sizefirsthandle); -#endif + disktomemlong (sizefirsthandle); ix = sizeof (long); Modified: Frontier/trunk/Common/source/menupack.c =================================================================== --- Frontier/trunk/Common/source/menupack.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/menupack.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -38,6 +38,7 @@ #include "opinternal.h" #include "menueditor.h" #include "menuinternal.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ Modified: Frontier/trunk/Common/source/odbengine.c =================================================================== --- Frontier/trunk/Common/source/odbengine.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/odbengine.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -47,6 +47,7 @@ #include "shellprivate.h" #endif #include "timedate.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ typedef struct tycancoonrecord { /*one of these for every cancoon file that's open*/ Modified: Frontier/trunk/Common/source/oplist.c =================================================================== --- Frontier/trunk/Common/source/oplist.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/oplist.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -34,9 +34,9 @@ #include "op.h" #include "opinternal.h" #include "oplist.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ - /* created 3/20/90 DW: @@ -54,21 +54,6 @@ #define oplistversionnumber 1 -#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) - #define unconditionalshortswap(x) doshortswap(x) - #define unconditionallyswaplong(x) longswap(x) - #define unconditionallyswapshort(x) shortswap(x) -#endif - - typedef struct tylistrecord { struct tyoutlinerecord ** houtline; /*the list is stored in an outline*/ @@ -725,11 +710,11 @@ if (gethandlesize (hpackedoutline) != (long) info.ctoutlinebytes) { //old, unbyteswapped? - unconditionallyswapshort (info.ctitems); + shortswap (info.ctitems); - // unconditionallyswapshort (info.ctitems_hiword); + // shortswap (info.ctitems_hiword); - unconditionallyswaplong (info.ctoutlinebytes); + longswap (info.ctoutlinebytes); info.isrecord = info.flunused; Modified: Frontier/trunk/Common/source/oppack.c =================================================================== --- Frontier/trunk/Common/source/oppack.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/oppack.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -35,10 +35,9 @@ #include "ops.h" #include "op.h" #include "opinternal.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ - - typedef struct tylinetableitem { short flags; Modified: Frontier/trunk/Common/source/pict.c =================================================================== --- Frontier/trunk/Common/source/pict.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/pict.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -43,6 +43,7 @@ #include "process.h" #include "pict.h" #include "timedate.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ Modified: Frontier/trunk/Common/source/quickdraw.c =================================================================== --- Frontier/trunk/Common/source/quickdraw.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/quickdraw.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -44,6 +44,7 @@ #include "quickdraw.h" #include "frontierwindows.h" #include "shell.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #ifdef WIN95VERSION @@ -3029,11 +3030,9 @@ (*r).blue = (*rgbdisk).blue; - #ifdef PACKFLIPPED - shortswap(r->red); - shortswap(r->green); - shortswap(r->blue); - #endif + disktomemshort(r->red); + disktomemshort(r->green); + disktomemshort(r->blue); } /*diskrgbtorgb*/ @@ -3045,11 +3044,9 @@ (*rgbdisk).blue = (short) (*r).blue; - #ifdef PACKFLIPPED - shortswap(rgbdisk->red); - shortswap(rgbdisk->green); - shortswap(rgbdisk->blue); - #endif + memtodiskshort(rgbdisk->red); + memtodiskshort(rgbdisk->green); + memtodiskshort(rgbdisk->blue); } /*rgbtodiskrgb*/ Modified: Frontier/trunk/Common/source/shellsysverbs.c =================================================================== --- Frontier/trunk/Common/source/shellsysverbs.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/shellsysverbs.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -64,6 +64,7 @@ #include "tableverbs.h" //6.1b7 AR: we need gettablevalue #include "tableinternal.h" //6.1b7 AR: we need tablepacktable and tableunpacktable #include "serialnumber.h" //7.1b34 dmb: new isvalidserialnumber verb +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #define systemevents (osMask | activMask) Modified: Frontier/trunk/Common/source/strings.c =================================================================== --- Frontier/trunk/Common/source/strings.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/strings.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -37,6 +37,7 @@ #include "shell.rsrc.h" #include "timedate.h" #include "langinternal.h" /* 2006-02-26 creedon */ +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #define ctparseparams 4 Modified: Frontier/trunk/Common/source/tableformats.c =================================================================== --- Frontier/trunk/Common/source/tableformats.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/tableformats.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -46,6 +46,7 @@ #include "claycallbacks.h" #include "claybrowservalidate.h" #include "timedate.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #define mincolwidth 50 Modified: Frontier/trunk/Common/source/tablepack.c =================================================================== --- Frontier/trunk/Common/source/tablepack.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/tablepack.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -36,6 +36,7 @@ #include "tablestructure.h" #include "tableinternal.h" #include "tableverbs.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ @@ -357,9 +358,7 @@ if (!fl) return (false); -#ifdef PACKFLIPPED - longswap (adr); -#endif + memtodisklong (adr); return (enlargehandle (*hpacked, sizeof (adr), (ptrchar) &adr)); } /*tableverbpack*/ Modified: Frontier/trunk/Common/source/tablestructure.c =================================================================== --- Frontier/trunk/Common/source/tablestructure.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/tablestructure.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -38,6 +38,7 @@ #include "tableinternal.h" #include "tableverbs.h" #include "tablestructure.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ /* @@ -498,9 +499,7 @@ popfromhandle (htmp, sizeof (dbaddress), adr); -#ifdef PACKFLIPPED - longswap (*adr); // un-swap it; tableverbpack swapped it -#endif + disktomemlong (*adr); // un-swap it; tableverbpack swapped it disposehandle (htmp); /*we can get the address from the variable record, below*/ Modified: Frontier/trunk/Common/source/wpengine.c =================================================================== --- Frontier/trunk/Common/source/wpengine.c 2006-04-08 21:23:37 UTC (rev 1235) +++ Frontier/trunk/Common/source/wpengine.c 2006-04-09 11:28:08 UTC (rev 1236) @@ -37,6 +37,7 @@ #include "standard.h" #include "bitmaps.h" +#include "byteorder.h" /* 2006-04-08 aradke: endianness conversion macros */ #include "cursor.h" #include "error.h" #include "font.h" Modified: Frontier/trunk/build_VC2K3/Frontier.vcproj =================================================================== (Binary files differ) Modified: Frontier/trunk/build_VC2K5/Frontier.vcproj =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <dav...@us...> - 2006-04-08 21:23:43
|
Revision: 1235 Author: davidgewirtz Date: 2006-04-08 14:23:37 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1235&view=rev Log Message: ----------- Modified Paths: -------------- Frontier/branches/SQLite/Common/headers/langinternal.h Modified: Frontier/branches/SQLite/Common/headers/langinternal.h =================================================================== --- Frontier/branches/SQLite/Common/headers/langinternal.h 2006-04-08 20:59:05 UTC (rev 1234) +++ Frontier/branches/SQLite/Common/headers/langinternal.h 2006-04-08 21:23:37 UTC (rev 1235) @@ -202,6 +202,8 @@ #define frnonexistantgroupnameerror 160 #define replaceitemerror 161 /* 2005-09-26 creedon */ #define cmdshellnotfounderror 162 /* 2006-03-10 aradke */ +#define sqliteopenerror 163 /* 2006-03-17 gewirtz */ +#define sqlitedberror 164 /* 2006-03-17 gewirtz */ #define langstacklist 137 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <dav...@us...> - 2006-04-08 21:00:00
|
Revision: 1234 Author: davidgewirtz Date: 2006-04-08 13:59:05 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1234&view=rev Log Message: ----------- Updated files post-svn conversion. --DG Modified Paths: -------------- Frontier/branches/SQLite/Common/headers/kernelverbdefs.h Frontier/branches/SQLite/Common/resources/Mac/kernelverbs.r Frontier/branches/SQLite/Common/resources/Win32/WinLand.rc Frontier/branches/SQLite/Common/resources/Win32/kernelverbs.rc Frontier/branches/SQLite/build_VC2K5/Frontier.vcproj Added Paths: ----------- Frontier/branches/SQLite/Common/headers/langsqlite.h Frontier/branches/SQLite/Common/source/langsqlite.c Frontier/branches/SQLite/Common/sqlite3/ Frontier/branches/SQLite/Common/sqlite3/alter.c Frontier/branches/SQLite/Common/sqlite3/analyze.c Frontier/branches/SQLite/Common/sqlite3/attach.c Frontier/branches/SQLite/Common/sqlite3/auth.c Frontier/branches/SQLite/Common/sqlite3/btree.c Frontier/branches/SQLite/Common/sqlite3/btree.h Frontier/branches/SQLite/Common/sqlite3/build.c Frontier/branches/SQLite/Common/sqlite3/callback.c Frontier/branches/SQLite/Common/sqlite3/complete.c Frontier/branches/SQLite/Common/sqlite3/date.c Frontier/branches/SQLite/Common/sqlite3/delete.c Frontier/branches/SQLite/Common/sqlite3/expr.c Frontier/branches/SQLite/Common/sqlite3/func.c Frontier/branches/SQLite/Common/sqlite3/hash.c Frontier/branches/SQLite/Common/sqlite3/hash.h Frontier/branches/SQLite/Common/sqlite3/insert.c Frontier/branches/SQLite/Common/sqlite3/keywordhash.h Frontier/branches/SQLite/Common/sqlite3/legacy.c Frontier/branches/SQLite/Common/sqlite3/main.c Frontier/branches/SQLite/Common/sqlite3/opcodes.c Frontier/branches/SQLite/Common/sqlite3/opcodes.h Frontier/branches/SQLite/Common/sqlite3/os.c Frontier/branches/SQLite/Common/sqlite3/os.h Frontier/branches/SQLite/Common/sqlite3/os_common.h Frontier/branches/SQLite/Common/sqlite3/os_unix.c Frontier/branches/SQLite/Common/sqlite3/os_win.c Frontier/branches/SQLite/Common/sqlite3/pager.c Frontier/branches/SQLite/Common/sqlite3/pager.h Frontier/branches/SQLite/Common/sqlite3/parse.c Frontier/branches/SQLite/Common/sqlite3/parse.h Frontier/branches/SQLite/Common/sqlite3/pragma.c Frontier/branches/SQLite/Common/sqlite3/prepare.c Frontier/branches/SQLite/Common/sqlite3/printf.c Frontier/branches/SQLite/Common/sqlite3/random.c Frontier/branches/SQLite/Common/sqlite3/select.c Frontier/branches/SQLite/Common/sqlite3/shell.c Frontier/branches/SQLite/Common/sqlite3/sqlite3.def Frontier/branches/SQLite/Common/sqlite3/sqlite3.h Frontier/branches/SQLite/Common/sqlite3/sqliteInt.h Frontier/branches/SQLite/Common/sqlite3/table.c Frontier/branches/SQLite/Common/sqlite3/tclsqlite.c Frontier/branches/SQLite/Common/sqlite3/tokenize.c Frontier/branches/SQLite/Common/sqlite3/trigger.c Frontier/branches/SQLite/Common/sqlite3/update.c Frontier/branches/SQLite/Common/sqlite3/utf.c Frontier/branches/SQLite/Common/sqlite3/util.c Frontier/branches/SQLite/Common/sqlite3/vacuum.c Frontier/branches/SQLite/Common/sqlite3/vdbe.c Frontier/branches/SQLite/Common/sqlite3/vdbe.h Frontier/branches/SQLite/Common/sqlite3/vdbeInt.h Frontier/branches/SQLite/Common/sqlite3/vdbeapi.c Frontier/branches/SQLite/Common/sqlite3/vdbeaux.c Frontier/branches/SQLite/Common/sqlite3/vdbefifo.c Frontier/branches/SQLite/Common/sqlite3/vdbemem.c Frontier/branches/SQLite/Common/sqlite3/where.c Modified: Frontier/branches/SQLite/Common/headers/kernelverbdefs.h =================================================================== --- Frontier/branches/SQLite/Common/headers/kernelverbdefs.h 2006-04-08 20:04:23 UTC (rev 1233) +++ Frontier/branches/SQLite/Common/headers/kernelverbdefs.h 2006-04-08 20:59:05 UTC (rev 1234) @@ -51,4 +51,5 @@ #define idregexpverbs 1023 /*2003-04-22 AR: regular expression verbs*/ #define idmathverbs 1024 /*2004-12-29 SMD: extended math verbs*/ #define idcryptverbs 1025 /* 2006-03-07 creedon: crypt verbs */ +#define idsqliteverbs 1026 /* 2006-03-15 gewirtz sqlite verbs */ Added: Frontier/branches/SQLite/Common/headers/langsqlite.h =================================================================== --- Frontier/branches/SQLite/Common/headers/langsqlite.h (rev 0) +++ Frontier/branches/SQLite/Common/headers/langsqlite.h 2006-04-08 20:59:05 UTC (rev 1234) @@ -0,0 +1,41 @@ + +/* $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 */ + Modified: Frontier/branches/SQLite/Common/resources/Mac/kernelverbs.r =================================================================== --- Frontier/branches/SQLite/Common/resources/Mac/kernelverbs.r 2006-04-08 20:04:23 UTC (rev 1233) +++ Frontier/branches/SQLite/Common/resources/Mac/kernelverbs.r 2006-04-08 20:59:05 UTC (rev 1234) @@ -1135,3 +1135,13 @@ } }; +resource 'EFP#' (idsqliteverbs, "sqlite") { /* 2006-03-15 gewirtz sqlite verbs */ + { + "sqlite", false, { + + "open", + "exec", + "close" + } + } +}; Modified: Frontier/branches/SQLite/Common/resources/Win32/WinLand.rc =================================================================== --- Frontier/branches/SQLite/Common/resources/Win32/WinLand.rc 2006-04-08 20:04:23 UTC (rev 1233) +++ Frontier/branches/SQLite/Common/resources/Win32/WinLand.rc 2006-04-08 20:59:05 UTC (rev 1234) @@ -1533,6 +1533,8 @@ 160 Lang_Errors DISCARDABLE BEGIN "Can't execute command because the replacement string contains a non-existant group name at character #^0.\0" END 161 Lang_Errors DISCARDABLE BEGIN "An item named \042^0\042 already exists.\0" END // Replace it or create a duplicate?" /* 2005-09-26 creedon */ 162 Lang_Errors DISCARDABLE BEGIN "Can't run shell command because the shell \042^0\042 was not found.\0" END /* 2006-03-10 aradke */ + 163 Lang_Errors DISCARDABLE BEGIN "Can't open database: ^0.\0" END /* 2006-03-17 gewirtz */ + 164 Lang_Errors DISCARDABLE BEGIN "Database error: ^0.\0" END /* 2006-03-17 gewirtz */ 1 Mac_Errors DISCARDABLE BEGIN "The \042^0\042 folder is full.\0" END 2 Mac_Errors DISCARDABLE BEGIN "The disk is full.\0" END Modified: Frontier/branches/SQLite/Common/resources/Win32/kernelverbs.rc =================================================================== --- Frontier/branches/SQLite/Common/resources/Win32/kernelverbs.rc 2006-04-08 20:04:23 UTC (rev 1233) +++ Frontier/branches/SQLite/Common/resources/Win32/kernelverbs.rc 2006-04-08 20:59:05 UTC (rev 1234) @@ -1073,3 +1073,14 @@ "hmacSHA1\0" END +1026 /* sqliteverbs */ EFP DISCARDABLE + BEGIN + 1, // Number of "blocks" in this resource + "sqlite\0", // Function Processor name + false, // Window required + 3, // Count of verbs + "open\0", + "exec\0", + "close\0" + END + Added: Frontier/branches/SQLite/Common/source/langsqlite.c =================================================================== --- Frontier/branches/SQLite/Common/source/langsqlite.c (rev 0) +++ Frontier/branches/SQLite/Common/source/langsqlite.c 2006-04-08 20:59:05 UTC (rev 1234) @@ -0,0 +1,266 @@ + +/* $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 + +*/ \ No newline at end of file Added: Frontier/branches/SQLite/Common/sqlite3/alter.c =================================================================== --- Frontier/branches/SQLite/Common/sqlite3/alter.c (rev 0) +++ Frontier/branches/SQLite/Common/sqlite3/alter.c 2006-04-08 20:59:05 UTC (rev 1234) @@ -0,0 +1,562 @@ +/* +** 2005 February 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 used to generate VDBE code +** that implements the ALTER TABLE command. +** +** $Id: alter.c,v 1.20 2006/02/09 02:56:03 drh Exp $ +*/ +#include "sqliteInt.h" +#include <ctype.h> + +/* +** The code in this file only exists if we are not omitting the +** ALTER TABLE logic from the build. +*/ +#ifndef SQLITE_OMIT_ALTERTABLE + + +/* +** This function is used by SQL generated to implement the +** ALTER TABLE command. The first argument is the text of a CREATE TABLE or +** CREATE INDEX command. The second is a table name. The table name in +** the CREATE TABLE or CREATE INDEX statement is replaced with the second +** argument and the result returned. Examples: +** +** sqlite_rename_table('CREATE TABLE abc(a, b, c)', 'def') +** -> 'CREATE TABLE def(a, b, c)' +** +** sqlite_rename_table('CREATE INDEX i ON abc(a)', 'def') +** -> 'CREATE INDEX i ON def(a, b, c)' +*/ +static void renameTableFunc( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + unsigned char const *zSql = sqlite3_value_text(argv[0]); + unsigned char const *zTableName = sqlite3_value_text(argv[1]); + + int token; + Token tname; + unsigned char const *zCsr = zSql; + int len = 0; + char *zRet; + + /* The principle used to locate the table name in the CREATE TABLE + ** statement is that the table name is the first token that is immediatedly + ** followed by a left parenthesis - TK_LP. + */ + if( zSql ){ + do { + /* Store the token that zCsr points to in tname. */ + tname.z = zCsr; + tname.n = len; + + /* Advance zCsr to the next token. Store that token type in 'token', + ** and it's length in 'len' (to be used next iteration of this loop). + */ + do { + zCsr += len; + len = sqlite3GetToken(zCsr, &token); + } while( token==TK_SPACE ); + assert( len>0 ); + } while( token!=TK_LP ); + + zRet = sqlite3MPrintf("%.*s%Q%s", tname.z - zSql, zSql, + zTableName, tname.z+tname.n); + sqlite3_result_text(context, zRet, -1, sqlite3FreeX); + } +} + +#ifndef SQLITE_OMIT_TRIGGER +/* This function is used by SQL generated to implement the ALTER TABLE +** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER +** statement. The second is a table name. The table name in the CREATE +** TRIGGER statement is replaced with the second argument and the result +** returned. This is analagous to renameTableFunc() above, except for CREATE +** TRIGGER, not CREATE INDEX and CREATE TABLE. +*/ +static void renameTriggerFunc( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + unsigned char const *zSql = sqlite3_value_text(argv[0]); + unsigned char const *zTableName = sqlite3_value_text(argv[1]); + + int token; + Token tname; + int dist = 3; + unsigned char const *zCsr = zSql; + int len = 0; + char *zRet; + + /* The principle used to locate the table name in the CREATE TRIGGER + ** statement is that the table name is the first token that is immediatedly + ** preceded by either TK_ON or TK_DOT and immediatedly followed by one + ** of TK_WHEN, TK_BEGIN or TK_FOR. + */ + if( zSql ){ + do { + /* Store the token that zCsr points to in tname. */ + tname.z = zCsr; + tname.n = len; + + /* Advance zCsr to the next token. Store that token type in 'token', + ** and it's length in 'len' (to be used next iteration of this loop). + */ + do { + zCsr += len; + len = sqlite3GetToken(zCsr, &token); + }while( token==TK_SPACE ); + assert( len>0 ); + + /* Variable 'dist' stores the number of tokens read since the most + ** recent TK_DOT or TK_ON. This means that when a WHEN, FOR or BEGIN + ** token is read and 'dist' equals 2, the condition stated above + ** to be met. + ** + ** Note that ON cannot be a database, table or column name, so + ** there is no need to worry about syntax like + ** "CREATE TRIGGER ... ON ON.ON BEGIN ..." etc. + */ + dist++; + if( token==TK_DOT || token==TK_ON ){ + dist = 0; + } + } while( dist!=2 || (token!=TK_WHEN && token!=TK_FOR && token!=TK_BEGIN) ); + + /* Variable tname now contains the token that is the old table-name + ** in the CREATE TRIGGER statement. + */ + zRet = sqlite3MPrintf("%.*s%Q%s", tname.z - zSql, zSql, + zTableName, tname.z+tname.n); + sqlite3_result_text(context, zRet, -1, sqlite3FreeX); + } +} +#endif /* !SQLITE_OMIT_TRIGGER */ + +/* +** Register built-in functions used to help implement ALTER TABLE +*/ +void sqlite3AlterFunctions(sqlite3 *db){ + static const struct { + char *zName; + signed char nArg; + void (*xFunc)(sqlite3_context*,int,sqlite3_value **); + } aFuncs[] = { + { "sqlite_rename_table", 2, renameTableFunc}, +#ifndef SQLITE_OMIT_TRIGGER + { "sqlite_rename_trigger", 2, renameTriggerFunc}, +#endif + }; + int i; + + for(i=0; i<sizeof(aFuncs)/sizeof(aFuncs[0]); i++){ + sqlite3CreateFunc(db, aFuncs[i].zName, aFuncs[i].nArg, + SQLITE_UTF8, 0, aFuncs[i].xFunc, 0, 0); + } +} + +/* +** Generate the text of a WHERE expression which can be used to select all +** temporary triggers on table pTab from the sqlite_temp_master table. If +** table pTab has no temporary triggers, or is itself stored in the +** temporary database, NULL is returned. +*/ +static char *whereTempTriggers(Parse *pParse, Table *pTab){ + Trigger *pTrig; + char *zWhere = 0; + char *tmp = 0; + const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */ + + /* If the table is not located in the temp-db (in which case NULL is + ** returned, loop through the tables list of triggers. For each trigger + ** that is not part of the temp-db schema, add a clause to the WHERE + ** expression being built up in zWhere. + */ + if( pTab->pSchema!=pTempSchema ){ + for( pTrig=pTab->pTrigger; pTrig; pTrig=pTrig->pNext ){ + if( pTrig->pSchema==pTempSchema ){ + if( !zWhere ){ + zWhere = sqlite3MPrintf("name=%Q", pTrig->name); + }else{ + tmp = zWhere; + zWhere = sqlite3MPrintf("%s OR name=%Q", zWhere, pTrig->name); + sqliteFree(tmp); + } + } + } + } + return zWhere; +} + +/* +** Generate code to drop and reload the internal representation of table +** pTab from the database, including triggers and temporary triggers. +** Argument zName is the name of the table in the database schema at +** the time the generated code is executed. This can be different from +** pTab->zName if this function is being called to code part of an +** "ALTER TABLE RENAME TO" statement. +*/ +static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){ + Vdbe *v; + char *zWhere; + int iDb; /* Index of database containing pTab */ +#ifndef SQLITE_OMIT_TRIGGER + Trigger *pTrig; +#endif + + v = sqlite3GetVdbe(pParse); + if( !v ) return; + iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema); + assert( iDb>=0 ); + +#ifndef SQLITE_OMIT_TRIGGER + /* Drop any table triggers from the internal schema. */ + for(pTrig=pTab->pTrigger; pTrig; pTrig=pTrig->pNext){ + int iTrigDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema); + assert( iTrigDb==iDb || iTrigDb==1 ); + sqlite3VdbeOp3(v, OP_DropTrigger, iTrigDb, 0, pTrig->name, 0); + } +#endif + + /* Drop the table and index from the internal schema */ + sqlite3VdbeOp3(v, OP_DropTable, iDb, 0, pTab->zName, 0); + + /* Reload the table, index and permanent trigger schemas. */ + zWhere = sqlite3MPrintf("tbl_name=%Q", zName); + if( !zWhere ) return; + sqlite3VdbeOp3(v, OP_ParseSchema, iDb, 0, zWhere, P3_DYNAMIC); + +#ifndef SQLITE_OMIT_TRIGGER + /* Now, if the table is not stored in the temp database, reload any temp + ** triggers. Don't use IN(...) in case SQLITE_OMIT_SUBQUERY is defined. + */ + if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){ + sqlite3VdbeOp3(v, OP_ParseSchema, 1, 0, zWhere, P3_DYNAMIC); + } +#endif +} + +/* +** Generate code to implement the "ALTER TABLE xxx RENAME TO yyy" +** command. +*/ +void sqlite3AlterRenameTable( + Parse *pParse, /* Parser context. */ + SrcList *pSrc, /* The table to rename. */ + Token *pName /* The new table name. */ +){ + int iDb; /* Database that contains the table */ + char *zDb; /* Name of database iDb */ + Table *pTab; /* Table being renamed */ + char *zName = 0; /* NULL-terminated version of pName */ + sqlite3 *db = pParse->db; /* Database connection */ + Vdbe *v; +#ifndef SQLITE_OMIT_TRIGGER + char *zWhere = 0; /* Where clause to locate temp triggers */ +#endif + + if( sqlite3MallocFailed() ) goto exit_rename_table; + assert( pSrc->nSrc==1 ); + + pTab = sqlite3LocateTable(pParse, pSrc->a[0].zName, pSrc->a[0].zDatabase); + if( !pTab ) goto exit_rename_table; + iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema); + zDb = db->aDb[iDb].zName; + + /* Get a NULL terminated version of the new table name. */ + zName = sqlite3NameFromToken(pName); + if( !zName ) goto exit_rename_table; + + /* Check that a table or index named 'zName' does not already exist + ** in database iDb. If so, this is an error. + */ + if( sqlite3FindTable(db, zName, zDb) || sqlite3FindIndex(db, zName, zDb) ){ + sqlite3ErrorMsg(pParse, + "there is already another table or index with this name: %s", zName); + goto exit_rename_table; + } + + /* Make sure it is not a system table being altered, or a reserved name + ** that the table is being renamed to. + */ + if( strlen(pTab->zName)>6 && 0==sqlite3StrNICmp(pTab->zName, "sqlite_", 7) ){ + sqlite3ErrorMsg(pParse, "table %s may not be altered", pTab->zName); + goto exit_rename_table; + } + if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ + goto exit_rename_table; + } + +#ifndef SQLITE_OMIT_AUTHORIZATION + /* Invoke the authorization callback. */ + if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){ + goto exit_rename_table; + } +#endif + + /* Begin a transaction and code the VerifyCookie for database iDb. + ** Then modify the schema cookie (since the ALTER TABLE modifies the + ** schema). + */ + v = sqlite3GetVdbe(pParse); + if( v==0 ){ + goto exit_rename_table; + } + sqlite3BeginWriteOperation(pParse, 0, iDb); + sqlite3ChangeCookie(db, v, iDb); + + /* Modify the sqlite_master table to use the new table name. */ + sqlite3NestedParse(pParse, + "UPDATE %Q.%s SET " +#ifdef SQLITE_OMIT_TRIGGER + "sql = sqlite_rename_table(sql, %Q), " +#else + "sql = CASE " + "WHEN type = 'trigger' THEN sqlite_rename_trigger(sql, %Q)" + "ELSE sqlite_rename_table(sql, %Q) END, " +#endif + "tbl_name = %Q, " + "name = CASE " + "WHEN type='table' THEN %Q " + "WHEN name LIKE 'sqlite_autoindex%%' AND type='index' THEN " + "'sqlite_autoindex_' || %Q || substr(name, %d+18,10) " + "ELSE name END " + "WHERE tbl_name=%Q AND " + "(type='table' OR type='index' OR type='trigger');", + zDb, SCHEMA_TABLE(iDb), zName, zName, zName, +#ifndef SQLITE_OMIT_TRIGGER + zName, +#endif + zName, strlen(pTab->zName), pTab->zName + ); + +#ifndef SQLITE_OMIT_AUTOINCREMENT + /* If the sqlite_sequence table exists in this database, then update + ** it with the new table name. + */ + if( sqlite3FindTable(db, "sqlite_sequence", zDb) ){ + sqlite3NestedParse(pParse, + "UPDATE %Q.sqlite_sequence set name = %Q WHERE name = %Q", + zDb, zName, pTab->zName); + } +#endif + +#ifndef SQLITE_OMIT_TRIGGER + /* If there are TEMP triggers on this table, modify the sqlite_temp_master + ** table. Don't do this if the table being ALTERed is itself located in + ** the temp database. + */ + if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){ + sqlite3NestedParse(pParse, + "UPDATE sqlite_temp_master SET " + "sql = sqlite_rename_trigger(sql, %Q), " + "tbl_name = %Q " + "WHERE %s;", zName, zName, zWhere); + sqliteFree(zWhere); + } +#endif + + /* Drop and reload the internal table schema. */ + reloadTableSchema(pParse, pTab, zName); + +exit_rename_table: + sqlite3SrcListDelete(pSrc); + sqliteFree(zName); +} + + +/* +** This function is called after an "ALTER TABLE ... ADD" statement +** has been parsed. Argument pColDef contains the text of the new +** column definition. +** +** The Table structure pParse->pNewTable was extended to include +** the new column during parsing. +*/ +void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ + Table *pNew; /* Copy of pParse->pNewTable */ + Table *pTab; /* Table being altered */ + int iDb; /* Database number */ + const char *zDb; /* Database name */ + const char *zTab; /* Table name */ + char *zCol; /* Null-terminated column definition */ + Column *pCol; /* The new column */ + Expr *pDflt; /* Default value for the new column */ + + if( pParse->nErr ) return; + pNew = pParse->pNewTable; + assert( pNew ); + + iDb = sqlite3SchemaToIndex(pParse->db, pNew->pSchema); + zDb = pParse->db->aDb[iDb].zName; + zTab = pNew->zName; + pCol = &pNew->aCol[pNew->nCol-1]; + pDflt = pCol->pDflt; + pTab = sqlite3FindTable(pParse->db, zTab, zDb); + assert( pTab ); + +#ifndef SQLITE_OMIT_AUTHORIZATION + /* Invoke the authorization callback. */ + if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){ + return; + } +#endif + + /* If the default value for the new column was specified with a + ** literal NULL, then set pDflt to 0. This simplifies checking + ** for an SQL NULL default below. + */ + if( pDflt && pDflt->op==TK_NULL ){ + pDflt = 0; + } + + /* Check that the new column is not specified as PRIMARY KEY or UNIQUE. + ** If there is a NOT NULL constraint, then the default value for the + ** column must not be NULL. + */ + if( pCol->isPrimKey ){ + sqlite3ErrorMsg(pParse, "Cannot add a PRIMARY KEY column"); + return; + } + if( pNew->pIndex ){ + sqlite3ErrorMsg(pParse, "Cannot add a UNIQUE column"); + return; + } + if( pCol->notNull && !pDflt ){ + sqlite3ErrorMsg(pParse, + "Cannot add a NOT NULL column with default value NULL"); + return; + } + + /* Ensure the default expression is something that sqlite3ValueFromExpr() + ** can handle (i.e. not CURRENT_TIME etc.) + */ + if( pDflt ){ + sqlite3_value *pVal; + if( sqlite3ValueFromExpr(pDflt, SQLITE_UTF8, SQLITE_AFF_NONE, &pVal) ){ + /* malloc() has failed */ + return; + } + if( !pVal ){ + sqlite3ErrorMsg(pParse, "Cannot add a column with non-constant default"); + return; + } + sqlite3ValueFree(pVal); + } + + /* Modify the CREATE TABLE statement. */ + zCol = sqliteStrNDup((char*)pColDef->z, pColDef->n); + if( zCol ){ + char *zEnd = &zCol[pColDef->n-1]; + while( (zEnd>zCol && *zEnd==';') || isspace(*(unsigned char *)zEnd) ){ + *zEnd-- = '\0'; + } + sqlite3NestedParse(pParse, + "UPDATE %Q.%s SET " + "sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d,length(sql)) " + "WHERE type = 'table' AND name = %Q", + zDb, SCHEMA_TABLE(iDb), pNew->addColOffset, zCol, pNew->addColOffset+1, + zTab + ); + sqliteFree(zCol); + } + + /* If the default value of the new column is NULL, then set the file + ** format to 2. If the default value of the new column is not NULL, + ** the file format becomes 3. + */ + sqlite3MinimumFileFormat(pParse, iDb, pDflt ? 3 : 2); + + /* Reload the schema of the modified table. */ + reloadTableSchema(pParse, pTab, pTab->zName); +} + +/* +** This function is called by the parser after the table-name in +** an "ALTER TABLE <table-name> ADD" statement is parsed. Argument +** pSrc is the full-name of the table being altered. +** +** This routine makes a (partial) copy of the Table structure +** for the table being altered and sets Parse.pNewTable to point +** to it. Routines called by the parser as the column definition +** is parsed (i.e. sqlite3AddColumn()) add the new Column data to +** the copy. The copy of the Table structure is deleted by tokenize.c +** after parsing is finished. +** +** Routine sqlite3AlterFinishAddColumn() will be called to complete +** coding the "ALTER TABLE ... ADD" statement. +*/ +void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){ + Table *pNew; + Table *pTab; + Vdbe *v; + int iDb; + int i; + int nAlloc; + + /* Look up the table being altered. */ + assert( pParse->pNewTable==0 ); + if( sqlite3MallocFailed() ) goto exit_begin_add_column; + pTab = sqlite3LocateTable(pParse, pSrc->a[0].zName, pSrc->a[0].zDatabase); + if( !pTab ) goto exit_begin_add_column; + + /* Make sure this is not an attempt to ALTER a view. */ + if( pTab->pSelect ){ + sqlite3ErrorMsg(pParse, "Cannot add a column to a view"); + goto exit_begin_add_column; + } + + assert( pTab->addColOffset>0 ); + iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema); + + /* Put a copy of the Table struct in Parse.pNewTable for the + ** sqlite3AddColumn() function and friends to modify. + */ + pNew = (Table *)sqliteMalloc(sizeof(Table)); + if( !pNew ) goto exit_begin_add_column; + pParse->pNewTable = pNew; + pNew->nRef = 1; + pNew->nCol = pTab->nCol; + assert( pNew->nCol>0 ); + nAlloc = (((pNew->nCol-1)/8)*8)+8; + assert( nAlloc>=pNew->nCol && nAlloc%8==0 && nAlloc-pNew->nCol<8 ); + pNew->aCol = (Column *)sqliteMalloc(sizeof(Column)*nAlloc); + pNew->zName = sqliteStrDup(pTab->zName); + if( !pNew->aCol || !pNew->zName ){ + goto exit_begin_add_column; + } + memcpy(pNew->aCol, pTab->aCol, sizeof(Column)*pNew->nCol); + for(i=0; i<pNew->nCol; i++){ + Column *pCol = &pNew->aCol[i]; + pCol->zName = sqliteStrDup(pCol->zName); + pCol->zColl = 0; + pCol->zType = 0; + pCol->pDflt = 0; + } + pNew->pSchema = pParse->db->aDb[iDb].pSchema; + pNew->addColOffset = pTab->addColOffset; + pNew->nRef = 1; + + /* Begin a transaction and increment the schema cookie. */ + sqlite3BeginWriteOperation(pParse, 0, iDb); + v = sqlite3GetVdbe(pParse); + if( !v ) goto exit_begin_add_column; + sqlite3ChangeCookie(pParse->db, v, iDb); + +exit_begin_add_column: + sqlite3SrcListDelete(pSrc); + return; +} +#endif /* SQLITE_ALTER_TABLE */ Added: Frontier/branches/SQLite/Common/sqlite3/analyze.c =================================================================== --- Frontier/branches/SQLite/Common/sqlite3/analyze.c (rev 0) +++ Frontier/branches/SQLite/Common/sqlite3/analyze.c 2006-04-08 20:59:05 UTC (rev 1234) @@ -0,0 +1,403 @@ +/* +** 2005 July 8 +** +** 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 associated with the ANALYZE command. +** +** @(#) $Id: analyze.c,v 1.16 2006/01/10 17:58:23 danielk1977 Exp $ +*/ +#ifndef SQLITE_OMIT_ANALYZE +#include "sqliteInt.h" + +/* +** This routine generates code that opens the sqlite_stat1 table on cursor +** iStatCur. +** +** If the sqlite_stat1 tables does not previously exist, it is created. +** If it does previously exist, all entires associated with table zWhere +** are removed. If zWhere==0 then all entries are removed. +*/ +static void openStatTable( + Parse *pParse, /* Parsing context */ + int iDb, /* The database we are looking in */ + int iStatCur, /* Open the sqlite_stat1 table on this cursor */ + const char *zWhere /* Delete entries associated with this table */ +){ + sqlite3 *db = pParse->db; + Db *pDb; + int iRootPage; + Table *pStat; + Vdbe *v = sqlite3GetVdbe(pParse); + + pDb = &db->aDb[iDb]; + if( (pStat = sqlite3FindTable(db, "sqlite_stat1", pDb->zName))==0 ){ + /* The sqlite_stat1 tables does not exist. Create it. + ** Note that a side-effect of the CREATE TABLE statement is to leave + ** the rootpage of the new table on the top of the stack. This is + ** important because the OpenWrite opcode below will be needing it. */ + sqlite3NestedParse(pParse, + "CREATE TABLE %Q.sqlite_stat1(tbl,idx,stat)", + pDb->zName + ); + iRootPage = 0; /* Cause rootpage to be taken from top of stack */ + }else if( zWhere ){ + /* The sqlite_stat1 table exists. Delete all entries associated with + ** the table zWhere. */ + sqlite3NestedParse(pParse, + "DELETE FROM %Q.sqlite_stat1 WHERE tbl=%Q", + pDb->zName, zWhere + ); + iRootPage = pStat->tnum; + }else{ + /* The sqlite_stat1 table already exists. Delete all rows. */ + iRootPage = pStat->tnum; + sqlite3VdbeAddOp(v, OP_Clear, pStat->tnum, iDb); + } + + /* Open the sqlite_stat1 table for writing. Unless it was created + ** by this vdbe program, lock it for writing at the shared-cache level. + ** If this vdbe did create the sqlite_stat1 table, then it must have + ** already obtained a schema-lock, making the write-lock redundant. + */ + if( iRootPage>0 ){ + sqlite3TableLock(pParse, iDb, iRootPage, 1, "sqlite_stat1"); + } + sqlite3VdbeAddOp(v, OP_Integer, iDb, 0); + sqlite3VdbeAddOp(v, OP_OpenWrite, iStatCur, iRootPage); + sqlite3VdbeAddOp(v, OP_SetNumColumns, iStatCur, 3); +} + +/* +** Generate code to do an analysis of all indices associated with +** a single table. +*/ +static void analyzeOneTable( + Parse *pParse, /* Parser context */ + Table *pTab, /* Table whose indices are to be analyzed */ + int iStatCur, /* Cursor that writes to the sqlite_stat1 table */ + int iMem /* Available memory locations begin here */ +){ + Index *pIdx; /* An index to being analyzed */ + int iIdxCur; /* Cursor number for index being analyzed */ + int nCol; /* Number of columns in the index */ + Vdbe *v; /* The virtual machine being built up */ + int i; /* Loop counter */ + int topOfLoop; /* The top of the loop */ + int endOfLoop; /* The end of the loop */ + int addr; /* The address of an instruction */ + int iDb; /* Index of database containing pTab */ + + v = sqlite3GetVdbe(pParse); + if( pTab==0 || pTab->pIndex==0 ){ + /* Do no analysis for tables that have no indices */ + return; + } + + iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema); + assert( iDb>=0 ); +#ifndef SQLITE_OMIT_AUTHORIZATION + if( sqlite3AuthCheck(pParse, SQLITE_ANALYZE, pTab->zName, 0, + pParse->db->aDb[iDb].zName ) ){ + return; + } +#endif + + /* Establish a read-lock on the table at the shared-cache level. */ + sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName); + + iIdxCur = pParse->nTab; + for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ + KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx); + + /* Open a cursor to the index to be analyzed + */ + assert( iDb==sqlite3SchemaToIndex(pParse->db, pIdx->pSchema) ); + sqlite3VdbeAddOp(v, OP_Integer, iDb, 0); + VdbeComment((v, "# %s", pIdx->zName)); + sqlite3VdbeOp3(v, OP_OpenRead, iIdxCur, pIdx->tnum, + (char *)pKey, P3_KEYINFO_HANDOFF); + nCol = pIdx->nColumn; + if( iMem+nCol*2>=pParse->nMem ){ + pParse->nMem = iMem+nCol*2+1; + } + sqlite3VdbeAddOp(v, OP_SetNumColumns, iIdxCur, nCol+1); + + /* Memory cells are used as follows: + ** + ** mem[iMem]: The total number of rows in the table. + ** mem[iMem+1]: Number of distinct values in column 1 + ** ... + ** mem[iMem+nCol]: Number of distinct values in column N + ** mem[iMem+nCol+1] Last observed value of column 1 + ** ... + ** mem[iMem+nCol+nCol]: Last observed value of column N + ** + ** Cells iMem through iMem+nCol are initialized to 0. The others + ** are initialized to NULL. + */ + for(i=0; i<=nCol; i++){ + sqlite3VdbeAddOp(v, OP_MemInt, 0, iMem+i); + } + for(i=0; i<nCol; i++){ + sqlite3VdbeAddOp(v, OP_MemNull, iMem+nCol+i+1, 0); + } + + /* Do the analysis. + */ + endOfLoop = sqlite3VdbeMakeLabel(v); + sqlite3VdbeAddOp(v, OP_Rewind, iIdxCur, endOfLoop); + topOfLoop = sqlite3VdbeCurrentAddr(v); + sqlite3VdbeAddOp(v, OP_MemIncr, 1, iMem); + for(i=0; i<nCol; i++){ + sqlite3VdbeAddOp(v, OP_Column, iIdxCur, i); + sqlite3VdbeAddOp(v, OP_MemLoad, iMem+nCol+i+1, 0); + sqlite3VdbeAddOp(v, OP_Ne, 0x100, 0); + } + sqlite3VdbeAddOp(v, OP_Goto, 0, endOfLoop); + for(i=0; i<nCol; i++){ + addr = sqlite3VdbeAddOp(v, OP_MemIncr, 1, iMem+i+1); + sqlite3VdbeChangeP2(v, topOfLoop + 3*i + 3, addr); + sqlite3VdbeAddOp(v, OP_Column, iIdxCur, i); + sqlite3VdbeAddOp(v, OP_MemStore, iMem+nCol+i+1, 1); + } + sqlite3VdbeResolveLabel(v, endOfLoop); + sqlite3VdbeAddOp(v, OP_Next, iIdxCur, topOfLoop); + sqlite3VdbeAddOp(v, OP_Close, iIdxCur, 0); + + /* Store the results. + ** + ** The result is a single row of the sqlite_stmt1 table. The first + ** two columns are the names of the table and index. The third column + ** is a string composed of a list of integer statistics about the + ** index. The first integer in the list is the total number of entires + ** in the index. There is one additional integer in the list for each + ** column of the table. This additional integer is a guess of how many + ** rows of the table the index will select. If D is the count of distinct + ** values and K is the total number of rows, then the integer is computed + ** as: + ** + ** I = (K+D-1)/D + ** + ** If K==0 then no entry is made into the sqlite_stat1 table. + ** If K>0 then it is always the case the D>0 so division by zero + ** is never possible. + */ + sqlite3VdbeAddOp(v, OP_MemLoad, iMem, 0); + addr = sqlite3VdbeAddOp(v, OP_IfNot, 0, 0); + sqlite3VdbeAddOp(v, OP_NewRowid, iStatCur, 0); + sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->zName, 0); + sqlite3VdbeOp3(v, OP_String8, 0, 0, pIdx->zName, 0); + sqlite3VdbeAddOp(v, OP_MemLoad, iMem, 0); + sqlite3VdbeOp3(v, OP_String8, 0, 0, " ", 0); + for(i=0; i<nCol; i++){ + sqlite3VdbeAddOp(v, OP_MemLoad, iMem, 0); + sqlite3VdbeAddOp(v, OP_MemLoad, iMem+i+1, 0); + sqlite3VdbeAddOp(v, OP_Add, 0, 0); + sqlite3VdbeAddOp(v, OP_AddImm, -1, 0); + sqlite3VdbeAddOp(v, OP_MemLoad, iMem+i+1, 0); + sqlite3VdbeAddOp(v, OP_Divide, 0, 0); + sqlite3VdbeAddOp(v, OP_ToInt, 0, 0); + if( i==nCol-1 ){ + sqlite3VdbeAddOp(v, OP_Concat, nCol*2-1, 0); + }else{ + sqlite3VdbeAddOp(v, OP_Dup, 1, 0); + } + } + sqlite3VdbeOp3(v, OP_MakeRecord, 3, 0, "aaa", 0); + sqlite3VdbeAddOp(v, OP_Insert, iStatCur, 0); + sqlite3VdbeJumpHere(v, addr); + } +} + +/* +** Generate code that will cause the most recent index analysis to +** be laoded into internal hash tables where is can be used. +*/ +static void loadAnalysis(Parse *pParse, int iDb){ + Vdbe *v = sqlite3GetVdbe(pParse); + sqlite3VdbeAddOp(v, OP_LoadAnalysis, iDb, 0); +} + +/* +** Generate code that will do an analysis of an entire database +*/ +static void analyzeDatabase(Parse *pParse, int iDb){ + sqlite3 *db = pParse->db; + Schema *pSchema = db->aDb[iDb].pSchema; /* Schema of database iDb */ + HashElem *k; + int iStatCur; + int iMem; + + sqlite3BeginWriteOperation(pParse, 0, iDb); + iStatCur = pParse->nTab++; + openStatTable(pParse, iDb, iStatCur, 0); + iMem = pParse->nMem; + for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){ + Table *pTab = (Table*)sqliteHashData(k); + analyzeOneTable(pParse, pTab, iStatCur, iMem); + } + loadAnalysis(pParse, iDb); +} + +/* +** Generate code that will do an analysis of a single table in +** a database. +*/ +static void analyzeTable(Parse *pParse, Table *pTab){ + int iDb; + int iStatCur; + + assert( pTab!=0 ); + iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema); + sqlite3BeginWriteOperation(pParse, 0, iDb); + iStatCur = pParse->nTab++; + openStatTable(pParse, iDb, iStatCur, pTab->zName); + analyzeOneTable(pParse, pTab, iStatCur, pParse->nMem); + loadAnalysis(pParse, iDb); +} + +/* +** Generate code for the ANALYZE command. The parser calls this routine +** when it recognizes an ANALYZE command. +** +** ANALYZE -- 1 +** ANALYZE <database> -- 2 +** ANALYZE ?<database>.?<tablename> -- 3 +** +** Form 1 causes all indices in all attached databases to be analyzed. +** Form 2 analyzes all indices the single database named. +** Form 3 analyzes all indices associated with the named table. +*/ +void sqlite3Analyze(Parse *pParse, Token *pName1, Token *pName2){ + sqlite3 *db = pParse->db; + int iDb; + int i; + char *z, *zDb; + Table *pTab; + Token *pTableName; + + /* Read the database schema. If an error occurs, leave an error message + ** and code in pParse and return NULL. */ + if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ + return; + } + + if( pName1==0 ){ + /* Form 1: Analyze everything */ + for(i=0; i<db->nDb; i++){ + if( i==1 ) continue; /* Do not analyze the TEMP database */ + analyzeDatabase(pParse, i); + } + }else if( pName2==0 || pName2->n==0 ){ + /* Form 2: Analyze the database or table named */ + iDb = sqlite3FindDb(db, pName1); + if( iDb>=0 ){ + analyzeDatabase(pParse, iDb); + }else{ + z = sqlite3NameFromToken(pName1); + pTab = sqlite3LocateTable(pParse, z, 0); + sqliteFree(z); + if( pTab ){ + analyzeTable(pParse, pTab); + } + } + }else{ + /* Form 3: Analyze the fully qualified table name */ + iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pTableName); + if( iDb>=0 ){ + zDb = db->aDb[iDb].zName; + z = sqlite3NameFromToken(pTableName); + pTab = sqlite3LocateTable(pParse, z, zDb); + sqliteFree(z); + if( pTab ){ + analyzeTable(pParse, pTab); + } + } + } +} + +/* +** Used to pass information from the analyzer reader through to the +** callback routine. +*/ +typedef struct analysisInfo analysisInfo; +struct analysisInfo { + sqlite3 *db; + const char *zDatabase; +}; + +/* +** This callback is invoked once for each index when reading the +** sqlite_stat1 table. +** +** argv[0] = name of the index +** argv[1] = results of analysis - on integer for each column +*/ +static int analysisLoader(void *pData, int argc, char **argv, char **azNotUsed){ + analysisInfo *pInfo = (analysisInfo*)pData; + Index *pIndex; + int i, c; + unsigned int v; + const char *z; + + assert( argc==2 ); + if( argv==0 || argv[0]==0 || argv[1]==0 ){ + return 0; + } + pIndex = sqlite3FindIndex(pInfo->db, argv[0], pInfo->zDatabase); + if( pIndex==0 ){ + return 0; + } + z = argv[1]; + for(i=0; *z && i<=pIndex->nColumn; i++){ + v = 0; + while( (c=z[0])>='0' && c<='9' ){ + v = v*10 + c - '0'; + z++; + } + pIndex->aiRowEst[i] = v; + if( *z==' ' ) z++; + } + return 0; +} + +/* +** Load the content of the sqlite_stat1 table into the index hash tables. +*/ +void sqlite3AnalysisLoad(sqlite3 *db, int iDb){ + analysisInfo sInfo; + HashElem *i; + char *zSql; + + /* Clear any prior statistics */ + for(i=sqliteHashFirst(&db->aDb[iDb].pSchema->idxHash);i;i=sqliteHashNext(i)){ + Index *pIdx = sqliteHashData(i); + sqlite3DefaultRowEst(pIdx); + } + + /* Check to make sure the sqlite_stat1 table existss */ + sInfo.db = db; + sInfo.zDatabase = db->aDb[iDb].zName; + if( sqlite3FindTable(db, "sqlite_stat1", sInfo.zDatabase)==0 ){ + return; + } + + + /* Load new statistics out of the sqlite_stat1 table */ + zSql = sqlite3MPrintf("SELECT idx, stat FROM %Q.sqlite_stat1", + sInfo.zDatabase); + sqlite3SafetyOff(db); + sqlite3_exec(db, zSql, analysisLoader, &sInfo, 0); + sqlite3SafetyOn(db); + sqliteFree(zSql); +} + + +#endif /* SQLITE_OMIT_ANALYZE */ Added: Frontier/branches/SQLite/Common/sqlite3/attach.c =================================================================== --- Frontier/branches/SQLite/Common/sqlite3/attach.c (rev 0) +++ Frontier/branches/SQLite/Common/sqlite3/attach.c 2006-04-08 20:59:05 UTC (rev 1234) @@ -0,0 +1,493 @@ +/* +** 2003 April 6 +** +** 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 used to implement the ATTACH and DETACH commands. +** +** $Id: attach.c,v 1.49 2006/01/24 12:09:18 danielk1977 Exp $ +*/ +#include "sqliteInt.h" + +/* +** Resolve an expression that was part of an ATTACH or DETACH statement. This +** is slightly different from resolving a normal SQL expression, because simple +** identifiers are treated as strings, not possible column names or aliases. +** +** i.e. if the parser sees: +** +** ATTACH DATABASE abc AS def +** +** it treats the two expressions as literal strings 'abc' and 'def' instead of +** looking for columns of the same name. +** +** This only applies to the root node of pExpr, so the statement: +** +** ATTACH DATABASE abc||def AS 'db2' +** +** will fail because neither abc or def can be resolved. +*/ +static int resolveAttachExpr(NameContext *pName, Expr *pExpr) +{ + int rc = SQLITE_OK; + if( pExpr ){ + if( pExpr->op!=TK_ID ){ + rc = sqlite3ExprResolveNames(pName, pExpr); + }else{ + pExpr->op = TK_STRING; + } + } + return rc; +} + +/* +** An SQL user-function registered to do the work of an ATTACH statement. The +** three arguments to the function come directly from an attach statement: +** +** ATTACH DATABASE x AS y KEY z +** +** SELECT sqlite_attach(x, y, z) +** +** If the optional "KEY z" syntax is omitted, an SQL NULL is passed as the +** third argument. +*/ +static void attachFunc( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + int i; + int rc = 0; + sqlite3 *db = sqlite3_user_data(context); + const char *zName; + const char *zFile; + Db *aNew; + char zErr[128]; + char *zErrDyn = 0; + + zFile = (const char *)sqlite3_value_text(argv[0]); + zName = (const char *)sqlite3_value_text(argv[1]); + + /* Check for the following errors: + ** + ** * Too many attached databases, + ** * Transaction currently open + ** * Specified database name already being used. + */ + if( db->nDb>=MAX_ATTACHED+2 ){ + sqlite3_snprintf( + 127, zErr, "too many attached databases - max %d", MAX_ATTACHED + ); + goto attach_error; + } + if( !db->autoCommit ){ + strcpy(zErr, "cannot ATTACH database within transaction"); + goto attach_error; + } + for(i=0; i<db->nDb; i++){ + char *z = db->aDb[i].zName; + if( z && sqlite3StrICmp(z, zName)==0 ){ + sqlite3_snprintf(127, zErr, "database %s is already in use", zName); + goto attach_error; + } + } + + /* Allocate the new entry in the db->aDb[] array and initialise the schema + ** hash tables. + */ + if( db->aDb==db->aDbStatic ){ + aNew = sqliteMalloc( sizeof(db->aDb[0])*3 ); + if( aNew==0 ){ + return; + } + memcpy(aNew, db->aDb, sizeof(db->aDb[0])*2); + }else{ + aNew = sqliteRealloc(db->aDb, sizeof(db->aDb[0])*(db->nDb+1) ); + if( aNew==0 ){ + return; + } + } + db->aDb = aNew; + aNew = &db->aDb[db->nDb++]; + memset(aNew, 0, sizeof(*aNew)); + + /* Open the database file. If the btree is successfully opened, use + ** it to obtain the database schema. At this point the schema may + ** or may not be initialised. + */ + rc = sqlite3BtreeFactory(db, zFile, 0, MAX_PAGES, &aNew->pBt); + if( rc==SQLITE_OK ){ + aNew->pSchema = sqlite3SchemaGet(aNew->pBt); + if( !aNew->pSchema ){ + rc = SQLITE_NOMEM; + }else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){ + strcpy(zErr, + "attached databases must use the same text encoding as main database"); + goto attach_error; + } + } + aNew->zName = sqliteStrDup(zName); + aNew->safety_level = 3; + +#if SQLITE_HAS_CODEC + { + extern int sqlite3CodecAttach(sqlite3*, int, void*, int); + extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*); + int nKey; + char *zKey; + int t = sqlite3_value_type(argv[2]); + switch( t ){ + case SQLITE_INTEGER: + case SQLITE_FLOAT: + zErrDyn = sqliteStrDup("Invalid key value"); + rc = SQLITE_ERROR; + break; + + case SQLITE_TEXT: + case SQLITE_BLOB: + nKey = sqlite3_value_bytes(argv[2]); + zKey = (char *)sqlite3_value_blob(argv[2]); + sqlite3CodecAttach(db, db->nDb-1, zKey, nKey); + break; + + case SQLITE_NULL: + /* No key specified. Use the key from the main database */ + sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey); + sqlite3CodecAttach(db, db->nDb-1, zKey, nKey); + break; + } + } +#endif + + /* If the file was opened successfully, read the schema for the new database. + ** If this fails, or if opening the file failed, then close the file and + ** remove the entry from the db->aDb[] array. i.e. put everything back the way + ** we found it. + */ + if( rc==SQLITE_OK ){ + sqlite3SafetyOn(db); + rc = sqlite3Init(db, &zErrDyn); + sqlite3SafetyOff(db); + } + if( rc ){ + int iDb = db->nDb - 1; + assert( iDb>=2 ); + if( db->aDb[iDb].pBt ){ + sqlite3BtreeClose(db->aDb[iDb].pBt); + db->aDb[iDb].pBt = 0; + db->aDb[iDb].pSchema = 0; + } + sqlite3ResetInternalSchema(db, 0); + db->nDb = iDb; + sqlite3_snprintf(127, zErr, "unable to open database: %s", zFile); + goto attach_error; + } + + return; + +attach_error: + /* Return an error if we get here */ + if( zErrDyn ){ + sqlite3_result_error(context, zErrDyn, -1); + sqliteFree(zErrDyn); + }else{ + zErr[sizeof(zErr)-1] = 0; + sqlite3_result_error(context, zErr, -1); + } +} + +/* +** An SQL user-function registered to do the work of an DETACH statement. The +** three arguments to the function come directly from a detach statement: +** +** DETACH DATABASE x +** +** SELECT sqlite_detach(x) +*/ +static void detachFunc( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + const char *zName = (const char *)sqlite3_value_text(argv[0]); + sqlite3 *db = sqlite3_user_data(context); + int i; + Db *pDb = 0; + char zErr[128]; + + assert(zName); + for(i=0; i<db->nDb; i++){ + pDb = &db->aDb[i]; + if( pDb->pBt==0 ) continue; + if( sqlite3StrICmp(pDb->zName, zName)==0 ) break; + } + + if( i>=db->nDb ){ + sqlite3_snprintf(sizeof(zErr), zErr, "no such database: %s", zName); + goto detach_error; + } + if( i<2 ){ + sqlite3_snprintf(sizeof(zErr), zErr, "cannot detach database %s", zName); + goto detach_error; + } + if( !db->autoCommit ){ + strcpy(zErr, "cannot DETACH database within transaction"); + goto detach_error; + } + + sqlite3BtreeClose(pDb->pBt); + pDb->pBt = 0; + pDb->pSchema = 0; + sqlite3ResetInternalSchema(db, 0); + return; + +detach_error: + sqlite3_result_error(context, zErr, -1); +} + +/* +** This procedure generates VDBE code for a single invocation of either the +** sqlite_detach() or sqlite_attach() SQL user functions. +*/ +static void codeAttach( + Parse *pParse, /* The parser context */ + int type, /* Either SQLITE_ATTACH or SQLITE_DETACH */ + const char *zFunc, /* Either "sqlite_attach" or "sqlite_detach */ + int nFunc, /* Number of args to pass to zFunc */ + Expr *pAuthArg, /* Expression to pass to authorization callback */ + Expr *pFilename, /* Name of database file */ + Expr *pDbname, /* Name of the database to use internally */ + Expr *pKey /* Database key for encryption extension */ +){ + int rc; + NameContext sName; + Vdbe *v; + FuncDef *pFunc; + sqlite3* db = pParse->db; + +#ifndef SQLITE_OMIT_AUTHORIZATION + assert( sqlite3MallocFailed() || pAuthArg ); + if( pAuthArg ){ + char *zAuthArg = sqlite3NameFromToken(&pAuthArg->span); + if( !zAuthArg ){ + goto attach_end; + } + rc = sqlite3AuthCheck(pParse, type, zAuthArg, 0, 0); + sqliteFree(zAuthArg); + if(rc!=SQLITE_OK ){ + goto attach_end; + } + } +#endif /* SQLITE_OMIT_AUTHORIZATION */ + + memset(&sName, 0, sizeof(NameContext)); + sName.pParse = pParse; + + if( + SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) || + SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) || + SQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey)) + ){ + pParse->nErr++; + goto attach_end; + } + + v = sqlite3GetVdbe(pParse); + sqlite3ExprCode(pParse, pFilename); + sqlite3ExprCode(pParse, pDbname); + sqlite3ExprCode(pParse, pKey); + + assert( v || sqlite3MallocFailed() ); + if( v ){ + sqlite3VdbeAddOp(v, OP_Function, 0, nFunc); + pFunc = sqlite3FindFunction(db, zFunc, strlen(zFunc), nFunc, SQLITE_UTF8,0); + sqlite3VdbeChangeP3(v, -1, (char *)pFunc, P3_FUNCDEF); + + /* Code an OP_Expire. For an ATTACH statement, set P1 to true (expire this + ** statement only). For DETACH, s... [truncated message content] |
|
From: <dav...@us...> - 2006-04-08 20:04:36
|
Revision: 1233 Author: davidgewirtz Date: 2006-04-08 13:04:23 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1233&view=rev Log Message: ----------- Updated SQLite development branch after subversion conversion. -- DG Added Paths: ----------- Frontier/branches/SQLite/ Copied: Frontier/branches/SQLite (from rev 1232, Frontier/trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <dav...@us...> - 2006-04-08 20:02:45
|
Revision: 1232 Author: davidgewirtz Date: 2006-04-08 13:02:24 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1232&view=rev Log Message: ----------- Renamed because updating SQLite branch to a version post the Subversion update. It's easier and cleaner to just dump a new branch that's updated for Subversion than to make all the changes locally and upload them. -- DG Added Paths: ----------- Frontier/branches/SQLite_pre_svn/ Removed Paths: ------------- Frontier/branches/SQLite/ Copied: Frontier/branches/SQLite_pre_svn (from rev 1231, Frontier/branches/SQLite) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-08 15:34:45
|
Revision: 1231 Author: andreradke Date: 2006-04-08 08:34:26 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1231&view=rev Log Message: ----------- Updated about window and splash screen to give proper credit to UserLand Software. Modified Paths: -------------- Frontier/trunk/Common/headers/versions.h Frontier/trunk/Common/resources/Mac/SHELL.R Frontier/trunk/Common/resources/Win32/WinLand.rc Frontier/trunk/Common/source/about.c Modified: Frontier/trunk/Common/headers/versions.h =================================================================== --- Frontier/trunk/Common/headers/versions.h 2006-04-07 21:56:23 UTC (rev 1230) +++ Frontier/trunk/Common/headers/versions.h 2006-04-08 15:34:26 UTC (rev 1231) @@ -42,7 +42,7 @@ /* common strings for all targets */ -#define APP_COPYRIGHT_FROM "1992" +#define APP_COPYRIGHT_FROM "2004" #define APP_COPYRIGHT_TILL "2006" @@ -128,6 +128,7 @@ #endif +#define bs_APP_COPYRIGHT2 "\x22" "\xA9 1992-2004 UserLand Software, Inc" #define APP_COPYRIGHT APP_COPYRIGHT_FROM "-" APP_COPYRIGHT_TILL " " APP_COPYRIGHT_HOLDER #define APPNAME_SHORT APPNAME /* 2006-02-04 aradke */ Modified: Frontier/trunk/Common/resources/Mac/SHELL.R =================================================================== --- Frontier/trunk/Common/resources/Mac/SHELL.R 2006-04-07 21:56:23 UTC (rev 1230) +++ Frontier/trunk/Common/resources/Mac/SHELL.R 2006-04-08 15:34:26 UTC (rev 1231) @@ -4017,7 +4017,7 @@ plain, //302, 0, /*7.0b50 PBS: the About window has no buttons*/ - {40, 40, 100, 460}, + {40, 40, 114, 460}, }; resource 'cnfg' (138, "quick script") { Modified: Frontier/trunk/Common/resources/Win32/WinLand.rc =================================================================== --- Frontier/trunk/Common/resources/Win32/WinLand.rc 2006-04-07 21:56:23 UTC (rev 1230) +++ Frontier/trunk/Common/resources/Win32/WinLand.rc 2006-04-08 15:34:26 UTC (rev 1231) @@ -2027,7 +2027,7 @@ size12, plain, 0, - 40L, 40L, 460L, 100L + 40L, 40L, 460L, 114L END /*resource 'cnfg' (138, "quick script") {*/ Modified: Frontier/trunk/Common/source/about.c =================================================================== --- Frontier/trunk/Common/source/about.c 2006-04-07 21:56:23 UTC (rev 1230) +++ Frontier/trunk/Common/source/about.c 2006-04-08 15:34:26 UTC (rev 1231) @@ -151,7 +151,7 @@ #define aboutrectheightStats (aboutvertinset * 2 + aboutvertstart + aboutrowsStats * aboutlineheight + aboutvertgap) -#define aboutrowsNoStats 3 +#define aboutrowsNoStats 4 #define aboutrectheightNoStats (aboutvertinset * 2 + aboutvertstart + aboutrowsNoStats * aboutlineheight + aboutvertgap) @@ -167,6 +167,8 @@ bs_APP_SLOGAN, /* 2006-02-06 aradke: see versions.h */ + bs_APP_COPYRIGHT2, /* 2006-04-08 aradke: see versions.h */ + bs_APP_COPYRIGHT, /* 2006-02-06 aradke: see versions.h */ bs_APP_URL, /* 2006-02-06 aradke: see versions.h */ @@ -200,6 +202,8 @@ sloganitem, + copyright2item, + copyrightitem, urlitem, @@ -724,6 +728,8 @@ #endif setglobalfontsizestyle (geneva, 9, bold); + + rabout.top += max ((aboutrowsNoStats * aboutlineheight - abouticonsize) / 2, 0); rabout.left += abouticonsize; /*2005-01-12 aradke: shorter frontieritem, indent it too*/ @@ -746,6 +752,8 @@ ccdrawfrontiericon (rabout, false); } + ccdrawtextitem (copyright2item, nil, normal, leftjustified); + ccdrawtextitem (copyrightitem, nil, normal, leftjustified); ccdrawurlitem (false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-07 21:56:40
|
Revision: 1230 Author: sethdill Date: 2006-04-07 14:56:23 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1230&view=rev Log Message: ----------- Include Conversant-specific parts in various places Modified Paths: -------------- Frontier/branches/Conversant/Common/headers/kernelverbs.h Frontier/branches/Conversant/Common/headers/versions.h Frontier/branches/Conversant/Common/resources/Mac/kernelverbs.r Frontier/branches/Conversant/Common/resources/Mac/lang.r Frontier/branches/Conversant/Common/resources/Win32/kernelverbs.rc Modified: Frontier/branches/Conversant/Common/headers/kernelverbs.h =================================================================== --- Frontier/branches/Conversant/Common/headers/kernelverbs.h 2006-04-07 21:53:08 UTC (rev 1229) +++ Frontier/branches/Conversant/Common/headers/kernelverbs.h 2006-04-07 21:56:23 UTC (rev 1230) @@ -56,3 +56,8 @@ extern boolean cryptinitverbs (void); /* langcrypt.c */ +#ifdef flconversantverbs + +extern boolean conversantinitverbs (void); /* conversantverbs.c */ + +#endif \ No newline at end of file Modified: Frontier/branches/Conversant/Common/headers/versions.h =================================================================== --- Frontier/branches/Conversant/Common/headers/versions.h 2006-04-07 21:53:08 UTC (rev 1229) +++ Frontier/branches/Conversant/Common/headers/versions.h 2006-04-07 21:56:23 UTC (rev 1230) @@ -42,7 +42,7 @@ /* common strings for all targets */ -#define APP_COPYRIGHT_FROM "1992" +#define APP_COPYRIGHT_FROM "2000" #define APP_COPYRIGHT_TILL "2006" @@ -105,26 +105,26 @@ /* version info for FRONTIER targets */ - #define APPNAME "Frontier" - #define APP_COPYRIGHT_HOLDER "Frontier Kernel Project" + #define APPNAME "Frontier-Conversant" + #define APP_COPYRIGHT_HOLDER "Macrobyte Resources" - #define bs_APP_NAME "\x08" "Frontier" + #define bs_APP_NAME "\x13" "Frontier-Conversant" #define bs_APP_SLOGAN "\x25" "Powerful cross-platform web scripting" - #define bs_APP_COPYRIGHT "\x23" "\xA9 " APP_COPYRIGHT_FROM "-" APP_COPYRIGHT_TILL " Frontier Kernel Project" - #define bs_APP_URL "\x26" "http://frontierkernel.sourceforge.net/" + #define bs_APP_COPYRIGHT "\x1F" "\xA9 " APP_COPYRIGHT_FROM "-" APP_COPYRIGHT_TILL " Macrobyte Resources" + #define bs_APP_URL "\x20" "http://conversant.macrobyte.net/" #define APP_MAJOR_VERSION 10 #define APP_MAJOR_VERSION_BCD 0x10 /* major version in BCD notation */ #define APP_SUB_VERSION 1 - #define APP_MINOR_VERSION 0 + #define APP_MINOR_VERSION 2 #define APP_SUBMINOR_VERSION_BCD 0x10 /* sub and minor version in BCD notation */ #define APP_STAGE_CODE 0x40 /* dev = 0x20, alpha = 0x40, beta = 0x60, final = 0x80 */ #define APP_REVISION_LEVEL 9 /* for non-final releases only */ #define APP_BUILD_NUMBER 9 /* increment by one for every release, final or not */ - #define APP_VERSION_STRING "10.1a9" + #define APP_VERSION_STRING "10.1a9c2" #endif @@ -170,8 +170,9 @@ #define frontier_revision_level 5 /* for non-final releases only */ #define frontier_build_number 5 /* increment by one for every release, final or not */ -#define frontier_version_string "10.1a5" +#define frontier_version_string "10.1a9c2" +#define copyright_year_string "2006" /* OPML Editor version information */ Modified: Frontier/branches/Conversant/Common/resources/Mac/kernelverbs.r =================================================================== --- Frontier/branches/Conversant/Common/resources/Mac/kernelverbs.r 2006-04-07 21:53:08 UTC (rev 1229) +++ Frontier/branches/Conversant/Common/resources/Mac/kernelverbs.r 2006-04-07 21:56:23 UTC (rev 1230) @@ -1135,3 +1135,9 @@ } }; + +#ifdef flconversantverbs + +#include "conversantverbs.r" + +#endif Modified: Frontier/branches/Conversant/Common/resources/Mac/lang.r =================================================================== --- Frontier/branches/Conversant/Common/resources/Mac/lang.r 2006-04-07 21:53:08 UTC (rev 1229) +++ Frontier/branches/Conversant/Common/resources/Mac/lang.r 2006-04-07 21:56:23 UTC (rev 1230) @@ -1049,6 +1049,17 @@ } }; +#ifdef flconversantverbs + +resource 'STR#' (270, "Conversant Errors", purgeable) { + { /* array StringArray: 1 elements */ + /* [1] */ + "Internal error running \"conv.^0\"." + } +}; + +#endif + resource 'DLOG' (259, "notify", purgeable) { {0, 0, 107, 375}, dBoxProc, Modified: Frontier/branches/Conversant/Common/resources/Win32/kernelverbs.rc =================================================================== --- Frontier/branches/Conversant/Common/resources/Win32/kernelverbs.rc 2006-04-07 21:53:08 UTC (rev 1229) +++ Frontier/branches/Conversant/Common/resources/Win32/kernelverbs.rc 2006-04-07 21:56:23 UTC (rev 1230) @@ -1073,3 +1073,4 @@ "hmacSHA1\0" END +#include "conversantverbs.rc" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-07 21:53:15
|
Revision: 1229 Author: sethdill Date: 2006-04-07 14:53:08 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1229&view=rev Log Message: ----------- Set the internal id of the conversant verbs to 1026, until someone else steals that number on trunk as happened with the id for the crypt verbs. :-( Modified Paths: -------------- Frontier/branches/Conversant/Common/headers/kernelverbdefs.h Modified: Frontier/branches/Conversant/Common/headers/kernelverbdefs.h =================================================================== --- Frontier/branches/Conversant/Common/headers/kernelverbdefs.h 2006-04-07 21:52:00 UTC (rev 1228) +++ Frontier/branches/Conversant/Common/headers/kernelverbdefs.h 2006-04-07 21:53:08 UTC (rev 1229) @@ -50,5 +50,5 @@ #define idquicktimeverbs 1022 /*7.0b4 PBS: QuickTime Player window verbs*/ #define idregexpverbs 1023 /*2003-04-22 AR: regular expression verbs*/ #define idmathverbs 1024 /*2004-12-29 SMD: extended math verbs*/ -#define idcryptverbs 1025 /* 2006-03-07 creedon: crypt verbs */ - +#define idcryptverbs 1025 /* 2006-03-07 creedon: crypt verbs */ +#define idconversantverbs 1026 /*2004-12-31 SMD: private, conversant verbs*/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-07 21:52:09
|
Revision: 1228 Author: sethdill Date: 2006-04-07 14:52:00 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1228&view=rev Log Message: ----------- Define flconversantverbs to 1 in order to include them in the build. Modified Paths: -------------- Frontier/branches/Conversant/Common/headers/frontierdefs.h Modified: Frontier/branches/Conversant/Common/headers/frontierdefs.h =================================================================== --- Frontier/branches/Conversant/Common/headers/frontierdefs.h 2006-04-07 21:48:56 UTC (rev 1227) +++ Frontier/branches/Conversant/Common/headers/frontierdefs.h 2006-04-07 21:52:00 UTC (rev 1228) @@ -78,6 +78,7 @@ #define threadverbs 1 #define oplanglists 1 #define flregexpverbs 1 +#define flconversantverbs 1 /* if not defined, conversant won't be built */ #undef lazythis_optimization #undef langexternalfind_optimization #define PASCALSTRINGVERSION 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-07 21:49:07
|
Revision: 1227 Author: sethdill Date: 2006-04-07 14:48:56 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1227&view=rev Log Message: ----------- Initialize the conversant verbs. Modified Paths: -------------- Frontier/branches/Conversant/Common/source/shell.c Modified: Frontier/branches/Conversant/Common/source/shell.c =================================================================== --- Frontier/branches/Conversant/Common/source/shell.c 2006-04-07 21:24:58 UTC (rev 1226) +++ Frontier/branches/Conversant/Common/source/shell.c 2006-04-07 21:48:56 UTC (rev 1227) @@ -1331,6 +1331,15 @@ mathinitverbs (); /*2004-12-30 smd: langmath.c*/ +#ifdef flconversantverbs + #if (flconversantverbs == 1) + + /* 2004-12-31 smd: conversantverbs.c */ + conversantinitverbs (); + + #endif +#endif + dllinitverbs (); /*2004-11-29 aradke: langdll.c*/ cryptinitverbs (); /* 2006-03-07 creedon: langcrypt.c */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-07 21:25:13
|
Revision: 1226 Author: sethdill Date: 2006-04-07 14:24:58 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1226&view=rev Log Message: ----------- Adding Conversant-specific files. I hope this go into my branch... Added Paths: ----------- Frontier/branches/Conversant/Common/headers/conversantverbs.h Frontier/branches/Conversant/Common/resources/Mac/conversantverbs.r Frontier/branches/Conversant/Common/resources/Win32/conversantverbs.rc Frontier/branches/Conversant/Common/source/conversantverbs.c Added: Frontier/branches/Conversant/Common/headers/conversantverbs.h =================================================================== --- Frontier/branches/Conversant/Common/headers/conversantverbs.h (rev 0) +++ Frontier/branches/Conversant/Common/headers/conversantverbs.h 2006-04-07 21:24:58 UTC (rev 1226) @@ -0,0 +1 @@ +/****************************************************************************** Conversant Verbs Conversant-related verbs and functions for the Frontier Kernel Created by Seth Dillingham on 12/31/04. Copyright (C) 2004, 2005, 2006 Macrobyte Resources. 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 ******************************************************************************/ #ifndef conversantinclude #define conversantinclude #define conversanterrorlist 270 #define notimplementederror 1 #define STR_textname ("\x05" "\ttext") #define STR_rezname ("\x09" "\trezdelim") #define STR_macroname ("\x06" "\tmacro") #define STR_paramname ("\x06" "\tparam") #define STR_rezdelim ("\x01" "|") #define STR_macro ("\x05" "macro") #define STR_ifmacro ("\x02" "if") #define STR_elseifmacro ("\x06" "elseif") #define STR_elsemacro ("\x04" "else") #define STR_endifmacro ("\x05" "endif") #define STR_conditional ("\x0b" "conditional") #define STR_endconditional ("\x0f" "end conditional") #define STR_name ("\x04" "name") #define STR_type ("\x04" "type") #define STR_condblock ("\x10" "conditionalBlock") #define STR_macrotype ("\x09" "macroType") #define STR_parenthetical ("\x0d" "parenthetical") #define STR_parameterless ("\x0d" "parameterless") #define STR_attvaluepairs ("\x13" "attributeValuePairs") #define STR_params ("\x06" "params") #define STR_convcompileerror ("\x39" "Error compiling string (^0). Problem seems to be here: ^1") #define STR_nearcharacteroffset ("\x16" " (Near character #^0.)") #define STR_badcharinmacroname ("\x26" "Illegal character found in macro name.") #define STR_badcharinparamname ("\x26" "Illegal character found in param name.") #define STR_badcharunquoted ("\x29" "Illegal character found in unquoted param") #define STR_seekingparamname ("\x19" "Searching for param name.") #define STR_endfoundseekingparamname ("\x33" "Reached end of string while seeking parameter name.") #define STR_missingequalsign ("\x14" "Missing equals sign.") #define STR_badparametervalue ("\x4c" "Bad parameter value. Only macros, resources, and quoted strings are allowed.") #define STR_illegalparamstart ("\x2f" "Illegal start of param value after equals sign.") #define STR_endfoundprocmacro ("\x2d" "Reached end of string while processing macro.") #define STR_endfoundquoteparam ("\x37" "Reached end of string while processing quoted parameter.") #define STR_endfoundrezparam ("\x39" "Reached end of string while processing resource parameter.") #define STR_missingcomma ("\x26" "Missing comma between parameter values") #define STR_extracomma ("\x11" "Found extra comma") typedef enum tyconversanttoken { /* verbs that are processed by conversantverbs.c */ compilestringfunc, cconversantverbs } tyconversanttoken; typedef enum tyconvitemtype { /* types that are found when looking for the next macro or resource */ CONV_NOTYPE, /* no macro or resource was found */ CONV_MACRO, /* macro was found */ CONV_RESOURCE, /* resource was found */ /* types of macros */ CONV_MACROTYPE_NOPARAM, /* regular macro */ CONV_MACROTYPE_COND_IF, /* if macro */ CONV_MACROTYPE_COND_ELSE, /* else macro */ CONV_MACROTYPE_COND_ELSEIF, /* elseif macro */ CONV_MACROTYPE_COND_ENDIF, /* endif macro */ CONV_MACROTYPE_AV, /* attribute-value pairs */ CONV_MACROTYPE_PAREN /* parenthetical macros */ } tyconvitemtype; typedef struct convaddress { /* name and table of an xml item */ long tblsize; hdlhashtable ht; bigstring bs; } convaddress, *ptrconvaddress; /* function declarations */ static void extractstringfromhandle( Handle, long, long, bigstring ); static boolean conv_addrezdelim( hdlhashtable ); static boolean conv_compilemacro( hdlhashtable *, Handle, long *, long, long * ); #endif /* conversantinclude */ \ No newline at end of file Added: Frontier/branches/Conversant/Common/resources/Mac/conversantverbs.r =================================================================== --- Frontier/branches/Conversant/Common/resources/Mac/conversantverbs.r (rev 0) +++ Frontier/branches/Conversant/Common/resources/Mac/conversantverbs.r 2006-04-07 21:24:58 UTC (rev 1226) @@ -0,0 +1,36 @@ +/****************************************************************************** + + Conversant Verbs + + Conversant-related verbs and functions for the Frontier Kernel + + Created by Seth Dillingham on 12/31/04. + + Copyright (C) 2004, 2005, 2006 Macrobyte Resources. + + 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 + +******************************************************************************/ + + +resource 'EFP#' (idconversantverbs, "conv") { /*2004-12-31 SMD: conversant verbs*/ + + { + "conv", false, { + + "compilestring" + } + } +}; Added: Frontier/branches/Conversant/Common/resources/Win32/conversantverbs.rc =================================================================== --- Frontier/branches/Conversant/Common/resources/Win32/conversantverbs.rc (rev 0) +++ Frontier/branches/Conversant/Common/resources/Win32/conversantverbs.rc 2006-04-07 21:24:58 UTC (rev 1226) @@ -0,0 +1,31 @@ + +/****************************************************************************** + + Conversant. + + Copyright (C) 2004, 2005 Macrobyte Resources + + 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 + +******************************************************************************/ + +1026 /*conversantverbs*/ EFP DISCARDABLE + BEGIN + 1, //Number of "blocks" in this resource + "conv\0", //Function Processor name + false, //Window required + 1, //Count of verbs + "compilestring\0" + END Added: Frontier/branches/Conversant/Common/source/conversantverbs.c =================================================================== --- Frontier/branches/Conversant/Common/source/conversantverbs.c (rev 0) +++ Frontier/branches/Conversant/Common/source/conversantverbs.c 2006-04-07 21:24:58 UTC (rev 1226) @@ -0,0 +1,1089 @@ +/****************************************************************************** + + Conversant Verbs + + Conversant-related verbs and functions for the Frontier Kernel + + Created by Seth Dillingham on 12/31/04. + + Copyright (C) 2004, 2005, 2006 Macrobyte Resources. + + 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 + +******************************************************************************/ + +#ifdef flconversantverbs + #if (flconversantverbs==1) + +#include <ctype.h> + +#include "frontier.h" +#include "standard.h" + +#include "error.h" +#include "memory.h" +#include "strings.h" +#include "ops.h" +#include "resources.h" +#include "lang.h" +#include "langinternal.h" +#include "langexternal.h" +#include "langsystem7.h" +#include "tablestructure.h" +#include "tableverbs.h" +#include "kernelverbs.h" +#include "kernelverbdefs.h" +#include "shell.rsrc.h" +#include "conversantverbs.h" + +#define scriptError(act, hsrc, ix, len) do {langparamerrormessage (act, hsrc, ix, len);} while (0) + + +/* report error and position */ +/* "Error compiling string (^0). Problem seems to be here: ^1" + ( extraction of area near ixPos ) */ +static void langparamerrormessage( const bigstring bsaction, const Handle src, const long ixPos, const long slen ) +{ + bigstring bserrmsg, bsactsafe, bsextract; + long extractstart, extractlength; + + copystring( bsaction, bsactsafe ); + + extractstart = max( 1, ixPos - 16 ); + + extractlength = min( 32, slen - extractstart ); + + extractstringfromhandle( src, extractstart, extractlength, bsextract ); + + parsedialogstring( STR_convcompileerror, bsactsafe, bsextract, nil, nil, bserrmsg ); + + langerrormessage( bserrmsg ); +} /*langparamerrormessage*/ + + +static void extractstringfromhandle( const Handle src, const long ixStart, const long length, bigstring dest ) +{ + ptrbyte s = (ptrbyte) *src; + + if ( length > 0 ) + moveleft( &s[ ixStart ], &dest[ 1 ], length ); + + setstringlength( dest, length ); +} + + +static long skipwhitespace( Handle src, long ixpos, long slen ) +{ + ptrbyte s = (ptrbyte) *src; + long ix = ixpos; + + while ( ix <= slen ) + { + if ( ( s[ ix ] == ' ' ) || + ( s[ ix ] == '\t' ) || + ( s[ ix ] == '\r' ) || + ( s[ ix ] == '\n' ) + ) + ix++; + else + return ix; + } + + return ix; +} + + +/* +there are currently just five possible results from this question: + 1. CONV_MACROTYPE_COND_IF + 2. CONV_MACROTYPE_COND_ELSE + 3. CONV_MACROTYPE_COND_ELSEIF + 4. CONV_MACROTYPE_COND_ENDIF + 5. CONV_MACRO +*/ +static short getmacrotypefromname( bigstring macroname ) +{ + if ( equalstrings( STR_ifmacro, macroname ) ) + return ( CONV_MACROTYPE_COND_IF ); + + if ( equalstrings( STR_elseifmacro, macroname ) ) + return ( CONV_MACROTYPE_COND_ELSEIF ); + + if ( equalstrings( STR_elsemacro, macroname ) ) + return ( CONV_MACROTYPE_COND_ELSE ); + + if ( equalstrings( STR_endifmacro, macroname ) ) + return ( CONV_MACROTYPE_COND_ENDIF ); + + return ( CONV_MACRO ); /* all we know from the name is that it's not a conditional */ +} + + +static long nextserialnum( ptrconvaddress adrtbl ) +{ + long ctitems; + + if ( (*adrtbl).tblsize == 0 ) + { + hashcountitems ((*adrtbl).ht, &ctitems); + (*adrtbl).tblsize = ctitems; + } + + return ( ctitems + 1 ); +} + +static void makenewitemname( ptrconvaddress adrtbl, bigstring basename, bigstring deststring ) +{ + long ct = nextserialnum( adrtbl ); + + numbertostring( ct, deststring ); + + while ( stringlength( deststring ) < 4 ) + insertchar( '0', deststring ); + + pushstring( basename, deststring ); +} + +static void getnewplainaddress( hdlhashtable ht, bigstring newname, ptrconvaddress adr ) +{ + (*adr).ht = ht; + + (*adr).tblsize = 0; + + copystring( newname, (*adr).bs ); + /* pushstring( newname, (*adr).bs ); */ +} + +static void getnewitemaddress( hdlhashtable ht, bigstring basename, ptrconvaddress adr ) +{ + (*adr).ht = ht; + + (*adr).tblsize = 0; + + makenewitemname( adr, basename, (*adr).bs ); +} + + +static boolean createsubtable( hdlhashtable parenttable, bigstring newname, ptrconvaddress newtable, boolean flserialname ) +{ + if ( flserialname ) + getnewitemaddress( parenttable, newname, newtable ); + else + getnewplainaddress( parenttable, newname, newtable ); + + if ( !langassignnewtablevalue( (*newtable).ht, (*newtable).bs, &(*newtable).ht ) ) + return ( false ); + + return ( true ); +} + + +static boolean assignchar( ptrconvaddress newitemdest, byte ch ) +{ + if ( !langassigncharvalue( (*newitemdest).ht, (*newitemdest).bs, ch ) ) + return ( false ); + + (*newitemdest).tblsize++; + + return ( true ); +} + +static boolean assignstringhandle( ptrconvaddress newitemdest, Handle newtextvalue ) +{ + if ( !langassigntextvalue( (*newitemdest).ht, (*newitemdest).bs, newtextvalue ) ) + { + disposehandle( newtextvalue ); + return ( false ); + } + + (*newitemdest).tblsize++; + + return ( true ); +} + +static boolean assignstring( ptrconvaddress adrdest, const bigstring itemname, const bigstring itemvalue ) +{ + if ( !langassignstringvalue( (*adrdest).ht, itemname, itemvalue ) ) + return ( false ); + + (*adrdest).tblsize++; + + return ( true ); +} + +static boolean assignstringvalue( ptrconvaddress adrdest, bigstring itemname, bigstring itemvalue ) +{ + tyvaluerecord val; + convaddress adrnewitem; + + getnewitemaddress( (*adrdest).ht, itemname, &adrnewitem ); + + if ( !setstringvalue( itemvalue, &val ) ) + return ( false ); + + if ( !hashtableassign( adrnewitem.ht, adrnewitem.bs, val ) ) + return ( false ); + + exemptfromtmpstack( &val ); + + (*adrdest).tblsize++; + + return ( true ); +} + +static boolean conv_addtextrange( hdlhashtable tbldest, Handle s, long ixStart, long ix ) +{ + Handle htextrange; + convaddress adrnewitem; + + if ( ixStart < ix ) + { + if ( !loadfromhandletohandle( s, &ixStart, ix - ixStart, true, &htextrange ) ) + { + disposehandle( htextrange ); + return ( false ); + } + + getnewitemaddress( tbldest, STR_textname, &adrnewitem ); + + if ( !assignstringhandle( &adrnewitem, htextrange ) ) + { + disposehandle( htextrange ); + return ( false ); + } + } + + return ( true ); +} + + +static boolean parseunquotedstring( const Handle src, long * ixpos, const long slen, const bigstring bsextrachars, bigstring result, const bigstring badcharerr, const boolean flallowpuncs ) +{ + ptrbyte s = (ptrbyte) *src; + long ct = slen; + long ix = *ixpos; + long ixstart = ix; + long i; + char ch; + boolean flfoundend = false; + + while ( ix < ct ) + { + ch = s[ ix ]; + + if ( ( ! isalnum( ch ) ) && + ( ( ( ch != '.' ) && ( ch != '_' ) ) || !flallowpuncs ) /* this line is glad it doesn't have a mirror, it's ugly */ + ) + { + if ( ( ch == ' ' ) || /* these characters all _legally_ end any unquoted string */ + ( ch == '\r' ) || + ( ch == '\n' ) || + ( ch == '\t' ) + ) + { + flfoundend = true; + } + else + { + for ( i = 1; i <= stringlength( bsextrachars ); i++ ) /* check for other legal "endings" */ + { + if ( bsextrachars[ i ] == ch ) + { + flfoundend = true; + break; + } + } + } + + if ( flfoundend ) /* found a legal end of the unquoted string */ + { + extractstringfromhandle( src, ixstart, ix - ixstart, result ); + + *ixpos = ix; + + return ( true ); + } + else /* found an illegal character in an unquoted string */ + { + scriptError( badcharerr, src, ix, ct ); + + return ( false ); + } + } + + ++ix; + } + + *ixpos = ix; + + return ( false ); +} + +static boolean parseunquotedstringparam( ptrconvaddress adrparam, const Handle src, long * ixpos, const long slen ) +{ + bigstring param; + long ixstart = *ixpos; + + if ( !parseunquotedstring( src, ixpos, slen, "\x02,)", param, STR_badcharunquoted, false ) ) + return ( false ); + + if ( !conv_addtextrange( (*adrparam).ht, src, ixstart, *ixpos ) ) + return ( false ); + + return ( true ); +} + + +static boolean getmacroname( const Handle src, long * ixpos, const long slen, bigstring macroname ) +{ + boolean fl; + + fl = parseunquotedstring( src, ixpos, slen, "\x02-(", macroname, STR_badcharinmacroname, true ); + + if ( fl ) + alllower( macroname ); + + return ( fl ); +} + + +static boolean getparamname( Handle src, long * ixpos, long slen, bigstring paramname ) +{ + long ixstart = *ixpos; + + if ( ! parseunquotedstring( src, ixpos, slen, "\x01=", paramname, STR_badcharinparamname, false ) ) + { + if ( *ixpos == ixstart ) /* we ran out of string */ + { + *ixpos = ixstart; + scriptError( STR_endfoundseekingparamname, src, ixstart, slen ); + } + else + scriptError( STR_seekingparamname, src, *ixpos, slen ); /* generic error */ + + return ( false ); + } + + alllower( paramname ); + + return ( true ); +} + + +static boolean parsestringuntilchar( ptrconvaddress adrdest, Handle src, long * ixpos, long slen, long * depth, char ch ) +{ + long ix = *ixpos; + long ct = slen; + ptrbyte s = (ptrbyte) *src; + long ixstart = ix; + boolean flcomplete = false; + + while ( ix < ct ) + { + if ( s[ ix ] == ch ) /* found the ending char */ + { + if ( !conv_addtextrange( (*adrdest).ht, src, ixstart, ix ) ) + break; + + flcomplete = true; + break; + } + else if ( s[ ix ] == '\\' ) + { + if ( ( s[ ix + 1 ] == '\\' ) || ( s[ ix + 1 ] == '"' ) ) /* skip the next char */ + ix++; + } + else if ( s[ ix ] == '<' ) /* macro delim? */ + { + if ( ( ix < slen - 4 ) && + ( s[ ix + 1 ] == '!' ) && + ( s[ ix + 2 ] == '-' ) && + ( s[ ix + 3 ] == '-' ) && + ( s[ ix + 4 ] == '#' ) + ) + { + if ( !conv_addtextrange( (*adrdest).ht, src, ixstart, ix ) ) + break; + + *ixpos = ix += 5; /* move pointer past delim */ + + if ( !conv_compilemacro( &(*adrdest).ht, src, ixpos, slen, depth ) ) + break; + + ix = ixstart = *ixpos; + + continue; /* avoid the increment */ + } + } + else if ( s[ ix ] == '|' ) /* rez delim */ + { + if ( !conv_addtextrange( (*adrdest).ht, src, ixstart, ix ) ) + break; + + if ( !conv_addrezdelim( (*adrdest).ht ) ) + break; + + ixstart = ++ix; + + continue; + } + + ++ix; + } /* while */ + + *ixpos = ix; + + return ( flcomplete ); +} + + +static boolean parsequotedstring( ptrconvaddress adrdest, Handle src, long * ixpos, long slen, long * depth ) +{ + boolean fl; + + fl = parsestringuntilchar( adrdest, src, ixpos, slen, depth, '"' ); + + if ( fl ) + ++(*ixpos); /* increment past the closing quotes */ + else + scriptError( STR_missingequalsign, src, *ixpos, slen ); + + return ( fl ); +} + +static boolean parseresource( ptrconvaddress adrdest, Handle src, long * ixpos, long slen, long * depth ) +{ + boolean fl = true; + + /* add rez delim */ + fl = conv_addrezdelim( (*adrdest).ht ); + + ++(*ixpos); + + if ( fl ) /* pass to general param parser */ + { + fl = parsestringuntilchar( adrdest, src, ixpos, slen, depth, '|' ); + } + + if ( fl ) /* add rez delim */ + { + fl = conv_addrezdelim( (*adrdest).ht ); + + ++(*ixpos); /* increment past the closing resource delim */ + } + + return ( fl ); +} + + +static boolean commaneeded_commafound( boolean * flcommafound, long ctparams ) +{ + if ( *flcommafound ) + { + *flcommafound = false; + return ( true ); + } + + return ( ctparams == 0 ); +} + +/* + parenthetical macros suck. + they're an anachronism in Conversant that will probably never go away + they look like this: <!--#macroname ( "param1", param2, <!--#param3-->, |param4| )--> + + syntax rules: + 1. all white space is optional + 2. white space can appear after the macro name, before the opening paren + 3. white space to either side of any parameter is legal + 4. commas are required between parameters + 5. commas are illegal before the first param and after the last param + 6. parameters come in four fruity flavors: + a. quoted (actually, double-quoted), this is the easy and obvious type, containing anything + (they can even contain escaped double-quotes) + b. unquoted params can contain only letters and numbers + c. macro params can be any legal macro (following the same syntax rules as all other macros) + d. resource params are identical to string params, except the delimiter is the vertical pipe + (also, resource params are evaluated as resources by the macro processor) + resource params can not contain escaped resource delimiters. Wrap the param in quotes, instead. +*/ +static boolean conv_parseparentheticalmacro( ptrconvaddress adrparams, Handle src, long * ixpos, long slen, long * depth ) +{ + convaddress adrparam; + long ix; + long ixstart; + long ct = slen; + long ixmacrostart; + long ctparams = 0; + boolean flcommafound = false; + boolean flmacrocomplete = false; + ptrbyte s = (ptrbyte) *src; + + ixmacrostart = ixstart = ix = *ixpos; + + while ( ix < ct ) + { + *ixpos = ix = skipwhitespace( src, ix, slen ); + + if ( s[ ix ] == ')' ) /* end of macro */ + { + if ( flcommafound ) + { + scriptError( STR_extracomma, src, *ixpos, slen ); + + return ( false ); + } + + *ixpos = skipwhitespace( src, ++ix, slen ); /* move past the closing parens, we're done */ + + flmacrocomplete = true; + + break; + } + + /* set up the new subtable for the param */ + if ( !createsubtable( (*adrparams).ht, STR_paramname, &adrparam, true ) ) + break; + + if ( s[ ix ] == '<' ) /* macro param */ + { + if ( !commaneeded_commafound( &flcommafound, ctparams ) ) + { + scriptError( STR_missingcomma, src, ix, slen ); + + return ( false ); + } + + /* parameters that start with '<' must be macros, period */ + if ( ( ix > slen - 4 ) || + ( s[ ix + 1 ] != '!' ) || + ( s[ ix + 2 ] != '-' ) || + ( s[ ix + 3 ] != '-' ) || + ( s[ ix + 4 ] != '#' ) + ) + { + scriptError( STR_badparametervalue, src, ix, slen ); + break; + } + else + { + /* position the pointer to right after the macro delim */ + *ixpos = ixstart = ix + 5; + + if ( !conv_compilemacro( &adrparam.ht, src, ixpos, slen, depth ) ) + break; + + ++ctparams; + + ix = skipwhitespace( src, *ixpos, slen ); + + if ( s[ ix ] == ',' ) + { + flcommafound = true; + + ++ix; /* skip it */ + } + + continue; + } + } + else if ( s[ ix ] == '|' ) /* rez param */ + { + if ( !commaneeded_commafound( &flcommafound, ctparams ) ) + { + scriptError( STR_missingcomma, src, *ixpos, slen ); + + return ( false ); + } + + *ixpos = ixstart = ix; /* skip the pipe */ + + if ( !parseresource( &adrparam, src, ixpos, slen, depth ) ) + break; + + ++ctparams; + + ix = skipwhitespace( src, *ixpos, slen ); + + if ( s[ ix ] == ',' ) + { + flcommafound = true; + + ++ix; /* skip it */ + } + } + else if ( s[ ix ] == '"' ) /* quoted param */ + { + if ( !commaneeded_commafound( &flcommafound, ctparams ) ) + { + scriptError( STR_missingcomma, src, *ixpos, slen ); + + return ( false ); + } + + *ixpos = ixstart = ++ix; /* skip the quote */ + + if ( !parsequotedstring( &adrparam, src, ixpos, slen, depth ) ) + break; + + ix = skipwhitespace( src, *ixpos, slen ); + + if ( s[ ix ] == ',' ) + { + flcommafound = true; + + ++ix; /* skip it */ + } + } + else /* unquoted param */ + { + if ( !commaneeded_commafound( &flcommafound, ctparams ) ) + { + scriptError( STR_missingcomma, src, *ixpos, slen ); + + return ( false ); + } + + if ( !parseunquotedstringparam( &adrparam, src, ixpos, slen ) ) + break; + + ix = skipwhitespace( src, *ixpos, slen ); + + if ( s[ ix ] == ',' ) + { + flcommafound = true; + + ++ix; /* skip it */ + } + } + } + + if ( ! flmacrocomplete ) + { + scriptError( STR_endfoundprocmacro, src, ixmacrostart, slen ); + return ( false ); + } + else + { + *ixpos += 3; + + return ( true ); + } +} + +static boolean conv_parsemacro( ptrconvaddress adrdest, Handle src, long * ixpos, long slen, long * depth ) +{ + convaddress adrparams; + bigstring paramname; + convaddress adrparam; + long ix, ixstart; + boolean flmacrocomplete = false; + ptrbyte s = (ptrbyte) *src; + + if ( !createsubtable( (*adrdest).ht, STR_params, &adrparams, false ) ) + return ( false ); + + ix = skipwhitespace( src, *ixpos, slen ); + + if ( s[ ix ] == '(' ) /* parenthetical() macro */ + { + assignstring( adrdest, STR_macrotype, STR_parenthetical ); + ix++; + *ixpos = ix; + + return conv_parseparentheticalmacro( &adrparams, src, ixpos, slen, depth ); + } + else if ( s[ ix ] == '-' ) /* end of macro */ /* perhaps we assume too much? */ + { + assignstring( adrdest, STR_macrotype, STR_parameterless ); + + // *ixpos += 3; + *ixpos = ix + 3; // ixpos is now [whitespace] + '-->' + + return ( true ); + } + else /* if neither of the above, this must be a attribute=valuepairs macro */ + { + assignstring( adrdest, STR_macrotype, STR_attvaluepairs ); + } + + while ( ix < slen ) /* extract parameters */ + { + ix = skipwhitespace( src, *ixpos, slen ); + + if ( ( s[ ix ] == '-' ) && /* macro done? look for --> */ + ( ix <= ( slen - 2 ) ) && + ( s[ ix + 1 ] == '-' ) && + ( s[ ix + 2 ] == '>' ) + ) + { + flmacrocomplete = true; + break; + } + + /* param name */ + (*ixpos) = ix; + if ( !getparamname( src, ixpos, slen, paramname ) ) + break; + + if ( !insertchar( '\t', paramname ) ) + break; + + if ( !createsubtable( adrparams.ht, paramname, &adrparam, true ) ) + break; + + ix = skipwhitespace( src, *ixpos, slen ); + + /* equals */ + if ( s[ ix ] != '=' ) + { + scriptError( STR_missingequalsign, src, ix, slen ); + break; + } + ix++; /* skip the equals sign */ + ix = skipwhitespace( src, ix, slen ); + + /* param value */ + if ( s[ ix ] == '"' ) /* quoted string param */ + { + *ixpos = ixstart = ++ix; /* skip the quote */ + + if ( !parsequotedstring( &adrparam, src, ixpos, slen, depth ) ) + break; + } + else if ( s[ ix ] == '<' ) /* macro param */ + { + /* parameters that start with '<' must be macros, period */ + if ( ( ix > slen - 4 ) || + ( s[ ix + 1 ] != '!' ) || + ( s[ ix + 2 ] != '-' ) || + ( s[ ix + 3 ] != '-' ) || + ( s[ ix + 4 ] != '#' ) + ) + { + scriptError( STR_badparametervalue, src, ix, slen ); + break; + } + else + { + /* position the pointer to right after the macro delim */ + *ixpos = ixstart = ix + 5; + + if ( !conv_compilemacro( &adrparam.ht, src, ixpos, slen, depth ) ) + break; + + ix = *ixpos; + + continue; + } + } + else if ( s[ ix ] == '|' ) /* resource param */ + { + *ixpos = ixstart = ix; /* skip the pipe */ + + if ( !parseresource( &adrparam, src, ixpos, slen, depth ) ) + break; + } + else + { + scriptError( STR_badparametervalue, src, ix, slen ); + break; + } + } + + if ( flmacrocomplete ) + { + // *ixpos += 3; + *ixpos = ix + 3; // ixpos is now [whitespace] + '-->' + } + else + { + ; /* is anything needed here, to clean up in the event of failure? */ + } + + return ( flmacrocomplete ); +} + + +static boolean conv_compilemacro( hdlhashtable * tbldest, const Handle s, long * ixpos, const long slen, long * depth ) +{ + bigstring macroname; + short macrotype; + convaddress adrnewitem, adrconditionalblock; + + if ( !getmacroname( s, ixpos, slen, macroname ) ) + return ( false ); + + macrotype = getmacrotypefromname( macroname ); + + if ( macrotype == CONV_MACROTYPE_COND_IF ) + { + if ( !createsubtable( *tbldest, STR_macroname, &adrnewitem, true ) ) /* adrMacro = xmlAddTable( adrParent, "macro" ) */ + return ( false ); + + if ( !assignstring( &adrnewitem, STR_name, macroname ) ) /* adrDest^.macroname = macroname */ + return ( false ); + + if ( !assignstring( &adrnewitem, STR_type, STR_conditional ) ) /* adrDest^.macrotype = "conditional" */ + return ( false ); + + if ( !conv_parsemacro( &adrnewitem, s, ixpos, slen, depth ) ) /* parsemacro( adrMaro ) */ + return ( false ); + + if ( !createsubtable( adrnewitem.ht, STR_condblock, &adrconditionalblock, false ) ) /* new( tabletype, @adrMacro^.conditionalBlock ) */ + return ( false ); + + ++(*depth); + + *tbldest = adrconditionalblock.ht; + } + else if ( ( macrotype == CONV_MACROTYPE_COND_ELSE ) || ( macrotype == CONV_MACROTYPE_COND_ELSEIF ) ) + { + if ( *depth > 1 ) + { + *tbldest = (***tbldest).parenthashtable; + *tbldest = (***tbldest).parenthashtable; + --(*depth); + } + + if ( !createsubtable( *tbldest, STR_macroname, &adrnewitem, true ) ) + return ( false ); + + if ( !assignstring( &adrnewitem, STR_name, macroname ) ) + return ( false ); + + if ( !assignstring( &adrnewitem, STR_type, STR_conditional ) ) + return ( false ); + + if ( !conv_parsemacro( &adrnewitem, s, ixpos, slen, depth ) ) + return ( false ); + + if ( !createsubtable( adrnewitem.ht, STR_condblock, &adrconditionalblock, false ) ) + return ( false ); + + ++(*depth); + + *tbldest = adrconditionalblock.ht; + } + else if ( macrotype == CONV_MACROTYPE_COND_ENDIF ) + { + if ( *depth > 1 ) + { + *tbldest = (***tbldest).parenthashtable; + *tbldest = (***tbldest).parenthashtable; + --(*depth); + } + + if ( !createsubtable( *tbldest, STR_macroname, &adrnewitem, true ) ) + return ( false ); + + if ( !assignstring( &adrnewitem, STR_name, macroname ) ) + return ( false ); + + if ( !assignstring( &adrnewitem, STR_type, STR_endconditional ) ) + return ( false ); + + if ( !conv_parsemacro( &adrnewitem, s, ixpos, slen, depth ) ) + return ( false ); + } + else + { + if ( !createsubtable( *tbldest, STR_macroname, &adrnewitem, true ) ) + return ( false ); + + if ( !assignstring( &adrnewitem, STR_name, macroname ) ) + return ( false ); + + if ( !assignstring( &adrnewitem, STR_type, STR_macro ) ) + return ( false ); + + if ( !conv_parsemacro( &adrnewitem, s, ixpos, slen, depth ) ) + return ( false ); + } + + return ( true ); +} + +static boolean conv_addrezdelim( hdlhashtable tbldest ) +{ + boolean fl = false; + byte delim = '|'; + convaddress adrnewitem; + + getnewitemaddress( tbldest, STR_rezname, &adrnewitem ); + + if ( !assignchar( &adrnewitem, delim ) ) + return ( false ); + + return ( true ); +} + +/* just finds the delimiters, doesn't actually identify the contents */ +static int conv_findnextmacroorresource( Handle src, long * ixpos, const long slen ) +{ + ptrbyte s = (ptrbyte) *src; + long maxlen = slen; + long ix = *ixpos; + + while ( ix < maxlen ) + { + if ( s[ ix ] == '|' ) + { + *ixpos = ix; + return CONV_RESOURCE; + } + else if ( ( s[ ix ] == '<' ) && ( ix <= maxlen - 4 ) ) + { + if ( ( ix < maxlen - 4 ) && + ( s[ ix + 1 ] == '!' ) && + ( s[ ix + 2 ] == '-' ) && + ( s[ ix + 3 ] == '-' ) && + ( s[ ix + 4 ] == '#' ) + ) + { + *ixpos = ix; + return CONV_MACRO; + } + } + + ++ix; + } /* while ix maxlen */ + + *ixpos = slen; + + return CONV_NOTYPE; +} + +static boolean conv_compilestringverb( hdltreenode hp1, tyvaluerecord *v, bigstring bserror ) +{ + Handle s; /* the string being parsed */ + convaddress adr; /* the table where the compiled output is to be stored */ + + hdlhashtable nomadtable; /* the table or subtable we're currently compiling to */ + + long ix = 0; /* current position in string */ + long ixStart = 0; /* start of current word */ + long slen; /* total size of string */ + long depth = 1; /* how deeply nested (in conditionals) are we? */ + + int nexttype; /* type of next item found by the scanner */ + boolean flcomplete = false; /* did parsing finish? */ + + + /* initialize */ + + if ( !getreadonlytextvalue( hp1, 1, &s ) ) + return false; + + slen = gethandlesize( s ); + + flnextparamislast = true; + + if ( !getvarparam( hp1, 2, &adr.ht, adr.bs ) ) /* initialize adr to info about the provided address */ + return (false); + + if ( langassignnewtablevalue( adr.ht, adr.bs, &nomadtable ) ) + { + assert ( (**nomadtable).parenthashtable == adr.ht ); + + /* start looping through the string, in "chunks" handled by other parts of the code */ + + while ( ix < slen ) + { + nexttype = conv_findnextmacroorresource( s, &ix, slen ); + + if ( nexttype == CONV_NOTYPE ) /* no more macros or resources */ + { + if ( !conv_addtextrange( nomadtable, s, ixStart, ix ) ) + break; + + flcomplete = true; + break; + } + else if ( nexttype == CONV_MACRO ) /* found a macro */ + { + if ( !conv_addtextrange( nomadtable, s, ixStart, ix ) ) + break; + + ix += 5; /* skip the maco delim */ + + /* may leave nomadtable pointing at something else, if macro is a conditional */ + if ( !conv_compilemacro( &nomadtable, s, &ix, slen, &depth ) ) + break; + + ixStart = ix; + } + else if ( nexttype == CONV_RESOURCE ) /* found a resource */ + { + if ( !conv_addtextrange( nomadtable, s, ixStart, ix ) ) + break; + + if ( !conv_addrezdelim( nomadtable ) ) + break; + + ixStart = ++ix; /* increment ix past the rez delim, and set ixStart to the new position */ + } + } /* while */ + + if ( ( !flcomplete ) && ( ix == slen ) ) + flcomplete = true; + } /* if langassignnewtablevalue */ + + if ( !flcomplete ) + ; /*hashtabledelete( nomadtable, bserror ); */ + else + setbooleanvalue( flcomplete, v ); + + return ( flcomplete ); +} /* conv_compilestringverb */ + + +static boolean conv_functionvalue ( short token, hdltreenode hp1, tyvaluerecord *v, bigstring bserror ) +{ + /* + 2004-120-31 smd: kernelized conversant verbs + */ + + short errornum = 0; + + setbooleanvalue (false, v); /* by default, conversant functions return false */ + + switch (token) + { + case compilestringfunc: /* 2004/12/31 smd */ + return ( conv_compilestringverb( hp1, v, bserror ) ); + + default: + errornum = notimplementederror; + + goto error; + } /*switch*/ + + error: + + if (errornum != 0) /*get error string*/ + getstringlist (conversanterrorlist, errornum, bserror); + + return (false); +} /*conv_functionvalue*/ + + +extern boolean conversantinitverbs (void) { + + return (loadfunctionprocessor (idconversantverbs, &conv_functionvalue)); + +} /*conversantinitverbs*/ + + #endif /* flconversantverbs==1 */ +#endif /* flconversantverbs */ \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-07 20:59:05
|
Revision: 1225 Author: andreradke Date: 2006-04-07 13:58:44 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1225&view=rev Log Message: ----------- Prepare for Mac OS X Intel builds: Make conversion between big endian and little endian dependent on target architecture rather than MACVERSION and WIN95VERSION. Modified Paths: -------------- Frontier/trunk/Common/headers/frontierdefs.h Frontier/trunk/Common/headers/osincludes.h Modified: Frontier/trunk/Common/headers/frontierdefs.h =================================================================== --- Frontier/trunk/Common/headers/frontierdefs.h 2006-04-07 20:43:31 UTC (rev 1224) +++ Frontier/trunk/Common/headers/frontierdefs.h 2006-04-07 20:58:44 UTC (rev 1225) @@ -34,7 +34,6 @@ #ifdef WIN95VERSION - #define PACKFLIPPED /* enable little endian / big endian conversion for database file functions */ #define FRONTIERCOM 1 #ifndef OPMLEDITOR #define FRONTIERWEB 0 Modified: Frontier/trunk/Common/headers/osincludes.h =================================================================== --- Frontier/trunk/Common/headers/osincludes.h 2006-04-07 20:43:31 UTC (rev 1224) +++ Frontier/trunk/Common/headers/osincludes.h 2006-04-07 20:58:44 UTC (rev 1225) @@ -307,4 +307,19 @@ #include <string.h> #include <assert.h> +/* + 2006-04-07 aradke: determine native byte order. + checking whether WIN32 is defined is rather crude, + but I haven't found a better way yet. +*/ + +#if defined(__LITTLE_ENDIAN__) || defined(WIN32) + #define PACKFLIPPED 1 /* enable little endian / big endian conversion for database file functions */ +#elif defined(__BIG_ENDIAN__) + #undef PACKFLIPPED /* big endian is native database format, no need to convert */ +#else + #error Failed to determine native byte order of target architecture, update osincludes.h +#endif + + #endif /* __osincludes_h__ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <set...@us...> - 2006-04-07 20:43:44
|
Revision: 1224 Author: sethdill Date: 2006-04-07 13:43:31 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1224&view=rev Log Message: ----------- I'm finally setting up the Conversant branch. This is only the kernel code, not the ODBs. Added Paths: ----------- Frontier/branches/Conversant/ Copied: Frontier/branches/Conversant (from rev 1223, Frontier/trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-07 20:03:34
|
Revision: 1223 Author: andreradke Date: 2006-04-07 13:03:24 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1223&view=rev Log Message: ----------- Rolling back revision 1222: change broke Visual Studio builds. ViewCVS Links: ------------- http://svn.sourceforge.net/frontierkernel/?rev=1222&view=rev Modified Paths: -------------- Frontier/trunk/Common/headers/frontier.h Frontier/trunk/Common/headers/frontierdefs.h Modified: Frontier/trunk/Common/headers/frontier.h =================================================================== --- Frontier/trunk/Common/headers/frontier.h 2006-04-07 19:32:32 UTC (rev 1222) +++ Frontier/trunk/Common/headers/frontier.h 2006-04-07 20:03:24 UTC (rev 1223) @@ -36,17 +36,11 @@ #define __FRONTIER_H__ -/* sanity check of prefix headers and build environment */ - #if !defined(MACVERSION) && !defined(WIN95VERSION) #error Either MACVERSION or WIN95VERSION must always be defined! #endif -#if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) - #error Either __LITTLE_ENDIAN__ or __BIG_ENDIAN__ must be defined! -#endif - #ifdef WIN95VERSION #if (defined(_MSC_VER) && !defined(__MWERKS__)) /* Modified: Frontier/trunk/Common/headers/frontierdefs.h =================================================================== --- Frontier/trunk/Common/headers/frontierdefs.h 2006-04-07 19:32:32 UTC (rev 1222) +++ Frontier/trunk/Common/headers/frontierdefs.h 2006-04-07 20:03:24 UTC (rev 1223) @@ -32,13 +32,9 @@ #ifndef __FRONTIERDEFS_H__ #define __FRONTIERDEFS_H__ -#if defined(__LITTLE_ENDIAN__) /* 2006-04-07 aradke: use appropriate defines instead of target platform, prepare for MacIntel */ - #define PACKFLIPPED 1 /* enable little endian / big endian conversion for database file functions */ -#elif defined(__BIG_ENDIAN__) - #undef PACKFLIPPED /* big endian is native database format, no need to convert */ -#endif #ifdef WIN95VERSION + #define PACKFLIPPED /* enable little endian / big endian conversion for database file functions */ #define FRONTIERCOM 1 #ifndef OPMLEDITOR #define FRONTIERWEB 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-07 19:32:44
|
Revision: 1222 Author: andreradke Date: 2006-04-07 12:32:32 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1222&view=rev Log Message: ----------- Prepare for Mac OS X Universal build by defining PACKFLIPPED based on whether __LITTLE_ENDIAN__ is defined rather than based on the target platform. Modified Paths: -------------- Frontier/trunk/Common/headers/frontier.h Frontier/trunk/Common/headers/frontierdefs.h Modified: Frontier/trunk/Common/headers/frontier.h =================================================================== --- Frontier/trunk/Common/headers/frontier.h 2006-04-07 18:12:41 UTC (rev 1221) +++ Frontier/trunk/Common/headers/frontier.h 2006-04-07 19:32:32 UTC (rev 1222) @@ -36,11 +36,17 @@ #define __FRONTIER_H__ +/* sanity check of prefix headers and build environment */ + #if !defined(MACVERSION) && !defined(WIN95VERSION) #error Either MACVERSION or WIN95VERSION must always be defined! #endif +#if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) + #error Either __LITTLE_ENDIAN__ or __BIG_ENDIAN__ must be defined! +#endif + #ifdef WIN95VERSION #if (defined(_MSC_VER) && !defined(__MWERKS__)) /* Modified: Frontier/trunk/Common/headers/frontierdefs.h =================================================================== --- Frontier/trunk/Common/headers/frontierdefs.h 2006-04-07 18:12:41 UTC (rev 1221) +++ Frontier/trunk/Common/headers/frontierdefs.h 2006-04-07 19:32:32 UTC (rev 1222) @@ -32,9 +32,13 @@ #ifndef __FRONTIERDEFS_H__ #define __FRONTIERDEFS_H__ +#if defined(__LITTLE_ENDIAN__) /* 2006-04-07 aradke: use appropriate defines instead of target platform, prepare for MacIntel */ + #define PACKFLIPPED 1 /* enable little endian / big endian conversion for database file functions */ +#elif defined(__BIG_ENDIAN__) + #undef PACKFLIPPED /* big endian is native database format, no need to convert */ +#endif #ifdef WIN95VERSION - #define PACKFLIPPED /* enable little endian / big endian conversion for database file functions */ #define FRONTIERCOM 1 #ifndef OPMLEDITOR #define FRONTIERWEB 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <kar...@us...> - 2006-04-07 18:12:51
|
Revision: 1221 Author: karstenw Date: 2006-04-07 11:12:41 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1221&view=rev Log Message: ----------- merged changes from trunk(1220) to branch Modified Paths: -------------- Frontier/branches/Int64/Common/Paige/headers/CPUDEFS.H Frontier/branches/Int64/Common/Paige/libpaigemacho.a Modified: Frontier/branches/Int64/Common/Paige/headers/CPUDEFS.H =================================================================== --- Frontier/branches/Int64/Common/Paige/headers/CPUDEFS.H 2006-04-07 18:06:06 UTC (rev 1220) +++ Frontier/branches/Int64/Common/Paige/headers/CPUDEFS.H 2006-04-07 18:12:41 UTC (rev 1221) @@ -123,8 +123,9 @@ #define WIN32_COMPILE //#define WINDOWS_EMULATE_COMPILE /* Fakes Windows environment on Mac */ #else + #define MAC_COMPILE /* 2006-04-07 aradke: compiling with Xcode */ + #endif #endif -#endif #ifdef ACCESS_MS_DLL #define MS_DLL Modified: Frontier/branches/Int64/Common/Paige/libpaigemacho.a =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <and...@us...> - 2006-04-07 18:06:57
|
Revision: 1220 Author: andreradke Date: 2006-04-07 11:06:06 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1220&view=rev Log Message: ----------- Updated CPUDEFS.H to enable compilation of Paige library with Xcode. Replace CodeWarrior version of Mach-O Paige library with one compiled by Xcode 1.5 and GCC 3.3. Modified Paths: -------------- Frontier/trunk/Common/Paige/headers/CPUDEFS.H Frontier/trunk/Common/Paige/libpaigemacho.a Modified: Frontier/trunk/Common/Paige/headers/CPUDEFS.H =================================================================== --- Frontier/trunk/Common/Paige/headers/CPUDEFS.H 2006-04-07 18:04:09 UTC (rev 1219) +++ Frontier/trunk/Common/Paige/headers/CPUDEFS.H 2006-04-07 18:06:06 UTC (rev 1220) @@ -123,8 +123,9 @@ #define WIN32_COMPILE //#define WINDOWS_EMULATE_COMPILE /* Fakes Windows environment on Mac */ #else + #define MAC_COMPILE /* 2006-04-07 aradke: compiling with Xcode */ + #endif #endif -#endif #ifdef ACCESS_MS_DLL #define MS_DLL Modified: Frontier/trunk/Common/Paige/libpaigemacho.a =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <kar...@us...> - 2006-04-07 18:06:25
|
Revision: 1219 Author: karstenw Date: 2006-04-07 11:04:09 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1219&view=rev Log Message: ----------- merged changes from trunk(1218) to branch Modified Paths: -------------- Frontier/branches/Int64/Common/IOAToolkit/ioa.c Frontier/branches/Int64/Common/IOAToolkit/ioa.h Frontier/branches/Int64/Common/IOAToolkit/ioabutton.c Frontier/branches/Int64/Common/IOAToolkit/ioacheckbox.c Frontier/branches/Int64/Common/IOAToolkit/ioacolorpopup.c Frontier/branches/Int64/Common/IOAToolkit/ioaedittext.c Frontier/branches/Int64/Common/IOAToolkit/ioaframe.c Frontier/branches/Int64/Common/IOAToolkit/ioaicon.c Frontier/branches/Int64/Common/IOAToolkit/ioapicture.c Frontier/branches/Int64/Common/IOAToolkit/ioapopup.c Frontier/branches/Int64/Common/IOAToolkit/ioaradio.c Frontier/branches/Int64/Common/IOAToolkit/ioarect.c Frontier/branches/Int64/Common/IOAToolkit/ioascrollbar.c Frontier/branches/Int64/Common/IOAToolkit/ioastatic.c Frontier/branches/Int64/Common/IowaRuntime/Headers/iowaruntime.h Frontier/branches/Int64/Common/IowaRuntime/Source/iowacore.c Frontier/branches/Int64/Common/IowaRuntime/Source/iowaruntime.c Frontier/branches/Int64/Common/IowaRuntime/Source/iowascript.c Frontier/branches/Int64/Common/PCRE/pcre.c Frontier/branches/Int64/Common/Paige/headers/PAIGE.H Frontier/branches/Int64/Common/UserLandIACToolkit/land.c Frontier/branches/Int64/Common/UserLandIACToolkit/landgetparam.c Frontier/branches/Int64/Common/UserLandIACToolkit/landops.c Frontier/branches/Int64/Common/UserLandIACToolkit/landsystem7.c Frontier/branches/Int64/Common/headers/FDllCall.h Frontier/branches/Int64/Common/headers/WinSockNetEvents.h Frontier/branches/Int64/Common/headers/frontierconfig.h Frontier/branches/Int64/Common/headers/langdll.h Frontier/branches/Int64/Common/headers/memory.h Frontier/branches/Int64/Common/headers/process.h Frontier/branches/Int64/Common/source/FrontierWinMain.c Frontier/branches/Int64/Common/source/OpenTransportNetEvents.c Frontier/branches/Int64/Common/source/about.c Frontier/branches/Int64/Common/source/bitmaps.c Frontier/branches/Int64/Common/source/cancoon.c Frontier/branches/Int64/Common/source/cancoonpopup.c Frontier/branches/Int64/Common/source/cancoonwindow.c Frontier/branches/Int64/Common/source/claybrowserexpand.c Frontier/branches/Int64/Common/source/claybrowserstruc.c Frontier/branches/Int64/Common/source/claybrowservalidate.c Frontier/branches/Int64/Common/source/claycallbacks.c Frontier/branches/Int64/Common/source/claylinelayout.c Frontier/branches/Int64/Common/source/command.c Frontier/branches/Int64/Common/source/db.c Frontier/branches/Int64/Common/source/dbstats.c Frontier/branches/Int64/Common/source/dbverbs.c Frontier/branches/Int64/Common/source/dialogs.c Frontier/branches/Int64/Common/source/dockmenu.c Frontier/branches/Int64/Common/source/file.c Frontier/branches/Int64/Common/source/filealias.c Frontier/branches/Int64/Common/source/filelaunch.c Frontier/branches/Int64/Common/source/fileloop.c Frontier/branches/Int64/Common/source/fileops.c Frontier/branches/Int64/Common/source/filepath.c Frontier/branches/Int64/Common/source/fileverbs.c Frontier/branches/Int64/Common/source/frontierdebug.c Frontier/branches/Int64/Common/source/icon.c Frontier/branches/Int64/Common/source/kb.c Frontier/branches/Int64/Common/source/lang.c Frontier/branches/Int64/Common/source/langcard.c Frontier/branches/Int64/Common/source/langdll.c Frontier/branches/Int64/Common/source/langerrorwindow.c Frontier/branches/Int64/Common/source/langevaluate.c Frontier/branches/Int64/Common/source/langexternal.c Frontier/branches/Int64/Common/source/langhash.c Frontier/branches/Int64/Common/source/langhtml.c Frontier/branches/Int64/Common/source/langipc.c Frontier/branches/Int64/Common/source/langipcmenus.c Frontier/branches/Int64/Common/source/langlist.c Frontier/branches/Int64/Common/source/langmodeless.c Frontier/branches/Int64/Common/source/langpython.c Frontier/branches/Int64/Common/source/langquicktime.c Frontier/branches/Int64/Common/source/langregexp.c Frontier/branches/Int64/Common/source/langsystypes.c Frontier/branches/Int64/Common/source/langtrace.c Frontier/branches/Int64/Common/source/langtree.c Frontier/branches/Int64/Common/source/langvalue.c Frontier/branches/Int64/Common/source/langverbs.c Frontier/branches/Int64/Common/source/langwinipc.c Frontier/branches/Int64/Common/source/langxml.c Frontier/branches/Int64/Common/source/launch.c Frontier/branches/Int64/Common/source/mac.c Frontier/branches/Int64/Common/source/md5.c Frontier/branches/Int64/Common/source/memory.c Frontier/branches/Int64/Common/source/menu.c Frontier/branches/Int64/Common/source/menubar.c Frontier/branches/Int64/Common/source/menueditor.c Frontier/branches/Int64/Common/source/menupack.c Frontier/branches/Int64/Common/source/menuverbs.c Frontier/branches/Int64/Common/source/miniwindow.c Frontier/branches/Int64/Common/source/mouse.c Frontier/branches/Int64/Common/source/odbengine.c Frontier/branches/Int64/Common/source/op.c Frontier/branches/Int64/Common/source/opbuttons.c Frontier/branches/Int64/Common/source/opdisplay.c Frontier/branches/Int64/Common/source/opdraggingmove.c Frontier/branches/Int64/Common/source/opedit.c Frontier/branches/Int64/Common/source/opexpand.c Frontier/branches/Int64/Common/source/ophoist.c Frontier/branches/Int64/Common/source/opicons.c Frontier/branches/Int64/Common/source/opinit.c Frontier/branches/Int64/Common/source/opops.c Frontier/branches/Int64/Common/source/oppack.c Frontier/branches/Int64/Common/source/opprint.c Frontier/branches/Int64/Common/source/oprefcon.c Frontier/branches/Int64/Common/source/ops.c Frontier/branches/Int64/Common/source/opstructure.c Frontier/branches/Int64/Common/source/opverbs.c Frontier/branches/Int64/Common/source/opxml.c Frontier/branches/Int64/Common/source/osacomponent.c Frontier/branches/Int64/Common/source/osawindows.c Frontier/branches/Int64/Common/source/pictverbs.c Frontier/branches/Int64/Common/source/player.c Frontier/branches/Int64/Common/source/popup.c Frontier/branches/Int64/Common/source/process.c Frontier/branches/Int64/Common/source/quickdraw.c Frontier/branches/Int64/Common/source/scripts.c Frontier/branches/Int64/Common/source/services.c Frontier/branches/Int64/Common/source/shell.c Frontier/branches/Int64/Common/source/shellbuttons.c Frontier/branches/Int64/Common/source/shellcallbacks.c Frontier/branches/Int64/Common/source/shellfile.c Frontier/branches/Int64/Common/source/shelljuggler.c Frontier/branches/Int64/Common/source/shellmouse.c Frontier/branches/Int64/Common/source/shellprint.c Frontier/branches/Int64/Common/source/shellscroll.c Frontier/branches/Int64/Common/source/shellsysverbs.c Frontier/branches/Int64/Common/source/shellupdate.c Frontier/branches/Int64/Common/source/shellverbs.c Frontier/branches/Int64/Common/source/shellwindow.c Frontier/branches/Int64/Common/source/shellwindowmenu.c Frontier/branches/Int64/Common/source/shellwindowverbs.c Frontier/branches/Int64/Common/source/smallicon.c Frontier/branches/Int64/Common/source/sounds.c Frontier/branches/Int64/Common/source/strings.c Frontier/branches/Int64/Common/source/stringverbs.c Frontier/branches/Int64/Common/source/tablecompare.c Frontier/branches/Int64/Common/source/tabledisplay.c Frontier/branches/Int64/Common/source/tableexternal.c Frontier/branches/Int64/Common/source/tablefind.c Frontier/branches/Int64/Common/source/tableformats.c Frontier/branches/Int64/Common/source/tableops.c Frontier/branches/Int64/Common/source/tablepack.c Frontier/branches/Int64/Common/source/tablepopup.c Frontier/branches/Int64/Common/source/tablescrap.c Frontier/branches/Int64/Common/source/threads.c Frontier/branches/Int64/Common/source/timedate.c Frontier/branches/Int64/Common/source/uisharing.c Frontier/branches/Int64/Common/source/wpengine.c Frontier/branches/Int64/Common/source/wpverbs.c Frontier/branches/Int64/Common/source/zoom.c Frontier/branches/Int64/FrontierSDK/Toolkits/AppletToolkit/Headers/appletmemory.h Frontier/branches/Int64/FrontierSDK/Toolkits/IACTools/Source/iacapps.c Frontier/branches/Int64/FrontierSDK/Toolkits/IACTools/Source/iacasynch.c Frontier/branches/Int64/FrontierSDK/Toolkits/IACTools/Source/iacdouble.c Frontier/branches/Int64/FrontierSDK/Toolkits/IACTools/Source/iacnetwork.c Frontier/branches/Int64/FrontierSDK/Toolkits/IACTools/Source/iacops.c Frontier/branches/Int64/FrontierSDK/Toolkits/IACTools/Source/iacsysevents.c Frontier/branches/Int64/build_VC2K5/Frontier.sln Frontier/branches/Int64/build_VC2K5/Frontier.vcproj Added Paths: ----------- Frontier/branches/Int64/Common/Paige/PaigeWinVC8CRT.lib Property Changed: ---------------- Frontier/branches/Int64/build_VC2K3/ Frontier/branches/Int64/build_VC2K5/ Modified: Frontier/branches/Int64/Common/IOAToolkit/ioa.c =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioa.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioa.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -62,28 +62,13 @@ static tyioaconfigrecord config; - -void IOAfillchar (void *pfill, long ctfill, char chfill) { - - /* - do a mass memory fill -- copy ctfill chfills at pfill. - */ - - char *p = pfill; - long ct = ctfill; - char ch = chfill; - - while (ct--) *p++ = (char) ch; /*tight loop*/ - } /*IOAfillchar*/ - - void IOAclearbytes (void *pclear, long ctclear) { /* fill memory with 0's. */ - IOAfillchar (pclear, ctclear, (char) 0); + memset(pclear, 0, ctclear); } /*IOAclearbytes*/ @@ -493,7 +478,7 @@ boolean IOAincolorwindow (hdlobject h) { -#pragma unused (h) +#pragma unused(h) return (true); /*need to fill this in*/ } /*IOAincolorwindow*/ @@ -525,7 +510,8 @@ static boolean defaultDebugObjectCallback (hdlobject h, bigstring errorstring) { -#pragma unused (h) +#pragma unused(h) + IOAcopystring ("\pbad object type", errorstring); return (false); @@ -533,39 +519,43 @@ static boolean defaultRecalcObjectCallback (hdlobject h, boolean flmajorrecalc) { -#pragma unused (h, flmajorrecalc) +#pragma unused(h, flmajorrecalc) + return (true); } /*defaultRecalcObjectCallback*/ static boolean defaultClickObjectCallback (hdlobject listhead, hdlobject h, Point pt, boolean flshiftkey, boolean fl2click) { -#pragma unused (listhead, h, pt, flshiftkey, fl2click) +#pragma unused(h, listhead, pt, flshiftkey, fl2click) return (false); /*don't do a minor recalc*/ } /*defaultClickObjectCallback*/ static boolean defaultSetObjectCursorCallback (hdlobject h, Point pt) { -#pragma unused (h, pt) +#pragma unused(h, pt) return (false); /*we accept the default cursor*/ } /*defaultSetObjectCursorCallback*/ static boolean defaultCatchReturnCallback (hdlobject h) { -#pragma unused (h) +#pragma unused(h) + return (false); /*we don't want to intercept the Return key*/ } /*defaultCatchReturnCallback*/ static boolean defaultUnpackDataCallback (hdlobject h) { -#pragma unused (h) +#pragma unused(h) + return (true); /*do nothing*/ } /*defaultUnpackDataCallback*/ static boolean defaultAppleEventCallback (hdlobject h, AppleEvent *event) { -#pragma unused (h, event) +#pragma unused(h, event) + return (true); /*do nothing*/ } /*defaultAppleEventCallback*/ @@ -582,13 +572,14 @@ static boolean defaultDisposeDataCallback (hdlobject h) { -#pragma unused (h) +#pragma unused(h) + return (true); } /*defaultDisposeDataCallback*/ static void callsetuproutine (setupcallback pcallback, tyioaconfigrecord *pconfig) { - +// 2006-04-03 - kw --- renamed parameter config -> pconfig IOAclearbytes (pconfig, longsizeof (tyioaconfigrecord)); (*pconfig).setValueFromScriptCallback = IOAsetobjectvalue; @@ -643,7 +634,8 @@ static pascal ComponentResult IOAclose (ComponentInstance self) { -#pragma unused (self) +#pragma unused(self) + return (noErr); } /*IOAclose*/ @@ -1294,9 +1286,7 @@ //Code change by Timothy Paustian Saturday, July 8, 2000 8:23:29 AM //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 +#pragma unused (hstorage) #endif Modified: Frontier/branches/Int64/Common/IOAToolkit/ioa.h =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioa.h 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioa.h 2006-04-07 18:04:09 UTC (rev 1219) @@ -536,8 +536,6 @@ -void IOAfillchar (void *, long, char); - void IOAclearbytes (void *, long); short IOAmakemultiple (short, short); Modified: Frontier/branches/Int64/Common/IOAToolkit/ioabutton.c =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioabutton.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioabutton.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -67,7 +67,8 @@ static boolean canreplicatebutton (hdlobject h) { -#pragma unused (h) +#pragma unused(h) + return (true); /*it can be replicated*/ } /*canreplicatebutton*/ @@ -99,7 +100,8 @@ static boolean debugbutton (hdlobject h, bigstring errorstring) { -#pragma unused (h) +#pragma unused(h) + setstringlength (errorstring, 0); return (true); @@ -107,20 +109,22 @@ #if TARGET_API_MAC_CARBON == 1 + static void MyThemeButtonDrawCallback ( - const Rect *bounds, - ThemeButtonKind kind, - const ThemeButtonDrawInfo *info, - UInt32 refcon, - SInt16 depth, - Boolean isColorDev) + const Rect *bounds, + ThemeButtonKind kind, + const ThemeButtonDrawInfo *info, + UInt32 refcon, + SInt16 depth, + Boolean isColorDev) { -#pragma unused (kind, info, depth, isColorDev) +#pragma unused(kind, info, depth, isColorDev) + /* 7.0b48 PBS: draw the label for a popup menu. */ - + Handle htext = (Handle) refcon; ThemeFontID idfont; bigstring fontname, bs; @@ -299,7 +303,7 @@ static boolean recalcbutton (hdlobject h, boolean flmajorrecalc) { -#pragma unused (flmajorrecalc) +#pragma unused(flmajorrecalc) bigstring errorstring; Handle hvalue; @@ -316,7 +320,7 @@ static boolean clickbutton (hdlobject listhead, hdlobject h, Point pt, boolean flshiftkey, boolean fl2click) { -#pragma unused (listhead, pt, flshiftkey, fl2click) +#pragma unused(listhead, pt, flshiftkey, fl2click) IOArunbuttonscript (h); Modified: Frontier/branches/Int64/Common/IOAToolkit/ioacheckbox.c =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioacheckbox.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioacheckbox.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -79,7 +79,7 @@ static boolean canreplicatecheckbox (hdlobject h) { -#pragma unused (h) +#pragma unused(h) return (true); /*it can be replicated*/ } /*canreplicatecheckbox*/ @@ -108,7 +108,7 @@ static boolean debugcheckbox (hdlobject h, bigstring errorstring) { -#pragma unused (h) +#pragma unused(h) setstringlength (errorstring, 0); @@ -168,14 +168,15 @@ static boolean initcheckbox (tyobject *obj) { -#pragma unused (obj) +#pragma unused(obj) return (true); /*nothing special, we do want to edit it*/ } /*initcheckbox*/ static boolean recalccheckbox (hdlobject h, boolean flmajorrecalc) { -#pragma unused (flmajorrecalc) +#pragma unused(flmajorrecalc) + bigstring errorstring; Handle hboolvalue; @@ -189,7 +190,8 @@ static boolean clickcheckbox (hdlobject listhead, hdlobject h, Point pt, boolean flshiftkey, boolean fl2click) { -#pragma unused (listhead, pt, flshiftkey, fl2click) +#pragma unused(listhead, pt, flshiftkey, fl2click) + (**h).objectflag = !(**h).objectflag; (**(**h).owningcard).runtimevaluechanged = true; /*DW 9/19/95*/ Modified: Frontier/branches/Int64/Common/IOAToolkit/ioacolorpopup.c =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioacolorpopup.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioacolorpopup.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -436,7 +436,8 @@ static boolean clickcolorpopup (hdlobject listhead, hdlobject h, Point pt, boolean flshiftkey, boolean fl2click) { -#pragma unused (listhead, flshiftkey, fl2click) +#pragma unused(listhead, flshiftkey, fl2click) + hdlcolordata hdata = (hdlcolordata) (**h).objectdata; RGBColor rgb; @@ -474,7 +475,7 @@ static boolean canreplicatecolorpopup (hdlobject h) { -#pragma unused (h) +#pragma unused(h) return (true); } /*canreplicatecolorpopup*/ @@ -592,7 +593,7 @@ static boolean debugcolorpopup (hdlobject h, bigstring errorstring) { -#pragma unused (h) +#pragma unused(h) setstringlength (errorstring, 0); return (true); @@ -726,7 +727,8 @@ static boolean recalccolorpopup (hdlobject h, boolean flmajorrecalc) { -#pragma unused (flmajorrecalc) +#pragma unused(flmajorrecalc) + bigstring errorstring; Handle hrgbvalue; Modified: Frontier/branches/Int64/Common/IOAToolkit/ioaedittext.c =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioaedittext.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioaedittext.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -213,7 +213,8 @@ static boolean debugedittext (hdlobject h, bigstring errorstring) { -#pragma unused (h) +#pragma unused(h) + setstringlength (errorstring, 0); return (true); @@ -256,7 +257,8 @@ static boolean recalcedittext (hdlobject h, boolean flmajorrecalc) { -#pragma unused (flmajorrecalc) +#pragma unused(flmajorrecalc) + hdltextdata hdata = (hdltextdata) (**h).objectdata; if (!(**hdata).bullets) @@ -301,7 +303,8 @@ static boolean clickedittext (hdlobject listhead, hdlobject h, Point pt, boolean flshiftkey, boolean fl2click) { -#pragma unused (listhead, fl2click) +#pragma unused(listhead, fl2click) + hdlcard hc = (**h).owningcard; if (h != (**hc).activetextobject) { @@ -318,7 +321,8 @@ static boolean setcursoredittext (hdlobject h, Point pt) { -#pragma unused (h, pt) +#pragma unused(h, pt) + CursHandle hcursor; hcursor = GetCursor (iBeamCursor); @@ -355,7 +359,8 @@ static boolean idleedittext (hdlobject h) { -#pragma unused (h) +#pragma unused(h) + IOAeditidle (IOAgetactiveeditrecord ()); return (true); Modified: Frontier/branches/Int64/Common/IOAToolkit/ioaframe.c =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioaframe.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioaframe.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -174,7 +174,8 @@ static boolean debugframe (hdlobject h, bigstring errorstring) { -#pragma unused (h) +#pragma unused(h) + setstringlength (errorstring, 0); return (true); @@ -268,7 +269,8 @@ static boolean recalcframe (hdlobject h, boolean flmajorrecalc) { -#pragma unused (flmajorrecalc) +#pragma unused(flmajorrecalc) + return (IOArecalcobjectvalue (h)); } /*recalcframe*/ Modified: Frontier/branches/Int64/Common/IOAToolkit/ioaicon.c =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioaicon.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioaicon.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -94,7 +94,7 @@ static boolean canreplicateicon (hdlobject h) { -#pragma unused (h) +#pragma unused(h) return (true); /*it can be replicated*/ } /*canreplicateicon*/ @@ -107,7 +107,7 @@ static boolean debugicon (hdlobject h, bigstring errorstring) { -#pragma unused (h) +#pragma unused(h) setstringlength (errorstring, 0); @@ -211,7 +211,7 @@ static boolean recalciconobject (hdlobject h, boolean flmajorrecalc) { -#pragma unused (flmajorrecalc) +#pragma unused(flmajorrecalc) return (IOArecalcobjectvalue (h)); } /*recalciconobject*/ @@ -327,17 +327,10 @@ return (true); } /*unpackicondata*/ + +static boolean clickicon (hdlobject listhead, hdlobject h, Point pt, boolean flshiftkey, boolean fl2click) { +#pragma unused(listhead, pt, flshiftkey) -static boolean -clickicon ( - hdlobject listhead, - hdlobject h, - Point pt, - boolean flshiftkey, - boolean fl2click) -{ -#pragma unused (listhead, pt, flshiftkey) - hdlicondata hdata = (hdlicondata) (**h).objectdata; tyiconclickcallback lcallback = (**hdata).iconclick; Modified: Frontier/branches/Int64/Common/IOAToolkit/ioapicture.c =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioapicture.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioapicture.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -87,7 +87,7 @@ static boolean debugpicture (hdlobject h, bigstring errorstring) { #pragma unused(h) - + setstringlength (errorstring, 0); return (true); Modified: Frontier/branches/Int64/Common/IOAToolkit/ioapopup.c =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioapopup.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioapopup.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -385,12 +385,12 @@ (*r).bottom = (*r).top + height; - /*side-effect -- we use the popup width when drawing the object*/ - { + /*side-effect -- we use the popup width when drawing the object*/ { + hdlpopupdata lhdata = (hdlpopupdata) (**h).objectdata; - + (**lhdata).popupwidth = popupwidth; - } + } return (true); } /*cleanpopup*/ @@ -420,7 +420,7 @@ static boolean clickpopup (hdlobject listhead, hdlobject h, Point pt, boolean flshiftkey, boolean fl2click) { -#pragma unused (listhead, flshiftkey, fl2click) +#pragma unused(listhead, flshiftkey, fl2click) hdlpopupdata hdata = (hdlpopupdata) (**h).objectdata; hdlcard hc = (**h).owningcard; @@ -517,16 +517,9 @@ #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, depth, isColorDev) + static void MyThemeButtonDrawCallback (const Rect *bounds, ThemeButtonKind kind, const ThemeButtonDrawInfo *info, + UInt32 refcon, SInt16 depth, Boolean isColorDev) { +#pragma unused(kind, info, depth, isColorDev) /* 7.0b48 PBS: draw the label for a popup menu. @@ -679,14 +672,14 @@ return (true); /*we do want to edit it*/ } /*initpopup*/ - - + + static boolean recalcpopup (hdlobject h, boolean flmajorrecalc) { -#pragma unused (flmajorrecalc) +#pragma unused(flmajorrecalc) bigstring errorstring; Handle htoss; - + if (!IOAevalscript (h, (**h).objectrecalcscript, &htoss, (**h).objectlanguage, errorstring)) return (false); @@ -735,15 +728,15 @@ return (true); } /*getpopupinvalrect*/ - - + + static boolean canreplicatepopup (hdlobject h) { -#pragma unused (h) +#pragma unused(h) return (true); } /*canreplicatepopup*/ - + static boolean getpopupeditrect (hdlobject h, Rect *redit) { hdlpopupdata hdata = (hdlpopupdata) (**h).objectdata; @@ -776,7 +769,7 @@ static boolean debugpopup (hdlobject h, bigstring errorstring) { -#pragma unused (h) +#pragma unused(h) setstringlength (errorstring, 0); Modified: Frontier/branches/Int64/Common/IOAToolkit/ioaradio.c =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioaradio.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioaradio.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -80,7 +80,8 @@ static boolean canreplicateradio (hdlobject h) { -#pragma unused (h) +#pragma unused(h) + return (true); /*it can be replicated*/ } /*canreplicateradio*/ @@ -108,7 +109,8 @@ static boolean debugradio (hdlobject h, bigstring errorstring) { -#pragma unused (h) +#pragma unused(h) + setstringlength (errorstring, 0); return (true); @@ -117,18 +119,14 @@ #if TARGET_API_MAC_CARBON == 1 -static void -MyThemeButtonDrawCallback ( - const Rect *bounds, - ThemeButtonKind kind, - const ThemeButtonDrawInfo *info, - UInt32 refcon, - SInt16 depth, - Boolean isColorDev) -{ + static void MyThemeButtonDrawCallback (const Rect *bounds, ThemeButtonKind kind, const ThemeButtonDrawInfo *info, + UInt32 refcon, SInt16 depth, Boolean isColorDev) { #pragma unused(bounds, kind, info, refcon, depth, isColorDev) - //StringPtr bs = (StringPtr) refcon; + //StringPtr bs = (StringPtr) refcon; + + //pushstyle (geneva, 10, 0); + //pushstyle (geneva, 10, 0); //movepento ((*bounds).left, (*bounds).top + 10); @@ -226,12 +224,14 @@ static boolean initradio (tyobject *obj) { #pragma unused(obj) + return (true); /*nothing special, we do want to edit it*/ } /*initradio*/ static boolean recalcradio (hdlobject h, boolean flmajorrecalc) { #pragma unused(flmajorrecalc) + bigstring errorstring; Handle hboolvalue; @@ -246,6 +246,7 @@ static boolean clickradio (hdlobject listhead, hdlobject h, Point pt, boolean flshiftkey, boolean fl2click) { #pragma unused(pt, flshiftkey, fl2click) + /* the one you hit goes on, all others go off */ Modified: Frontier/branches/Int64/Common/IOAToolkit/ioarect.c =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioarect.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioarect.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -82,13 +82,15 @@ static boolean canreplicaterect (hdlobject h) { -#pragma unused (h) +#pragma unused(h) + return (false); /*it can't be replicated*/ } /*canreplicaterect*/ static boolean getrecteditrect (hdlobject h, Rect *r) { -#pragma unused (h, r) +#pragma unused(h, r) + return (false); /*can't be edited*/ } /*getrecteditrect*/ @@ -100,7 +102,8 @@ static boolean debugrectobject (hdlobject h, bigstring errorstring) { -#pragma unused (h) +#pragma unused(h) + setstringlength (errorstring, 0); return (true); @@ -181,7 +184,8 @@ static boolean clickrect (hdlobject listhead, hdlobject h, Point pt, boolean flshiftkey, boolean fl2click) { -#pragma unused (listhead, pt, flshiftkey, fl2click) +#pragma unused(listhead, pt, flshiftkey, fl2click) + IOArunbuttonscript (h); return (true); /*do a minor recalc*/ Modified: Frontier/branches/Int64/Common/IOAToolkit/ioascrollbar.c =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioascrollbar.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioascrollbar.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -81,7 +81,8 @@ static boolean cleanscrollbar (hdlobject h, short textheight, short textwidth, Rect *r) { -#pragma unused (textheight, textwidth) +#pragma unused(textwidth, textheight) + short height, width; if (!checkcontrolexists (h)) @@ -175,7 +176,9 @@ #endif static boolean clickscrollbar (hdlobject listhead, hdlobject h, Point pt, boolean flshiftkey, boolean fl2click) { -#pragma unused (listhead, flshiftkey, fl2click) +#pragma unused(listhead, flshiftkey, fl2click) + + // hdlscrollbardata hdata = (hdlscrollbardata) (**h).objectdata; hdlcard hc = (**h).owningcard; if (!checkcontrolexists (h)) @@ -297,7 +300,8 @@ static boolean recalcscrollbar (hdlobject h, boolean flmajorrecalc) { -#pragma unused (flmajorrecalc) +#pragma unused(flmajorrecalc) + return (IOArecalcobjectvalue (h)); } /*recalcscrollbar*/ @@ -311,13 +315,15 @@ static boolean canreplicatescrollbar (hdlobject h) { -#pragma unused (h) +#pragma unused(h) + return (true); } /*canreplicatescrollbar*/ static boolean getscrollbareditrect (hdlobject h, Rect *r) { -#pragma unused (h, r) +#pragma unused(h, r) + return (false); /*can't be edited*/ } /*getscrollbareditrect*/ @@ -343,7 +349,8 @@ static boolean debugscrollbar (hdlobject h, bigstring errorstring) { -#pragma unused (h) +#pragma unused(h) + setstringlength (errorstring, 0); return (true); Modified: Frontier/branches/Int64/Common/IOAToolkit/ioastatic.c =================================================================== --- Frontier/branches/Int64/Common/IOAToolkit/ioastatic.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IOAToolkit/ioastatic.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -105,7 +105,7 @@ static boolean debugstatic (hdlobject h, bigstring errorstring) { -#pragma unused (h) +#pragma unused(h) setstringlength (errorstring, 0); @@ -134,14 +134,14 @@ static boolean initstatic (tyobject *obj) { -#pragma unused (obj) +#pragma unused(obj) return (true); /*we do want to edit it*/ } /*initstatic*/ static boolean recalcstatic (hdlobject h, boolean flmajorrecalc) { -#pragma unused (flmajorrecalc) +#pragma unused(flmajorrecalc) return (IOArecalcobjectvalue (h)); } /*recalcstatic*/ Modified: Frontier/branches/Int64/Common/IowaRuntime/Headers/iowaruntime.h =================================================================== --- Frontier/branches/Int64/Common/IowaRuntime/Headers/iowaruntime.h 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IowaRuntime/Headers/iowaruntime.h 2006-04-07 18:04:09 UTC (rev 1219) @@ -112,7 +112,8 @@ boolean runCard (Handle, boolean, short, short, tycardeventcallback); -boolean runHostedCard (WindowPtr hostwindow, Handle hpackedcard, boolean flscriptedcard, tycardeventcallback lcallback); +// 2006-04-03 - kw --- renamed parameter +boolean runHostedCard (WindowPtr hostwindow, Handle hpackedcard, boolean flscriptedcard, tycardeventcallback pcallback); boolean setObjectValue (hdlcard, bigstring, Handle); Modified: Frontier/branches/Int64/Common/IowaRuntime/Source/iowacore.c =================================================================== --- Frontier/branches/Int64/Common/IowaRuntime/Source/iowacore.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IowaRuntime/Source/iowacore.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -908,13 +908,13 @@ if ((**h).objecthasframe) { - Rect lrobject; + Rect tempRect; // 2006-04-03 - kw ---renamed from robject - shadowwarning - lrobject = (**h).objectrect; + tempRect = (**h).objectrect; - if (!EmptyRect (&lrobject)) { /*user has changed its rect, it takes precedence*/ + if (!EmptyRect (&tempRect)) { /*user has changed its rect, it takes precedence*/ - rgroup = lrobject; + rgroup = tempRect; goto exit; } Modified: Frontier/branches/Int64/Common/IowaRuntime/Source/iowaruntime.c =================================================================== --- Frontier/branches/Int64/Common/IowaRuntime/Source/iowaruntime.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IowaRuntime/Source/iowaruntime.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -305,9 +305,7 @@ WindowPtr w; hdlcard hc; boolean beginendupdate; - Rect windBounds; // kw - 2006-02-02 --- osx refactoring - CGrafPtr thePort; - + if (hw == nil) // 7.3.97 dmb: can happen when multiple cards are started quickly return; @@ -316,18 +314,31 @@ beginendupdate = (**hw).ownwindow; /* || (**hc).macevent.what != updateEvt;*/ assert ((**hc).drawwindow == w); - - thePort = getmacwindowport(w); - - pushmacport (thePort); // kw - 2006-02-02 --- osx refactoring - + //Code change by Timothy Paustian Monday, August 21, 2000 9:34:50 PM + //have to use the port can't cast a window in OS X + { + CGrafPtr thePort; + #if TARGET_API_MAC_CARBON == 1 + thePort = GetWindowPort(w); + #else + thePort = (CGrafPtr)w; + #endif + pushmacport (thePort); + } if ((**hc).fullupdate) { - // kw - 2006-02-02 --- osx refactoring + //Code change by Timothy Paustian Friday, May 5, 2000 10:49:31 PM + //Changed to Opaque call for Carbon + //This may actually be useless in Carbon + #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 + CGrafPtr thePort; + Rect windBounds; + thePort = GetWindowPort(w); + GetPortBounds(thePort, &windBounds); + InvalWindowRect (w, &windBounds); + #else + InvalRect (&(*w).portRect); + #endif - windBounds = getwindowportrect(w); - - invalmacwindowrect(w, windBounds); - (**hc).fullupdate = false; } @@ -337,10 +348,10 @@ //Changed to Opaque call for Carbon #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 { - CGrafPtr lthePort; + CGrafPtr thePort; RgnHandle visRgn = NewRgn(); - lthePort = GetWindowPort(w); - visRgn = GetPortVisibleRegion(lthePort, visRgn); + thePort = GetWindowPort(w); + visRgn = GetPortVisibleRegion(thePort, visRgn); GetRegionBounds(visRgn, &(**hc).updaterect); DisposeRgn(visRgn); } @@ -360,9 +371,9 @@ //to the screen. Use QDFlushPortBuffer to do this. #if TARGET_API_MAC_CARBON == 1 { - CGrafPtr lthePort; - lthePort = GetWindowPort(w); - QDFlushPortBuffer(lthePort, nil); + CGrafPtr thePort; + thePort = GetWindowPort(w); + QDFlushPortBuffer(thePort, nil); } #endif iowadata = oldiowadata; @@ -457,18 +468,14 @@ nomad = (**nomad).nextinthread; } /*while*/ - + if (nearestnomad == nil) /*wrap around to the first guy*/ - { *hnext = lowestnomad; - } else - { *hnext = nearestnomad; - } -} /*getnexttextobject*/ + } /*getnexttextobject*/ + - static void getprevtextobject (hdlobject h, hdlobject *hnext) { hdlcard hc = iowadata; @@ -563,15 +570,21 @@ boolean recalcCardWindow (WindowPtr w, boolean flmajorrecalc) { - CGrafPtr thePort; - if (w == nil) return (false); - thePort = getmacwindowport(w); - + //Code change by Timothy Paustian Monday, August 21, 2000 9:34:50 PM + //have to use the port can't cast a window in OS X + { + CGrafPtr thePort; + #if TARGET_API_MAC_CARBON == 1 + thePort = GetWindowPort(w); + #else + thePort = (CGrafPtr)w; + #endif pushmacport (thePort); - + } + runtimedata = getwindowdata (w); /*set up global for runmode routines*/ iowadata = getwindowcardrecord (w); /*set up global for card routines*/ @@ -600,12 +613,10 @@ static void filterevent (EventRecord *ev) { + // 2006-04-03 - kw --- renamed callback -> lCallback + tycardeventcallback lCallback = (**runtimedata).callback; - CGrafPtr thePort; - - tycardeventcallback lcallback = (**runtimedata).callback; - - if (lcallback == nil) + if (lCallback == nil) return; if ((*ev).what == nullEvent) /*DW 8/22/93*/ @@ -618,55 +629,64 @@ clearbytes (&x, longsizeof (x)); x.what = iowaSetHandleEvent; - + x.message = (long) iowadata; - - (*lcallback) (&x); + + (*lCallback) (&x); } - - thePort = getmacwindowport((**iowadata).drawwindow); - + + //Code change by Timothy Paustian Monday, August 21, 2000 9:34:50 PM + //have to use the port can't cast a window in OS X + { + CGrafPtr thePort; + #if TARGET_API_MAC_CARBON == 1 + thePort = GetWindowPort((**iowadata).drawwindow); + #else + thePort = (CGrafPtr)(**iowadata).drawwindow; + #endif pushmacport (thePort); - - (*lcallback) (ev); - + } + + (*lCallback) (ev); + popmacport (); } /*filterevent*/ - - + + static void sendinitmessage (void) { tycardeventcallback lcallback = (**runtimedata).callback; EventRecord ev; - + if (lcallback == nil) return; - + ev.what = iowaInitEvent; - + ev.message = (long) iowadata; - + (*lcallback) (&ev); } /*sendinitmessage*/ - - + + static boolean sendbuttonhitmessage (hdlobject h) { /* return true if the buttonhit has been fully processed */ - tycardeventcallback lcallback = (**runtimedata).callback; + // 2006-04-03 - kw --- renamed callback -> lCallback + tycardeventcallback lCallback = (**runtimedata).callback; EventRecord ev; - if (lcallback == nil) + if (lCallback == nil) return (true); ev.what = iowaButtonHitEvent; ev.message = (long) h; - (*lcallback) (&ev); + (*lCallback) (&ev); if (ev.what == iowaRunScriptEvent) /*pass the buttonhit thru, run the script*/ return (false); @@ -686,17 +706,18 @@ giving him a chance to save data from the card. */ - tycardeventcallback lcallback = (**runtimedata).callback; + // 2006-04-03 - kw --- renamed callback -> lCallback + tycardeventcallback lCallback = (**runtimedata).callback; EventRecord ev; - if (lcallback == nil) + if (lCallback == nil) return (true); ev.what = iowaCloseEvent; ev.message = (long) iowadata; - (*lcallback) (&ev); + (*lCallback) (&ev); return (ev.what != iowaCancelEvent); } /*sendclosemessage*/ @@ -707,50 +728,40 @@ /* the user just clicked on this object in run mode. */ - - /*click on a clone is the same as clicking on the object*/ - derefclone (&h); - + + derefclone (&h); /*click on a clone is the same as clicking on the object*/ + if (sameasbuttontype ((**h).objecttype)) { - + if (sendbuttonhitmessage (h)) { - - /*protect against a closed window*/ - if (iowadata != nil) + + if (iowadata != nil) /*protect against a closed window*/ schedulerecalc (h, 0); - + return; } } - - if ( callclick( - listhead, - h, - mousestatus.localpt, - keyboardstatus.flshiftkey, - mousestatus.fldoubleclick)) - { + + if (callclick (listhead, h, mousestatus.localpt, keyboardstatus.flshiftkey, mousestatus.fldoubleclick)) { + if (iowadata == nil) /*protect against closed window*/ return; - - /*1/25/93 DW: very rarely you need to disable the quick recalc*/ - if (!flquickrecalc) { - + + if (!flquickrecalc) { /*1/25/93 DW: very rarely you need to disable the quick recalc*/ + flquickrecalc = true; /*must be reset for every call*/ - + return; } - + /*1/24/93 DW: streamlined for quick response to click and in recalc*/ - - /*avoid lag in display during massive recalcs*/ - runmodeupdate (); + + runmodeupdate (); /*avoid lag in display during massive recalcs*/ - /*make this card's table global*/ - frontSetRuntimeCard (true, false); - + frontSetRuntimeCard (true, false); /*make this card's table global*/ + (**iowadata).recalcobject = h; - + visitobjects ((**iowadata).objectlist, &minorrecalcvisit); /*recalc now, avoid lag*/ runmodeupdate (); /*avoid lag in display, agents might need to run now*/ @@ -834,16 +845,14 @@ (**hc).trackerobject = h; - /*display button in its hot state*/ - hotobject (true); + hotobject (true); /*display button in its hot state*/ waitfornexttick (); waitfornexttick (); waitfornexttick (); + + hotobject (false); /*display button in its un-hot state*/ - /*display button in its un-hot state*/ - hotobject (false); - (**hc).tracking = false; - + objectclick ((**iowadata).objectlist, h); return (false); /*stop searching*/ @@ -882,14 +891,16 @@ return (true); } - */ - if (ch == '.') - keyboardstatus.chkb = ch = chescape; - else -#endif + */ + if (ch == '.') + keyboardstatus.chkb = ch = chescape; + else + + #endif + return (false); /*we pass on all other cmd-keystrokes*/ } - + if (ch == chescape) { /*escape always kills the card*/ visitobjects ((**hc).objectlist, &mapkeyvisit); /*dmb 1.0b20*/ @@ -905,20 +916,17 @@ if (ch == chtab) { movetextboxcursor (keyboardstatus.flshiftkey); - + return (true); } - - if ((ch == chreturn) || (ch == chenter)) - { - if ( !keyboardstatus.floptionkey - || activetextobject == nil) /*dmb 1.0b20*/ - { + + if ((ch == chreturn) || (ch == chenter)) { + + if (!keyboardstatus.floptionkey || activetextobject == nil) /*dmb 1.0b20*/ if (!visitobjects ((**hc).objectlist, &returnkeyvisit)) return (true); } - } - + if (activetextobject == nil) { /*3/18/93 DW -- map keystroke to button*/ visitobjects ((**hc).objectlist, &mapkeyvisit); @@ -1021,9 +1029,7 @@ static void runmodecontentclick (WindowPtr w, Point pt) { - - CGrafPtr thePort; - + hdlobject listhead, x; if (w != FrontWindow ()) { @@ -1033,11 +1039,17 @@ return; } + //Code change by Timothy Paustian Wednesday, August 23, 2000 9:20:43 PM + // + { + #if TARGET_API_MAC_CARBON + CGrafPtr thePort = GetWindowPort(w); + #else + GrafPtr thePort = (GrafPtr)w; + #endif - thePort = getmacwindowport(w); - SetPort (thePort); - + } mousestatus.localpt = pt; globaltolocalpoint (w, &mousestatus.localpt); @@ -1144,30 +1156,45 @@ hdlcard hc = iowadata; WindowPtr w = (**runtimedata).macwindow; Rect portRect; - CGrafPtr thePort; - + if ((**hc).needsupdate && ((**hc).runmode)) { - - /*consume it*/ - (**hc).needsupdate = false; - thePort = getmacwindowport(w); - + (**hc).needsupdate = false; /*consume it*/ + + //Code change by Timothy Paustian Monday, August 21, 2000 9:34:50 PM + //have to use the port can't cast a window in OS X + { + CGrafPtr thePort; + #if TARGET_API_MAC_CARBON == 1 + thePort = GetWindowPort(w); + #else + thePort = (CGrafPtr)w; + #endif pushmacport (thePort); + } - portRect = getwindowportrect(w); + //Code change by Timothy Paustian Friday, May 5, 2000 10:55:27 PM + //Changed to Opaque call for Carbon + #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 + { + CGrafPtr thePort = GetWindowPort(w); + GetPortBounds(thePort, &portRect); + } + #else + portRect = w->portRect; + #endif pushclip (portRect); iowapreupdate (); /*actually inval everything that's been logically inval'd*/ - + runmodeupdate (); popclip (); popmacport (); - } -} /*runmodecheckupdate*/ + } + } /*runmodecheckupdate*/ static boolean alwaysidlevisit (hdlobject h) { @@ -1207,10 +1234,8 @@ boolean closeCardWindow (WindowPtr w) { - - CGrafPtr thePort; + Boolean ownwindow; - if (!isCardWindow (w)) return (false); @@ -1224,15 +1249,22 @@ ownwindow = (**runtimedata).ownwindow; -#ifdef iowaRuntimeInApp /*12/5/93 DW -- baling wire*/ - iowadata = getwindowcardrecord (w); -#endif - - thePort = getmacwindowport(w); - - /*8/27/94 DW -- on quit, if one modeless card is open, the port isn't properly set*/ + #ifdef iowaRuntimeInApp /*12/5/93 DW -- baling wire*/ + iowadata = getwindowcardrecord (w); + #endif + + //Code change by Timothy Paustian Monday, August 21, 2000 9:34:50 PM + //have to use the port can't cast a window in OS X + { + CGrafPtr thePort; + #if TARGET_API_MAC_CARBON == 1 + thePort = GetWindowPort(w); + #else + thePort = (CGrafPtr)w; + #endif pushmacport (thePort); - + } /*8/27/94 DW -- on quit, if one modeless card is open, the port isn't properly set*/ + clearactivetextobject (); popmacport (); @@ -1421,15 +1453,14 @@ pendrawline (r.right, r.bottom); /*draw bottom of box*/ -#if TARGET_API_MAC_CARBON == 1 - { + #if TARGET_API_MAC_CARBON == 1 + + { Rect rwindow; Rect rbackground; //short depth; - - // kw - 2006-02-02 --- this needs polish! - CGrafPtr thePort = getmacwindowport(w); - + CGrafPtr thePort = GetWindowPort (w); + GetPortBounds (thePort, &rwindow); //depth = maxdepth (&rwindow); @@ -1465,11 +1496,11 @@ poppen (); } - -#endif + + + #endif } /*frame3sides*/ - WindowPtr newCardWindow (Point pt, boolean notscriptedcard, Handle hpackedcard) { /* @@ -1482,8 +1513,7 @@ WindowPtr w = nil; hdlruntimerecord hw; hdlcard hc; - CGrafPtr thePort; - + iowadata = nil; if (!newclearhandle (longsizeof (tyruntimerecord), (Handle *) &runtimedata)) @@ -1509,9 +1539,8 @@ (**hc).updatecallback = &runmodeupdate; - /*DW 10/17/93: transition from default window resources, to letting the card specify*/ - { - + /*DW 10/17/93: transition from default window resources, to letting the card specify*/ { + short resnum = (**hc).idwindow; /*first try, use the resnum specified by card editor*/ if (systemhascolor ()) @@ -1521,42 +1550,51 @@ if (w == nil) goto error; + + #if TARGET_API_MAC_CARBON == 1 /*Theme background on OS X*/ + + if (!cardContainsEditTextObject (hc)) + + SetThemeWindowBackground (w, kThemeBrushModelessDialogBackgroundActive, false); -#if TARGET_API_MAC_CARBON == 1 /*Theme background on OS X*/ + else { + + SetPort (GetWindowPort (w)); - if (!cardContainsEditTextObject (hc)) - { - SetThemeWindowBackground (w, kThemeBrushModelessDialogBackgroundActive, false); + frameedittextrect (edittextrect, w); + } /*else*/ + + #endif } - else - { - SetPort (GetWindowPort (w)); - - frameedittextrect (edittextrect, w); - } /*else*/ -#endif - } SizeWindow (w, (**hc).rightborder, (**hc).bottomborder, false); ShowWindow (w); + //Code change by Timothy Paustian Wednesday, August 23, 2000 9:20:56 PM + // + { + #if TARGET_API_MAC_CARBON + CGrafPtr thePort = GetWindowPort(w); + #else + GrafPtr thePort = (GrafPtr)w; + #endif - thePort = getmacwindowport(w); - SetPort (thePort); - + } + if ((pt.h != 0) && (pt.v != 0)) MoveWindow (w, pt.h, pt.v, false); else { //Code change by Timothy Paustian Monday, June 26, 2000 3:15:51 PM -#if TARGET_API_MAC_CARBON == 1 + // + #if TARGET_API_MAC_CARBON == 1 BitMap screenBits; GetQDGlobalsScreenBits(&screenBits); centerwindow(w, screenBits.bounds); -#else + #else centerwindow (w, quickdrawglobal (screenBits).bounds); -#endif + #endif } (**hw).macwindow = w; @@ -1788,9 +1826,16 @@ releasetemphandles (); /*dispose of any temps created by the previous event*/ - thePort = getmacwindowport(w); - + //Code change by Timothy Paustian Monday, August 21, 2000 9:34:50 PM + //have to use the port can't cast a window in OS X + { + #if TARGET_API_MAC_CARBON == 1 + thePort = GetWindowPort(w); + #else + thePort = (CGrafPtr)w; + #endif pushmacport (thePort); + } cardcheckinit (); @@ -2252,14 +2297,8 @@ } /*passthruevent*/ -boolean -runModalCard ( - Handle hpackedcard, - boolean flscriptedcard, - short top, - short pLeft, - tycardeventcallback pCallback) -{ +boolean runModalCard (Handle hpackedcard, boolean flscriptedcard, short top, short pLeft, tycardeventcallback pCallback) { + // 2006-04-03 - kw --- renamed params left -pLeft, callback -> pCallback /* dmb 1.0b24: changed flcallback logic. we no longer call back on activate and update events that we just handled @@ -2271,31 +2310,30 @@ WindowPtr modalwindow; Point winpos; boolean flreturn; - CGrafPtr thePort; - + GetPort (&oldport); installRuntimeEventHandlers (); - + winpos.v = top; - + winpos.h = pLeft; - + modalwindow = newCardWindow (winpos, !flscriptedcard, hpackedcard); - + flreturn = true; if (modalwindow == nil) { flreturn = false; - + goto exit; } - + (**runtimedata).callback = pCallback; - + (**runtimedata).modeless = false; - + if (flscriptedcard) { if (!frontStartCard (nil)) { @@ -2304,12 +2342,19 @@ goto exit; } + } + //Code change by Timothy Paustian Wednesday, August 23, 2000 9:21:06 PM + // + { + #if TARGET_API_MAC_CARBON + CGrafPtr thePort = GetWindowPort(modalwindow); + #else + GrafPtr thePort = (GrafPtr)modalwindow; + #endif + + SetPort (thePort); } - - thePort = getmacwindowport(modalwindow); - - SetPort (thePort); - + sendinitmessage (); cardcheckinit (); /*1.0b23 dmb: init field before showing the card. more responsive*/ @@ -2352,24 +2397,30 @@ } } */ - + if ((flcallback) && (pCallback != nil)) { hdlcard loldiowadata = iowadata; hdlruntimerecord loldruntimedata = runtimedata; - + (*pCallback) (&ev); - + iowadata = loldiowadata; - + runtimedata = loldruntimedata; - - thePort = getmacwindowport(modalwindow); - + //Code change by Timothy Paustian Wednesday, August 23, 2000 9:21:26 PM + // + { + #if TARGET_API_MAC_CARBON + CGrafPtr thePort = GetWindowPort(modalwindow); + #else + GrafPtr thePort = (GrafPtr)modalwindow; + #endif + SetPort (thePort); - - } - + } + } + if (flexitcardloop) break; @@ -2380,16 +2431,16 @@ break; } /*while*/ -exit: + exit: + + flexitcardloop = false; /*we consume it, modal cards can be nested*/ - flexitcardloop = false; /*we consume it, modal cards can be nested*/ - - /*restore saved globals*/ - { + /*restore saved globals*/ { + iowadata = oldiowadata; - + runtimedata = oldruntimedata; - + SetPort (oldport); } @@ -2401,9 +2452,15 @@ hdlcard oldiowadata = iowadata; hdlruntimerecord oldruntimedata = runtimedata; - boolean flreturn = false; + //Code change by Timothy Paustian Monday, June 26, 2000 3:16:19 PM + // + #if TARGET_API_MAC_CARBON == 1 + CGrafPtr oldport = GetQDGlobalsThePort(); + #else + GrafPtr oldport = quickdrawglobal (thePort); + #endif + boolean flreturn = false; WindowPtr w; - CGrafPtr oldport = getport(); if ((*ev).what == nullEvent) { @@ -2449,12 +2506,16 @@ hdlcard oldiowadata = iowadata; hdlruntimerecord oldruntimedata = runtimedata; - Point winpos; + //Code change by Timothy Paustian Monday, June 26, 2000 3:15:15 PM + // + #if TARGET_API_MAC_CARBON == 1 + CGrafPtr oldport = GetQDGlobalsThePort(); + #else + GrafPtr oldport = quickdrawglobal (thePort); + #endif + Point winpos; WindowPtr modelesswindow; boolean flreturn; - CGrafPtr - oldport = getmacqdglobaltheport(), - thePort; installRuntimeEventHandlers (); @@ -2487,9 +2548,17 @@ } } - thePort = getmacwindowport(modelesswindow); - + //Code change by Timothy Paustian Wednesday, August 23, 2000 9:21:06 PM + // + { + #if TARGET_API_MAC_CARBON + CGrafPtr thePort = GetWindowPort(modelesswindow); + #else + GrafPtr thePort = (GrafPtr)modelesswindow; + #endif + SetPort (thePort); + } sendinitmessage (); @@ -2497,52 +2566,41 @@ ShowWindow (modelesswindow); -exit: + exit: - /*restore saved globals*/ - { + /*restore saved globals*/ { + iowadata = oldiowadata; - + runtimedata = oldruntimedata; - + SetPort (oldport); - } + } + return (flreturn); } /*runModelessCard*/ + - -boolean -runCard ( - Handle hpackedcard, - boolean flscriptedcard, - short top, - short pLeft, - tycardeventcallback pCallback) -{ - +boolean runCard (Handle hpackedcard, boolean flscriptedcard, short top, short pleft, tycardeventcallback pcallback) { + boolean fl; - + if (cardIsModal (hpackedcard)) - fl = runModalCard (hpackedcard, flscriptedcard, top, pLeft, pCallback); + fl = runModalCard (hpackedcard, flscriptedcard, top, pleft, pcallback); else - fl = runModelessCard (hpackedcard, flscriptedcard, top, pLeft, pCallback); - + fl = runModelessCard (hpackedcard, flscriptedcard, top, pleft, pcallback); + return (fl); } /*runCard*/ #pragma global_optimizer off -static WindowPtr -moveIntoCardWindow ( - WindowPtr hostwindow, - boolean notscriptedcard, - Handle hpackedcard) -{ - +static WindowPtr moveIntoCardWindow (WindowPtr hostwindow, boolean notscriptedcard, Handle hpackedcard) { + /* use existing window to run the packed card. - + dmb 2.1.96: this could share plenty of code with newCardWindow */ @@ -2609,21 +2667,14 @@ #pragma global_optimizer reset -boolean -runHostedCard ( - WindowPtr hostwindow, - Handle hpackedcard, - boolean flscriptedcard, - tycardeventcallback pCallback) -{ +boolean runHostedCard (WindowPtr hostwindow, Handle hpackedcard, boolean flscriptedcard, tycardeventcallback pCallback) { hdlcard oldiowadata = iowadata; hdlruntimerecord oldruntimedata = runtimedata; GrafPtr oldport; WindowPtr modelesswindow; boolean flreturn; - CGrafPtr thePort; - + GetPort (&oldport); installRuntimeEventHandlers (); @@ -2645,21 +2696,28 @@ goto exit; } } + //Code change by Timothy Paustian Wednesday, August 23, 2000 9:21:06 PM + // + { + #if TARGET_API_MAC_CARBON + CGrafPtr thePort = GetWindowPort(modelesswindow); + #else + GrafPtr thePort = (GrafPtr)modelesswindow; + #endif - thePort = getmacwindowport(modelesswindow); - SetPort (thePort); + } sendinitmessage (); -exit: + exit: - /*restore saved globals*/ - { + /*restore saved globals*/ { + iowadata = oldiowadata; - + runtimedata = oldruntimedata; - + SetPort (oldport); } Modified: Frontier/branches/Int64/Common/IowaRuntime/Source/iowascript.c =================================================================== --- Frontier/branches/Int64/Common/IowaRuntime/Source/iowascript.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/IowaRuntime/Source/iowascript.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -388,7 +388,7 @@ #endif static boolean rungraphicalurl (Handle hscript, bigstring errorstring) { -#pragma unused (hscript) +#pragma unused(hscript) setstringlength (errorstring, 0); Modified: Frontier/branches/Int64/Common/PCRE/pcre.c =================================================================== --- Frontier/branches/Int64/Common/PCRE/pcre.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/PCRE/pcre.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -1715,22 +1715,31 @@ posix_class *= 3; for (i = 0; i < 3; i++) - { - BOOL isblank = strncmp((char *)ptr, "blank", 5) == 0; - int taboffset = posix_class_maps[posix_class + i]; - if (taboffset < 0) break; - if (local_negate) + { + BOOL lisblank = strncmp((char *)ptr, "blank", 5) == 0; + int taboffset = posix_class_maps[posix_class + i]; + + if (taboffset < 0) + break; + + if (local_negate) { - for (c = 0; c < 32; c++) class[c] |= ~cbits[c+taboffset]; - if (isblank) class[1] |= 0x3c; + for (c = 0; c < 32; c++) + class[c] |= ~cbits[c+taboffset]; + + if (lisblank) + class[1] |= 0x3c; } - else + else { - for (c = 0; c < 32; c++) class[c] |= cbits[c+taboffset]; - if (isblank) class[1] &= ~0x3c; + for (c = 0; c < 32; c++) + class[c] |= cbits[c+taboffset]; + + if (lisblank) + class[1] &= ~0x3c; } - } - + } + ptr = tempptr + 1; class_charcount = 10; /* Set > 1; assumes more than 1 per class */ continue; /* End of POSIX syntax handling */ Copied: Frontier/branches/Int64/Common/Paige/PaigeWinVC8CRT.lib (from rev 1216, Frontier/trunk/Common/Paige/PaigeWinVC8CRT.lib) =================================================================== (Binary files differ) Modified: Frontier/branches/Int64/Common/Paige/headers/PAIGE.H =================================================================== --- Frontier/branches/Int64/Common/Paige/headers/PAIGE.H 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/Paige/headers/PAIGE.H 2006-04-07 18:04:09 UTC (rev 1219) @@ -1961,7 +1961,9 @@ /* Async Lock/Unlock */ -extern PG_PASCAL (pg_boolean) pgSetLockID (pg_ref pg, long ID); +// 2006-04-04 - kw --- removed parameter names +//extern PG_PASCAL (pg_boolean) pgSetLockID (pg_ref pg, long ID); +extern PG_PASCAL (pg_boolean) pgSetLockID (pg_ref, long); extern PG_PASCAL (long) pgGetLockID (pg_ref pg); @@ -2115,7 +2117,11 @@ extern PG_PASCAL (pg_boolean) pgGetStyleSheet (pg_ref pg, const select_pair_ptr selection, short PG_FAR *style_id); extern PG_PASCAL (short) pgFindStyleSheet (pg_ref pg, const style_info_ptr compare_style, const style_info_ptr mask); -extern PG_PASCAL (short) pgGetIndStyleSheet (pg_ref pg, short index, style_info_ptr stylesheet); + +// 2006-04-04 - kw --- removed parameter names +// extern PG_PASCAL (short) pgGetIndStyleSheet (pg_ref pg, short index, style_info_ptr stylesheet); +extern PG_PASCAL (short) pgGetIndStyleSheet (pg_ref, short, style_info_ptr); + extern PG_PASCAL (short) pgNewParStyle (pg_ref pg, const par_info_ptr new_style); extern PG_PASCAL (void) pgRemoveParStyle (pg_ref pg, short style_id); extern PG_PASCAL (short) pgNumParStyles (pg_ref pg); @@ -2128,17 +2134,28 @@ extern PG_PASCAL (pg_boolean) pgGetParStyleSheet (pg_ref pg, const select_pair_ptr selection, short PG_FAR *style_id); extern PG_PASCAL (short) pgFindParStyleSheet (pg_ref pg, const par_info_ptr compare_style, const par_info_ptr mask); -extern PG_PASCAL (short) pgGetIndParStyleSheet (pg_ref pg, short index, par_info_ptr stylesheet); + +// 2006-04-04 - kw --- removed parameter names +// extern PG_PASCAL (short) pgGetIndParStyleSheet (pg_ref pg, short index, par_info_ptr stylesheet); +extern PG_PASCAL (short) pgGetIndParStyleSheet (pg_ref, short, par_info_ptr); + extern PG_PASCAL (long) pgNewNamedStyle (pg_ref pg, pg_c_string_ptr stylename, const style_info_ptr style, const font_info_ptr font, par_info_ptr par); extern PG_PASCAL (long) pgAddNamedStyle (pg_ref pg, pg_c_string_ptr stylename, const short style_id, const short par_id); extern PG_PASCAL (void) pgApplyNamedStyle (pg_ref pg, select_pair_ptr selection, pg_c_string_ptr stylename, short draw_mode); -extern PG_PASCAL (void) pgApplyNamedStyleIndex (pg_ref pg, select_pair_ptr selection, long index, short draw_mode); + +// 2006-04-04 - kw --- removed parameter names +// extern PG_PASCAL (void) pgApplyNamedStyleIndex (pg_ref pg, select_pair_ptr selection, long index, short draw_mode); +extern PG_PASCAL (void) pgApplyNamedStyleIndex (pg_ref, select_pair_ptr, long, short); + extern PG_PASCAL (long) pgNumNamedStyles (pg_ref pg); extern PG_PASCAL (long) pgGetNamedStyleIndex (pg_ref pg, pg_c_string_ptr stylename); -extern PG_PASCAL (void) pgGetNamedStyleInfo (pg_ref pg, long index, style_info_ptr style, - font_info_ptr font, par_info_ptr par); + +// 2006-04-04 - kw --- removed parameter names +// extern PG_PASCAL (void) pgGetNamedStyleInfo (pg_ref pg, long index, style_info_ptr style, font_info_ptr font, par_info_ptr par); +extern PG_PASCAL (void) pgGetNamedStyleInfo (pg_ref, long, style_info_ptr, font_info_ptr, par_info_ptr); + extern PG_PASCAL (pg_boolean) pgGetNamedStyle (pg_ref pg, long named_style_index, named_stylesheet_ptr named_style); extern PG_PASCAL (pg_boolean) pgGetAppliedNamedStyle (pg_ref pg, select_pair_ptr selection, pg_c_string_ptr stylename); extern PG_PASCAL (void) pgDeleteNamedStyle (pg_ref pg, long named_style_index); @@ -2341,7 +2358,11 @@ pg_short_t exclusion2, short draw_mode); extern PG_PASCAL (void) pgInsertExclusionShape (pg_ref pg, pg_short_t position, shape_ref exclude_shape, short draw_mode); -extern PG_PASCAL (void) pgAttachParExclusion (pg_ref pg, long position, pg_short_t index, short draw_mode); + +// 2006-04-04 - kw --- removed parameter names +// extern PG_PASCAL (void) pgAttachParExclusion (pg_ref pg, long position, pg_short_t index, short draw_mode); +extern PG_PASCAL (void) pgAttachParExclusion (pg_ref, long, pg_short_t, short); + extern PG_PASCAL (long) pgGetAttachedPar (pg_ref pg, pg_short_t exclusion); Modified: Frontier/branches/Int64/Common/UserLandIACToolkit/land.c =================================================================== --- Frontier/branches/Int64/Common/UserLandIACToolkit/land.c 2006-04-07 15:25:44 UTC (rev 1218) +++ Frontier/branches/Int64/Common/UserLandIACToolkit/land.c 2006-04-07 18:04:09 UTC (rev 1219) @@ -586,6 +586,7 @@ pascal boolean landefaultbreakembrace (EventRecord *ev) { +#pragma unused (ev) /* return true if the user is holding down the cmd, option and shift keys. Modified: Frontier/branches/Int64/Common/UserLandIACToolkit/landgetparam.c =================================================================== --- ... [truncated message content] |
|
From: <set...@us...> - 2006-04-07 15:25:49
|
Revision: 1218 Author: sethdill Date: 2006-04-07 08:25:44 -0700 (Fri, 07 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1218&view=rev Log Message: ----------- Fixed crashing bug. Coerce langdialogwindow to a DialogPtr via carbon's provided casting function. (The crash was doing a select-all in Frontier's Find window on the Mac.) Modified Paths: -------------- Frontier/trunk/Common/source/langmodeless.c Modified: Frontier/trunk/Common/source/langmodeless.c =================================================================== --- Frontier/trunk/Common/source/langmodeless.c 2006-04-06 22:37:23 UTC (rev 1217) +++ Frontier/trunk/Common/source/langmodeless.c 2006-04-07 15:25:44 UTC (rev 1218) @@ -82,8 +82,9 @@ static boolean langdialogselectall (void) { + DialogPtr pdialog = GetDialogFromWindow (langdialogwindow); - return (dialogselectall ((DialogPtr) langdialogwindow)); + return (dialogselectall (pdialog)); } /*langdialogselectall*/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <cre...@us...> - 2006-04-06 22:37:32
|
Revision: 1217 Author: creecode Date: 2006-04-06 15:37:23 -0700 (Thu, 06 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1217&view=rev Log Message: ----------- work-around problem with access denied error on Windows Modified Paths: -------------- ODBs/trunk/frontierRoot/system/verbs/builtins/Frontier/data/DLLs/install.fvc Modified: ODBs/trunk/frontierRoot/system/verbs/builtins/Frontier/data/DLLs/install.fvc =================================================================== --- ODBs/trunk/frontierRoot/system/verbs/builtins/Frontier/data/DLLs/install.fvc 2006-04-06 02:45:49 UTC (rev 1216) +++ ODBs/trunk/frontierRoot/system/verbs/builtins/Frontier/data/DLLs/install.fvc 2006-04-06 22:37:23 UTC (rev 1217) @@ -1,6 +1,8 @@ FrontierVcsFile:2:scpt:system.verbs.builtins.Frontier.data.DLLs.install «Changes + «4/6/06; 2:32:07 PM by TAC + «work-around problem with access denied error on Windows «2/27/06; 11:15:57 AM by TAC «created, cribbed from regex.data.installDLL @@ -18,7 +20,19 @@ if date.versionLessThan (file.getVersion (adrPath^), regex.version) { file.delete (adrPath^)}} else { - file.delete (adrPath^)}}; + try { + file.delete (adrPath^)} + else { + local (f, path = file.folderFromPath (adrPath^), pc = file.getPathChar ()); + local (forDeletionPath = path + "for deletion" + pc); + + if not (file.exists (forDeletionPath)) { + file.newFolder (forDeletionPath)}; + + fileloop (f in forDeletionPath) { + file.delete (f)}; + + file.move (adrPath^, forDeletionPath)}}}; « = adrPath^ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <kar...@us...> - 2006-04-06 02:45:55
|
Revision: 1216 Author: karstenw Date: 2006-04-05 19:45:49 -0700 (Wed, 05 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1216&view=rev Log Message: ----------- parameter unused & name conflict fixes Modified Paths: -------------- Frontier/trunk/Common/source/tablecompare.c Modified: Frontier/trunk/Common/source/tablecompare.c =================================================================== --- Frontier/trunk/Common/source/tablecompare.c 2006-04-06 02:44:20 UTC (rev 1215) +++ Frontier/trunk/Common/source/tablecompare.c 2006-04-06 02:45:49 UTC (rev 1216) @@ -206,7 +206,8 @@ static short tableoverridecomparenodes (hdlhashtable htable, hdlhashnode hnode1, hdlhashnode hnode2) { - +#pragma unused (htable, hnode1) + if (hnode2 == nextnodecompare) return (-1); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <kar...@us...> - 2006-04-06 02:44:26
|
Revision: 1215 Author: karstenw Date: 2006-04-05 19:44:20 -0700 (Wed, 05 Apr 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1215&view=rev Log Message: ----------- parameter unused & name conflict fixes Modified Paths: -------------- Frontier/trunk/Common/PCRE/pcre.c Frontier/trunk/Common/source/OpenTransportNetEvents.c Modified: Frontier/trunk/Common/PCRE/pcre.c =================================================================== --- Frontier/trunk/Common/PCRE/pcre.c 2006-04-06 01:43:43 UTC (rev 1214) +++ Frontier/trunk/Common/PCRE/pcre.c 2006-04-06 02:44:20 UTC (rev 1215) @@ -1715,22 +1715,31 @@ posix_class *= 3; for (i = 0; i < 3; i++) - { - BOOL isblank = strncmp((char *)ptr, "blank", 5) == 0; - int taboffset = posix_class_maps[posix_class + i]; - if (taboffset < 0) break; - if (local_negate) + { + BOOL lisblank = strncmp((char *)ptr, "blank", 5) == 0; + int taboffset = posix_class_maps[posix_class + i]; + + if (taboffset < 0) + break; + + if (local_negate) { - for (c = 0; c < 32; c++) class[c] |= ~cbits[c+taboffset]; - if (isblank) class[1] |= 0x3c; + for (c = 0; c < 32; c++) + class[c] |= ~cbits[c+taboffset]; + + if (lisblank) + class[1] |= 0x3c; } - else + else { - for (c = 0; c < 32; c++) class[c] |= cbits[c+taboffset]; - if (isblank) class[1] &= ~0x3c; + for (c = 0; c < 32; c++) + class[c] |= cbits[c+taboffset]; + + if (lisblank) + class[1] &= ~0x3c; } - } - + } + ptr = tempptr + 1; class_charcount = 10; /* Set > 1; assumes more than 1 per class */ continue; /* End of POSIX syntax handling */ Modified: Frontier/trunk/Common/source/OpenTransportNetEvents.c =================================================================== --- Frontier/trunk/Common/source/OpenTransportNetEvents.c 2006-04-06 01:43:43 UTC (rev 1214) +++ Frontier/trunk/Common/source/OpenTransportNetEvents.c 2006-04-06 02:44:20 UTC (rev 1215) @@ -2459,7 +2459,7 @@ }/*fwsbackgroundtask*/ -static boolean fwsNetEventLaunch (struct hostData *data) { +static boolean fwsNetEventLaunch (void *data) { #pragma unused (data) /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |