You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(42) |
Nov
(368) |
Dec
(248) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(2) |
Feb
(207) |
Mar
(180) |
Apr
(9) |
May
(39) |
Jun
(9) |
Jul
(22) |
Aug
(56) |
Sep
(82) |
Oct
(113) |
Nov
(236) |
Dec
(219) |
2005 |
Jan
(119) |
Feb
(81) |
Mar
(53) |
Apr
(177) |
May
(2) |
Jun
(67) |
Jul
(17) |
Aug
(5) |
Sep
(53) |
Oct
(17) |
Nov
(122) |
Dec
(77) |
2006 |
Jan
(293) |
Feb
(16) |
Mar
(32) |
Apr
(14) |
May
(29) |
Jun
(6) |
Jul
|
Aug
|
Sep
(18) |
Oct
(28) |
Nov
|
Dec
(2) |
2007 |
Jan
(8) |
Feb
(19) |
Mar
(4) |
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(37) |
Oct
(1) |
Nov
(8) |
Dec
(25) |
2008 |
Jan
(1) |
Feb
(13) |
Mar
(17) |
Apr
(3) |
May
(2) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
(19) |
Dec
(16) |
2009 |
Jan
(6) |
Feb
(9) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Rolf K. <lab...@us...> - 2006-03-01 14:56:57
|
Update of /cvsroot/opengtoolkit/lvzip/source/lvzip.llb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23552/source/lvzip.llb Modified Files: ZLIB Extract File.vi ZLIB Open Unzip Archive.vi ZLIB VI Tree.vi Log Message: Index: ZLIB Open Unzip Archive.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Open Unzip Archive.vi,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 Binary files /tmp/cvs5eehEp and /tmp/cvsiqlZkE differ Index: ZLIB Extract File.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Extract File.vi,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 Binary files /tmp/cvsTQZ3dr and /tmp/cvsYauwnG differ Index: ZLIB VI Tree.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB VI Tree.vi,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 Binary files /tmp/cvs8I51eH and /tmp/cvs2Nt09W differ |
From: Rolf K. <lab...@us...> - 2006-03-01 13:39:10
|
Update of /cvsroot/opengtoolkit/lvzip/source/lvzip.llb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7628/source/lvzip.llb Modified Files: ZLIB File Information.vi ZLIB Store File.vi Log Message: Index: ZLIB Store File.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Store File.vi,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 Binary files /tmp/cvsFJVGv7 and /tmp/cvs4uEiHl differ Index: ZLIB File Information.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB File Information.vi,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsIUAqzJ and /tmp/cvsFT0sHZ differ |
From: Rolf K. <lab...@us...> - 2006-03-01 13:38:58
|
Update of /cvsroot/opengtoolkit/lvzip/source/macbin.llb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7628/source/macbin.llb Added Files: MACBIN Has Resource Fork.vi Log Message: --- NEW FILE: MACBIN Has Resource Fork.vi --- (This appears to be a binary file; contents omitted.) |
From: Rolf K. <lab...@us...> - 2006-03-01 13:01:51
|
Update of /cvsroot/opengtoolkit/lvzip/source/lvzip.llb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13976/source/lvzip.llb Modified Files: ZLIB Compress Directory.vi ZLIB Compress Files.vi ZLIB Extract All Files To Dir.vi ZLIB Extract File.vi ZLIB File Information.vi ZLIB Open Unzip Archive.vi ZLIB Open Write File.vi ZLIB Store File.vi ZLIB VI Tree.vi Log Message: Prepare lvZlib library to do transparent MacBinary encoding and decoding. Index: ZLIB Store File.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Store File.vi,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 Binary files /tmp/cvsg6Rape and /tmp/cvsKyWlCO differ Index: ZLIB Extract All Files To Dir.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Extract All Files To Dir.vi,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 Binary files /tmp/cvsvKbSSQ and /tmp/cvsm2wEZv differ Index: ZLIB Open Write File.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Open Write File.vi,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 Binary files /tmp/cvsdZiwUU and /tmp/cvsOprlhA differ Index: ZLIB Compress Files.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Compress Files.vi,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 Binary files /tmp/cvsItXjU7 and /tmp/cvsCgIYHN differ Index: ZLIB Open Unzip Archive.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Open Unzip Archive.vi,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 Binary files /tmp/cvsR3mVWh and /tmp/cvsnMlBaY differ Index: ZLIB File Information.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB File Information.vi,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvscS10TN and /tmp/cvsgV8kmy differ Index: ZLIB Extract File.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Extract File.vi,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 Binary files /tmp/cvsHoBfm3 and /tmp/cvsJGoyrO differ Index: ZLIB Compress Directory.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Compress Directory.vi,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 Binary files /tmp/cvsdyNtF7 and /tmp/cvs8NAqqT differ Index: ZLIB VI Tree.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB VI Tree.vi,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 Binary files /tmp/cvsaQbamd and /tmp/cvsV4WWlZ differ |
From: Rolf K. <lab...@us...> - 2006-03-01 13:01:26
|
Update of /cvsroot/opengtoolkit/lvzip/source/macbin.llb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13976/source/macbin.llb Modified Files: MACBIN Copy Fork To File.vi MACBIN Create Header.vi MACBIN Decode MacBinary.vi MACBIN Encode MacBinary.vi MACBIN Open Resource Fork.vi MACBIN Read Header.vi MACBIN Resource File Info.vi MACBIN VI Tree.vi Log Message: Prepare lvZlib library to do transparent MacBinary encoding and decoding. Index: MACBIN Resource File Info.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/macbin.llb/MACBIN Resource File Info.vi,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 Binary files /tmp/cvssdbhgr and /tmp/cvsvXSBsC differ Index: MACBIN VI Tree.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/macbin.llb/MACBIN VI Tree.vi,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 Binary files /tmp/cvswzCnrv and /tmp/cvsu8TsiH differ Index: MACBIN Create Header.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/macbin.llb/MACBIN Create Header.vi,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsFr6ysW and /tmp/cvs5aefq9 differ Index: MACBIN Decode MacBinary.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/macbin.llb/MACBIN Decode MacBinary.vi,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsOKcD7L and /tmp/cvs7Y4uu1 differ Index: MACBIN Open Resource Fork.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/macbin.llb/MACBIN Open Resource Fork.vi,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 Binary files /tmp/cvs66Wqif and /tmp/cvs18RmRv differ Index: MACBIN Read Header.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/macbin.llb/MACBIN Read Header.vi,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsq8KXpJ and /tmp/cvsj80yH1 differ Index: MACBIN Encode MacBinary.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/macbin.llb/MACBIN Encode MacBinary.vi,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 Binary files /tmp/cvsKD13Yf and /tmp/cvsJ7Ifvz differ Index: MACBIN Copy Fork To File.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/macbin.llb/MACBIN Copy Fork To File.vi,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsuWr3eF and /tmp/cvsRnJJNZ differ |
From: Rolf K. <lab...@us...> - 2006-03-01 11:37:20
|
Update of /cvsroot/opengtoolkit/lvzip/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27379/source Modified Files: lvzlib.dll readme2_3.txt Log Message: Index: readme2_3.txt =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/readme2_3.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** readme2_3.txt 10 Jan 2006 17:20:39 -0000 1.1 --- readme2_3.txt 1 Mar 2006 11:37:16 -0000 1.2 *************** *** 11,16 **** modifications. ! New features: ! ------------- 1) Password support (limited testing) --- 11,28 ---- modifications. ! New features in 2.3: ! -------------------- ! 1) Transparent MacBinary support on the Macintosh ! ! If the compression routine encounters a Macintosh file with a resource fork ! the file is automatically encoded using the Macbinary algorithme before it ! is actually compressed. On extraction of such files on the Macintosh the ! file is restored with its resource fork. On non-Macintosh platfoirms extracting ! a MacBinary file will result in the data fork being stored in the original ! file and the resource fork being stored in the filename extended with the ! .rsrc file ending. ! ! New features in 2.2 (never really properly released): ! ----------------------------------------------------- 1) Password support (limited testing) Index: lvzlib.dll =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzlib.dll,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 Binary files /tmp/cvslj0etx and /tmp/cvsMQk3rr differ |
From: Rolf K. <lab...@us...> - 2006-03-01 11:31:51
|
Update of /cvsroot/opengtoolkit/lvzip/source/lvzip.llb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24049/source/lvzip.llb Modified Files: ZLIB Compress Directory.vi ZLIB Compress Files.vi ZLIB Delete Files From Archive.vi ZLIB Extract All Files To Dir.vi ZLIB Open Unzip Archive.vi ZLIB Open Zip Archive.vi ZLIB Store File.vi ZLIB VI Tree.vi Added Files: ZLIB Path to Path String.vi Removed Files: ZLIB Path to LVZLIB Path String.vi Log Message: Modifications to Path String conversion to fully support MacOSX Index: ZLIB Store File.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Store File.vi,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 Binary files /tmp/cvs4WS8eT and /tmp/cvsOMSQCB differ Index: ZLIB Compress Directory.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Compress Directory.vi,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 Binary files /tmp/cvsE9KARV and /tmp/cvskoT0lE differ --- ZLIB Path to LVZLIB Path String.vi DELETED --- Index: ZLIB Extract All Files To Dir.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Extract All Files To Dir.vi,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 Binary files /tmp/cvsc0H6cY and /tmp/cvsh6Q9NG differ Index: ZLIB Open Zip Archive.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Open Zip Archive.vi,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 Binary files /tmp/cvs4kqd10 and /tmp/cvsH7BwIJ differ Index: ZLIB Open Unzip Archive.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Open Unzip Archive.vi,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 Binary files /tmp/cvsBFzId3 and /tmp/cvszKoS0L differ --- NEW FILE: ZLIB Path to Path String.vi --- (This appears to be a binary file; contents omitted.) Index: ZLIB Compress Files.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Compress Files.vi,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 Binary files /tmp/cvsN97Js7 and /tmp/cvsNTMuqQ differ Index: ZLIB Delete Files From Archive.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB Delete Files From Archive.vi,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 Binary files /tmp/cvsN8fWP9 and /tmp/cvsK41gUS differ Index: ZLIB VI Tree.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/source/lvzip.llb/ZLIB VI Tree.vi,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 Binary files /tmp/cvs4JJhtc and /tmp/cvsS6wCEV differ |
From: Rolf K. <lab...@us...> - 2006-03-01 10:17:47
|
Update of /cvsroot/opengtoolkit/lvzip/c_source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11710/c_source Modified Files: zlibvc.def zlibvc.dsp Log Message: Minor update to project settings Index: zlibvc.def =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/zlibvc.def,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** zlibvc.def 10 Jan 2006 22:51:31 -0000 1.12 --- zlibvc.def 1 Mar 2006 10:17:44 -0000 1.13 *************** *** 98,104 **** DLLVersion @190 InitializeFileFuncs @200 ! LVPath_UtilFileInfo @201 ! LVPath_OpenResFork @202 ! LVPath_HasResourceFork @203 ! LVPath_EncodeMacbinary @204 ! LVPath_DecodeMacbinary @205 --- 98,105 ---- DLLVersion @190 InitializeFileFuncs @200 ! LVPath_ToText @201 ! LVPath_UtilFileInfo @202 ! LVPath_OpenResFork @203 ! LVPath_HasResourceFork @204 ! LVPath_EncodeMacbinary @205 ! LVPath_DecodeMacbinary @206 Index: zlibvc.dsp =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/zlibvc.dsp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** zlibvc.dsp 7 Jan 2006 20:12:01 -0000 1.7 --- zlibvc.dsp 1 Mar 2006 10:17:44 -0000 1.8 *************** *** 59,63 **** LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /dll /pdb:none /machine:I386 ! # ADD LINK32 /nologo /subsystem:windows /dll /pdb:none /machine:I386 /out:"zlibvc___Win32_DLL_Release\lvzlib.dll" !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL Debug" --- 59,63 ---- LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /dll /pdb:none /machine:I386 ! # ADD LINK32 user32.lib /nologo /subsystem:windows /dll /pdb:none /machine:I386 /out:"zlibvc___Win32_DLL_Release\lvzlib.dll" !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL Debug" *************** *** 87,91 **** LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 ! # ADD LINK32 /nologo /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"zlibvc___Win32_DLL_Debug\lvzlib.dll" !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL ASM Release" --- 87,91 ---- LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 ! # ADD LINK32 user32.lib /nologo /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"zlibvc___Win32_DLL_Debug\lvzlib.dll" !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL ASM Release" *************** *** 116,120 **** LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /dll /pdb:none /machine:I386 ! # ADD LINK32 /nologo /subsystem:windows /dll /pdb:none /machine:I386 /out:"zlibvc___Win32_DLL_ASM_Release\lvzlib.dll" !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL ASM Debug" --- 116,120 ---- LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /dll /pdb:none /machine:I386 ! # ADD LINK32 user32.lib /nologo /subsystem:windows /dll /pdb:none /machine:I386 /out:"zlibvc___Win32_DLL_ASM_Release\lvzlib.dll" !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL ASM Debug" *************** *** 145,149 **** LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 ! # ADD LINK32 /nologo /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"zlibvc___Win32_DLL_ASM_Debug\lvzlib.dll" !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL ASM Obj Release" --- 145,149 ---- LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 ! # ADD LINK32 user32.lib /nologo /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"zlibvc___Win32_DLL_ASM_Debug\lvzlib.dll" !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL ASM Obj Release" *************** *** 174,178 **** LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /dll /pdb:none /machine:I386 ! # ADD LINK32 gvmat32.obj inffas32.obj /nologo /subsystem:windows /dll /pdb:none /machine:I386 /out:"zlibvc___Win32_DLL_ASM_Obj_Release\lvzlib.dll" !ENDIF --- 174,178 ---- LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /dll /pdb:none /machine:I386 ! # ADD LINK32 user32.lib gvmat32.obj inffas32.obj /nologo /subsystem:windows /dll /pdb:none /machine:I386 /out:"zlibvc___Win32_DLL_ASM_Obj_Release\lvzlib.dll" !ENDIF *************** *** 191,194 **** --- 191,209 ---- SOURCE=.\adler32.c + + !IF "$(CFG)" == "zlibvc - Win32 DLL Release" + + !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL Debug" + + !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL ASM Release" + + # SUBTRACT CPP /YX /Yc /Yu + + !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL ASM Debug" + + !ELSEIF "$(CFG)" == "zlibvc - Win32 DLL ASM Obj Release" + + !ENDIF + # End Source File # Begin Source File *************** *** 475,478 **** --- 490,497 ---- # End Source File # End Group + # Begin Source File + + SOURCE=..\..\cintools\labview.lib + # End Source File # End Target # End Project |
From: Rolf K. <lab...@us...> - 2006-03-01 10:17:15
|
Update of /cvsroot/opengtoolkit/lvzip/c_source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11227/c_source Modified Files: macbin.c Log Message: Some theoretical improvment, not yet tested. Index: macbin.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/macbin.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** macbin.c 1 Mar 2006 09:55:33 -0000 1.20 --- macbin.c 1 Mar 2006 10:17:00 -0000 1.21 *************** *** 138,142 **** extern void ZEXPORT DLLVersion(uChar* version) { ! sprintf(version, "lvzlib date: %s, time: %s",__DATE__,__TIME__); } --- 138,142 ---- extern void ZEXPORT DLLVersion(uChar* version) { ! sprintf(version, "lvzlib date: %s, time: %s",__DATE__,__TIME__); } *************** *** 459,470 **** if (posixRef) { - int32 l = CFStringGetLength(posixRef); - err = noErr; ! if (posixPath && *len > l) ! if (!CFStringGetCString(posixRef, posixPath, *len, enc)) err = mgArgErr; ! else ! *len = l; CFRelease(posixRef); } --- 459,469 ---- if (posixRef) { err = noErr; ! if (posixPath && (*len > CFStringGetLength(posixRef))) ! { ! if (!CFStringGetCString(posixRef, posixPath, *len, enc)) err = mgArgErr; ! } ! *len = CFStringGetLength(posixRef); CFRelease(posixRef); } *************** *** 485,496 **** if (!err) { ! if (str && *len > pathLen) { ! lstr = (LStrPtr)DSNewPClr(pathLen + 1 + sizeof(int32)); ! if (!lstr) ! return mFullErr; ! lstr->cnt = pathLen; ! err = FPathToText(path, lstr); ! if (!err) #if MacOSX err = ConvertToPosixPath(lstr->str, str, len); --- 484,500 ---- if (!err) { ! lstr = (LStrPtr)DSNewPClr(sizeof(int32) + pathLen + 1); ! if (!lstr) ! return mFullErr; ! lstr->cnt = pathLen; ! err = FPathToText(path, lstr); ! #if MacOSX ! if (!err) ! err = ConvertToPosixPath(lstr->str, NULL, &pathLen); ! #endif ! if (!err) { ! if (str && (*len > pathLen)) ! { #if MacOSX err = ConvertToPosixPath(lstr->str, str, len); *************** *** 498,509 **** StrNCpy(str, lstr->str, *len); #endif ! DSDisposePtr((UPtr)lstr); } ! #if MacOSX ! else ! err = ConvertToPosixPath(lstr->str, NULL, len); ! #else ! *len = pathLen; ! #endif } return err; --- 502,509 ---- StrNCpy(str, lstr->str, *len); #endif ! } } ! DSDisposePtr((UPtr)lstr); ! *len = pathLen + 1; } return err; |
From: Rolf K. <lab...@us...> - 2006-03-01 09:55:37
|
Update of /cvsroot/opengtoolkit/lvzip/c_source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30981/c_source Modified Files: macbin.c macbin.h Log Message: More fixes to the MacOSX code base to allow for mac binary support. The actual path conversion routine still does not work correctly and crashes LabVIEW. Index: macbin.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/macbin.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** macbin.c 11 Jan 2006 12:13:56 -0000 1.19 --- macbin.c 1 Mar 2006 09:55:33 -0000 1.20 *************** *** 22,26 **** #define kFileChanged (1L<<7) ! static OSErr MakeMacSpec(Path path, FSSpec *fss); static OSErr MakeFSpec(int16 vol, int32 dirID, ConstStr255 path, FSSpec *fss); static MgErr OSErrToLVErr(OSErr err); --- 22,26 ---- #define kFileChanged (1L<<7) ! static MgErr MakeMacSpec(Path path, FSSpec *fss); static OSErr MakeFSpec(int16 vol, int32 dirID, ConstStr255 path, FSSpec *fss); static MgErr OSErrToLVErr(OSErr err); *************** *** 81,85 **** /* Compatibility functions for older LabVIEW libraries */ ! extern McErr ZEXPORT HasResourceFork(PStr path, int32 *hasResFork) { FSSpec theFSSpec; --- 81,85 ---- /* Compatibility functions for older LabVIEW libraries */ ! extern OSErr ZEXPORT HasResourceFork(PStr path, int32 *hasResFork) { FSSpec theFSSpec; *************** *** 101,105 **** } ! extern McErr ZEXPORT LV_EncodeMacbinary(PStr srcPath, PStr dstPath) { FSSpec srcFSSpec; --- 101,105 ---- } ! extern OSErr ZEXPORT LV_EncodeMacbinary(PStr srcPath, PStr dstPath) { FSSpec srcFSSpec; *************** *** 117,121 **** } ! extern McErr ZEXPORT LV_DecodeMacbinary(PStr srcPath, PStr dstPath) { FSSpec srcFSSpec; --- 117,121 ---- } ! extern OSErr ZEXPORT LV_DecodeMacbinary(PStr srcPath, PStr dstPath) { FSSpec srcFSSpec; *************** *** 145,149 **** #if Mac FSSpec theFSSpec; ! OSErr err = noErr; *hasResFork = 0; --- 145,149 ---- #if Mac FSSpec theFSSpec; ! MgErr err = noErr; *hasResFork = 0; *************** *** 159,163 **** } } ! return OSErrToLVErr(err);; #else *hasResFork = 0; --- 159,163 ---- } } ! return err; #else *hasResFork = 0; *************** *** 171,175 **** FSSpec srcFSSpec; FSSpec dstFSSpec; ! OSErr err; err = MakeMacSpec(srcPath, &srcFSSpec); --- 171,175 ---- FSSpec srcFSSpec; FSSpec dstFSSpec; ! MgErr err; err = MakeMacSpec(srcPath, &srcFSSpec); *************** *** 178,184 **** err = MakeMacSpec(dstPath, &dstFSSpec); if (!err) ! err = EncodeMacbinaryFiles(&srcFSSpec, &dstFSSpec); } ! return OSErrToLVErr(err); #else return mgNotSupported; --- 178,184 ---- err = MakeMacSpec(dstPath, &dstFSSpec); if (!err) ! err = OSErrToLVErr(EncodeMacbinaryFiles(&srcFSSpec, &dstFSSpec)); } ! return err; #else return mgNotSupported; *************** *** 191,195 **** FSSpec srcFSSpec; FSSpec dstFSSpec; ! OSErr err; err = MakeMacSpec(srcPath, &srcFSSpec); --- 191,195 ---- FSSpec srcFSSpec; FSSpec dstFSSpec; ! MgErr err; err = MakeMacSpec(srcPath, &srcFSSpec); *************** *** 197,204 **** { err = MakeMacSpec(dstPath, &dstFSSpec); ! if (err) ! err = DecodeMacBinaryFiles(&srcFSSpec, &dstFSSpec); } ! return OSErrToLVErr(err); #else return mgNotSupported; --- 197,204 ---- { err = MakeMacSpec(dstPath, &dstFSSpec); ! if (!err) ! err = OSErrToLVErr(DecodeMacBinaryFiles(&srcFSSpec, &dstFSSpec)); } ! return err; #else return mgNotSupported; *************** *** 208,223 **** extern MgErr ZEXPORT LVPath_OpenResFork(LVRefNum *refnum, Path path, uInt32 openMode, uInt32 denyMode) { #if Mac int16 perm; HParamBlockRec pb; FSSpec fss; - OSErr ret; Boolean hasDeny; *refnum = 0; ! if (ret = MakeMacSpec(path, &fss)) { ! return OSErrToLVErr(ret); } hasDeny = HasFMExtension(&fss, 1L << bHasOpenDeny); --- 208,224 ---- extern MgErr ZEXPORT LVPath_OpenResFork(LVRefNum *refnum, Path path, uInt32 openMode, uInt32 denyMode) { + MgErr err = mgNotSupported; #if Mac int16 perm; HParamBlockRec pb; FSSpec fss; Boolean hasDeny; *refnum = 0; ! if (err = MakeMacSpec(path, &fss)) { ! DbgPrintf("MakeMacSpec: err = %ld", err); ! return err; } hasDeny = HasFMExtension(&fss, 1L << bHasOpenDeny); *************** *** 266,289 **** if (hasDeny) { ! ret = PBHOpenRFDenySync(&pb); } else { pb.ioParam.ioPermssn = perm; ! ret = PBHOpenSync(&pb); } ! if (!ret) { if (openMode == openWriteOnlyTruncate) ! ret = SetEOF(pb.ioParam.ioRefNum, 0L); } ! if (ret) ! return OSErrToLVErr(ret); ! ! return FNewRefNum(path, (File)pb.ioParam.ioRefNum, refnum); ! #endif *refnum = 0; ! return noErr; } --- 267,292 ---- if (hasDeny) { ! err = OSErrToLVErr(PBHOpenRFDenySync(&pb)); } else { pb.ioParam.ioPermssn = perm; ! err = OSErrToLVErr(PBHOpenSync(&pb)); } ! if (!err) { if (openMode == openWriteOnlyTruncate) ! err = OSErrToLVErr(SetEOF(pb.ioParam.ioRefNum, 0L)); } ! else ! DbgPrintf("OpenRF: err = %ld", err); ! ! if (!err) ! err = FNewRefNum(path, (File)pb.ioParam.ioRefNum, refnum); ! #else *refnum = 0; ! #endif ! return err; } *************** *** 297,307 **** DTPBRec dtpb; CInfoPBRec cpb; ! OSErr err; if (!comment || !PStrLen(comment)) return mgArgErr; if (err = MakeMacSpec(path, &fss)) ! return OSErrToLVErr(err); memset(&cpb, 0, sizeof(CInfoPBRec)); --- 300,315 ---- DTPBRec dtpb; CInfoPBRec cpb; ! MgErr err; if (!comment || !PStrLen(comment)) return mgArgErr; + DoDebugger(); + if (err = MakeMacSpec(path, &fss)) ! { ! DbgPrintf("MakeMacSpec: err = %ld", err); ! return err; ! } memset(&cpb, 0, sizeof(CInfoPBRec)); *************** *** 310,315 **** cpb.hFileInfo.ioDirID = fss.parID; ! err = PBGetCatInfoSync(&cpb); ! if (err == noErr) { dtpb.ioCompletion = nil; --- 318,326 ---- cpb.hFileInfo.ioDirID = fss.parID; ! err = OSErrToLVErr(PBGetCatInfoSync(&cpb)); ! if (err) ! DbgPrintf("PBGetCatInfo: err = %ld", err); ! ! if (!err) { dtpb.ioCompletion = nil; *************** *** 317,322 **** dtpb.ioVRefNum = fss.vRefNum; ! err = PBDTGetPath(&dtpb); ! if (err == noErr) { dtpb.ioNamePtr = fss.name; --- 328,335 ---- dtpb.ioVRefNum = fss.vRefNum; ! err = OSErrToLVErr(PBDTGetPath(&dtpb)); ! if (err) ! DbgPrintf("PBGetPath: err = %ld", err); ! if (!err) { dtpb.ioNamePtr = fss.name; *************** *** 354,361 **** } ! err = PBSetCatInfoSync(&cpb); if (!err && comment) { ! err = PBDTSetCommentSync(&dtpb); } } --- 367,376 ---- } ! err = OSErrToLVErr(PBSetCatInfoSync(&cpb)); ! if (err) ! DbgPrintf("PBSetCatInfo: err = %ld", err); if (!err && comment) { ! err = OSErrToLVErr(PBDTSetCommentSync(&dtpb)); } } *************** *** 392,400 **** ConvertLVTime(&fileInfo->cDate, &cpb.hFileInfo.ioFlMdDat, true); } ! err = PBDTGetCommentSync(&dtpb); } } } ! return OSErrToLVErr(err); #else return mgNotSupported; --- 407,415 ---- ConvertLVTime(&fileInfo->cDate, &cpb.hFileInfo.ioFlMdDat, true); } ! err = OSErrToLVErr(PBDTGetCommentSync(&dtpb)); } } } ! return err; #else return mgNotSupported; *************** *** 417,451 **** } ! #if Mac ! static int32 LToPStr(LStrPtr lstr, PStr str) { ! int32 n = LStrLen(lstr); ! if (n > 255) ! n = 255; ! str[0] = n; ! if (n) ! BlockMove(LStrBuf(lstr), PStrBuf(str), n); ! return n; } ! static OSErr MakeMacSpec(Path path, FSSpec *fss) { ! OSErr err; ! LStr256 lStr; Str255 name; Boolean isDir, isAlias; ! lStr.cnt = -1; ! FPathToText(path, (LStrPtr)&lStr); ! if (lStr.cnt > 255) ! return paramErr; ! else { ! FPathToText(path, (LStrPtr)&lStr); ! LToPStr((LStrPtr)&lStr, name); ! err = MakeFSpec(0, 0, name, fss); ! if (err == noErr) ! err = ResolveAliasFileWithMountFlags(fss, true, (Boolean*)&isDir, (Boolean*)&isAlias, 0); } return err; } --- 432,539 ---- } ! #if MacOSX ! static MgErr ConvertToPosixPath(const CStr hfsPath, CStr posixPath, int32 *len) { ! MgErr err = mFullErr; ! CFStringRef fileRef, posixRef = NULL; ! CFURLRef urlRef = NULL; ! Boolean isDir = FALSE; ! uInt32 enc = CFStringGetSystemEncoding(); ! ! if (!len) ! return mgArgErr; ! ! fileRef = CFStringCreateWithCString(NULL, hfsPath, enc); ! if (fileRef) ! { ! urlRef = CFURLCreateWithFileSystemPath(NULL, fileRef, kCFURLHFSPathStyle, isDir); ! CFRelease(fileRef); ! } ! ! if (urlRef) ! { ! posixRef = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle); ! CFRelease(urlRef); ! } ! ! if (posixRef) ! { ! int32 l = CFStringGetLength(posixRef); ! ! err = noErr; ! if (posixPath && *len > l) ! if (!CFStringGetCString(posixRef, posixPath, *len, enc)) ! err = mgArgErr; ! else ! *len = l; ! CFRelease(posixRef); ! } ! return err; } + #endif ! extern MgErr ZEXPORT LVPath_ToText(Path path, CStr str, int32 *len) { ! MgErr err; ! LStrPtr lstr; ! int32 pathLen = -1; ! ! if (!len) ! return mgArgErr; ! ! err = FPathToText(path, (LStrPtr)&pathLen); ! if (!err) ! { ! if (str && *len > pathLen) ! { ! lstr = (LStrPtr)DSNewPClr(pathLen + 1 + sizeof(int32)); ! if (!lstr) ! return mFullErr; ! lstr->cnt = pathLen; ! err = FPathToText(path, lstr); ! if (!err) ! #if MacOSX ! err = ConvertToPosixPath(lstr->str, str, len); ! #else ! StrNCpy(str, lstr->str, *len); ! #endif ! DSDisposePtr((UPtr)lstr); ! } ! #if MacOSX ! else ! err = ConvertToPosixPath(lstr->str, NULL, len); ! #else ! *len = pathLen; ! #endif ! } ! return err; ! } ! ! #if Mac ! static MgErr MakeMacSpec(Path path, FSSpec *fss) ! { ! MgErr err; Str255 name; + int32 len; Boolean isDir, isAlias; ! err = LVPath_ToText(path, NULL, &len); ! if (err) ! DbgPrintf("LVPath_ToText: err = %ld", err); ! ! if (!err && len <= 255) { ! err = LVPath_ToText(path, name, &len); ! if (err) ! DbgPrintf("LVPath_ToText: err = %ld", err); ! err = OSErrToLVErr(MakeFSpec(0, 0, name, fss)); ! if (!err) ! err = OSErrToLVErr(ResolveAliasFileWithMountFlags(fss, true, (Boolean*)&isDir, (Boolean*)&isAlias, 0)); ! else ! DbgPrintf("MakeFSpec: err = %ld", err); ! } + else + err = mgArgErr; return err; } *************** *** 464,468 **** /* root directory by passing a full pathname in MakeFSSpec's */ /* fileName parameter. */ ! if ((err == noErr) && (fss->parID == 0)) { fss->parID = fsRtParID; } --- 552,557 ---- /* root directory by passing a full pathname in MakeFSSpec's */ /* fileName parameter. */ ! if ((err == noErr) && (fss->parID == 0)) ! { fss->parID = fsRtParID; } Index: macbin.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/macbin.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** macbin.h 11 Jan 2006 12:13:57 -0000 1.14 --- macbin.h 1 Mar 2006 09:55:33 -0000 1.15 *************** *** 13,21 **** #if defined(macintosh) || defined(__PPCC__) || defined(THINK_C) || defined(__SC__) || defined(__MWERKS__) || defined(__APPLE_CC__) ! #define Mac 1 #elif defined(__GNUC__) || defined(linux) ! #define Unix 1 #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN32_WCE) ! #define Win32 1 #endif --- 13,36 ---- #if defined(macintosh) || defined(__PPCC__) || defined(THINK_C) || defined(__SC__) || defined(__MWERKS__) || defined(__APPLE_CC__) ! #define Mac 1 ! #ifdef __MACH__ ! #define MacOSX 1 ! #endif #elif defined(__GNUC__) || defined(linux) ! #define Unix 1 #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN32_WCE) ! #define Win32 1 ! #endif ! ! #if defined(DEBUG) ! #if Win32 ! #define DoDebugger() {__asm int 3} ! #elif Mac ! #define DoDebugger() Debugger() ! #else ! #define DoDebugger() ! #endif ! #else ! #define DoDebugger() #endif *************** *** 172,175 **** --- 187,197 ---- MgErr FPathToText(Path path, LStrPtr lstr); MgErr FNewRefNum(Path path, File fd, LVRefNum* refnum); + int32 DbgPrintf(CStr fmt, ...); + + UPtr DSNewPClr(int32); + MgErr DSDisposePtr(UPtr); + int32 StrNCpy(CStr t, const CStr s, int32 l); + + #define Min(a, b) ((a) < (b)) ? (a) : (b) /* Our exported functions */ *************** *** 182,185 **** --- 204,208 ---- #endif + extern MgErr ZEXPORT LVPath_ToText OF((Path path, CStr str, int32 *len)); extern MgErr ZEXPORT LVPath_HasResourceFork OF((Path path, int32 *hasResFork)); extern MgErr ZEXPORT LVPath_EncodeMacbinary OF((Path srcFileName, Path dstFileName)); |
From: Rolf K. <lab...@us...> - 2006-03-01 09:54:20
|
Update of /cvsroot/opengtoolkit/lvzip/c_source/lvzip.xcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30320/c_source/lvzip.xcode Modified Files: project.pbxproj Log Message: Some small modifications to the project build settings for MacOSX Index: project.pbxproj =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/lvzip.xcode/project.pbxproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** project.pbxproj 25 Jan 2006 03:01:27 -0000 1.4 --- project.pbxproj 1 Mar 2006 09:54:13 -0000 1.5 *************** *** 6,9 **** --- 6,47 ---- objectVersion = 39; objects = { + 7E90BB7F09A4EC9A005660FA = { + isa = PBXFileReference; + lastKnownFileType = archive.ar; + name = liblabviewcin.a; + path = "/Applications/National Instruments/LabVIEW 7.0/cintools/Mach-O/liblabviewcin.a"; + refType = 0; + sourceTree = "<absolute>"; + }; + 7E90BB8009A4EC9A005660FA = { + fileRef = 7E90BB7F09A4EC9A005660FA; + isa = PBXBuildFile; + settings = { + }; + }; + 7EA88CE6097414D400852875 = { + isa = PBXFileReference; + lastKnownFileType = archive.ar; + name = liblvexports.a; + path = "/Applications/National Instruments/LabVIEW 7.0/cintools/Mach-O/liblvexports.a"; + refType = 0; + sourceTree = "<absolute>"; + }; + 7EA88CE7097414D400852875 = { + fileRef = 7EA88CE6097414D400852875; + isa = PBXBuildFile; + settings = { + }; + }; + //7E0 + //7E1 + //7E2 + //7E3 + //7E4 + //830 + //831 + //832 + //833 + //834 836583A3088D034C0083EC20 = { isa = PBXFileReference; *************** *** 172,183 **** sourceTree = "<group>"; }; - 839542A70894F2490020C3E2 = { - fileEncoding = 30; - isa = PBXFileReference; - lastKnownFileType = text; - path = zlib.3; - refType = 4; - sourceTree = "<group>"; - }; 839542A80894F2490020C3E2 = { fileEncoding = 30; --- 210,213 ---- *************** *** 422,431 **** }; }; - 839542DE0894F2490020C3E2 = { - fileRef = 839542A70894F2490020C3E2; - isa = PBXBuildFile; - settings = { - }; - }; 839542DF0894F2490020C3E2 = { fileRef = 839542A80894F2490020C3E2; --- 452,455 ---- *************** *** 526,532 **** 83D3E18C080D116E00DE332C = { children = ( ! C71D0E85098720D40065FB1E, ! C71D0E86098720D40065FB1E, ! C71D0E87098720D40065FB1E, 83D3E1B0080D116E00DE332C, 83D3E1B5080D116E00DE332C, --- 550,555 ---- 83D3E18C080D116E00DE332C = { children = ( ! 7EA88CE6097414D400852875, ! 7E90BB7F09A4EC9A005660FA, 83D3E1B0080D116E00DE332C, 83D3E1B5080D116E00DE332C, *************** *** 635,646 **** runOnlyForDeploymentPostprocessing = 0; }; - 83D3E1AB080D116E00DE332C = { - buildActionMask = 2147483647; - files = ( - 839542DE0894F2490020C3E2, - ); - isa = PBXResourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; 83D3E1AC080D116E00DE332C = { buildActionMask = 2147483647; --- 658,661 ---- *************** *** 648,654 **** 83D3E26D080D117700DE332C, 836583B4088D13980083EC20, ! C71D0E88098720D40065FB1E, ! C71D0E89098720D40065FB1E, ! C71D0E8A098720D40065FB1E, ); isa = PBXFrameworksBuildPhase; --- 663,668 ---- 83D3E26D080D117700DE332C, 836583B4088D13980083EC20, ! 7EA88CE7097414D400852875, ! 7E90BB8009A4EC9A005660FA, ); isa = PBXFrameworksBuildPhase; *************** *** 666,670 **** 83D3E1A9080D116E00DE332C, 83D3E1AA080D116E00DE332C, - 83D3E1AB080D116E00DE332C, 83D3E1AC080D116E00DE332C, 83D3E1AD080D116E00DE332C, --- 680,683 ---- *************** *** 685,689 **** GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ""; ! LIBRARY_SEARCH_PATHS = "\"$(SYSTEM_APPS_DIR)/National Instruments/LabVIEW 7.0/cintools/Mach-O\" \"$(SYSTEM_APPS_DIR)/National Instruments/LabVIEW 8.0/cintools/Mach-O\""; LIBRARY_STYLE = DYNAMIC; OTHER_CFLAGS = "-fno-inline"; --- 698,702 ---- GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ""; ! LIBRARY_SEARCH_PATHS = "\"$(SYSTEM_APPS_DIR)/National Instruments/LabVIEW 7.0/cintools/Mach-O\""; LIBRARY_STYLE = DYNAMIC; OTHER_CFLAGS = "-fno-inline"; *************** *** 765,769 **** 839542A40894F2480020C3E2, 839542A60894F2490020C3E2, - 839542A70894F2490020C3E2, 839542A80894F2490020C3E2, 839542A90894F2490020C3E2, --- 778,781 ---- *************** *** 824,879 **** }; }; - //830 - //831 - //832 - //833 - //834 - //C70 - //C71 - //C72 - //C73 - //C74 - C71D0E85098720D40065FB1E = { - isa = PBXFileReference; - lastKnownFileType = archive.ar; - name = dllshellx.o; - path = "/Applications/National Instruments/LabVIEW 8.0/cintools/Mach-O/dllshellx.o"; - refType = 0; - sourceTree = "<absolute>"; - }; - C71D0E86098720D40065FB1E = { - isa = PBXFileReference; - lastKnownFileType = archive.ar; - name = liblabviewcin.a; - path = "/Applications/National Instruments/LabVIEW 8.0/cintools/Mach-O/liblabviewcin.a"; - refType = 0; - sourceTree = "<absolute>"; - }; - C71D0E87098720D40065FB1E = { - isa = PBXFileReference; - lastKnownFileType = archive.ar; - name = liblvexports.a; - path = "/Applications/National Instruments/LabVIEW 8.0/cintools/Mach-O/liblvexports.a"; - refType = 0; - sourceTree = "<absolute>"; - }; - C71D0E88098720D40065FB1E = { - fileRef = C71D0E85098720D40065FB1E; - isa = PBXBuildFile; - settings = { - }; - }; - C71D0E89098720D40065FB1E = { - fileRef = C71D0E86098720D40065FB1E; - isa = PBXBuildFile; - settings = { - }; - }; - C71D0E8A098720D40065FB1E = { - fileRef = C71D0E87098720D40065FB1E; - isa = PBXBuildFile; - settings = { - }; - }; }; rootObject = 83D3E190080D116E00DE332C; --- 836,839 ---- |
From: Christopher G. R. <cr...@us...> - 2006-02-22 02:28:46
|
Update of /cvsroot/opengtoolkit/OpenMenu/OpenMenu/crertmnu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9697/crertmnu Log Message: Directory /cvsroot/opengtoolkit/OpenMenu/OpenMenu/crertmnu added to the repository |
From: Christopher G. R. <cr...@us...> - 2006-02-22 02:28:37
|
Update of /cvsroot/opengtoolkit/OpenMenu/OpenMenu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9660/OpenMenu Log Message: Directory /cvsroot/opengtoolkit/OpenMenu/OpenMenu added to the repository |
From: Rolf K. <lab...@us...> - 2006-02-21 12:44:15
|
Update of /cvsroot/opengtoolkit/lvzip/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv383/tests Modified Files: lvzip-test-lg bin files.vi lvzip-test-sm text files.vi Log Message: Make test functions use installed OpenG libraries Index: lvzip-test-lg bin files.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/tests/lvzip-test-lg bin files.vi,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 Binary files /tmp/cvsWhJ1mW and /tmp/cvsW2LN4H differ Index: lvzip-test-sm text files.vi =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/tests/lvzip-test-sm text files.vi,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 Binary files /tmp/cvss3qzFb and /tmp/cvsNX0H0X differ |
From: Christopher G. R. <cr...@us...> - 2006-02-20 01:29:19
|
Update of /cvsroot/opengtoolkit/buttons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31476 Modified Files: change-log.txt Log Message: Index: change-log.txt =================================================================== RCS file: /cvsroot/opengtoolkit/buttons/change-log.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** change-log.txt 18 Jan 2006 04:07:18 -0000 1.3 --- change-log.txt 20 Feb 2006 01:29:14 -0000 1.4 *************** *** 1,3 **** ! -= ogctl_buttons-2.3-1.ogp =- --- 1,9 ---- ! -= ogctl_buttons-2.4-1.ogp =- ! ! ! Changes from 2.2-1 --> 2.3-1 ! -------------------------------- ! 2006-02-19 ! [ADD] Added Toolbar buttons (sub palette and controls) |
Update of /cvsroot/opengtoolkit/buttons/Source/toolbar_buttons/toolbar_buttons.llb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19063/Source/toolbar_buttons/toolbar_buttons.llb Added Files: toolbar.Application.Exit.ctl toolbar.File.Check.ctl toolbar.File.Close.ctl toolbar.File.Export.ctl toolbar.File.New.ctl toolbar.File.Open.ctl toolbar.File.Print.ctl toolbar.File.Save.ctl toolbar.Help.ctl toolbar.Lock.ctl toolbar.Refresh.ctl toolbar.Sequence.Beginning.ctl toolbar.Sequence.End.ctl toolbar.Sequence.FFWD.ctl toolbar.Sequence.FREV.ctl toolbar.Sequence.Frame.Advance.ctl toolbar.Sequence.Frame.Retreat.ctl toolbar.Sequence.Play.ctl toolbar.Sequence.Record.ctl toolbar.Sequence.Stop.ctl toolbar.Sign.Go.ctl toolbar.Sign.Stop.ctl toolbar.Synchronize.ctl toolbar.WindowsMediaPlayer.ctl Log Message: --- NEW FILE: toolbar.Lock.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.File.New.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Sequence.Frame.Retreat.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Sequence.Beginning.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Sequence.Stop.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.File.Close.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Sequence.Play.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Synchronize.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Sign.Go.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Sequence.Record.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Sequence.End.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Help.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Application.Exit.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Sequence.FREV.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.File.Save.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Refresh.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.File.Open.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.File.Check.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.File.Print.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Sign.Stop.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Sequence.FFWD.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.Sequence.Frame.Advance.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.File.Export.ctl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: toolbar.WindowsMediaPlayer.ctl --- (This appears to be a binary file; contents omitted.) |
From: Christopher G. R. <cr...@us...> - 2006-02-20 01:04:19
|
Update of /cvsroot/opengtoolkit/buttons/Source/toolbar_buttons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19063/Source/toolbar_buttons Added Files: dir.mnu Log Message: --- NEW FILE: dir.mnu --- (This appears to be a binary file; contents omitted.) |
From: Christopher G. R. <cr...@us...> - 2006-02-20 01:03:46
|
Update of /cvsroot/opengtoolkit/buttons/Source/toolbar_buttons/toolbar_buttons.llb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18805/toolbar_buttons.llb Log Message: Directory /cvsroot/opengtoolkit/buttons/Source/toolbar_buttons/toolbar_buttons.llb added to the repository |
From: Christopher G. R. <cr...@us...> - 2006-02-20 01:03:14
|
Update of /cvsroot/opengtoolkit/buttons/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18374/Source Added Files: toolbar_buttons.mnu Log Message: --- NEW FILE: toolbar_buttons.mnu --- (This appears to be a binary file; contents omitted.) |
From: Christopher G. R. <cr...@us...> - 2006-02-20 01:02:19
|
Update of /cvsroot/opengtoolkit/buttons/Source/toolbar_buttons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18100/toolbar_buttons Log Message: Directory /cvsroot/opengtoolkit/buttons/Source/toolbar_buttons added to the repository |
From: Christopher G. R. <cr...@us...> - 2006-02-20 01:01:35
|
Update of /cvsroot/opengtoolkit/buttons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17670 Modified Files: ogctl_buttons.spec Log Message: Index: ogctl_buttons.spec =================================================================== RCS file: /cvsroot/opengtoolkit/buttons/ogctl_buttons.spec,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ogctl_buttons.spec 18 Jan 2006 04:07:18 -0000 1.3 --- ogctl_buttons.spec 20 Feb 2006 01:01:29 -0000 1.4 *************** *** 1,131 **** [Package Name] - Name=ogctl_buttons ! ! Version=2.3 ! Release=1 - [Description] - Description="The buttons package contains various button controls." ! ! Summary=OpenG Button Controls ! License=LGPL ! ! Copyright=2002 Jim Kring ! ! Distribution=OpenG Toolkit ! ! Icon="Source/ogctl_buttons.bmp" ! Vendor=OpenG.org - URL=http://opengtoolkit.sourceforge.net/buttons ! ! Packager=Jim Kring <ji...@ji...> ! ! ! [Dependencies] ! ! Requires="ogrsc_dynamicpalette >= 0.6" ! ! AutoReqProv=FALSE ! [Platform] ! ! Exclusive_LabVIEW_Version=">=6.0" ! Exclusive_LabVIEW_System=All - Exclusive_OS=All ! [Files] ! ! Num File Groups=5 [File Group 0] ! ! Source Dir="Source" ! ! Target Dir=<user.lib>/_OpenG.lib ! Replace Mode=Always - Num Files=6 - File 0=3d_dir_buttons/dir.mnu ! File 1=3d_dir_buttons/3d_dir_buttons.llb/3D Arrow Pad.vi ! File 2=3d_dir_buttons/3d_dir_buttons.llb/3D Down.ctl ! File 3=3d_dir_buttons/3d_dir_buttons.llb/3D Left.ctl ! File 4=3d_dir_buttons/3d_dir_buttons.llb/3D Right.ctl ! File 5=3d_dir_buttons/3d_dir_buttons.llb/3D Up.ctl ! [File Group 1] ! ! Source Dir="Source" ! ! Target Dir=<user.lib>/_OpenG.lib ! Replace Mode=Always - Num Files=9 - File 0=misc_buttons/dir.mnu ! File 1=misc_buttons/misc_buttons.llb/Copy Button.ctl ! File 2=misc_buttons/misc_buttons.llb/Cut Button.ctl ! File 3=misc_buttons/misc_buttons.llb/File Browse Button.ctl ! File 4=misc_buttons/misc_buttons.llb/Lock Button.ctl ! File 5=misc_buttons/misc_buttons.llb/Options Button.ctl ! File 6=misc_buttons/misc_buttons.llb/Paste Button.ctl ! File 7=misc_buttons/misc_buttons.llb/Radio Buttons (Codeless).ctl ! File 8=misc_buttons/misc_buttons.llb/Search Button.ctl ! [File Group 2] ! Source Dir="Source" ! Target Dir=<user.lib>/_dynamicpalette_dirs/boolean - Replace Mode=Always ! ! Num Files=2 ! File 0=3d_dir_buttons.mnu File 1=misc_buttons.mnu ! ! [File Group 3] ! ! Source Dir="Source" ! Target Dir=<user.lib>/_dynamicpalette_dirs/3dbool - Replace Mode=Always ! ! Num Files=2 ! File 0=3d_dir_buttons.mnu File 1=misc_buttons.mnu ! ! [File Group 4] ! ! Source Dir="Source" ! Target Dir=<user.lib>/_dynamicpalette_dirs/OpenG_Controls - Replace Mode=Always ! ! Num Files=2 ! File 0=3d_dir_buttons.mnu File 1=misc_buttons.mnu --- 1,124 ---- [Package Name] Name=ogctl_buttons ! Version=2.4 Release=1 [Description] Description="The buttons package contains various button controls." ! Summary="OpenG Button Controls" License=LGPL ! Copyright="2002 Jim Kring; 2006 Christopher Relf" ! Distribution="OpenG Toolkit" ! Icon=Source/ogctl_buttons.bmp Vendor=OpenG.org URL=http://opengtoolkit.sourceforge.net/buttons ! Packager="Christopher Relf <chr...@ya...>" [Platform] ! Exclusive_LabVIEW_Version=>=7.1 Exclusive_LabVIEW_System=All Exclusive_OS=All + [Script VIs] + Source Dir="" + PreInstall="" + PostInstall="" + PreUninstall="" + PostUninstall="" + Verify="" + PreBuild="" + PostBuild="" ! [Dependencies] ! AutoReqProv=FALSE ! Requires=ogrsc_dynamicpalette>=0.6 ! Conflicts="" + [Files] + Num File Groups=6 [File Group 0] ! Source Dir=Source ! Target Dir=<OpenG.lib> Replace Mode=Always Num Files=6 File 0=3d_dir_buttons/dir.mnu ! File 1="3d_dir_buttons/3d_dir_buttons.llb/3D Arrow Pad.vi" ! File 2="3d_dir_buttons/3d_dir_buttons.llb/3D Down.ctl" ! File 3="3d_dir_buttons/3d_dir_buttons.llb/3D Left.ctl" ! File 4="3d_dir_buttons/3d_dir_buttons.llb/3D Right.ctl" ! File 5="3d_dir_buttons/3d_dir_buttons.llb/3D Up.ctl" [File Group 1] ! Source Dir=Source ! Target Dir=<OpenG.lib> Replace Mode=Always Num Files=9 File 0=misc_buttons/dir.mnu ! File 1="misc_buttons/misc_buttons.llb/Copy Button.ctl" ! File 2="misc_buttons/misc_buttons.llb/Cut Button.ctl" ! File 3="misc_buttons/misc_buttons.llb/File Browse Button.ctl" ! File 4="misc_buttons/misc_buttons.llb/Lock Button.ctl" ! File 5="misc_buttons/misc_buttons.llb/Options Button.ctl" ! File 6="misc_buttons/misc_buttons.llb/Paste Button.ctl" ! File 7="misc_buttons/misc_buttons.llb/Radio Buttons (Codeless).ctl" ! File 8="misc_buttons/misc_buttons.llb/Search Button.ctl" [File Group 2] + Source Dir=Source + Target Dir=<OpenG.lib> + Replace Mode=Always + Num Files=25 + File 0=toolbar_buttons/toolbar_buttons.llb/toolbar.Application.Exit.ctl + File 1=toolbar_buttons/toolbar_buttons.llb/toolbar.File.Check.ctl + File 2=toolbar_buttons/toolbar_buttons.llb/toolbar.File.Close.ctl + File 3=toolbar_buttons/toolbar_buttons.llb/toolbar.File.Export.ctl + File 4=toolbar_buttons/toolbar_buttons.llb/toolbar.File.New.ctl + File 5=toolbar_buttons/toolbar_buttons.llb/toolbar.File.Open.ctl + File 6=toolbar_buttons/toolbar_buttons.llb/toolbar.File.Print.ctl + File 7=toolbar_buttons/toolbar_buttons.llb/toolbar.File.Save.ctl + File 8=toolbar_buttons/toolbar_buttons.llb/toolbar.Help.ctl + File 9=toolbar_buttons/toolbar_buttons.llb/toolbar.Lock.ctl + File 10=toolbar_buttons/toolbar_buttons.llb/toolbar.Refresh.ctl + File 11=toolbar_buttons/toolbar_buttons.llb/toolbar.Sequence.Beginning.ctl + File 12=toolbar_buttons/toolbar_buttons.llb/toolbar.Sequence.End.ctl + File 13=toolbar_buttons/toolbar_buttons.llb/toolbar.Sequence.FFWD.ctl + File 14=toolbar_buttons/toolbar_buttons.llb/toolbar.Sequence.Frame.Advance.ctl + File 15=toolbar_buttons/toolbar_buttons.llb/toolbar.Sequence.Frame.Retreat.ctl + File 16=toolbar_buttons/toolbar_buttons.llb/toolbar.Sequence.FREV.ctl + File 17=toolbar_buttons/toolbar_buttons.llb/toolbar.Sequence.Play.ctl + File 18=toolbar_buttons/toolbar_buttons.llb/toolbar.Sequence.Record.ctl + File 19=toolbar_buttons/toolbar_buttons.llb/toolbar.Sequence.Stop.ctl + File 20=toolbar_buttons/toolbar_buttons.llb/toolbar.Sign.Go.ctl + File 21=toolbar_buttons/toolbar_buttons.llb/toolbar.Sign.Stop.ctl + File 22=toolbar_buttons/toolbar_buttons.llb/toolbar.Synchronize.ctl + File 23=toolbar_buttons/toolbar_buttons.llb/toolbar.WindowsMediaPlayer.ctl + File 24=toolbar_buttons/dir.mnu ! [File Group 3] ! Source Dir=Source Target Dir=<user.lib>/_dynamicpalette_dirs/boolean Replace Mode=Always ! Num Files=3 File 0=3d_dir_buttons.mnu File 1=misc_buttons.mnu + File 2=toolbar_buttons.mnu ! [File Group 4] ! Source Dir=Source Target Dir=<user.lib>/_dynamicpalette_dirs/3dbool Replace Mode=Always ! Num Files=3 File 0=3d_dir_buttons.mnu File 1=misc_buttons.mnu + File 2=toolbar_buttons.mnu ! [File Group 5] ! Source Dir=Source Target Dir=<user.lib>/_dynamicpalette_dirs/OpenG_Controls Replace Mode=Always ! Num Files=3 File 0=3d_dir_buttons.mnu File 1=misc_buttons.mnu + File 2=toolbar_buttons.mnu |
Update of /cvsroot/opengtoolkit/sqlite/LV SQLite Library Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20206/LV SQLite Library Source Added Files: alter.c analyze.c attach.c auth.c btree.c btree.h build.c callback.c complete.c date.c delete.c expr.c func.c hash.c hash.h insert.c keywordhash.h legacy.c main.c opcodes.c opcodes.h os.c os.h os_common.h os_unix.c os_win.c pager.c pager.h parse.c parse.h pragma.c prepare.c printf.c random.c select.c sqlite3.def sqlite3.h sqliteInt.h table.c tokenize.c trigger.c update.c utf.c util.c vacuum.c vdbe.c vdbe.h vdbeInt.h vdbeapi.c vdbeaux.c vdbefifo.c vdbemem.c where.c Log Message: Adding the SQLite 3.3.3 source code downloaded from www.sqlite.org. This is the version of SQLite we will be using for initial development. 2/13/2006 Chris Davis --- NEW FILE: pager.h --- /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This header file defines the interface that the sqlite page cache ** subsystem. The page cache subsystem reads and writes a file a page ** at a time and provides a journal for rollback. ** ** @(#) $Id: pager.h,v 1.1 2006/02/14 02:16:48 chrisdavis3587 Exp $ */ #ifndef _PAGER_H_ #define _PAGER_H_ /* ** The default size of a database page. */ #ifndef SQLITE_DEFAULT_PAGE_SIZE # define SQLITE_DEFAULT_PAGE_SIZE 1024 #endif /* Maximum page size. The upper bound on this value is 32768. This a limit ** imposed by necessity of storing the value in a 2-byte unsigned integer ** and the fact that the page size must be a power of 2. ** ** This value is used to initialize certain arrays on the stack at ** various places in the code. On embedded machines where stack space ** is limited and the flexibility of having large pages is not needed, ** it makes good sense to reduce the maximum page size to something more ** reasonable, like 1024. */ #ifndef SQLITE_MAX_PAGE_SIZE # define SQLITE_MAX_PAGE_SIZE 32768 #endif /* ** Maximum number of pages in one database. */ #define SQLITE_MAX_PAGE 1073741823 /* ** The type used to represent a page number. The first page in a file ** is called page 1. 0 is used to represent "not a page". */ typedef unsigned int Pgno; /* ** Each open file is managed by a separate instance of the "Pager" structure. */ typedef struct Pager Pager; /* ** Allowed values for the flags parameter to sqlite3pager_open(). ** ** NOTE: This values must match the corresponding BTREE_ values in btree.h. */ #define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */ #define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */ /* ** See source code comments for a detailed description of the following ** routines: */ int sqlite3pager_open(Pager **ppPager, const char *zFilename, int nExtra, int flags); void sqlite3pager_set_busyhandler(Pager*, BusyHandler *pBusyHandler); void sqlite3pager_set_destructor(Pager*, void(*)(void*,int)); void sqlite3pager_set_reiniter(Pager*, void(*)(void*,int)); int sqlite3pager_set_pagesize(Pager*, int); void sqlite3pager_read_fileheader(Pager*, int, unsigned char*); void sqlite3pager_set_cachesize(Pager*, int); int sqlite3pager_close(Pager *pPager); int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage); void *sqlite3pager_lookup(Pager *pPager, Pgno pgno); int sqlite3pager_ref(void*); int sqlite3pager_unref(void*); Pgno sqlite3pager_pagenumber(void*); int sqlite3pager_write(void*); int sqlite3pager_iswriteable(void*); int sqlite3pager_overwrite(Pager *pPager, Pgno pgno, void*); int sqlite3pager_pagecount(Pager*); int sqlite3pager_truncate(Pager*,Pgno); int sqlite3pager_begin(void*, int exFlag); int sqlite3pager_commit(Pager*); int sqlite3pager_sync(Pager*,const char *zMaster, Pgno); int sqlite3pager_rollback(Pager*); int sqlite3pager_isreadonly(Pager*); int sqlite3pager_stmt_begin(Pager*); int sqlite3pager_stmt_commit(Pager*); int sqlite3pager_stmt_rollback(Pager*); void sqlite3pager_dont_rollback(void*); void sqlite3pager_dont_write(Pager*, Pgno); int *sqlite3pager_stats(Pager*); void sqlite3pager_set_safety_level(Pager*,int); const char *sqlite3pager_filename(Pager*); const char *sqlite3pager_dirname(Pager*); const char *sqlite3pager_journalname(Pager*); int sqlite3pager_nosync(Pager*); int sqlite3pager_rename(Pager*, const char *zNewName); void sqlite3pager_set_codec(Pager*,void(*)(void*,void*,Pgno,int),void*); int sqlite3pager_movepage(Pager*,void*,Pgno); int sqlite3pager_reset(Pager*); int sqlite3pager_release_memory(int); #if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) int sqlite3pager_lockstate(Pager*); #endif #ifdef SQLITE_TEST void sqlite3pager_refdump(Pager*); int pager3_refinfo_enable; #endif #endif /* _PAGER_H_ */ --- NEW FILE: update.c --- /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle UPDATE statements. ** ** $Id: update.c,v 1.1 2006/02/14 02:16:48 chrisdavis3587 Exp $ */ #include "sqliteInt.h" /* ** The most recently coded instruction was an OP_Column to retrieve the ** i-th column of table pTab. This routine sets the P3 parameter of the ** OP_Column to the default value, if any. ** ** The default value of a column is specified by a DEFAULT clause in the ** column definition. This was either supplied by the user when the table ** was created, or added later to the table definition by an ALTER TABLE ** command. If the latter, then the row-records in the table btree on disk ** may not contain a value for the column and the default value, taken ** from the P3 parameter of the OP_Column instruction, is returned instead. ** If the former, then all row-records are guaranteed to include a value ** for the column and the P3 value is not required. ** ** Column definitions created by an ALTER TABLE command may only have ** literal default values specified: a number, null or a string. (If a more ** complicated default expression value was provided, it is evaluated ** when the ALTER TABLE is executed and one of the literal values written ** into the sqlite_master table.) ** ** Therefore, the P3 parameter is only required if the default value for ** the column is a literal number, string or null. The sqlite3ValueFromExpr() ** function is capable of transforming these types of expressions into ** sqlite3_value objects. */ void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i){ if( pTab && !pTab->pSelect ){ sqlite3_value *pValue; u8 enc = ENC(sqlite3VdbeDb(v)); Column *pCol = &pTab->aCol[i]; sqlite3ValueFromExpr(pCol->pDflt, enc, pCol->affinity, &pValue); if( pValue ){ sqlite3VdbeChangeP3(v, -1, (const char *)pValue, P3_MEM); }else{ VdbeComment((v, "# %s.%s", pTab->zName, pCol->zName)); } } } /* ** Process an UPDATE statement. ** ** UPDATE OR IGNORE table_wxyz SET a=b, c=d WHERE e<5 AND f NOT NULL; ** \_______/ \________/ \______/ \________________/ * onError pTabList pChanges pWhere */ void sqlite3Update( Parse *pParse, /* The parser context */ SrcList *pTabList, /* The table in which we should change things */ ExprList *pChanges, /* Things to be changed */ Expr *pWhere, /* The WHERE clause. May be null */ int onError /* How to handle constraint errors */ ){ int i, j; /* Loop counters */ Table *pTab; /* The table to be updated */ int addr = 0; /* VDBE instruction address of the start of the loop */ WhereInfo *pWInfo; /* Information about the WHERE clause */ Vdbe *v; /* The virtual database engine */ Index *pIdx; /* For looping over indices */ int nIdx; /* Number of indices that need updating */ int nIdxTotal; /* Total number of indices */ int iCur; /* VDBE Cursor number of pTab */ sqlite3 *db; /* The database structure */ Index **apIdx = 0; /* An array of indices that need updating too */ char *aIdxUsed = 0; /* aIdxUsed[i]==1 if the i-th index is used */ int *aXRef = 0; /* aXRef[i] is the index in pChanges->a[] of the ** an expression for the i-th column of the table. ** aXRef[i]==-1 if the i-th column is not changed. */ int chngRowid; /* True if the record number is being changed */ Expr *pRowidExpr = 0; /* Expression defining the new record number */ int openAll = 0; /* True if all indices need to be opened */ AuthContext sContext; /* The authorization context */ NameContext sNC; /* The name-context to resolve expressions in */ int iDb; /* Database containing the table being updated */ #ifndef SQLITE_OMIT_TRIGGER int isView; /* Trying to update a view */ int triggers_exist = 0; /* True if any row triggers exist */ #endif int newIdx = -1; /* index of trigger "new" temp table */ int oldIdx = -1; /* index of trigger "old" temp table */ sContext.pParse = 0; if( pParse->nErr || sqlite3MallocFailed() ){ goto update_cleanup; } db = pParse->db; assert( pTabList->nSrc==1 ); /* Locate the table which we want to update. */ pTab = sqlite3SrcListLookup(pParse, pTabList); if( pTab==0 ) goto update_cleanup; iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema); /* Figure out if we have any triggers and if the table being ** updated is a view */ #ifndef SQLITE_OMIT_TRIGGER triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_UPDATE, pChanges); isView = pTab->pSelect!=0; #else # define triggers_exist 0 # define isView 0 #endif #ifdef SQLITE_OMIT_VIEW # undef isView # define isView 0 #endif if( sqlite3IsReadOnly(pParse, pTab, triggers_exist) ){ goto update_cleanup; } if( isView ){ if( sqlite3ViewGetColumnNames(pParse, pTab) ){ goto update_cleanup; } } aXRef = sqliteMallocRaw( sizeof(int) * pTab->nCol ); if( aXRef==0 ) goto update_cleanup; for(i=0; i<pTab->nCol; i++) aXRef[i] = -1; /* If there are FOR EACH ROW triggers, allocate cursors for the ** special OLD and NEW tables */ if( triggers_exist ){ newIdx = pParse->nTab++; oldIdx = pParse->nTab++; } /* Allocate a cursors for the main database table and for all indices. ** The index cursors might not be used, but if they are used they ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ pTabList->a[0].iCursor = iCur = pParse->nTab++; for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ pParse->nTab++; } /* Initialize the name-context */ memset(&sNC, 0, sizeof(sNC)); sNC.pParse = pParse; sNC.pSrcList = pTabList; /* Resolve the column names in all the expressions of the ** of the UPDATE statement. Also find the column index ** for each column to be updated in the pChanges array. For each ** column to be updated, make sure we have authorization to change ** that column. */ chngRowid = 0; for(i=0; i<pChanges->nExpr; i++){ if( sqlite3ExprResolveNames(&sNC, pChanges->a[i].pExpr) ){ goto update_cleanup; } for(j=0; j<pTab->nCol; j++){ if( sqlite3StrICmp(pTab->aCol[j].zName, pChanges->a[i].zName)==0 ){ if( j==pTab->iPKey ){ chngRowid = 1; pRowidExpr = pChanges->a[i].pExpr; } aXRef[j] = i; break; } } if( j>=pTab->nCol ){ if( sqlite3IsRowid(pChanges->a[i].zName) ){ chngRowid = 1; pRowidExpr = pChanges->a[i].pExpr; }else{ sqlite3ErrorMsg(pParse, "no such column: %s", pChanges->a[i].zName); goto update_cleanup; } } #ifndef SQLITE_OMIT_AUTHORIZATION { int rc; rc = sqlite3AuthCheck(pParse, SQLITE_UPDATE, pTab->zName, pTab->aCol[j].zName, db->aDb[iDb].zName); if( rc==SQLITE_DENY ){ goto update_cleanup; }else if( rc==SQLITE_IGNORE ){ aXRef[j] = -1; } } #endif } /* Allocate memory for the array apIdx[] and fill it with pointers to every ** index that needs to be updated. Indices only need updating if their ** key includes one of the columns named in pChanges or if the record ** number of the original table entry is changing. */ for(nIdx=nIdxTotal=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdxTotal++){ if( chngRowid ){ i = 0; }else { for(i=0; i<pIdx->nColumn; i++){ if( aXRef[pIdx->aiColumn[i]]>=0 ) break; } } if( i<pIdx->nColumn ) nIdx++; } if( nIdxTotal>0 ){ apIdx = sqliteMallocRaw( sizeof(Index*) * nIdx + nIdxTotal ); if( apIdx==0 ) goto update_cleanup; aIdxUsed = (char*)&apIdx[nIdx]; } for(nIdx=j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ if( chngRowid ){ i = 0; }else{ for(i=0; i<pIdx->nColumn; i++){ if( aXRef[pIdx->aiColumn[i]]>=0 ) break; } } if( i<pIdx->nColumn ){ apIdx[nIdx++] = pIdx; aIdxUsed[j] = 1; }else{ aIdxUsed[j] = 0; } } /* Resolve the column names in all the expressions in the ** WHERE clause. */ if( sqlite3ExprResolveNames(&sNC, pWhere) ){ goto update_cleanup; } /* Start the view context */ if( isView ){ sqlite3AuthContextPush(pParse, &sContext, pTab->zName); } /* Begin generating code. */ v = sqlite3GetVdbe(pParse); if( v==0 ) goto update_cleanup; if( pParse->nested==0 ) sqlite3VdbeCountChanges(v); sqlite3BeginWriteOperation(pParse, 1, iDb); /* If we are trying to update a view, realize that view into ** a ephemeral table. */ if( isView ){ Select *pView; pView = sqlite3SelectDup(pTab->pSelect); sqlite3Select(pParse, pView, SRT_VirtualTab, iCur, 0, 0, 0, 0); sqlite3SelectDelete(pView); } /* Begin the database scan */ pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0); if( pWInfo==0 ) goto update_cleanup; /* Remember the index of every item to be updated. */ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); sqlite3VdbeAddOp(v, OP_FifoWrite, 0, 0); /* End the database scan loop. */ sqlite3WhereEnd(pWInfo); /* Initialize the count of updated rows */ if( db->flags & SQLITE_CountRows && !pParse->trigStack ){ sqlite3VdbeAddOp(v, OP_Integer, 0, 0); } if( triggers_exist ){ /* Create pseudo-tables for NEW and OLD */ sqlite3VdbeAddOp(v, OP_OpenPseudo, oldIdx, 0); sqlite3VdbeAddOp(v, OP_SetNumColumns, oldIdx, pTab->nCol); sqlite3VdbeAddOp(v, OP_OpenPseudo, newIdx, 0); sqlite3VdbeAddOp(v, OP_SetNumColumns, newIdx, pTab->nCol); /* The top of the update loop for when there are triggers. */ addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, 0); if( !isView ){ sqlite3VdbeAddOp(v, OP_Dup, 0, 0); sqlite3VdbeAddOp(v, OP_Dup, 0, 0); /* Open a cursor and make it point to the record that is ** being updated. */ sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenRead); } sqlite3VdbeAddOp(v, OP_MoveGe, iCur, 0); /* Generate the OLD table */ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); sqlite3VdbeAddOp(v, OP_RowData, iCur, 0); sqlite3VdbeAddOp(v, OP_Insert, oldIdx, 0); /* Generate the NEW table */ if( chngRowid ){ sqlite3ExprCodeAndCache(pParse, pRowidExpr); }else{ sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0); } for(i=0; i<pTab->nCol; i++){ if( i==pTab->iPKey ){ sqlite3VdbeAddOp(v, OP_Null, 0, 0); continue; } j = aXRef[i]; if( j<0 ){ sqlite3VdbeAddOp(v, OP_Column, iCur, i); sqlite3ColumnDefault(v, pTab, i); }else{ sqlite3ExprCodeAndCache(pParse, pChanges->a[j].pExpr); } } sqlite3VdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0); if( !isView ){ sqlite3TableAffinityStr(v, pTab); } if( pParse->nErr ) goto update_cleanup; sqlite3VdbeAddOp(v, OP_Insert, newIdx, 0); if( !isView ){ sqlite3VdbeAddOp(v, OP_Close, iCur, 0); } /* Fire the BEFORE and INSTEAD OF triggers */ if( sqlite3CodeRowTrigger(pParse, TK_UPDATE, pChanges, TRIGGER_BEFORE, pTab, newIdx, oldIdx, onError, addr) ){ goto update_cleanup; } } if( !isView ){ /* ** Open every index that needs updating. Note that if any ** index could potentially invoke a REPLACE conflict resolution ** action, then we need to open all indices because we might need ** to be deleting some records. */ sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenWrite); if( onError==OE_Replace ){ openAll = 1; }else{ openAll = 0; for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ if( pIdx->onError==OE_Replace ){ openAll = 1; break; } } } for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ if( openAll || aIdxUsed[i] ){ KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx); sqlite3VdbeAddOp(v, OP_Integer, iDb, 0); sqlite3VdbeOp3(v, OP_OpenWrite, iCur+i+1, pIdx->tnum, (char*)pKey, P3_KEYINFO_HANDOFF); assert( pParse->nTab>iCur+i+1 ); } } /* Loop over every record that needs updating. We have to load ** the old data for each record to be updated because some columns ** might not change and we will need to copy the old value. ** Also, the old data is needed to delete the old index entires. ** So make the cursor point at the old record. */ if( !triggers_exist ){ addr = sqlite3VdbeAddOp(v, OP_FifoRead, 0, 0); sqlite3VdbeAddOp(v, OP_Dup, 0, 0); } sqlite3VdbeAddOp(v, OP_NotExists, iCur, addr); /* If the record number will change, push the record number as it ** will be after the update. (The old record number is currently ** on top of the stack.) */ if( chngRowid ){ sqlite3ExprCode(pParse, pRowidExpr); sqlite3VdbeAddOp(v, OP_MustBeInt, 0, 0); } /* Compute new data for this record. */ for(i=0; i<pTab->nCol; i++){ if( i==pTab->iPKey ){ sqlite3VdbeAddOp(v, OP_Null, 0, 0); continue; } j = aXRef[i]; if( j<0 ){ sqlite3VdbeAddOp(v, OP_Column, iCur, i); sqlite3ColumnDefault(v, pTab, i); }else{ sqlite3ExprCode(pParse, pChanges->a[j].pExpr); } } /* Do constraint checks */ sqlite3GenerateConstraintChecks(pParse, pTab, iCur, aIdxUsed, chngRowid, 1, onError, addr); /* Delete the old indices for the current record. */ sqlite3GenerateRowIndexDelete(db, v, pTab, iCur, aIdxUsed); /* If changing the record number, delete the old record. */ if( chngRowid ){ sqlite3VdbeAddOp(v, OP_Delete, iCur, 0); } /* Create the new index entries and the new record. */ sqlite3CompleteInsertion(pParse, pTab, iCur, aIdxUsed, chngRowid, 1, -1); } /* Increment the row counter */ if( db->flags & SQLITE_CountRows && !pParse->trigStack){ sqlite3VdbeAddOp(v, OP_AddImm, 1, 0); } /* If there are triggers, close all the cursors after each iteration ** through the loop. The fire the after triggers. */ if( triggers_exist ){ if( !isView ){ for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ if( openAll || aIdxUsed[i] ) sqlite3VdbeAddOp(v, OP_Close, iCur+i+1, 0); } sqlite3VdbeAddOp(v, OP_Close, iCur, 0); } if( sqlite3CodeRowTrigger(pParse, TK_UPDATE, pChanges, TRIGGER_AFTER, pTab, newIdx, oldIdx, onError, addr) ){ goto update_cleanup; } } /* Repeat the above with the next record to be updated, until ** all record selected by the WHERE clause have been updated. */ sqlite3VdbeAddOp(v, OP_Goto, 0, addr); sqlite3VdbeJumpHere(v, addr); /* Close all tables if there were no FOR EACH ROW triggers */ if( !triggers_exist ){ for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ if( openAll || aIdxUsed[i] ){ sqlite3VdbeAddOp(v, OP_Close, iCur+i+1, 0); } } sqlite3VdbeAddOp(v, OP_Close, iCur, 0); }else{ sqlite3VdbeAddOp(v, OP_Close, newIdx, 0); sqlite3VdbeAddOp(v, OP_Close, oldIdx, 0); } /* ** Return the number of rows that were changed. If this routine is ** generating code because of a call to sqlite3NestedParse(), do not ** invoke the callback function. */ if( db->flags & SQLITE_CountRows && !pParse->trigStack && pParse->nested==0 ){ sqlite3VdbeAddOp(v, OP_Callback, 1, 0); sqlite3VdbeSetNumCols(v, 1); sqlite3VdbeSetColName(v, 0, "rows updated", P3_STATIC); } update_cleanup: sqlite3AuthContextPop(&sContext); sqliteFree(apIdx); sqliteFree(aXRef); sqlite3SrcListDelete(pTabList); sqlite3ExprListDelete(pChanges); sqlite3ExprDelete(pWhere); return; } --- NEW FILE: vdbemem.c --- /* ** 2004 May 26 ** ** 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 use to manipulate "Mem" structure. A "Mem" ** stores a single value in the VDBE. Mem is an opaque structure visible ** only within the VDBE. Interface routines refer to a Mem using the ** name sqlite_value */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> #include "vdbeInt.h" /* ** If pMem is an object with a valid string representation, this routine ** ensures the internal encoding for the string representation is ** 'desiredEnc', one of SQLITE_UTF8, SQLITE_UTF16LE or SQLITE_UTF16BE. ** ** If pMem is not a string object, or the encoding of the string ** representation is already stored using the requested encoding, then this ** routine is a no-op. ** ** SQLITE_OK is returned if the conversion is successful (or not required). ** SQLITE_NOMEM may be returned if a malloc() fails during conversion ** between formats. */ int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){ int rc; if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){ return SQLITE_OK; } #ifdef SQLITE_OMIT_UTF16 return SQLITE_ERROR; #else /* MemTranslate() may return SQLITE_OK or SQLITE_NOMEM. If NOMEM is returned, ** then the encoding of the value may not have changed. */ rc = sqlite3VdbeMemTranslate(pMem, desiredEnc); assert(rc==SQLITE_OK || rc==SQLITE_NOMEM); assert(rc==SQLITE_OK || pMem->enc!=desiredEnc); assert(rc==SQLITE_NOMEM || pMem->enc==desiredEnc); if( rc==SQLITE_NOMEM ){ /* sqlite3VdbeMemRelease(pMem); pMem->flags = MEM_Null; pMem->z = 0; */ } return rc; #endif } /* ** Make the given Mem object MEM_Dyn. ** ** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails. */ int sqlite3VdbeMemDynamicify(Mem *pMem){ int n = pMem->n; u8 *z; if( (pMem->flags & (MEM_Ephem|MEM_Static|MEM_Short))==0 ){ return SQLITE_OK; } assert( (pMem->flags & MEM_Dyn)==0 ); assert( pMem->flags & (MEM_Str|MEM_Blob) ); z = sqliteMallocRaw( n+2 ); if( z==0 ){ return SQLITE_NOMEM; } pMem->flags |= MEM_Dyn|MEM_Term; pMem->xDel = 0; memcpy(z, pMem->z, n ); z[n] = 0; z[n+1] = 0; pMem->z = (char*)z; pMem->flags &= ~(MEM_Ephem|MEM_Static|MEM_Short); return SQLITE_OK; } /* ** Make the given Mem object either MEM_Short or MEM_Dyn so that bytes ** of the Mem.z[] array can be modified. ** ** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails. */ int sqlite3VdbeMemMakeWriteable(Mem *pMem){ int n; u8 *z; if( (pMem->flags & (MEM_Ephem|MEM_Static))==0 ){ return SQLITE_OK; } assert( (pMem->flags & MEM_Dyn)==0 ); assert( pMem->flags & (MEM_Str|MEM_Blob) ); if( (n = pMem->n)+2<sizeof(pMem->zShort) ){ z = (u8*)pMem->zShort; pMem->flags |= MEM_Short|MEM_Term; }else{ z = sqliteMallocRaw( n+2 ); if( z==0 ){ return SQLITE_NOMEM; } pMem->flags |= MEM_Dyn|MEM_Term; pMem->xDel = 0; } memcpy(z, pMem->z, n ); z[n] = 0; z[n+1] = 0; pMem->z = (char*)z; pMem->flags &= ~(MEM_Ephem|MEM_Static); return SQLITE_OK; } /* ** Make sure the given Mem is \u0000 terminated. */ int sqlite3VdbeMemNulTerminate(Mem *pMem){ /* In SQLite, a string without a nul terminator occurs when a string ** is loaded from disk (in this case the memory management is ephemeral), ** or when it is supplied by the user as a bound variable or function ** return value. Therefore, the memory management of the string must be ** either ephemeral, static or controlled by a user-supplied destructor. */ assert( !(pMem->flags&MEM_Str) || /* it's not a string, or */ (pMem->flags&MEM_Term) || /* it's nul term. already, or */ (pMem->flags&(MEM_Ephem|MEM_Static)) || /* it's static or ephem, or */ (pMem->flags&MEM_Dyn && pMem->xDel) /* external management */ ); if( (pMem->flags & MEM_Term)!=0 || (pMem->flags & MEM_Str)==0 ){ return SQLITE_OK; /* Nothing to do */ } if( pMem->flags & (MEM_Static|MEM_Ephem) ){ return sqlite3VdbeMemMakeWriteable(pMem); }else{ char *z = sqliteMalloc(pMem->n+2); if( !z ) return SQLITE_NOMEM; memcpy(z, pMem->z, pMem->n); z[pMem->n] = 0; z[pMem->n+1] = 0; pMem->xDel(pMem->z); pMem->xDel = 0; pMem->z = z; } return SQLITE_OK; } /* ** Add MEM_Str to the set of representations for the given Mem. Numbers ** are converted using sqlite3_snprintf(). Converting a BLOB to a string ** is a no-op. ** ** Existing representations MEM_Int and MEM_Real are *not* invalidated. ** ** A MEM_Null value will never be passed to this function. This function is ** used for converting values to text for returning to the user (i.e. via ** sqlite3_value_text()), or for ensuring that values to be used as btree ** keys are strings. In the former case a NULL pointer is returned the ** user and the later is an internal programming error. */ int sqlite3VdbeMemStringify(Mem *pMem, int enc){ int rc = SQLITE_OK; int fg = pMem->flags; char *z = pMem->zShort; assert( !(fg&(MEM_Str|MEM_Blob)) ); assert( fg&(MEM_Int|MEM_Real) ); /* For a Real or Integer, use sqlite3_snprintf() to produce the UTF-8 ** string representation of the value. Then, if the required encoding ** is UTF-16le or UTF-16be do a translation. ** ** FIX ME: It would be better if sqlite3_snprintf() could do UTF-16. */ if( fg & MEM_Int ){ sqlite3_snprintf(NBFS, z, "%lld", pMem->i); }else{ assert( fg & MEM_Real ); sqlite3_snprintf(NBFS, z, "%!.15g", pMem->r); } pMem->n = strlen(z); pMem->z = z; pMem->enc = SQLITE_UTF8; pMem->flags |= MEM_Str | MEM_Short | MEM_Term; sqlite3VdbeChangeEncoding(pMem, enc); return rc; } /* ** Memory cell pMem contains the context of an aggregate function. ** This routine calls the finalize method for that function. The ** result of the aggregate is stored back into pMem. ** ** Return SQLITE_ERROR if the finalizer reports an error. SQLITE_OK ** otherwise. */ int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){ int rc = SQLITE_OK; if( pFunc && pFunc->xFinalize ){ sqlite3_context ctx; assert( (pMem->flags & MEM_Null)!=0 || pFunc==*(FuncDef**)&pMem->i ); ctx.s.flags = MEM_Null; ctx.s.z = pMem->zShort; ctx.pMem = pMem; ctx.pFunc = pFunc; ctx.isError = 0; pFunc->xFinalize(&ctx); if( pMem->z && pMem->z!=pMem->zShort ){ sqliteFree( pMem->z ); } *pMem = ctx.s; if( pMem->flags & MEM_Short ){ pMem->z = pMem->zShort; } if( ctx.isError ){ rc = SQLITE_ERROR; } } return rc; } /* ** Release any memory held by the Mem. This may leave the Mem in an ** inconsistent state, for example with (Mem.z==0) and ** (Mem.type==SQLITE_TEXT). */ void sqlite3VdbeMemRelease(Mem *p){ if( p->flags & (MEM_Dyn|MEM_Agg) ){ if( p->xDel ){ if( p->flags & MEM_Agg ){ sqlite3VdbeMemFinalize(p, *(FuncDef**)&p->i); assert( (p->flags & MEM_Agg)==0 ); sqlite3VdbeMemRelease(p); }else{ p->xDel((void *)p->z); } }else{ sqliteFree(p->z); } p->z = 0; p->xDel = 0; } } /* ** Return some kind of integer value which is the best we can do ** at representing the value that *pMem describes as an integer. ** If pMem is an integer, then the value is exact. If pMem is ** a floating-point then the value returned is the integer part. ** If pMem is a string or blob, then we make an attempt to convert ** it into a integer and return that. If pMem is NULL, return 0. ** ** If pMem is a string, its encoding might be changed. */ i64 sqlite3VdbeIntValue(Mem *pMem){ int flags = pMem->flags; if( flags & MEM_Int ){ return pMem->i; }else if( flags & MEM_Real ){ return (i64)pMem->r; }else if( flags & (MEM_Str|MEM_Blob) ){ i64 value; if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8) || sqlite3VdbeMemNulTerminate(pMem) ){ return 0; } assert( pMem->z ); sqlite3atoi64(pMem->z, &value); return value; }else{ return 0; } } /* ** Return the best representation of pMem that we can get into a ** double. If pMem is already a double or an integer, return its ** value. If it is a string or blob, try to convert it to a double. ** If it is a NULL, return 0.0. */ double sqlite3VdbeRealValue(Mem *pMem){ if( pMem->flags & MEM_Real ){ return pMem->r; }else if( pMem->flags & MEM_Int ){ return (double)pMem->i; }else if( pMem->flags & (MEM_Str|MEM_Blob) ){ double val = 0.0; if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8) || sqlite3VdbeMemNulTerminate(pMem) ){ return 0.0; } assert( pMem->z ); sqlite3AtoF(pMem->z, &val); return val; }else{ return 0.0; } } /* ** The MEM structure is already a MEM_Real. Try to also make it a ** MEM_Int if we can. */ void sqlite3VdbeIntegerAffinity(Mem *pMem){ assert( pMem->flags & MEM_Real ); pMem->i = pMem->r; if( ((double)pMem->i)==pMem->r ){ pMem->flags |= MEM_Int; } } /* ** Convert pMem to type integer. Invalidate any prior representations. */ int sqlite3VdbeMemIntegerify(Mem *pMem){ pMem->i = sqlite3VdbeIntValue(pMem); sqlite3VdbeMemRelease(pMem); pMem->flags = MEM_Int; return SQLITE_OK; } /* ** Convert pMem so that it is of type MEM_Real. ** Invalidate any prior representations. */ int sqlite3VdbeMemRealify(Mem *pMem){ pMem->r = sqlite3VdbeRealValue(pMem); sqlite3VdbeMemRelease(pMem); pMem->flags = MEM_Real; return SQLITE_OK; } /* ** Convert pMem so that it has types MEM_Real or MEM_Int or both. ** Invalidate any prior representations. */ int sqlite3VdbeMemNumerify(Mem *pMem){ sqlite3VdbeMemRealify(pMem); sqlite3VdbeIntegerAffinity(pMem); return SQLITE_OK; } /* ** Delete any previous value and set the value stored in *pMem to NULL. */ void sqlite3VdbeMemSetNull(Mem *pMem){ sqlite3VdbeMemRelease(pMem); pMem->flags = MEM_Null; pMem->type = SQLITE_NULL; pMem->n = 0; } /* ** Delete any previous value and set the value stored in *pMem to val, ** manifest type INTEGER. */ void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){ sqlite3VdbeMemRelease(pMem); pMem->i = val; pMem->flags = MEM_Int; pMem->type = SQLITE_INTEGER; } /* ** Delete any previous value and set the value stored in *pMem to val, ** manifest type REAL. */ void sqlite3VdbeMemSetDouble(Mem *pMem, double val){ sqlite3VdbeMemRelease(pMem); pMem->r = val; pMem->flags = MEM_Real; pMem->type = SQLITE_FLOAT; } /* ** Make an shallow copy of pFrom into pTo. Prior contents of ** pTo are overwritten. The pFrom->z field is not duplicated. If ** pFrom->z is used, then pTo->z points to the same thing as pFrom->z ** and flags gets srcType (either MEM_Ephem or MEM_Static). */ void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){ memcpy(pTo, pFrom, sizeof(*pFrom)-sizeof(pFrom->zShort)); pTo->xDel = 0; if( pTo->flags & (MEM_Str|MEM_Blob) ){ pTo->flags &= ~(MEM_Dyn|MEM_Static|MEM_Short|MEM_Ephem); assert( srcType==MEM_Ephem || srcType==MEM_Static ); pTo->flags |= srcType; } } /* ** Make a full copy of pFrom into pTo. Prior contents of pTo are ** freed before the copy is made. */ int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){ int rc; if( pTo->flags & MEM_Dyn ){ sqlite3VdbeMemRelease(pTo); } sqlite3VdbeMemShallowCopy(pTo, pFrom, MEM_Ephem); if( pTo->flags & MEM_Ephem ){ rc = sqlite3VdbeMemMakeWriteable(pTo); }else{ rc = SQLITE_OK; } return rc; } /* ** Transfer the contents of pFrom to pTo. Any existing value in pTo is ** freed. If pFrom contains ephemeral data, a copy is made. ** ** pFrom contains an SQL NULL when this routine returns. SQLITE_NOMEM ** might be returned if pFrom held ephemeral data and we were unable ** to allocate enough space to make a copy. */ int sqlite3VdbeMemMove(Mem *pTo, Mem *pFrom){ int rc; if( pTo->flags & MEM_Dyn ){ sqlite3VdbeMemRelease(pTo); } memcpy(pTo, pFrom, sizeof(Mem)); if( pFrom->flags & MEM_Short ){ pTo->z = pTo->zShort; } pFrom->flags = MEM_Null; pFrom->xDel = 0; if( pTo->flags & MEM_Ephem ){ rc = sqlite3VdbeMemMakeWriteable(pTo); }else{ rc = SQLITE_OK; } return rc; } /* ** Change the value of a Mem to be a string or a BLOB. */ int sqlite3VdbeMemSetStr( Mem *pMem, /* Memory cell to set to string value */ const char *z, /* String pointer */ int n, /* Bytes in string, or negative */ u8 enc, /* Encoding of z. 0 for BLOBs */ void (*xDel)(void*) /* Destructor function */ ){ sqlite3VdbeMemRelease(pMem); if( !z ){ pMem->flags = MEM_Null; pMem->type = SQLITE_NULL; return SQLITE_OK; } pMem->z = (char *)z; if( xDel==SQLITE_STATIC ){ pMem->flags = MEM_Static; }else if( xDel==SQLITE_TRANSIENT ){ pMem->flags = MEM_Ephem; }else{ pMem->flags = MEM_Dyn; pMem->xDel = xDel; } pMem->enc = enc; pMem->type = enc==0 ? SQLITE_BLOB : SQLITE_TEXT; pMem->n = n; assert( enc==0 || enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE ); switch( enc ){ case 0: pMem->flags |= MEM_Blob; pMem->enc = SQLITE_UTF8; break; case SQLITE_UTF8: pMem->flags |= MEM_Str; if( n<0 ){ pMem->n = strlen(z); pMem->flags |= MEM_Term; } break; #ifndef SQLITE_OMIT_UTF16 case SQLITE_UTF16LE: case SQLITE_UTF16BE: pMem->flags |= MEM_Str; if( pMem->n<0 ){ pMem->n = sqlite3utf16ByteLen(pMem->z,-1); pMem->flags |= MEM_Term; } if( sqlite3VdbeMemHandleBom(pMem) ){ return SQLITE_NOMEM; } #endif /* SQLITE_OMIT_UTF16 */ } if( pMem->flags&MEM_Ephem ){ return sqlite3VdbeMemMakeWriteable(pMem); } return SQLITE_OK; } /* ** Compare the values contained by the two memory cells, returning ** negative, zero or positive if pMem1 is less than, equal to, or greater ** than pMem2. Sorting order is NULL's first, followed by numbers (integers ** and reals) sorted numerically, followed by text ordered by the collating ** sequence pColl and finally blob's ordered by memcmp(). ** ** Two NULL values are considered equal by this function. */ int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl){ int rc; int f1, f2; int combined_flags; /* Interchange pMem1 and pMem2 if the collating sequence specifies ** DESC order. */ f1 = pMem1->flags; f2 = pMem2->flags; combined_flags = f1|f2; /* If one value is NULL, it is less than the other. If both values ** are NULL, return 0. */ if( combined_flags&MEM_Null ){ return (f2&MEM_Null) - (f1&MEM_Null); } /* If one value is a number and the other is not, the number is less. ** If both are numbers, compare as reals if one is a real, or as integers ** if both values are integers. */ if( combined_flags&(MEM_Int|MEM_Real) ){ if( !(f1&(MEM_Int|MEM_Real)) ){ return 1; } if( !(f2&(MEM_Int|MEM_Real)) ){ return -1; } if( (f1 & f2 & MEM_Int)==0 ){ double r1, r2; if( (f1&MEM_Real)==0 ){ r1 = pMem1->i; }else{ r1 = pMem1->r; } if( (f2&MEM_Real)==0 ){ r2 = pMem2->i; }else{ r2 = pMem2->r; } if( r1<r2 ) return -1; if( r1>r2 ) return 1; return 0; }else{ assert( f1&MEM_Int ); assert( f2&MEM_Int ); if( pMem1->i < pMem2->i ) return -1; if( pMem1->i > pMem2->i ) return 1; return 0; } } /* If one value is a string and the other is a blob, the string is less. ** If both are strings, compare using the collating functions. */ if( combined_flags&MEM_Str ){ if( (f1 & MEM_Str)==0 ){ return 1; } if( (f2 & MEM_Str)==0 ){ return -1; } assert( pMem1->enc==pMem2->enc ); assert( pMem1->enc==SQLITE_UTF8 || pMem1->enc==SQLITE_UTF16LE || pMem1->enc==SQLITE_UTF16BE ); /* The collation sequence must be defined at this point, even if ** the user deletes the collation sequence after the vdbe program is ** compiled (this was not always the case). */ assert( !pColl || pColl->xCmp ); if( pColl ){ if( pMem1->enc==pColl->enc ){ return pColl->xCmp(pColl->pUser,pMem1->n,pMem1->z,pMem2->n,pMem2->z); }else{ u8 origEnc = pMem1->enc; rc = pColl->xCmp( pColl->pUser, sqlite3ValueBytes((sqlite3_value*)pMem1, pColl->enc), sqlite3ValueText((sqlite3_value*)pMem1, pColl->enc), sqlite3ValueBytes((sqlite3_value*)pMem2, pColl->enc), sqlite3ValueText((sqlite3_value*)pMem2, pColl->enc) ); sqlite3ValueBytes((sqlite3_value*)pMem1, origEnc); sqlite3ValueText((sqlite3_value*)pMem1, origEnc); sqlite3ValueBytes((sqlite3_value*)pMem2, origEnc); sqlite3ValueText((sqlite3_value*)pMem2, origEnc); return rc; } } /* If a NULL pointer was passed as the collate function, fall through ** to the blob case and use memcmp(). */ } /* Both values must be blobs. Compare using memcmp(). */ rc = memcmp(pMem1->z, pMem2->z, (pMem1->n>pMem2->n)?pMem2->n:pMem1->n); if( rc==0 ){ rc = pMem1->n - pMem2->n; } return rc; } /* ** Move data out of a btree key or data field and into a Mem structure. ** The data or key is taken from the entry that pCur is currently pointing ** to. offset and amt determine what portion of the data or key to retrieve. ** key is true to get the key or false to get data. The result is written ** into the pMem element. ** ** The pMem structure is assumed to be uninitialized. Any prior content ** is overwritten without being freed. ** ** If this routine fails for any reason (malloc returns NULL or unable ** to read from the disk) then the pMem is left in an inconsistent state. */ int sqlite3VdbeMemFromBtree( BtCursor *pCur, /* Cursor pointing at record to retrieve. */ int offset, /* Offset from the start of data to return bytes from. */ int amt, /* Number of bytes to return. */ int key, /* If true, retrieve from the btree key, not data. */ Mem *pMem /* OUT: Return data in this Mem structure. */ ){ char *zData; /* Data from the btree layer */ int available; /* Number of bytes available on the local btree page */ if( key ){ zData = (char *)sqlite3BtreeKeyFetch(pCur, &available); }else{ zData = (char *)sqlite3BtreeDataFetch(pCur, &available); } pMem->n = amt; if( offset+amt<=available ){ pMem->z = &zData[offset]; pMem->flags = MEM_Blob|MEM_Ephem; }else{ int rc; if( amt>NBFS-2 ){ zData = (char *)sqliteMallocRaw(amt+2); if( !zData ){ return SQLITE_NOMEM; } pMem->flags = MEM_Blob|MEM_Dyn|MEM_Term; pMem->xDel = 0; }else{ zData = &(pMem->zShort[0]); pMem->flags = MEM_Blob|MEM_Short|MEM_Term; } pMem->z = zData; pMem->enc = 0; pMem->type = SQLITE_BLOB; if( key ){ rc = sqlite3BtreeKey(pCur, offset, amt, zData); }else{ rc = sqlite3BtreeData(pCur, offset, amt, zData); } zData[amt] = 0; zData[amt+1] = 0; if( rc!=SQLITE_OK ){ if( amt>NBFS-2 ){ assert( zData!=pMem->zShort ); assert( pMem->flags & MEM_Dyn ); sqliteFree(zData); } else { assert( zData==pMem->zShort ); assert( pMem->flags & MEM_Short ); } return rc; } } return SQLITE_OK; } #ifndef NDEBUG /* ** Perform various checks on the memory cell pMem. An assert() will ** fail if pMem is internally inconsistent. */ void sqlite3VdbeMemSanity(Mem *pMem, u8 db_enc){ int flags = pMem->flags; assert( flags!=0 ); /* Must define some type */ if( pMem->flags & (MEM_Str|MEM_Blob) ){ int x = pMem->flags & (MEM_Static|MEM_Dyn|MEM_Ephem|MEM_Short); assert( x!=0 ); /* Strings must define a string subtype */ assert( (x & (x-1))==0 ); /* Only one string subtype can be defined */ assert( pMem->z!=0 ); /* Strings must have a value */ /* Mem.z points to Mem.zShort iff the subtype is MEM_Short */ assert( (pMem->flags & MEM_Short)==0 || pMem->z==pMem->zShort ); assert( (pMem->flags & MEM_Short)!=0 || pMem->z!=pMem->zShort ); /* No destructor unless there is MEM_Dyn */ assert( pMem->xDel==0 || (pMem->flags & MEM_Dyn)!=0 ); if( (flags & MEM_Str) ){ assert( pMem->enc==SQLITE_UTF8 || pMem->enc==SQLITE_UTF16BE || pMem->enc==SQLITE_UTF16LE ); /* If the string is UTF-8 encoded and nul terminated, then pMem->n ** must be the length of the string. (Later:) If the database file ** has been corrupted, '\000' characters might have been inserted ** into the middle of the string. In that case, the strlen() might ** be less. */ if( pMem->enc==SQLITE_UTF8 && (flags & MEM_Term) ){ assert( strlen(pMem->z)<=pMem->n ); assert( pMem->z[pMem->n]==0 ); } } }else{ /* Cannot define a string subtype for non-string objects */ assert( (pMem->flags & (MEM_Static|MEM_Dyn|MEM_Ephem|MEM_Short))==0 ); assert( pMem->xDel==0 ); } /* MEM_Null excludes all other types */ assert( (pMem->flags&(MEM_Str|MEM_Int|MEM_Real|MEM_Blob))==0 || (pMem->flags&MEM_Null)==0 ); /* If the MEM is both real and integer, the values are equal */ assert( (pMem->flags & (MEM_Int|MEM_Real))!=(MEM_Int|MEM_Real) || pMem->r==pMem->i ); } #endif /* This function is only available internally, it is not part of the ** external API. It works in a similar way to sqlite3_value_text(), ** except the data returned is in the encoding specified by the second ** parameter, which must be one of SQLITE_UTF16BE, SQLITE_UTF16LE or ** SQLITE_UTF8. */ const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){ if( !pVal ) return 0; assert( enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE || enc==SQLITE_UTF8); if( pVal->flags&MEM_Null ){ return 0; } assert( (MEM_Blob>>3) == MEM_Str ); pVal->flags |= (pVal->flags & MEM_Blob)>>3; if( pVal->flags&MEM_Str ){ sqlite3VdbeChangeEncoding(pVal, enc); }else if( !(pVal->flags&MEM_Blob) ){ sqlite3VdbeMemStringify(pVal, enc); } assert(pVal->enc==enc || sqlite3MallocFailed() ); return (const void *)(pVal->enc==enc ? (pVal->z) : 0); } /* ** Create a new sqlite3_value object. */ sqlite3_value* sqlite3ValueNew(void){ Mem *p = sqliteMalloc(sizeof(*p)); if( p ){ p->flags = MEM_Null; p->type = SQLITE_NULL; } return p; } /* ** Create a new sqlite3_value object, containing the value of pExpr. ** ** This only works for very simple expressions that consist of one constant ** token (i.e. "5", "5.1", "NULL", "'a string'"). If the expression can ** be converted directly into a value, then the value is allocated and ** a pointer written to *ppVal. The caller is responsible for deallocating ** the value by passing it to sqlite3ValueFree() later on. If the expression ** cannot be converted to a value, then *ppVal is set to NULL. */ int sqlite3ValueFromExpr( Expr *pExpr, u8 enc, u8 affinity, sqlite3_value **ppVal ){ int op; char *zVal = 0; sqlite3_value *pVal = 0; if( !pExpr ){ *ppVal = 0; return SQLITE_OK; } op = pExpr->op; if( op==TK_STRING || op==TK_FLOAT || op==TK_INTEGER ){ zVal = sqliteStrNDup((char*)pExpr->token.z, pExpr->token.n); pVal = sqlite3ValueNew(); if( !zVal || !pVal ) goto no_mem; sqlite3Dequote(zVal); sqlite3ValueSetStr(pVal, -1, zVal, SQLITE_UTF8, sqlite3FreeX); if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==SQLITE_AFF_NONE ){ sqlite3ValueApplyAffinity(pVal, SQLITE_AFF_NUMERIC, enc); }else{ sqlite3ValueApplyAffinity(pVal, affinity, enc); } }else if( op==TK_UMINUS ) { if( SQLITE_OK==sqlite3ValueFromExpr(pExpr->pLeft, enc, affinity, &pVal) ){ pVal->i = -1 * pVal->i; pVal->r = -1.0 * pVal->r; } } #ifndef SQLITE_OMIT_BLOB_LITERAL else if( op==TK_BLOB ){ int nVal; pVal = sqlite3ValueNew(); zVal = sqliteStrNDup((char*)pExpr->token.z+1, pExpr->token.n-1); if( !zVal || !pVal ) goto no_mem; sqlite3Dequote(zVal); nVal = strlen(zVal)/2; sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(zVal), nVal, 0, sqlite3FreeX); sqliteFree(zVal); } #endif *ppVal = pVal; return SQLITE_OK; no_mem: sqliteFree(zVal); sqlite3ValueFree(pVal); *ppVal = 0; return SQLITE_NOMEM; } /* ** Change the string value of an sqlite3_value object */ void sqlite3ValueSetStr( sqlite3_value *v, int n, const void *z, u8 enc, void (*xDel)(void*) ){ if( v ) sqlite3VdbeMemSetStr((Mem *)v, z, n, enc, xDel); } /* ** Free an sqlite3_value object */ void sqlite3ValueFree(sqlite3_value *v){ if( !v ) return; sqlite3ValueSetStr(v, 0, 0, SQLITE_UTF8, SQLITE_STATIC); sqliteFree(v); } /* ** Return the number of bytes in the sqlite3_value object assuming ** that it uses the encoding "enc" */ int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){ Mem *p = (Mem*)pVal; if( (p->flags & MEM_Blob)!=0 || sqlite3ValueText(pVal, enc) ){ return p->n; } return 0; } --- NEW FILE: table.c --- /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains the sqlite3_get_table() and sqlite3_free_table() ** interface routines. These are just wrappers around the main ** interface routine of sqlite3_exec(). ** ** These routines are in a separate files so that they will not be linked ** if they are not used. */ #include "sqliteInt.h" #include <stdlib.h> #include <string.h> #ifndef SQLITE_OMIT_GET_TABLE /* ** This structure is used to pass data from sqlite3_get_table() through ** to the callback function is uses to build the result. */ typedef struct TabResult { char **azResult; char *zErrMsg; int nResult; int nAlloc; int nRow; int nColumn; int nData; int rc; } TabResult; /* ** This routine is called once for each row in the result table. Its job ** is to fill in the TabResult structure appropriately, allocating new ** memory as necessary. */ static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){ TabResult *p = (TabResult*)pArg; int need; int i; char *z; /* Make sure there is enough space in p->azResult to hold everything ** we need to remember from this invocation of the callback. */ if( p->nRow==0 && argv!=0 ){ need = nCol*2; }else{ need = nCol; } if( p->nData + need >= p->nAlloc ){ char **azNew; p->nAlloc = p->nAlloc*2 + need + 1; azNew = realloc( p->azResult, sizeof(char*)*p->nAlloc ); if( azNew==0 ) goto malloc_failed; p->azResult = azNew; } /* If this is the first row, then generate an extra row containing ** the names of all columns. */ if( p->nRow==0 ){ p->nColumn = nCol; for(i=0; i<nCol; i++){ if( colv[i]==0 ){ z = 0; }else{ z = malloc( strlen(colv[i])+1 ); if( z==0 ) goto malloc_failed; strcpy(z, colv[i]); } p->azResult[p->nData++] = z; } }else if( p->nColumn!=nCol ){ sqlite3SetString(&p->zErrMsg, "sqlite3_get_table() called with two or more incompatible queries", (char*)0); p->rc = SQLITE_ERROR; return 1; } /* Copy over the row data */ if( argv!=0 ){ for(i=0; i<nCol; i++){ if( argv[i]==0 ){ z = 0; }else{ z = malloc( strlen(argv[i])+1 ); if( z==0 ) goto malloc_failed; strcpy(z, argv[i]); } p->azResult[p->nData++] = z; } p->nRow++; } return 0; malloc_failed: p->rc = SQLITE_NOMEM; return 1; } /* ** Query the database. But instead of invoking a callback for each row, ** malloc() for space to hold the result and return the entire results ** at the conclusion of the call. ** ** The result that is written to ***pazResult is held in memory obtained ** from malloc(). But the caller cannot free this memory directly. ** Instead, the entire table should be passed to sqlite3_free_table() when ** the calling procedure is finished using it. */ int sqlite3_get_table( sqlite3 *db, /* The database on which the SQL executes */ const char *zSql, /* The SQL to be executed */ char ***pazResult, /* Write the result table here */ int *pnRow, /* Write the number of rows in the result here */ int *pnColumn, /* Write the number of columns of result here */ char **pzErrMsg /* Write error messages here */ ){ int rc; TabResult res; if( pazResult==0 ){ return SQLITE_ERROR; } *pazResult = 0; if( pnColumn ) *pnColumn = 0; if( pnRow ) *pnRow = 0; res.zErrMsg = 0; res.nResult = 0; res.nRow = 0; res.nColumn = 0; res.nData = 1; res.nAlloc = 20; res.rc = SQLITE_OK; res.azResult = malloc( sizeof(char*)*res.nAlloc ); if( res.azResult==0 ) return SQLITE_NOMEM; res.azResult[0] = 0; rc = sqlite3_exec(db, zSql, sqlite3_get_table_cb, &res, pzErrMsg); if( res.azResult ){ res.azResult[0] = (char*)res.nData; } if( rc==SQLITE_ABORT ){ sqlite3_free_table(&res.azResult[1]); if( res.zErrMsg ){ if( pzErrMsg ){ free(*pzErrMsg); *pzErrMsg = sqlite3_mprintf("%s",res.zErrMsg); } sqliteFree(res.zErrMsg); } db->errCode = res.rc; return res.rc; } sqliteFree(res.zErrMsg); if( rc!=SQLITE_OK ){ sqlite3_free_table(&res.azResult[1]); return rc; } if( res.nAlloc>res.nData ){ char **azNew; azNew = realloc( res.azResult, sizeof(char*)*(res.nData+1) ); if( azNew==0 ){ sqlite3_free_table(&res.azResult[1]); return SQLITE_NOMEM; } res.nAlloc = res.nData+1; res.azResult = azNew; } *pazResult = &res.azResult[1]; if( pnColumn ) *pnColumn = res.nColumn; if( pnRow ) *pnRow = res.nRow; return rc; } /* ** This routine frees the space the sqlite3_get_table() malloced. */ void sqlite3_free_table( char **azResult /* Result returned from from sqlite3_get_table() */ ){ if( azResult ){ int i, n; azResult--; if( azResult==0 ) return; n = (int)azResult[0]; for(i=1; i<n; i++){ if( azResult[i] ) free(azResult[i]); } free(azResult); } } #endif /* SQLITE_OMIT_GET_TABLE */ --- NEW FILE: pager.c --- /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This is the implementation of the page cache subsystem or "pager". ** ** The pager is used to access a database disk file. It implements ** atomic commit and rollback through the use of a journal file that ** is separate from the database file. The pager also implements file ** locking to prevent two processes from writing the same database ** file simultaneously, or one process from reading the database while ** another is writing. [...3765 lines suppressed...] int sqlite3pager_lockstate(Pager *pPager){ return sqlite3OsLockState(pPager->fd); } #endif #ifdef SQLITE_DEBUG /* ** Print a listing of all referenced pages and their ref count. */ void sqlite3pager_refdump(Pager *pPager){ PgHdr *pPg; for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){ if( pPg->nRef<=0 ) continue; sqlite3DebugPrintf("PAGE %3d addr=%p nRef=%d\n", pPg->pgno, PGHDR_TO_DATA(pPg), pPg->nRef); } } #endif #endif /* SQLITE_OMIT_DISKIO */ --- NEW FILE: prepare.c --- /* ** 2005 May 25 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains the implementation of the sqlite3_prepare() ** interface, and routines that contribute to loading the database schema ** from disk. ** ** $Id: prepare.c,v 1.1 2006/02/14 02:16:48 chrisdavis3587 Exp $ */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> /* ** Fill the InitData structure with an error message that indicates ** that the database is corrupt. */ static void corruptSchema(InitData *pData, const char *zExtra){ if( !sqlite3MallocFailed() ){ sqlite3SetString(pData->pzErrMsg, "malformed database schema", zExtra!=0 && zExtra[0]!=0 ? " - " : (char*)0, zExtra, (char*)0); } } /* ** This is the callback routine for the code that initializes the ** database. See sqlite3Init() below for additional information. ** This routine is also called from the OP_ParseSchema opcode of the VDBE. ** ** Each callback contains the following information: ** ** argv[0] = name of thing being created ** argv[1] = root page number for table or index. NULL for trigger or view. ** argv[2] = SQL text for the CREATE statement. ** argv[3] = "1" for temporary files, "0" for main database, "2" or more ** for auxiliary database files. ** */ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){ InitData *pData = (InitData*)pInit; sqlite3 *db = pData->db; int iDb; if( sqlite3MallocFailed() ){ return SQLITE_NOMEM; } assert( argc==4 ); if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */ if( argv[1]==0 || argv[3]==0 ){ corruptSchema(pData, 0); return 1; } iDb = atoi(argv[3]); assert( iDb>=0 && iDb<db->nDb ); if( argv[2] && argv[2][0] ){ /* Call the parser to process a CREATE TABLE, INDEX or VIEW. ** But because db->init.busy is set to 1, no VDBE code is generated ** or executed. All the parser does is build the internal data ** structures that describe the table, index, or view. */ char *zErr; int rc; assert( db->init.busy ); db->init.iDb = iDb; db->init.newTnum = atoi(argv[1]); rc = sqlite3_exec(db, argv[2], 0, 0, &zErr); db->init.iDb = 0; if( SQLITE_OK!=rc ){ if( rc==SQLITE_NOMEM ){ sqlite3FailedMalloc(); }else{ corruptSchema(pData, zErr); } sqlite3_free(zErr); return rc; } }else{ /* If the SQL column is blank it means this is an index that ** was created to be the PRIMARY KEY or to fulfill a UNIQUE ** constraint for a CREATE TABLE. The index should have already ** been created when we processed the CREATE TABLE. All we have ** to do here is record the root page number for that index. */ Index *pIndex; pIndex = sqlite3FindIndex(db, argv[0], db->aDb[iDb].zName); if( pIndex==0 || pIndex->tnum!=0 ){ /* This can occur if there exists an index on a TEMP table which ** has the same name as another index on a permanent index. Since ** the permanent table is hidden by the TEMP table, we can also ** safely ignore the index on the permanent table. */ /* Do Nothing */; }else{ pIndex->tnum = atoi(argv[1]); } } return 0; } /* ** Attempt to read the database schema and initialize internal ** data structures for a single database file. The index of the ** database file is given by iDb. iDb==0 is used for the main ** database. iDb==1 should never be used. iDb>=2 is used for ** auxiliary databases. Return one of the SQLITE_ error codes to ** indicate success or failure. */ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ int rc; BtCursor *curMain; int size; Table *pTab; Db *pDb; char const *azArg[5]; char zDbNum[30]; int meta[10]; InitData initData; char const *zMasterSchema; char const *zMasterName = SCHEMA_TABLE(iDb); /* ** The master database table has a structure like this */ static const char master_schema[] = "CREATE TABLE sqlite_master(\n" " type text,\n" " name text,\n" " tbl_name text,\n" " rootpage integer,\n" " sql text\n" ")" ; #ifndef SQLITE_OMIT_TEMPDB static const char temp_master_schema[] = "CREATE TEMP TABLE sqlite_temp_master(\n" " type text,\n" " name text,\n" " tbl_name text,\n" " rootpage integer,\n" " sql text\n" ")" ; #else #define temp_master_schema 0 #endif assert( iDb>=0 && iDb<db->nDb ); assert( db->aDb[iDb].pSchema ); /* zMasterSchema and zInitScript are set to point at the master schema ** and initialisation script appropriate for the database being ** initialised. zMasterName is the name of the master table. */ if( !OMIT_TEMPDB && iDb==1 ){ zMasterSchema = temp_master_schema; }else{ zMasterSchema = master_schema; } zMasterName = SCHEMA_TABLE(iDb); /* Construct the schema tables. */ sqlite3SafetyOff(db); azArg[0] = zMasterName; azArg[1] = "1"; azArg[2] = zMasterSchema; sprintf(zDbNum, "%d", iDb); azArg[3] = zDbNum; azArg[4] = 0; initData.db = db; initData.pzErrMsg = pzErrMsg; rc = sqlite3InitCallback(&initData, 4, (char **)azArg, 0); if( rc!=SQLITE_OK ){ sqlite3SafetyOn(db); return rc; } pTab = sqlite3FindTable(db, zMasterName, db->aDb[iDb].zName); if( pTab ){ pTab->readOnly = 1; } sqlite3SafetyOn(db); /* Create a cursor to hold the database open */ pDb = &db->aDb[iDb]; if( pDb->pBt==0 ){ if( !OMIT_TEMPDB && iDb==1 ){ DbSetProperty(db, 1, DB_SchemaLoaded); } return SQLITE_OK; } rc = sqlite3BtreeCursor(pDb->pBt, MASTER_ROOT, 0, 0, 0, &curMain); if( rc!=SQLITE_OK && rc!=SQLITE_EMPTY ){ sqlite3SetString(pzErrMsg, sqlite3ErrStr(rc), (char*)0); return rc; } /* Get the database meta information. ** ** Meta values are as follows: ** meta[0] Schema cookie. Changes with each schema change. ** meta[1] File format of schema layer. ** meta[2] Size of the page cache. ** meta[3] Use freelist if 0. Autovacuum if greater than zero. ** meta[4] Db text encoding. 1:UTF-8 3:UTF-16 LE 4:UTF-16 BE ** meta[5] The user cookie. Used by the application. ** meta[6] ** meta[7] ** meta[8] ** meta[9] ** ** Note: The #defined SQLITE_UTF* symbols in sqliteInt.h correspond to ** the possible values of meta[4]. */ if( rc==SQLITE_OK ){ int i; for(i=0; ... [truncated message content] |
From: Chris D. <chr...@us...> - 2006-02-14 02:10:30
|
Update of /cvsroot/opengtoolkit/sqlite/LV SQLite Library Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18449/LV SQLite Library Source Log Message: Directory /cvsroot/opengtoolkit/sqlite/LV SQLite Library Source added to the repository |
From: Chris D. <chr...@us...> - 2006-02-14 02:09:46
|
Update of /cvsroot/opengtoolkit/sqlite/SQLite Example Database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17965/SQLite Example Database Added Files: Example Database.csv Example Database.sqliteDB Example Database.xls sqlite3.exe Log Message: Added some simple example databases for code verification. Added a sample SQLite 3.x.x database (.sqliteDB) for reading with the finished library. The .xls file and the .csv file are copies of one another, I use the .xls file to generate the .csv file if it gets corrupted. 2/13/2006 Chris Davis --- NEW FILE: Example Database.xls --- (This appears to be a binary file; contents omitted.) --- NEW FILE: sqlite3.exe --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Example Database.csv --- "CustID","Name","Purchases","PurchasePrice" "Integer Primary Key","VarChar(50)","Integer","Double" 100,"Bob",1,12.36 101,"Sue",2,65.54 102,"Mark",5,78.65 103,"Marcus",3,10.23 104,"Chris",6,23.01 105,"Jim",7,52.13 106,"Mike",8,2.35 107,"Sarah",23,56.26 108,"Bobby",5,54.52 109,"George",8,543.12 110,"Susie",2,82.65 111,"Susan",7,32.14 112,"Patrick",3,23.14 113,"William",78,23.65 114,"Christian",9,65.56 115,"Phillip",3,25.63 116,"Steve",45,14.36 117,"Milt",6,78.96 118,"Andrew",1,85.65 119,"Alex",2,23.25 120,"Austin",5,45.62 121,"Tracey",8,65.48 122,"Chelsey",10,78.23 123,"John",11,56 124,"James",34,65 125,"Troy",2,100 126,"Bobby",6,101 127,"Bob",89,45.36 128,"Chris",23,87.25 129,"Mark",4,98.65 130,"Jim",7,45.32 --- NEW FILE: Example Database.sqliteDB --- (This appears to be a binary file; contents omitted.) |
From: Chris D. <chr...@us...> - 2006-02-14 02:04:49
|
Update of /cvsroot/opengtoolkit/sqlite/SQLite Example Database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16140/SQLite Example Database Log Message: Directory /cvsroot/opengtoolkit/sqlite/SQLite Example Database added to the repository |