rhodes 2.3.2 → 2.4.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +18 -0
- data/CREDITS +38 -0
- data/README.md +2 -2
- data/Rakefile +60 -2
- data/bin/set-rhodes-sdk.bat +1 -0
- data/doc/application.txt +11 -0
- data/doc/build.txt +156 -39
- data/doc/configuration.txt +1 -10
- data/doc/connect-to-web-services.txt +6 -6
- data/doc/device-caps.txt +48 -5
- data/doc/extensions.txt +8 -1
- data/doc/rhom.txt +16 -0
- data/doc/synchronization.txt +56 -14
- data/doc/ui.txt +23 -2
- data/installer/instant-rhodes.nsi +6 -6
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Barcode.xcodeproj/project.pbxproj +4 -2
- data/lib/extensions/barcode/ext/barcode/platform/wm/Rakefile +1 -1
- data/lib/extensions/digest-md5/ext/Rakefile +3 -3
- data/lib/extensions/digest-md5/ext/build +0 -1
- data/lib/extensions/digest-sha1/ext/Rakefile +1 -1
- data/lib/extensions/digest-sha1/ext/build +0 -1
- data/lib/extensions/digest/ext/Rakefile +3 -3
- data/lib/extensions/digest/ext/build +0 -1
- data/lib/extensions/fcntl/ext/Rakefile +1 -1
- data/lib/extensions/mspec/mspec/guards/guard.rb +4 -0
- data/lib/extensions/mspec/mspec/helpers/environment.rb +4 -0
- data/lib/extensions/nfc/ext.yml +2 -0
- data/lib/extensions/nfc/ext/build +12 -0
- data/lib/extensions/nfc/ext/build.bat +8 -0
- data/lib/extensions/nfc/ext/nfc/platform/android/AndroidManifest.xml +25 -0
- data/lib/extensions/nfc/ext/nfc/platform/android/Rakefile +94 -0
- data/lib/extensions/nfc/ext/nfc/platform/android/ext_build.files +4 -0
- data/lib/extensions/nfc/ext/nfc/platform/android/jni/src/nfc.cpp +404 -0
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/Nfc.java +138 -0
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/NfcMessage.java +34 -0
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/NfcMessagePack.java +33 -0
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/NfcRecord.java +149 -0
- data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc.i +22 -0
- data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c +2034 -0
- data/lib/extensions/nfc/nfc.rb +120 -0
- data/lib/extensions/rholang/{lang_ca.rb → rholang/lang_ca.rb} +0 -0
- data/lib/extensions/rholang/{lang_cf.rb → rholang/lang_cf.rb} +0 -0
- data/lib/extensions/rholang/{lang_chef.rb → rholang/lang_chef.rb} +0 -0
- data/lib/extensions/rholang/{lang_cs.rb → rholang/lang_cs.rb} +0 -0
- data/lib/extensions/rholang/{lang_da.rb → rholang/lang_da.rb} +0 -0
- data/lib/extensions/rholang/{lang_de.rb → rholang/lang_de.rb} +0 -0
- data/lib/extensions/rholang/{lang_es.rb → rholang/lang_es.rb} +0 -0
- data/lib/extensions/rholang/{lang_es_ar.rb → rholang/lang_es_ar.rb} +0 -0
- data/lib/extensions/rholang/{lang_fi.rb → rholang/lang_fi.rb} +0 -0
- data/lib/extensions/rholang/{lang_fr.rb → rholang/lang_fr.rb} +0 -0
- data/lib/extensions/rholang/{lang_it.rb → rholang/lang_it.rb} +0 -0
- data/lib/extensions/rholang/{lang_ko.rb → rholang/lang_ko.rb} +0 -0
- data/lib/extensions/rholang/{lang_nl.rb → rholang/lang_nl.rb} +0 -0
- data/lib/extensions/rholang/{lang_no.rb → rholang/lang_no.rb} +0 -0
- data/lib/extensions/rholang/{lang_pt.rb → rholang/lang_pt.rb} +0 -0
- data/lib/extensions/rholang/{lang_pt_br.rb → rholang/lang_pt_br.rb} +0 -0
- data/lib/extensions/rholang/{lang_ru.rb → rholang/lang_ru.rb} +0 -0
- data/lib/extensions/rholang/{lang_se.rb → rholang/lang_se.rb} +0 -0
- data/lib/extensions/rholang/{lang_sr.rb → rholang/lang_sr.rb} +0 -0
- data/lib/extensions/rholang/{rhoerror_ru.rb → rholang/rhoerror_ru.rb} +0 -0
- data/lib/extensions/rholang/{rhomsg_ru.rb → rholang/rhomsg_ru.rb} +0 -0
- data/lib/framework/date/format.rb +2 -0
- data/lib/framework/dateOrig.rb +17 -8
- data/lib/framework/rational18.rb +532 -0
- data/lib/framework/res/back_btn.wp7.png +0 -0
- data/lib/framework/res/blue_pushpin.wp7.png +0 -0
- data/lib/framework/res/blue_pushpin_small.wp7.png +0 -0
- data/lib/framework/res/callout.wp7.png +0 -0
- data/lib/framework/res/callout_link.wp7.png +0 -0
- data/lib/framework/res/esri.wp7.png +0 -0
- data/lib/framework/res/forward_btn.wp7.png +0 -0
- data/lib/framework/res/home_btn.wp7.png +0 -0
- data/lib/framework/res/options_btn.wp7.png +0 -0
- data/lib/framework/res/refresh_btn.wp7.png +0 -0
- data/lib/framework/rho/render.rb +8 -1
- data/lib/framework/rho/rho.rb +30 -7
- data/lib/framework/rho/rhoapplication.rb +9 -4
- data/lib/framework/rho/rhofsconnector.rb +5 -1
- data/lib/framework/rho/rhotabbar.rb +8 -0
- data/lib/framework/rho/rhotoolbar.rb +1 -1
- data/lib/framework/rho/rhoviewhelpers.rb +18 -1
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhoframework.rb +46 -1
- data/lib/framework/rholang/localization_simplified.rb +17 -16
- data/lib/framework/rhom/rhom_db_adapter.rb +2 -2
- data/lib/framework/rhom/rhom_object_factory.rb +115 -12
- data/lib/framework/rhosystem.rb +135 -0
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/lib/test/apps/rhoconfig.txt +23 -23
- data/platform/android/Rhodes/AndroidManifest.full.xml +101 -0
- data/platform/android/Rhodes/AndroidManifest.xml +10 -15
- data/platform/android/Rhodes/default.properties +11 -0
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +59 -53
- data/platform/android/Rhodes/jni/include/rhodes.h +1 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesApplication.h +21 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_alert_PopupActivity.h +21 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_file_RhoFileApi.h +10 -2
- data/platform/android/Rhodes/jni/src/alert.cpp +2 -1
- data/platform/android/Rhodes/jni/src/datetimepicker.cpp +2 -0
- data/platform/android/Rhodes/jni/src/fileapi.cpp +671 -84
- data/platform/android/Rhodes/jni/src/nativebar.cpp +18 -0
- data/platform/android/Rhodes/jni/src/rhodes.cpp +92 -1
- data/platform/android/Rhodes/res/values/styles.xml +7 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +35 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +12 -13
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/LocalFileProvider.java +130 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +6 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +5 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +6 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +7 -36
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +43 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +2 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +63 -28
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Utils.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +6 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +19 -282
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/PopupActivity.java +354 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePickerScreen.java +4 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +1 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +71 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +107 -37
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +10 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +156 -56
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +0 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +40 -32
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/ExternalHttpHandler.java +14 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/LocalFileHandler.java +46 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/MailUriHandler.java +4 -24
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/UriHandler.java +3 -1
- data/platform/android/build/RhodesSRC_build.files +28 -25
- data/platform/android/build/android.rake +230 -54
- data/platform/android/build/androidcommon.rb +1 -1
- data/platform/android/build/librhocommon_build.files +1 -0
- data/platform/bb/Hsqldb/BlackBerry_App_Descriptor.xml +20 -0
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +1 -5
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +6 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/rowio/RowOutputBase.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/rowio/RowOutputBinary.java +1 -1
- data/platform/bb/RubyVM/BlackBerry_App_Descriptor.xml +20 -0
- data/platform/bb/RubyVM/src/com/rho/IRhoRubyHelper.java +2 -0
- data/platform/bb/RubyVM/src/com/rho/RhoLogOutputSink.java +0 -1
- data/platform/bb/RubyVM/src/com/rho/RhoLogger.java +12 -10
- data/platform/bb/RubyVM/src/com/rho/RhoThread.java +16 -0
- data/platform/bb/RubyVM/src/com/rho/RhoTimer.java +89 -0
- data/platform/bb/RubyVM/src/com/rho/RhodesApp.java +20 -13
- data/platform/bb/RubyVM/src/com/rho/SplashScreen.java +1 -2
- data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +2 -2
- data/platform/bb/RubyVM/src/com/rho/TimeInterval.java +5 -0
- data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +54 -48
- data/platform/bb/RubyVM/src/com/rho/db/IDBResult.java +0 -1
- data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +1 -0
- data/platform/bb/RubyVM/src/com/rho/net/AsyncHttp.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/sync/ClientRegister.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/sync/JSONStructIterator.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +16 -8
- data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +2 -2
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +52 -29
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +1 -3
- data/platform/bb/build/RubyVM_build.files +1 -0
- data/platform/bb/build/bb.rake +29 -9
- data/platform/bb/rhodes/BlackBerry_App_Descriptor.xml +23 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +1 -1
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteCopyResult.java +0 -4
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteResult.java +13 -20
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteStorage.java +183 -157
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +22 -0
- data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +1 -1
- data/platform/bb/rhodes/src/com/rho/db/SqliteCopyResult.java +0 -4
- data/platform/bb/rhodes/src/com/rho/db/SqliteResult.java +13 -20
- data/platform/bb/rhodes/src/com/rho/db/SqliteStorage.java +183 -157
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +46 -1
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +8 -1
- data/platform/bb/rhodes/src/rhomobile/camera/CameraFilesListener.java +13 -3
- data/platform/iphone/Classes/AppManager/AppManager.h +5 -1
- data/platform/iphone/Classes/AppManager/AppManager.m +170 -7
- data/platform/iphone/Classes/DateTimePicker.m +14 -1
- data/platform/iphone/Classes/DateTimePickerDelegate.h +2 -0
- data/platform/iphone/Classes/DateTimePickerDelegate.m +36 -2
- data/platform/iphone/Classes/NativeBar.h +1 -0
- data/platform/iphone/Classes/NativeBar.m +15 -3
- data/platform/iphone/Classes/Phonebook/phonebook.m +8 -9
- data/platform/iphone/Classes/Rhodes.m +50 -6
- data/platform/iphone/Classes/SimpleMainView.m +7 -6
- data/platform/iphone/Classes/SplitView/RightViewController.h +3 -1
- data/platform/iphone/Classes/SplitView/RightViewController.m +14 -1
- data/platform/iphone/Classes/TabbedMainView.h +4 -0
- data/platform/iphone/Classes/TabbedMainView.m +43 -26
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +4 -0
- data/platform/iphone/curl/curl.xcodeproj/project.pbxproj +3 -3
- data/platform/iphone/rbuild/iphone.rake +168 -119
- data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +4 -2
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +3 -3
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +2 -2
- data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +3 -3
- data/platform/shared/SyncClient/SyncClient.cpp +20 -8
- data/platform/shared/SyncClient/SyncClient.h +2 -1
- data/platform/shared/common/RhoDefs.h +4 -0
- data/platform/shared/common/RhoPort.h +22 -0
- data/platform/shared/common/RhoStd.h +5 -0
- data/platform/shared/common/RhoTime.cpp +73 -0
- data/platform/shared/common/RhoTime.h +26 -53
- data/platform/shared/common/RhodesApp.cpp +29 -28
- data/platform/shared/common/RhodesApp.h +4 -1
- data/platform/shared/common/StringConverter.h +37 -10
- data/platform/shared/common/app_build_capabilities.h +2 -0
- data/platform/shared/common/rhoparams.cpp +25 -12
- data/platform/shared/common/rhoparams.h +10 -8
- data/platform/shared/db/DBAdapter.cpp +0 -22
- data/platform/shared/json/RJSONTokener.c +15 -23
- data/platform/shared/net/AsyncHttp.cpp +9 -8
- data/platform/shared/net/HttpServer.cpp +61 -19
- data/platform/shared/net/HttpServer.h +2 -0
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker.i +3 -0
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +151 -402
- data/platform/shared/ruby/ext/nativebar/nativebar.i +3 -0
- data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +154 -403
- data/platform/shared/ruby/ext/rho/rhoruby.c +4 -0
- data/platform/shared/ruby/ext/rho/rhoruby.h +2 -0
- data/platform/shared/ruby/ext/system/system.i +8 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +80 -5
- data/platform/shared/ruby/file.c +6 -4
- data/platform/shared/ruby/gc.c +1 -1
- data/platform/shared/ruby/linux/ruby/config.h +7 -2
- data/platform/shared/ruby/missing/acosh.c +3 -3
- data/platform/shared/ruby/wince/_time.h +1 -1
- data/platform/shared/ruby/wince/stdlib.c +1 -1
- data/platform/shared/ruby/wince/string_wce.c +2 -2
- data/platform/shared/ruby/wince/sys/timeb.c +1 -0
- data/platform/shared/ruby/wince/time_wce.c +8 -0
- data/platform/shared/ruby/wince/wince.c +7 -7
- data/platform/shared/ruby/wince/wince.h +22 -0
- data/platform/shared/rubyext/System.cpp +19 -1
- data/platform/shared/sqlite/sqlite3.c +18993 -8129
- data/platform/shared/sqlite/sqlite3.h +953 -358
- data/platform/shared/sqlite/sqlite3ext.h +42 -0
- data/platform/shared/sync/SyncEngine.cpp +10 -0
- data/platform/shared/sync/SyncSource.cpp +41 -19
- data/platform/shared/sync/SyncSource.h +1 -1
- data/platform/shared/tcmalloc/rhomem.h +7 -2
- data/platform/shared/tcmalloc/windows/port.h +2 -0
- data/platform/shared/unzip/unzip.cpp +1 -0
- data/platform/shared/xruby/src/com/xruby/compiler/parser/RubyParser.java +11 -1
- data/platform/wm/RhoLib/RhoLib.vcproj +182 -24
- data/platform/wm/build/wm.rake +16 -3
- data/platform/wm/rhodes.sln +106 -113
- data/platform/wm/rhodes/Alert.cpp +6 -7
- data/platform/wm/rhodes/AppManager.cpp +8 -17
- data/platform/wm/rhodes/DateTimePicker.cpp +3 -0
- data/platform/wm/rhodes/DateTimePicker.h +2 -0
- data/platform/wm/rhodes/MainWindow.cpp +36 -16
- data/platform/wm/rhodes/MainWindow.h +6 -3
- data/platform/wm/rhodes/OutlookApp.cpp +3 -3
- data/platform/wm/rhodes/Rhodes.cpp +46 -27
- data/platform/wm/rhodes/Rhodes.rc +16 -3
- data/platform/wm/rhodes/RingtoneManager.cpp +7 -7
- data/platform/wm/rhodes/RingtoneManager.h +1 -1
- data/platform/wm/rhodes/Utils.cpp +2 -1
- data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +1 -13
- data/platform/wm/rhodes/bluetooth/Bluetooth.h +1 -2
- data/platform/wm/rhodes/camera/Camera.cpp +6 -12
- data/platform/wm/rhodes/phonebook/phonebook.cpp +11 -11
- data/platform/wm/rhodes/phonebook/phonebook.h +1 -1
- data/platform/wm/rhodes/resource.h +3 -1
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +7 -5
- data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.cpp +6 -6
- data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.h +1 -1
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +6 -1
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +84 -19
- data/platform/wm/rhodes/rho/rubyext/calendar.cpp +2 -2
- data/platform/wm/rhodes/rhodes.vcproj +316 -73
- data/platform/wm/rhodes/signature/Signature.cpp +336 -6
- data/platform/wm/rhodes/signature/Signature.h +55 -0
- data/platform/wm/rhodes/stdafx.h +7 -4
- data/platform/wm/rubylib/rubylib.vcproj +261 -91
- data/platform/wm/sqlite3/sqlite3.vcproj +223 -69
- data/platform/wm/syncengine/syncengine.vcproj +220 -66
- data/platform/wm/tcmalloc/tcmalloc.vcproj +197 -43
- data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Builtins/ConsoleStream.cs +107 -0
- data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/Loader.cs +1037 -0
- data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/RubyUtils.cs +1476 -0
- data/platform/wp7/RhoAppRunner/Program.cs +55 -0
- data/platform/wp7/RhoAppRunner/Properties/AssemblyInfo.cs +36 -0
- data/platform/wp7/RhoAppRunner/RhoAppRunner.csproj +69 -0
- data/platform/wp7/RhoRubyExtGen/GenerateInitializers.cmd +7 -0
- data/platform/wp7/RhoRubyExtGen/Properties/AssemblyInfo.cs +36 -0
- data/platform/wp7/RhoRubyExtGen/RhoAsyncHttp.cs +38 -0
- data/platform/wp7/RhoRubyExtGen/RhoDatabase.cs +93 -0
- data/platform/wp7/RhoRubyExtGen/RhoJSON.cs +37 -0
- data/platform/wp7/RhoRubyExtGen/RhoNativeBar.cs +106 -0
- data/platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj +75 -0
- data/platform/wp7/RhoRubyExtGen/RhoSyncEngine.cs +123 -0
- data/platform/wp7/RhoRubyExtGen/RhoWebView.cs +42 -0
- data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +309 -0
- data/platform/wp7/RhoRubyLib/Properties/AssemblyInfo.cs +36 -0
- data/platform/wp7/RhoRubyLib/RhoAppAdapter.cs +96 -0
- data/platform/wp7/RhoRubyLib/RhoRuby.cs +296 -0
- data/platform/wp7/RhoRubyLib/RhoRubyLib.csproj +155 -0
- data/platform/wp7/RhoRubyLib/WP_PlatformAdaptationLayer.cs +107 -0
- data/platform/wp7/RhoRubyLib/common/IInputStream.cs +21 -0
- data/platform/wp7/RhoRubyLib/common/Mutex.cs +30 -0
- data/platform/wp7/RhoRubyLib/common/RhoConf.cs +389 -0
- data/platform/wp7/RhoRubyLib/common/RhoEmptyProfiler.cs +27 -0
- data/platform/wp7/RhoRubyLib/common/RhoFile.cs +332 -0
- data/platform/wp7/RhoRubyLib/common/RhoFilePath.cs +89 -0
- data/platform/wp7/RhoRubyLib/common/RhoParamArray.cs +33 -0
- data/platform/wp7/RhoRubyLib/common/RhoParams.cs +66 -0
- data/platform/wp7/RhoRubyLib/common/RhoProfiler.cs +145 -0
- data/platform/wp7/RhoRubyLib/common/RhoResourceMap.cs +68 -0
- data/platform/wp7/RhoRubyLib/common/RhoStd.cs +205 -0
- data/platform/wp7/RhoRubyLib/common/RhoThread.cs +114 -0
- data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +504 -0
- data/platform/wp7/RhoRubyLib/common/ThreadQueue.cs +199 -0
- data/platform/wp7/RhoRubyLib/common/TimeInterval.cs +56 -0
- data/platform/wp7/RhoRubyLib/common/Tokenizer.cs +52 -0
- data/platform/wp7/RhoRubyLib/db/DBAdapter.cs +1129 -0
- data/platform/wp7/RhoRubyLib/db/DBAttrManager.cs +92 -0
- data/platform/wp7/RhoRubyLib/db/DBException.cs +35 -0
- data/platform/wp7/RhoRubyLib/db/IDBCallback.cs +10 -0
- data/platform/wp7/RhoRubyLib/db/IDBResult.cs +33 -0
- data/platform/wp7/RhoRubyLib/db/IDBStorage.cs +32 -0
- data/platform/wp7/RhoRubyLib/db/SqliteCopyResult.cs +79 -0
- data/platform/wp7/RhoRubyLib/db/SqliteResult.cs +267 -0
- data/platform/wp7/RhoRubyLib/db/SqliteStorage.cs +319 -0
- data/platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs +63 -0
- data/platform/wp7/RhoRubyLib/json/JSONEntry.cs +96 -0
- data/platform/wp7/RhoRubyLib/json/JSONStructIterator.cs +77 -0
- data/platform/wp7/RhoRubyLib/json/JsonParser.cs +483 -0
- data/platform/wp7/RhoRubyLib/json/RJSONTokener.cs +406 -0
- data/platform/wp7/RhoRubyLib/logging/IRhoLogSink.cs +12 -0
- data/platform/wp7/RhoRubyLib/logging/RhoLogConf.cs +161 -0
- data/platform/wp7/RhoRubyLib/logging/RhoLogFileSink.cs +174 -0
- data/platform/wp7/RhoRubyLib/logging/RhoLogger.cs +320 -0
- data/platform/wp7/RhoRubyLib/net/AsyncHttp.cs +362 -0
- data/platform/wp7/RhoRubyLib/net/HttpServer.cs +466 -0
- data/platform/wp7/RhoRubyLib/net/NetRequest.cs +717 -0
- data/platform/wp7/RhoRubyLib/net/NetResponse.cs +64 -0
- data/platform/wp7/RhoRubyLib/net/URI.cs +187 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoAsyncHttp.cs +43 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoDatabase.cs +177 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoJSON.cs +39 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoKernelOps.cs +19 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoNativeBar.cs +117 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +199 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +49 -0
- data/platform/wp7/RhoRubyLib/sync/ClientRegister.cs +142 -0
- data/platform/wp7/RhoRubyLib/sync/ISyncProtocol.cs +23 -0
- data/platform/wp7/RhoRubyLib/sync/ISyncStatusListener.cs +10 -0
- data/platform/wp7/RhoRubyLib/sync/SyncEngine.cs +1051 -0
- data/platform/wp7/RhoRubyLib/sync/SyncNotify.cs +651 -0
- data/platform/wp7/RhoRubyLib/sync/SyncProtocol_3.cs +79 -0
- data/platform/wp7/RhoRubyLib/sync/SyncSource.cs +1105 -0
- data/platform/wp7/RhoRubyLib/sync/SyncThread.cs +301 -0
- data/platform/wp7/WPApplication.sln +50 -0
- data/platform/wp7/WPApplication/App.xaml +19 -0
- data/platform/wp7/WPApplication/App.xaml.cs +211 -0
- data/platform/wp7/WPApplication/ApplicationIcon.png +0 -0
- data/platform/wp7/WPApplication/Background.png +0 -0
- data/platform/wp7/WPApplication/MainPage.xaml +44 -0
- data/platform/wp7/WPApplication/MainPage.xaml.cs +132 -0
- data/platform/wp7/WPApplication/Properties/AppManifest.xml +6 -0
- data/platform/wp7/WPApplication/Properties/AssemblyInfo.cs +35 -0
- data/platform/wp7/WPApplication/Properties/WMAppManifest.xml +32 -0
- data/platform/wp7/WPApplication/SplashScreenImage.jpg +0 -0
- data/platform/wp7/WPApplication/WPApplication.csproj +201 -0
- data/platform/wp7/WPApplication/WP_PlatformAdaptationLayer.cs +88 -0
- data/platform/wp7/WPApplication/app_manifest.txt +1 -0
- data/platform/wp7/WPApplication/readme.htm +40 -0
- data/platform/wp7/WPApplication/readme2.htm +37 -0
- data/platform/wp7/WPApplication/rho/apps/app/Model1/edit.bb.erb +29 -0
- data/platform/wp7/WPApplication/rho/apps/app/Model1/edit.erb +32 -0
- data/platform/wp7/WPApplication/rho/apps/app/Model1/index.bb.erb +21 -0
- data/platform/wp7/WPApplication/rho/apps/app/Model1/index.erb +26 -0
- data/platform/wp7/WPApplication/rho/apps/app/Model1/model1.rb +10 -0
- data/platform/wp7/WPApplication/rho/apps/app/Model1/model1_controller.rb +58 -0
- data/platform/wp7/WPApplication/rho/apps/app/Model1/new.bb.erb +29 -0
- data/platform/wp7/WPApplication/rho/apps/app/Model1/new.erb +31 -0
- data/platform/wp7/WPApplication/rho/apps/app/Model1/show.bb.erb +26 -0
- data/platform/wp7/WPApplication/rho/apps/app/Model1/show.erb +28 -0
- data/platform/wp7/WPApplication/rho/apps/app/Settings/controller.rb +75 -0
- data/platform/wp7/WPApplication/rho/apps/app/Settings/home.bb.erb +17 -0
- data/platform/wp7/WPApplication/rho/apps/app/Settings/home.erb +20 -0
- data/platform/wp7/WPApplication/rho/apps/app/Settings/index.bb.erb +32 -0
- data/platform/wp7/WPApplication/rho/apps/app/Settings/index.erb +30 -0
- data/platform/wp7/WPApplication/rho/apps/app/Settings/login.bb.erb +35 -0
- data/platform/wp7/WPApplication/rho/apps/app/Settings/login.erb +27 -0
- data/platform/wp7/WPApplication/rho/apps/app/Settings/reset.bb.erb +15 -0
- data/platform/wp7/WPApplication/rho/apps/app/Settings/reset.erb +17 -0
- data/platform/wp7/WPApplication/rho/apps/app/Settings/wait.bb.erb +3 -0
- data/platform/wp7/WPApplication/rho/apps/app/Settings/wait.erb +5 -0
- data/platform/wp7/WPApplication/rho/apps/app/application.rb +16 -0
- data/platform/wp7/WPApplication/rho/apps/app/helpers/application_helper.rb +126 -0
- data/platform/wp7/WPApplication/rho/apps/app/helpers/browser_helper.rb +18 -0
- data/platform/wp7/WPApplication/rho/apps/app/index.bb.erb +26 -0
- data/platform/wp7/WPApplication/rho/apps/app/index.erb +26 -0
- data/platform/wp7/WPApplication/rho/apps/app/layout.erb +45 -0
- data/platform/wp7/WPApplication/rho/apps/app/loading.html +11 -0
- data/platform/wp7/WPApplication/rho/apps/app_manifest.txt +1 -0
- data/platform/wp7/WPApplication/rho/apps/public/css/android.css +330 -0
- data/platform/wp7/WPApplication/rho/apps/public/css/blackberry.css +115 -0
- data/platform/wp7/WPApplication/rho/apps/public/css/iphone.css +410 -0
- data/platform/wp7/WPApplication/rho/apps/public/css/windows_mobile.css +222 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/IUI_LICENSE.txt +21 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/android/btn_check_off.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/android/btn_check_on.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/android/btn_radio_off.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/android/btn_radio_on.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/android/disclosure.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/android/ic_menu_more.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/backButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/blueButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/cancel.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/grayButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/disclosure.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/disclosure_detail.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/backButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/blueButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/cancel.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/chevron.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/grayButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/listArrowSel.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/listGroup.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/loading.gif +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/on_off.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/pinstripes.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/selection.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/thumb.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toggle.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toggleOn.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toolButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toolbar.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/whiteButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/radiobutton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/select.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/switch.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iui-logo-touch-icon.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/listArrow.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/listArrowDown.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/listArrowSel.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/listGroup.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/loading.gif +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/pinstripes.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/right_button.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/selection.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/thumb.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/toggle.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/toggleOn.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/toolButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/toolButton_new.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/toolbar.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/whiteButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch-iphone.css +9 -0
- data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch.css +374 -0
- data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch.js +742 -0
- data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch.transitions.js +60 -0
- data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jquery.1.3.2.min.js +19 -0
- data/platform/wp7/WPApplication/rho/apps/public/js/application.js +1 -0
- data/platform/wp7/WPApplication/rho/apps/public/js/rho.js +4 -0
- data/platform/wp7/WPApplication/rho/apps/public/js/rhogeolocation-wm.js +59 -0
- data/platform/wp7/WPApplication/rho/apps/public/js/rhogeolocation.js +11 -0
- data/platform/wp7/WPApplication/rho/apps/rhoconfig.txt +32 -0
- data/platform/wp7/WPApplication/rhoconfig.txt +32 -0
- data/platform/wp7/WPApplication/windows_mobile.css +222 -0
- data/platform/wp7/build/wp.rake +261 -0
- data/platform/wp7/rhodes.sln +79 -0
- data/platform/wp7/rhodes/App.xaml +19 -0
- data/platform/wp7/rhodes/App.xaml.cs +144 -0
- data/platform/wp7/rhodes/Background.png +0 -0
- data/platform/wp7/rhodes/MainPage.xaml +44 -0
- data/platform/wp7/rhodes/MainPage.xaml.cs +98 -0
- data/platform/wp7/rhodes/Properties/AppManifest.xml +6 -0
- data/platform/wp7/rhodes/Properties/AssemblyInfo.cs +35 -0
- data/platform/wp7/rhodes/Properties/WMAppManifest.xml +31 -0
- data/platform/wp7/rhodes/Rhodes.csproj +127 -0
- data/platform/wp7/rhodes/SplashScreenImage.jpg +0 -0
- data/platform/wp7/rhodes/icon.png +0 -0
- data/platform/wp7/sqlite3/Properties/AssemblyInfo.cs +35 -0
- data/platform/wp7/sqlite3/SQLiteClient.cs +550 -0
- data/platform/wp7/sqlite3/SqliteWrapper/BtreeInt_h.cs +774 -0
- data/platform/wp7/sqlite3/SqliteWrapper/Btree_h.cs +280 -0
- data/platform/wp7/sqlite3/SqliteWrapper/ClassDiagram1.cd +1306 -0
- data/platform/wp7/sqlite3/SqliteWrapper/Delagates.cs +365 -0
- data/platform/wp7/sqlite3/SqliteWrapper/Hash_h.cs +133 -0
- data/platform/wp7/sqlite3/SqliteWrapper/VdbeInt_h.cs +620 -0
- data/platform/wp7/sqlite3/SqliteWrapper/Vdbe_h.cs +302 -0
- data/platform/wp7/sqlite3/SqliteWrapper/_Custom.cs +449 -0
- data/platform/wp7/sqlite3/SqliteWrapper/alter_c.cs +872 -0
- data/platform/wp7/sqlite3/SqliteWrapper/analyze_c.cs +757 -0
- data/platform/wp7/sqlite3/SqliteWrapper/attach_c.cs +628 -0
- data/platform/wp7/sqlite3/SqliteWrapper/auth_c.cs +268 -0
- data/platform/wp7/sqlite3/SqliteWrapper/backup_c.cs +737 -0
- data/platform/wp7/sqlite3/SqliteWrapper/bitvec_c.cs +509 -0
- data/platform/wp7/sqlite3/SqliteWrapper/btmutex_c.cs +379 -0
- data/platform/wp7/sqlite3/SqliteWrapper/btree_c.cs +9138 -0
- data/platform/wp7/sqlite3/SqliteWrapper/build_c.cs +4189 -0
- data/platform/wp7/sqlite3/SqliteWrapper/callback_c.cs +548 -0
- data/platform/wp7/sqlite3/SqliteWrapper/complete_c.cs +342 -0
- data/platform/wp7/sqlite3/SqliteWrapper/ctime_cs.cs +408 -0
- data/platform/wp7/sqlite3/SqliteWrapper/date_c.cs +1317 -0
- data/platform/wp7/sqlite3/SqliteWrapper/delete_c.cs +726 -0
- data/platform/wp7/sqlite3/SqliteWrapper/expr_c.cs +4406 -0
- data/platform/wp7/sqlite3/SqliteWrapper/fault_c.cs +115 -0
- data/platform/wp7/sqlite3/SqliteWrapper/fkey_c.cs +1330 -0
- data/platform/wp7/sqlite3/SqliteWrapper/func_c.cs +2025 -0
- data/platform/wp7/sqlite3/SqliteWrapper/global_c.cs +228 -0
- data/platform/wp7/sqlite3/SqliteWrapper/hash_c.cs +351 -0
- data/platform/wp7/sqlite3/SqliteWrapper/hwtime_c.cs +101 -0
- data/platform/wp7/sqlite3/SqliteWrapper/insert_c.cs +2122 -0
- data/platform/wp7/sqlite3/SqliteWrapper/journal_c.cs +247 -0
- data/platform/wp7/sqlite3/SqliteWrapper/keywordhash_h.cs +302 -0
- data/platform/wp7/sqlite3/SqliteWrapper/legacy_c.cs +223 -0
- data/platform/wp7/sqlite3/SqliteWrapper/loadext_c.cs +683 -0
- data/platform/wp7/sqlite3/SqliteWrapper/main_c.cs +2716 -0
- data/platform/wp7/sqlite3/SqliteWrapper/malloc_c.cs +977 -0
- data/platform/wp7/sqlite3/SqliteWrapper/mem_Pool.cs +394 -0
- data/platform/wp7/sqlite3/SqliteWrapper/memjournal_c.cs +315 -0
- data/platform/wp7/sqlite3/SqliteWrapper/mutex_c.cs +182 -0
- data/platform/wp7/sqlite3/SqliteWrapper/mutex_h.cs +91 -0
- data/platform/wp7/sqlite3/SqliteWrapper/mutex_noop_c.cs +202 -0
- data/platform/wp7/sqlite3/SqliteWrapper/mutex_w32.cs +344 -0
- data/platform/wp7/sqlite3/SqliteWrapper/notify_c.cs +347 -0
- data/platform/wp7/sqlite3/SqliteWrapper/opcodes_c.cs +171 -0
- data/platform/wp7/sqlite3/SqliteWrapper/opcodes_h.cs +346 -0
- data/platform/wp7/sqlite3/SqliteWrapper/os_c.cs +367 -0
- data/platform/wp7/sqlite3/SqliteWrapper/os_common_h.cs +174 -0
- data/platform/wp7/sqlite3/SqliteWrapper/os_h.cs +295 -0
- data/platform/wp7/sqlite3/SqliteWrapper/os_win_c.cs +1255 -0
- data/platform/wp7/sqlite3/SqliteWrapper/pager_c.cs +6078 -0
- data/platform/wp7/sqlite3/SqliteWrapper/pager_h.cs +188 -0
- data/platform/wp7/sqlite3/SqliteWrapper/parse_c.cs +4045 -0
- data/platform/wp7/sqlite3/SqliteWrapper/parse_h.cs +331 -0
- data/platform/wp7/sqlite3/SqliteWrapper/pcache1_c.cs +969 -0
- data/platform/wp7/sqlite3/SqliteWrapper/pcache_c.cs +712 -0
- data/platform/wp7/sqlite3/SqliteWrapper/pcache_h.cs +213 -0
- data/platform/wp7/sqlite3/SqliteWrapper/pragma_c.cs +1767 -0
- data/platform/wp7/sqlite3/SqliteWrapper/prepare_c.cs +1015 -0
- data/platform/wp7/sqlite3/SqliteWrapper/printf_c.cs +1300 -0
- data/platform/wp7/sqlite3/SqliteWrapper/random_c.cs +201 -0
- data/platform/wp7/sqlite3/SqliteWrapper/resolve_c.cs +1396 -0
- data/platform/wp7/sqlite3/SqliteWrapper/rowset_c.cs +519 -0
- data/platform/wp7/sqlite3/SqliteWrapper/select_c.cs +4878 -0
- data/platform/wp7/sqlite3/SqliteWrapper/sqlite3_h.cs +6253 -0
- data/platform/wp7/sqlite3/SqliteWrapper/sqlite3ext_h.cs +397 -0
- data/platform/wp7/sqlite3/SqliteWrapper/sqliteInt_h.cs +4075 -0
- data/platform/wp7/sqlite3/SqliteWrapper/sqliteLimit_h.cs +214 -0
- data/platform/wp7/sqlite3/SqliteWrapper/sqliteicu_h.cs +39 -0
- data/platform/wp7/sqlite3/SqliteWrapper/status_c.cs +155 -0
- data/platform/wp7/sqlite3/SqliteWrapper/table_c.cs +222 -0
- data/platform/wp7/sqlite3/SqliteWrapper/tokenize_c.cs +673 -0
- data/platform/wp7/sqlite3/SqliteWrapper/trigger_c.cs +1219 -0
- data/platform/wp7/sqlite3/SqliteWrapper/update_c.cs +766 -0
- data/platform/wp7/sqlite3/SqliteWrapper/utf_c.cs +612 -0
- data/platform/wp7/sqlite3/SqliteWrapper/util_c.cs +1476 -0
- data/platform/wp7/sqlite3/SqliteWrapper/vacuum_c.cs +382 -0
- data/platform/wp7/sqlite3/SqliteWrapper/vdbe_c.cs +6566 -0
- data/platform/wp7/sqlite3/SqliteWrapper/vdbeapi_c.cs +1557 -0
- data/platform/wp7/sqlite3/SqliteWrapper/vdbeaux_c.cs +4019 -0
- data/platform/wp7/sqlite3/SqliteWrapper/vdbeblob_c.cs +396 -0
- data/platform/wp7/sqlite3/SqliteWrapper/vdbemem_c.cs +1480 -0
- data/platform/wp7/sqlite3/SqliteWrapper/vdbetrace_c.cs +181 -0
- data/platform/wp7/sqlite3/SqliteWrapper/vtab_c.cs +957 -0
- data/platform/wp7/sqlite3/SqliteWrapper/walker_c.cs +174 -0
- data/platform/wp7/sqlite3/SqliteWrapper/where_c.cs +4651 -0
- data/platform/wp7/sqlite3/sqlite3.csproj +155 -0
- data/rakefile.rb +60 -2
- data/res/build-tools/7za.exe +0 -0
- data/res/build-tools/RhoAppRunner.exe +0 -0
- data/res/build-tools/xruby-0.3.3.jar +0 -0
- data/res/generators/rhogen.rb +9 -1
- data/res/generators/templates/application/app/Settings/reset.erb +1 -1
- data/res/generators/templates/application/app/layout.erb +17 -10
- data/res/generators/templates/application/build.yml +5 -3
- data/res/generators/templates/application/public/jqtouch/changes.txt +20 -0
- data/res/generators/templates/application/public/jqtouch/jqtouch.js +12 -4
- data/res/generators/templates/application/public/jqtouch/jquery.1.3.2.min.js +1 -1
- data/res/generators/templates/application/public/js/wp7.js +7 -0
- data/res/generators/templates/model/controller.rb +5 -6
- data/rhobuild.yml.example +1 -0
- data/rhodes.gemspec +2 -1
- data/spec/framework_spec/app/spec/core/dir/close_spec.rb +1 -1
- data/spec/framework_spec/app/spec/core/dir/shared/pwd.rb +13 -11
- data/spec/framework_spec/app/spec/core/env/shared/store.rb +12 -10
- data/spec/framework_spec/app/spec/core/env/update_spec.rb +1 -0
- data/spec/framework_spec/app/spec/core/file/expand_path_spec.rb +3 -2
- data/spec/framework_spec/app/spec/core/file/fixtures/file_types.rb +7 -1
- data/spec/framework_spec/app/spec/core/file/flock_spec.rb +8 -1
- data/spec/framework_spec/app/spec/core/file/ftype_spec.rb +5 -3
- data/spec/framework_spec/app/spec/core/file/lchmod_spec.rb +1 -1
- data/spec/framework_spec/app/spec/core/file/setgid_spec.rb +1 -1
- data/spec/framework_spec/app/spec/core/file/setuid_spec.rb +1 -1
- data/spec/framework_spec/app/spec/core/file/stat/ftype_spec.rb +6 -4
- data/spec/framework_spec/app/spec/core/file/truncate_spec.rb +5 -1
- data/spec/framework_spec/app/spec/core/float/to_s_spec.rb +1 -1
- data/spec/framework_spec/app/spec/core/process/gid_spec.rb +5 -3
- data/spec/framework_spec/app/spec/core/process/groups_spec.rb +11 -9
- data/spec/framework_spec/app/spec/core/process/uid_spec.rb +5 -3
- data/spec/framework_spec/app/spec/language/execution_spec.rb +10 -6
- data/spec/framework_spec/app/spec/shared/file/directory.rb +6 -1
- data/spec/framework_spec/app/spec/shared/file/executable.rb +7 -1
- data/spec/framework_spec/app/spec/shared/file/file.rb +6 -1
- data/spec/framework_spec/app/spec/shared/file/readable.rb +13 -4
- data/spec/framework_spec/app/spec/shared/file/writable.rb +6 -1
- data/spec/phone_spec/app/spec/rho_controller_spec.rb +11 -0
- data/spec/phone_spec/app/spec/rho_spec.rb +11 -0
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +102 -6
- data/spec/phone_spec/app/spec/string/end_with_spec.rb +4 -1
- data/spec/phone_spec/app/spec/string/slice_spec.rb +5 -1
- data/spec/phone_spec/app/spec/string/start_with_spec.rb +4 -0
- data/spec/phone_spec/app/spec/syncengine_spec.rb +73 -6
- data/spec/phone_spec/app/spec_runner.rb +7 -3
- metadata +380 -41
- data/Manifest.txt +0 -5819
- data/platform/bb/Hsqldb/Hsqldb.cso +0 -5
- data/platform/bb/Hsqldb/Hsqldb.jdp +0 -197
- data/platform/bb/RhoBundle/RhoBundle.cso +0 -5
- data/platform/bb/RhoBundle/RhoBundle.jdp +0 -42
- data/platform/bb/RubyVM/RubyVM.cso +0 -5
- data/platform/bb/RubyVM/RubyVM.jdp +0 -467
- data/platform/bb/rhodes/rhodes.csl +0 -3
- data/platform/bb/rhodes/rhodes.cso +0 -5
- data/platform/bb/rhodes/rhodes.jdp +0 -104
@@ -0,0 +1,1015 @@
|
|
1
|
+
using System;
|
2
|
+
using System.Diagnostics;
|
3
|
+
using System.Text;
|
4
|
+
|
5
|
+
using u8 = System.Byte;
|
6
|
+
using u16 = System.UInt16;
|
7
|
+
using u32 = System.UInt32;
|
8
|
+
using sqlite3_int64 = System.Int64;
|
9
|
+
|
10
|
+
namespace Community.CsharpSqlite
|
11
|
+
{
|
12
|
+
using sqlite3_stmt = Sqlite3.Vdbe;
|
13
|
+
|
14
|
+
public partial class Sqlite3
|
15
|
+
{
|
16
|
+
/*
|
17
|
+
** 2005 May 25
|
18
|
+
**
|
19
|
+
** The author disclaims copyright to this source code. In place of
|
20
|
+
** a legal notice, here is a blessing:
|
21
|
+
**
|
22
|
+
** May you do good and not evil.
|
23
|
+
** May you find forgiveness for yourself and forgive others.
|
24
|
+
** May you share freely, never taking more than you give.
|
25
|
+
**
|
26
|
+
*************************************************************************
|
27
|
+
** This file contains the implementation of the sqlite3_prepare()
|
28
|
+
** interface, and routines that contribute to loading the database schema
|
29
|
+
** from disk.
|
30
|
+
*************************************************************************
|
31
|
+
** Included in SQLite3 port to C#-SQLite; 2008 Noah B Hart
|
32
|
+
** C#-SQLite is an independent reimplementation of the SQLite software library
|
33
|
+
**
|
34
|
+
** SQLITE_SOURCE_ID: 2010-03-09 19:31:43 4ae453ea7be69018d8c16eb8dabe05617397dc4d
|
35
|
+
**
|
36
|
+
** $Header$
|
37
|
+
*************************************************************************
|
38
|
+
*/
|
39
|
+
//#include "sqliteInt.h"
|
40
|
+
|
41
|
+
/*
|
42
|
+
** Fill the InitData structure with an error message that indicates
|
43
|
+
** that the database is corrupt.
|
44
|
+
*/
|
45
|
+
static void corruptSchema(
|
46
|
+
InitData pData, /* Initialization context */
|
47
|
+
string zObj, /* Object being parsed at the point of error */
|
48
|
+
string zExtra /* Error information */
|
49
|
+
)
|
50
|
+
{
|
51
|
+
sqlite3 db = pData.db;
|
52
|
+
if ( /* 0 == db.mallocFailed && */ (db.flags & SQLITE_RecoveryMode) == 0)
|
53
|
+
{
|
54
|
+
{
|
55
|
+
if (zObj == null) zObj = "?";
|
56
|
+
sqlite3SetString(ref pData.pzErrMsg, db,
|
57
|
+
"malformed database schema (%s)", zObj);
|
58
|
+
if (!String.IsNullOrEmpty(zExtra))
|
59
|
+
{
|
60
|
+
pData.pzErrMsg = sqlite3MAppendf(db, pData.pzErrMsg
|
61
|
+
, "%s - %s", pData.pzErrMsg, zExtra);
|
62
|
+
}
|
63
|
+
}
|
64
|
+
pData.rc = //db.mallocFailed != 0 ? SQLITE_NOMEM :
|
65
|
+
SQLITE_CORRUPT_BKPT();
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
/*
|
70
|
+
** This is the callback routine for the code that initializes the
|
71
|
+
** database. See sqlite3Init() below for additional information.
|
72
|
+
** This routine is also called from the OP_ParseSchema opcode of the VDBE.
|
73
|
+
**
|
74
|
+
** Each callback contains the following information:
|
75
|
+
**
|
76
|
+
** argv[0] = name of thing being created
|
77
|
+
** argv[1] = root page number for table or index. 0 for trigger or view.
|
78
|
+
** argv[2] = SQL text for the CREATE statement.
|
79
|
+
**
|
80
|
+
*/
|
81
|
+
static int sqlite3InitCallback(object pInit, sqlite3_int64 argc, object p2, object NotUsed)
|
82
|
+
{
|
83
|
+
string[] argv = (string[])p2;
|
84
|
+
InitData pData = (InitData)pInit;
|
85
|
+
sqlite3 db = pData.db;
|
86
|
+
int iDb = pData.iDb;
|
87
|
+
|
88
|
+
Debug.Assert(argc == 3);
|
89
|
+
UNUSED_PARAMETER2(NotUsed, argc);
|
90
|
+
Debug.Assert(sqlite3_mutex_held(db.mutex));
|
91
|
+
DbClearProperty(db, iDb, DB_Empty);
|
92
|
+
//if ( db.mallocFailed != 0 )
|
93
|
+
//{
|
94
|
+
// corruptSchema( pData, argv[0], "" );
|
95
|
+
// return 1;
|
96
|
+
//}
|
97
|
+
|
98
|
+
Debug.Assert(iDb >= 0 && iDb < db.nDb);
|
99
|
+
if (argv == null) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */
|
100
|
+
if (argv[1] == null)
|
101
|
+
{
|
102
|
+
corruptSchema(pData, argv[0], "");
|
103
|
+
}
|
104
|
+
else if (!String.IsNullOrEmpty(argv[2]))
|
105
|
+
{
|
106
|
+
/* Call the parser to process a CREATE TABLE, INDEX or VIEW.
|
107
|
+
** But because db.init.busy is set to 1, no VDBE code is generated
|
108
|
+
** or executed. All the parser does is build the internal data
|
109
|
+
** structures that describe the table, index, or view.
|
110
|
+
*/
|
111
|
+
string zErr = "";
|
112
|
+
int rc;
|
113
|
+
Debug.Assert(db.init.busy != 0);
|
114
|
+
db.init.iDb = iDb;
|
115
|
+
db.init.newTnum = atoi(argv[1]);
|
116
|
+
db.init.orphanTrigger = 0;
|
117
|
+
rc = sqlite3_exec(db, argv[2], null, null, ref zErr);
|
118
|
+
db.init.iDb = 0;
|
119
|
+
Debug.Assert(rc != SQLITE_OK || zErr == "");
|
120
|
+
if (SQLITE_OK != rc)
|
121
|
+
{
|
122
|
+
if (db.init.orphanTrigger != 0)
|
123
|
+
{
|
124
|
+
Debug.Assert(iDb == 1);
|
125
|
+
}
|
126
|
+
else
|
127
|
+
{
|
128
|
+
pData.rc = rc;
|
129
|
+
if (rc == SQLITE_NOMEM)
|
130
|
+
{
|
131
|
+
// db.mallocFailed = 1;
|
132
|
+
}
|
133
|
+
else if (rc != SQLITE_INTERRUPT && rc != SQLITE_LOCKED)
|
134
|
+
{
|
135
|
+
corruptSchema(pData, argv[0], zErr);
|
136
|
+
}
|
137
|
+
} sqlite3DbFree(db, ref zErr);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
else if (argv[0] == null || argv[0] == "")
|
141
|
+
{
|
142
|
+
corruptSchema(pData, null, null);
|
143
|
+
}
|
144
|
+
else
|
145
|
+
{
|
146
|
+
/* If the SQL column is blank it means this is an index that
|
147
|
+
** was created to be the PRIMARY KEY or to fulfill a UNIQUE
|
148
|
+
** constraint for a CREATE TABLE. The index should have already
|
149
|
+
** been created when we processed the CREATE TABLE. All we have
|
150
|
+
** to do here is record the root page number for that index.
|
151
|
+
*/
|
152
|
+
Index pIndex;
|
153
|
+
pIndex = sqlite3FindIndex(db, argv[0], db.aDb[iDb].zName);
|
154
|
+
if (pIndex == null)
|
155
|
+
{
|
156
|
+
/* This can occur if there exists an index on a TEMP table which
|
157
|
+
** has the same name as another index on a permanent index. Since
|
158
|
+
** the permanent table is hidden by the TEMP table, we can also
|
159
|
+
** safely ignore the index on the permanent table.
|
160
|
+
*/
|
161
|
+
/* Do Nothing */
|
162
|
+
;
|
163
|
+
}
|
164
|
+
else if (sqlite3GetInt32(argv[1], ref pIndex.tnum) == false)
|
165
|
+
{
|
166
|
+
corruptSchema(pData, argv[0], "invalid rootpage");
|
167
|
+
}
|
168
|
+
}
|
169
|
+
return 0;
|
170
|
+
}
|
171
|
+
|
172
|
+
/*
|
173
|
+
** Attempt to read the database schema and initialize internal
|
174
|
+
** data structures for a single database file. The index of the
|
175
|
+
** database file is given by iDb. iDb==0 is used for the main
|
176
|
+
** database. iDb==1 should never be used. iDb>=2 is used for
|
177
|
+
** auxiliary databases. Return one of the SQLITE_ error codes to
|
178
|
+
** indicate success or failure.
|
179
|
+
*/
|
180
|
+
static int sqlite3InitOne(sqlite3 db, int iDb, ref string pzErrMsg)
|
181
|
+
{
|
182
|
+
int rc;
|
183
|
+
int i;
|
184
|
+
int size;
|
185
|
+
Table pTab;
|
186
|
+
Db pDb;
|
187
|
+
string[] azArg = new string[4];
|
188
|
+
u32[] meta = new u32[5];
|
189
|
+
InitData initData = new InitData();
|
190
|
+
string zMasterSchema;
|
191
|
+
string zMasterName = SCHEMA_TABLE(iDb);
|
192
|
+
int openedTransaction = 0;
|
193
|
+
|
194
|
+
/*
|
195
|
+
** The master database table has a structure like this
|
196
|
+
*/
|
197
|
+
string master_schema =
|
198
|
+
"CREATE TABLE sqlite_master(\n" +
|
199
|
+
" type text,\n" +
|
200
|
+
" name text,\n" +
|
201
|
+
" tbl_name text,\n" +
|
202
|
+
" rootpage integer,\n" +
|
203
|
+
" sql text\n" +
|
204
|
+
")"
|
205
|
+
;
|
206
|
+
#if !SQLITE_OMIT_TEMPDB
|
207
|
+
string temp_master_schema =
|
208
|
+
"CREATE TEMP TABLE sqlite_temp_master(\n" +
|
209
|
+
" type text,\n" +
|
210
|
+
" name text,\n" +
|
211
|
+
" tbl_name text,\n" +
|
212
|
+
" rootpage integer,\n" +
|
213
|
+
" sql text\n" +
|
214
|
+
")"
|
215
|
+
;
|
216
|
+
#else
|
217
|
+
//#define temp_master_schema 0
|
218
|
+
#endif
|
219
|
+
|
220
|
+
Debug.Assert(iDb >= 0 && iDb < db.nDb);
|
221
|
+
Debug.Assert(db.aDb[iDb].pSchema != null);
|
222
|
+
Debug.Assert(sqlite3_mutex_held(db.mutex));
|
223
|
+
Debug.Assert(iDb == 1 || sqlite3BtreeHoldsMutex(db.aDb[iDb].pBt));
|
224
|
+
|
225
|
+
/* zMasterSchema and zInitScript are set to point at the master schema
|
226
|
+
** and initialisation script appropriate for the database being
|
227
|
+
** initialised. zMasterName is the name of the master table.
|
228
|
+
*/
|
229
|
+
if (OMIT_TEMPDB == 0 && iDb == 1)
|
230
|
+
{
|
231
|
+
zMasterSchema = temp_master_schema;
|
232
|
+
}
|
233
|
+
else
|
234
|
+
{
|
235
|
+
zMasterSchema = master_schema;
|
236
|
+
}
|
237
|
+
zMasterName = SCHEMA_TABLE(iDb);
|
238
|
+
|
239
|
+
/* Construct the schema tables. */
|
240
|
+
azArg[0] = zMasterName;
|
241
|
+
azArg[1] = "1";
|
242
|
+
azArg[2] = zMasterSchema;
|
243
|
+
azArg[3] = "";
|
244
|
+
initData.db = db;
|
245
|
+
initData.iDb = iDb;
|
246
|
+
initData.rc = SQLITE_OK;
|
247
|
+
initData.pzErrMsg = pzErrMsg;
|
248
|
+
sqlite3InitCallback(initData, 3, azArg, null);
|
249
|
+
if (initData.rc != 0)
|
250
|
+
{
|
251
|
+
rc = initData.rc;
|
252
|
+
goto error_out;
|
253
|
+
}
|
254
|
+
pTab = sqlite3FindTable(db, zMasterName, db.aDb[iDb].zName);
|
255
|
+
if (ALWAYS(pTab))
|
256
|
+
{
|
257
|
+
pTab.tabFlags |= TF_Readonly;
|
258
|
+
}
|
259
|
+
|
260
|
+
/* Create a cursor to hold the database open
|
261
|
+
*/
|
262
|
+
pDb = db.aDb[iDb];
|
263
|
+
if (pDb.pBt == null)
|
264
|
+
{
|
265
|
+
if (OMIT_TEMPDB == 0 && ALWAYS(iDb == 1))
|
266
|
+
{
|
267
|
+
DbSetProperty(db, 1, DB_SchemaLoaded);
|
268
|
+
}
|
269
|
+
return SQLITE_OK;
|
270
|
+
}
|
271
|
+
|
272
|
+
/* If there is not already a read-only (or read-write) transaction opened
|
273
|
+
** on the b-tree database, open one now. If a transaction is opened, it
|
274
|
+
** will be closed before this function returns. */
|
275
|
+
sqlite3BtreeEnter(pDb.pBt);
|
276
|
+
if (!sqlite3BtreeIsInReadTrans(pDb.pBt))
|
277
|
+
{
|
278
|
+
rc = sqlite3BtreeBeginTrans(pDb.pBt, 0);
|
279
|
+
if (rc != SQLITE_OK)
|
280
|
+
{
|
281
|
+
sqlite3SetString(ref pzErrMsg, db, "%s", sqlite3ErrStr(rc));
|
282
|
+
goto initone_error_out;
|
283
|
+
}
|
284
|
+
openedTransaction = 1;
|
285
|
+
}
|
286
|
+
|
287
|
+
/* Get the database meta information.
|
288
|
+
**
|
289
|
+
** Meta values are as follows:
|
290
|
+
** meta[0] Schema cookie. Changes with each schema change.
|
291
|
+
** meta[1] File format of schema layer.
|
292
|
+
** meta[2] Size of the page cache.
|
293
|
+
** meta[3] Largest rootpage (auto/incr_vacuum mode)
|
294
|
+
** meta[4] Db text encoding. 1:UTF-8 2:UTF-16LE 3:UTF-16BE
|
295
|
+
** meta[5] User version
|
296
|
+
** meta[6] Incremental vacuum mode
|
297
|
+
** meta[7] unused
|
298
|
+
** meta[8] unused
|
299
|
+
** meta[9] unused
|
300
|
+
**
|
301
|
+
** Note: The #defined SQLITE_UTF* symbols in sqliteInt.h correspond to
|
302
|
+
** the possible values of meta[BTREE_TEXT_ENCODING-1].
|
303
|
+
*/
|
304
|
+
for (i = 0; i < ArraySize(meta); i++)
|
305
|
+
{
|
306
|
+
sqlite3BtreeGetMeta(pDb.pBt, i + 1, ref meta[i]);
|
307
|
+
}
|
308
|
+
pDb.pSchema.schema_cookie = (int)meta[BTREE_SCHEMA_VERSION - 1];
|
309
|
+
|
310
|
+
/* If opening a non-empty database, check the text encoding. For the
|
311
|
+
** main database, set sqlite3.enc to the encoding of the main database.
|
312
|
+
** For an attached db, it is an error if the encoding is not the same
|
313
|
+
** as sqlite3.enc.
|
314
|
+
*/
|
315
|
+
if (meta[BTREE_TEXT_ENCODING - 1] != 0)
|
316
|
+
{ /* text encoding */
|
317
|
+
if (iDb == 0)
|
318
|
+
{
|
319
|
+
u8 encoding;
|
320
|
+
/* If opening the main database, set ENC(db). */
|
321
|
+
encoding = (u8)(meta[BTREE_TEXT_ENCODING - 1] & 3);
|
322
|
+
if (encoding == 0) encoding = SQLITE_UTF8;
|
323
|
+
db.aDb[0].pSchema.enc = encoding; //ENC( db ) = encoding;
|
324
|
+
db.pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 0);
|
325
|
+
}
|
326
|
+
else
|
327
|
+
{
|
328
|
+
/* If opening an attached database, the encoding much match ENC(db) */
|
329
|
+
if (meta[BTREE_TEXT_ENCODING - 1] != ENC(db))
|
330
|
+
{
|
331
|
+
sqlite3SetString(ref pzErrMsg, db, "attached databases must use the same" +
|
332
|
+
" text encoding as main database");
|
333
|
+
rc = SQLITE_ERROR;
|
334
|
+
goto initone_error_out;
|
335
|
+
}
|
336
|
+
}
|
337
|
+
}
|
338
|
+
else
|
339
|
+
{
|
340
|
+
DbSetProperty(db, iDb, DB_Empty);
|
341
|
+
}
|
342
|
+
pDb.pSchema.enc = ENC(db);
|
343
|
+
|
344
|
+
if (pDb.pSchema.cache_size == 0)
|
345
|
+
{
|
346
|
+
size = (int)meta[BTREE_DEFAULT_CACHE_SIZE - 1];
|
347
|
+
if (size == 0) { size = SQLITE_DEFAULT_CACHE_SIZE; }
|
348
|
+
if (size < 0) size = -size;
|
349
|
+
pDb.pSchema.cache_size = size;
|
350
|
+
sqlite3BtreeSetCacheSize(pDb.pBt, pDb.pSchema.cache_size);
|
351
|
+
}
|
352
|
+
|
353
|
+
/*
|
354
|
+
** file_format==1 Version 3.0.0.
|
355
|
+
** file_format==2 Version 3.1.3. // ALTER TABLE ADD COLUMN
|
356
|
+
** file_format==3 Version 3.1.4. // ditto but with non-NULL defaults
|
357
|
+
** file_format==4 Version 3.3.0. // DESC indices. Boolean constants
|
358
|
+
*/
|
359
|
+
pDb.pSchema.file_format = (u8)meta[BTREE_FILE_FORMAT - 1];
|
360
|
+
if (pDb.pSchema.file_format == 0)
|
361
|
+
{
|
362
|
+
pDb.pSchema.file_format = 1;
|
363
|
+
}
|
364
|
+
if (pDb.pSchema.file_format > SQLITE_MAX_FILE_FORMAT)
|
365
|
+
{
|
366
|
+
sqlite3SetString(ref pzErrMsg, db, "unsupported file format");
|
367
|
+
rc = SQLITE_ERROR;
|
368
|
+
goto initone_error_out;
|
369
|
+
}
|
370
|
+
|
371
|
+
/* Ticket #2804: When we open a database in the newer file format,
|
372
|
+
** clear the legacy_file_format pragma flag so that a VACUUM will
|
373
|
+
** not downgrade the database and thus invalidate any descending
|
374
|
+
** indices that the user might have created.
|
375
|
+
*/
|
376
|
+
if (iDb == 0 && meta[BTREE_FILE_FORMAT - 1] >= 4)
|
377
|
+
{
|
378
|
+
db.flags &= ~SQLITE_LegacyFileFmt;
|
379
|
+
}
|
380
|
+
|
381
|
+
/* Read the schema information out of the schema tables
|
382
|
+
*/
|
383
|
+
Debug.Assert(db.init.busy != 0);
|
384
|
+
{
|
385
|
+
string zSql;
|
386
|
+
zSql = sqlite3MPrintf(db,
|
387
|
+
"SELECT name, rootpage, sql FROM '%q'.%s ORDER BY rowid",
|
388
|
+
db.aDb[iDb].zName, zMasterName);
|
389
|
+
#if ! SQLITE_OMIT_AUTHORIZATION
|
390
|
+
{
|
391
|
+
int (*xAuth)(void*,int,const char*,const char*,const char*,const char*);
|
392
|
+
xAuth = db.xAuth;
|
393
|
+
db.xAuth = 0;
|
394
|
+
#endif
|
395
|
+
rc = sqlite3_exec(db, zSql, (dxCallback)sqlite3InitCallback, initData, 0);
|
396
|
+
pzErrMsg = initData.pzErrMsg;
|
397
|
+
#if ! SQLITE_OMIT_AUTHORIZATION
|
398
|
+
db.xAuth = xAuth;
|
399
|
+
}
|
400
|
+
#endif
|
401
|
+
if (rc == SQLITE_OK) rc = initData.rc;
|
402
|
+
sqlite3DbFree(db, ref zSql);
|
403
|
+
#if !SQLITE_OMIT_ANALYZE
|
404
|
+
if (rc == SQLITE_OK)
|
405
|
+
{
|
406
|
+
sqlite3AnalysisLoad(db, iDb);
|
407
|
+
}
|
408
|
+
#endif
|
409
|
+
}
|
410
|
+
//if ( db.mallocFailed != 0 )
|
411
|
+
//{
|
412
|
+
// rc = SQLITE_NOMEM;
|
413
|
+
// sqlite3ResetInternalSchema( db, 0 );
|
414
|
+
//}
|
415
|
+
if (rc == SQLITE_OK || (db.flags & SQLITE_RecoveryMode) != 0)
|
416
|
+
{
|
417
|
+
/* Black magic: If the SQLITE_RecoveryMode flag is set, then consider
|
418
|
+
** the schema loaded, even if errors occurred. In this situation the
|
419
|
+
** current sqlite3_prepare() operation will fail, but the following one
|
420
|
+
** will attempt to compile the supplied statement against whatever subset
|
421
|
+
** of the schema was loaded before the error occurred. The primary
|
422
|
+
** purpose of this is to allow access to the sqlite_master table
|
423
|
+
** even when its contents have been corrupted.
|
424
|
+
*/
|
425
|
+
DbSetProperty(db, iDb, DB_SchemaLoaded);
|
426
|
+
rc = SQLITE_OK;
|
427
|
+
}
|
428
|
+
/* Jump here for an error that occurs after successfully allocating
|
429
|
+
** curMain and calling sqlite3BtreeEnter(). For an error that occurs
|
430
|
+
** before that point, jump to error_out.
|
431
|
+
*/
|
432
|
+
initone_error_out:
|
433
|
+
if (openedTransaction != 0)
|
434
|
+
{
|
435
|
+
sqlite3BtreeCommit(pDb.pBt);
|
436
|
+
}
|
437
|
+
sqlite3BtreeLeave(pDb.pBt);
|
438
|
+
|
439
|
+
error_out:
|
440
|
+
if (rc == SQLITE_NOMEM || rc == SQLITE_IOERR_NOMEM)
|
441
|
+
{
|
442
|
+
// db.mallocFailed = 1;
|
443
|
+
}
|
444
|
+
return rc;
|
445
|
+
}
|
446
|
+
|
447
|
+
/*
|
448
|
+
** Initialize all database files - the main database file, the file
|
449
|
+
** used to store temporary tables, and any additional database files
|
450
|
+
** created using ATTACH statements. Return a success code. If an
|
451
|
+
** error occurs, write an error message into pzErrMsg.
|
452
|
+
**
|
453
|
+
** After a database is initialized, the DB_SchemaLoaded bit is set
|
454
|
+
** bit is set in the flags field of the Db structure. If the database
|
455
|
+
** file was of zero-length, then the DB_Empty flag is also set.
|
456
|
+
*/
|
457
|
+
static int sqlite3Init(sqlite3 db, ref string pzErrMsg)
|
458
|
+
{
|
459
|
+
int i, rc;
|
460
|
+
bool commit_internal = !((db.flags & SQLITE_InternChanges) != 0);
|
461
|
+
|
462
|
+
Debug.Assert(sqlite3_mutex_held(db.mutex));
|
463
|
+
rc = SQLITE_OK;
|
464
|
+
db.init.busy = 1;
|
465
|
+
for (i = 0; rc == SQLITE_OK && i < db.nDb; i++)
|
466
|
+
{
|
467
|
+
if (DbHasProperty(db, i, DB_SchemaLoaded) || i == 1) continue;
|
468
|
+
rc = sqlite3InitOne(db, i, ref pzErrMsg);
|
469
|
+
if (rc != 0)
|
470
|
+
{
|
471
|
+
sqlite3ResetInternalSchema(db, i);
|
472
|
+
}
|
473
|
+
}
|
474
|
+
|
475
|
+
/* Once all the other databases have been initialised, load the schema
|
476
|
+
** for the TEMP database. This is loaded last, as the TEMP database
|
477
|
+
** schema may contain references to objects in other databases.
|
478
|
+
*/
|
479
|
+
#if !SQLITE_OMIT_TEMPDB
|
480
|
+
if (rc == SQLITE_OK && ALWAYS(db.nDb > 1)
|
481
|
+
&& !DbHasProperty(db, 1, DB_SchemaLoaded))
|
482
|
+
{
|
483
|
+
rc = sqlite3InitOne(db, 1, ref pzErrMsg);
|
484
|
+
if (rc != 0)
|
485
|
+
{
|
486
|
+
sqlite3ResetInternalSchema(db, 1);
|
487
|
+
}
|
488
|
+
}
|
489
|
+
#endif
|
490
|
+
|
491
|
+
db.init.busy = 0;
|
492
|
+
if (rc == SQLITE_OK && commit_internal)
|
493
|
+
{
|
494
|
+
sqlite3CommitInternalChanges(db);
|
495
|
+
}
|
496
|
+
|
497
|
+
return rc;
|
498
|
+
}
|
499
|
+
|
500
|
+
/*
|
501
|
+
** This routine is a no-op if the database schema is already initialised.
|
502
|
+
** Otherwise, the schema is loaded. An error code is returned.
|
503
|
+
*/
|
504
|
+
static int sqlite3ReadSchema(Parse pParse)
|
505
|
+
{
|
506
|
+
int rc = SQLITE_OK;
|
507
|
+
sqlite3 db = pParse.db;
|
508
|
+
Debug.Assert(sqlite3_mutex_held(db.mutex));
|
509
|
+
if (0 == db.init.busy)
|
510
|
+
{
|
511
|
+
rc = sqlite3Init(db, ref pParse.zErrMsg);
|
512
|
+
}
|
513
|
+
if (rc != SQLITE_OK)
|
514
|
+
{
|
515
|
+
pParse.rc = rc;
|
516
|
+
pParse.nErr++;
|
517
|
+
}
|
518
|
+
return rc;
|
519
|
+
}
|
520
|
+
|
521
|
+
|
522
|
+
/*
|
523
|
+
** Check schema cookies in all databases. If any cookie is out
|
524
|
+
** of date set pParse->rc to SQLITE_SCHEMA. If all schema cookies
|
525
|
+
** make no changes to pParse->rc.
|
526
|
+
*/
|
527
|
+
static void schemaIsValid(Parse pParse)
|
528
|
+
{
|
529
|
+
sqlite3 db = pParse.db;
|
530
|
+
int iDb;
|
531
|
+
int rc;
|
532
|
+
u32 cookie = 0;
|
533
|
+
|
534
|
+
Debug.Assert(pParse.checkSchema != 0);
|
535
|
+
Debug.Assert(sqlite3_mutex_held(db.mutex));
|
536
|
+
for (iDb = 0; iDb < db.nDb; iDb++)
|
537
|
+
{
|
538
|
+
int openedTransaction = 0; /* True if a transaction is opened */
|
539
|
+
Btree pBt = db.aDb[iDb].pBt; /* Btree database to read cookie from */
|
540
|
+
if (pBt == null) continue;
|
541
|
+
|
542
|
+
/* If there is not already a read-only (or read-write) transaction opened
|
543
|
+
** on the b-tree database, open one now. If a transaction is opened, it
|
544
|
+
** will be closed immediately after reading the meta-value. */
|
545
|
+
if (!sqlite3BtreeIsInReadTrans(pBt))
|
546
|
+
{
|
547
|
+
rc = sqlite3BtreeBeginTrans(pBt, 0);
|
548
|
+
//if ( rc == SQLITE_NOMEM || rc == SQLITE_IOERR_NOMEM )
|
549
|
+
//{
|
550
|
+
// db.mallocFailed = 1;
|
551
|
+
//}
|
552
|
+
if (rc != SQLITE_OK) return;
|
553
|
+
openedTransaction = 1;
|
554
|
+
}
|
555
|
+
|
556
|
+
/* Read the schema cookie from the database. If it does not match the
|
557
|
+
** value stored as part of the in-memory schema representation,
|
558
|
+
** set Parse.rc to SQLITE_SCHEMA. */
|
559
|
+
sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, ref cookie);
|
560
|
+
if (cookie != db.aDb[iDb].pSchema.schema_cookie)
|
561
|
+
{
|
562
|
+
pParse.rc = SQLITE_SCHEMA;
|
563
|
+
}
|
564
|
+
|
565
|
+
/* Close the transaction, if one was opened. */
|
566
|
+
if (openedTransaction != 0)
|
567
|
+
{
|
568
|
+
sqlite3BtreeCommit(pBt);
|
569
|
+
}
|
570
|
+
}
|
571
|
+
}
|
572
|
+
|
573
|
+
/*
|
574
|
+
** Convert a schema pointer into the iDb index that indicates
|
575
|
+
** which database file in db.aDb[] the schema refers to.
|
576
|
+
**
|
577
|
+
** If the same database is attached more than once, the first
|
578
|
+
** attached database is returned.
|
579
|
+
*/
|
580
|
+
static int sqlite3SchemaToIndex(sqlite3 db, Schema pSchema)
|
581
|
+
{
|
582
|
+
int i = -1000000;
|
583
|
+
|
584
|
+
/* If pSchema is NULL, then return -1000000. This happens when code in
|
585
|
+
** expr.c is trying to resolve a reference to a transient table (i.e. one
|
586
|
+
** created by a sub-select). In this case the return value of this
|
587
|
+
** function should never be used.
|
588
|
+
**
|
589
|
+
** We return -1000000 instead of the more usual -1 simply because using
|
590
|
+
** -1000000 as the incorrect index into db->aDb[] is much
|
591
|
+
** more likely to cause a segfault than -1 (of course there are assert()
|
592
|
+
** statements too, but it never hurts to play the odds).
|
593
|
+
*/
|
594
|
+
Debug.Assert(sqlite3_mutex_held(db.mutex));
|
595
|
+
if (pSchema != null)
|
596
|
+
{
|
597
|
+
for (i = 0; ALWAYS(i < db.nDb); i++)
|
598
|
+
{
|
599
|
+
if (db.aDb[i].pSchema == pSchema)
|
600
|
+
{
|
601
|
+
break;
|
602
|
+
}
|
603
|
+
}
|
604
|
+
Debug.Assert(i >= 0 && i < db.nDb);
|
605
|
+
}
|
606
|
+
return i;
|
607
|
+
}
|
608
|
+
|
609
|
+
/*
|
610
|
+
** Compile the UTF-8 encoded SQL statement zSql into a statement handle.
|
611
|
+
*/
|
612
|
+
static int sqlite3Prepare(
|
613
|
+
sqlite3 db, /* Database handle. */
|
614
|
+
string zSql, /* UTF-8 encoded SQL statement. */
|
615
|
+
int nBytes, /* Length of zSql in bytes. */
|
616
|
+
int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */
|
617
|
+
Vdbe pReprepare, /* VM being reprepared */
|
618
|
+
ref sqlite3_stmt ppStmt, /* OUT: A pointer to the prepared statement */
|
619
|
+
ref string pzTail /* OUT: End of parsed string */
|
620
|
+
)
|
621
|
+
{
|
622
|
+
Parse pParse; /* Parsing context */
|
623
|
+
string zErrMsg = ""; /* Error message */
|
624
|
+
int rc = SQLITE_OK; /* Result code */
|
625
|
+
int i; /* Loop counter */
|
626
|
+
|
627
|
+
/* Allocate the parsing context */
|
628
|
+
pParse = new Parse();//sqlite3StackAllocZero(db, sizeof(*pParse));
|
629
|
+
if (pParse == null)
|
630
|
+
{
|
631
|
+
rc = SQLITE_NOMEM;
|
632
|
+
goto end_prepare;
|
633
|
+
}
|
634
|
+
pParse.pReprepare = pReprepare;
|
635
|
+
pParse.sLastToken.z = "";
|
636
|
+
|
637
|
+
Debug.Assert(ppStmt == null);// assert( ppStmt && *ppStmt==0 );
|
638
|
+
//Debug.Assert( 0 == db.mallocFailed );
|
639
|
+
Debug.Assert(sqlite3_mutex_held(db.mutex));
|
640
|
+
|
641
|
+
/* Check to verify that it is possible to get a read lock on all
|
642
|
+
** database schemas. The inability to get a read lock indicates that
|
643
|
+
** some other database connection is holding a write-lock, which in
|
644
|
+
** turn means that the other connection has made uncommitted changes
|
645
|
+
** to the schema.
|
646
|
+
**
|
647
|
+
** Were we to proceed and prepare the statement against the uncommitted
|
648
|
+
** schema changes and if those schema changes are subsequently rolled
|
649
|
+
** back and different changes are made in their place, then when this
|
650
|
+
** prepared statement goes to run the schema cookie would fail to detect
|
651
|
+
** the schema change. Disaster would follow.
|
652
|
+
**
|
653
|
+
** This thread is currently holding mutexes on all Btrees (because
|
654
|
+
** of the sqlite3BtreeEnterAll() in sqlite3LockAndPrepare()) so it
|
655
|
+
** is not possible for another thread to start a new schema change
|
656
|
+
** while this routine is running. Hence, we do not need to hold
|
657
|
+
** locks on the schema, we just need to make sure nobody else is
|
658
|
+
** holding them.
|
659
|
+
**
|
660
|
+
** Note that setting READ_UNCOMMITTED overrides most lock detection,
|
661
|
+
** but it does *not* override schema lock detection, so this all still
|
662
|
+
** works even if READ_UNCOMMITTED is set.
|
663
|
+
*/
|
664
|
+
for (i = 0; i < db.nDb; i++)
|
665
|
+
{
|
666
|
+
Btree pBt = db.aDb[i].pBt;
|
667
|
+
if (pBt != null)
|
668
|
+
{
|
669
|
+
Debug.Assert(sqlite3BtreeHoldsMutex(pBt));
|
670
|
+
rc = sqlite3BtreeSchemaLocked(pBt);
|
671
|
+
if (rc != 0)
|
672
|
+
{
|
673
|
+
string zDb = db.aDb[i].zName;
|
674
|
+
sqlite3Error(db, rc, "database schema is locked: %s", zDb);
|
675
|
+
testcase(db.flags & SQLITE_ReadUncommitted);
|
676
|
+
goto end_prepare;
|
677
|
+
}
|
678
|
+
}
|
679
|
+
}
|
680
|
+
|
681
|
+
sqlite3VtabUnlockList(db);
|
682
|
+
|
683
|
+
pParse.db = db;
|
684
|
+
if (nBytes >= 0 && (nBytes == 0 || zSql[nBytes - 1] != 0))
|
685
|
+
{
|
686
|
+
string zSqlCopy;
|
687
|
+
int mxLen = db.aLimit[SQLITE_LIMIT_SQL_LENGTH];
|
688
|
+
testcase(nBytes == mxLen);
|
689
|
+
testcase(nBytes == mxLen + 1);
|
690
|
+
if (nBytes > mxLen)
|
691
|
+
{
|
692
|
+
sqlite3Error(db, SQLITE_TOOBIG, "statement too long");
|
693
|
+
rc = sqlite3ApiExit(db, SQLITE_TOOBIG);
|
694
|
+
goto end_prepare;
|
695
|
+
}
|
696
|
+
zSqlCopy = zSql.Substring(0, nBytes);// sqlite3DbStrNDup(db, zSql, nBytes);
|
697
|
+
if (zSqlCopy != null)
|
698
|
+
{
|
699
|
+
sqlite3RunParser(pParse, zSqlCopy, ref zErrMsg);
|
700
|
+
sqlite3DbFree(db, ref zSqlCopy);
|
701
|
+
//pParse->zTail = &zSql[pParse->zTail-zSqlCopy];
|
702
|
+
}
|
703
|
+
else
|
704
|
+
{
|
705
|
+
//pParse->zTail = &zSql[nBytes];
|
706
|
+
}
|
707
|
+
}
|
708
|
+
else
|
709
|
+
{
|
710
|
+
sqlite3RunParser(pParse, zSql, ref zErrMsg);
|
711
|
+
}
|
712
|
+
|
713
|
+
//if ( db.mallocFailed != 0 )
|
714
|
+
//{
|
715
|
+
// pParse.rc = SQLITE_NOMEM;
|
716
|
+
//}
|
717
|
+
if (pParse.rc == SQLITE_DONE) pParse.rc = SQLITE_OK;
|
718
|
+
if (pParse.checkSchema != 0)
|
719
|
+
{
|
720
|
+
schemaIsValid(pParse);
|
721
|
+
}
|
722
|
+
if (pParse.rc == SQLITE_SCHEMA)
|
723
|
+
{
|
724
|
+
sqlite3ResetInternalSchema(db, 0);
|
725
|
+
}
|
726
|
+
//if ( db.mallocFailed != 0 )
|
727
|
+
//{
|
728
|
+
// pParse.rc = SQLITE_NOMEM;
|
729
|
+
//}
|
730
|
+
//if (pzTail != null)
|
731
|
+
{
|
732
|
+
pzTail = pParse.zTail == null ? "" : pParse.zTail.ToString();
|
733
|
+
}
|
734
|
+
rc = pParse.rc;
|
735
|
+
#if !SQLITE_OMIT_EXPLAIN
|
736
|
+
if (rc == SQLITE_OK && pParse.pVdbe != null && pParse.explain != 0)
|
737
|
+
{
|
738
|
+
string[] azColName = new string[] {
|
739
|
+
"addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment",
|
740
|
+
"order", "from", "detail"
|
741
|
+
};
|
742
|
+
int iFirst, mx;
|
743
|
+
if (pParse.explain == 2)
|
744
|
+
{
|
745
|
+
sqlite3VdbeSetNumCols(pParse.pVdbe, 3);
|
746
|
+
iFirst = 8;
|
747
|
+
mx = 11;
|
748
|
+
}
|
749
|
+
else
|
750
|
+
{
|
751
|
+
sqlite3VdbeSetNumCols(pParse.pVdbe, 8);
|
752
|
+
iFirst = 0;
|
753
|
+
mx = 8;
|
754
|
+
}
|
755
|
+
for (i = iFirst; i < mx; i++)
|
756
|
+
{
|
757
|
+
sqlite3VdbeSetColName(pParse.pVdbe, i - iFirst, COLNAME_NAME,
|
758
|
+
azColName[i], SQLITE_STATIC);
|
759
|
+
}
|
760
|
+
}
|
761
|
+
#endif
|
762
|
+
|
763
|
+
Debug.Assert(db.init.busy == 0 || saveSqlFlag == 0);
|
764
|
+
if (db.init.busy == 0)
|
765
|
+
{
|
766
|
+
Vdbe pVdbe = pParse.pVdbe;
|
767
|
+
sqlite3VdbeSetSql(pVdbe, zSql, (int)(zSql.Length - (pParse.zTail == null ? 0 : pParse.zTail.Length)), saveSqlFlag);
|
768
|
+
}
|
769
|
+
if (pParse.pVdbe != null && (rc != SQLITE_OK /*|| db.mallocFailed != 0 */ ))
|
770
|
+
{
|
771
|
+
sqlite3VdbeFinalize(pParse.pVdbe);
|
772
|
+
Debug.Assert(ppStmt == null);
|
773
|
+
}
|
774
|
+
else
|
775
|
+
{
|
776
|
+
ppStmt = pParse.pVdbe;
|
777
|
+
}
|
778
|
+
|
779
|
+
if (zErrMsg != "")
|
780
|
+
{
|
781
|
+
sqlite3Error(db, rc, "%s", zErrMsg);
|
782
|
+
sqlite3DbFree(db, ref zErrMsg);
|
783
|
+
}
|
784
|
+
else
|
785
|
+
{
|
786
|
+
sqlite3Error(db, rc, 0);
|
787
|
+
}
|
788
|
+
|
789
|
+
/* Delete any TriggerPrg structures allocated while parsing this statement. */
|
790
|
+
while (pParse.pTriggerPrg != null)
|
791
|
+
{
|
792
|
+
TriggerPrg pT = pParse.pTriggerPrg;
|
793
|
+
pParse.pTriggerPrg = pT.pNext;
|
794
|
+
sqlite3VdbeProgramDelete(db, pT.pProgram, 0);
|
795
|
+
pT = null; sqlite3DbFree(db, ref pT);
|
796
|
+
}
|
797
|
+
|
798
|
+
end_prepare:
|
799
|
+
|
800
|
+
//sqlite3StackFree( db, pParse );
|
801
|
+
rc = sqlite3ApiExit(db, rc);
|
802
|
+
Debug.Assert((rc & db.errMask) == rc);
|
803
|
+
return rc;
|
804
|
+
}
|
805
|
+
|
806
|
+
static int sqlite3LockAndPrepare(
|
807
|
+
sqlite3 db, /* Database handle. */
|
808
|
+
string zSql, /* UTF-8 encoded SQL statement. */
|
809
|
+
int nBytes, /* Length of zSql in bytes. */
|
810
|
+
int saveSqlFlag, /* True to copy SQL text into the sqlite3_stmt */
|
811
|
+
Vdbe pOld, /* VM being reprepared */
|
812
|
+
ref sqlite3_stmt ppStmt, /* OUT: A pointer to the prepared statement */
|
813
|
+
ref string pzTail /* OUT: End of parsed string */
|
814
|
+
)
|
815
|
+
{
|
816
|
+
int rc;
|
817
|
+
// assert( ppStmt!=0 );
|
818
|
+
ppStmt = null;
|
819
|
+
if (!sqlite3SafetyCheckOk(db))
|
820
|
+
{
|
821
|
+
return SQLITE_MISUSE_BKPT();
|
822
|
+
}
|
823
|
+
sqlite3_mutex_enter(db.mutex);
|
824
|
+
sqlite3BtreeEnterAll(db);
|
825
|
+
rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, pOld, ref ppStmt, ref pzTail);
|
826
|
+
if (rc == SQLITE_SCHEMA)
|
827
|
+
{
|
828
|
+
sqlite3_finalize(ref ppStmt);
|
829
|
+
rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, pOld, ref ppStmt, ref pzTail);
|
830
|
+
}
|
831
|
+
sqlite3BtreeLeaveAll(db);
|
832
|
+
sqlite3_mutex_leave(db.mutex);
|
833
|
+
return rc;
|
834
|
+
}
|
835
|
+
|
836
|
+
/*
|
837
|
+
** Rerun the compilation of a statement after a schema change.
|
838
|
+
**
|
839
|
+
** If the statement is successfully recompiled, return SQLITE_OK. Otherwise,
|
840
|
+
** if the statement cannot be recompiled because another connection has
|
841
|
+
** locked the sqlite3_master table, return SQLITE_LOCKED. If any other error
|
842
|
+
** occurs, return SQLITE_SCHEMA.
|
843
|
+
*/
|
844
|
+
static int sqlite3Reprepare(Vdbe p)
|
845
|
+
{
|
846
|
+
int rc;
|
847
|
+
sqlite3_stmt pNew = new sqlite3_stmt();
|
848
|
+
string zSql;
|
849
|
+
sqlite3 db;
|
850
|
+
|
851
|
+
Debug.Assert(sqlite3_mutex_held(sqlite3VdbeDb(p).mutex));
|
852
|
+
zSql = sqlite3_sql((sqlite3_stmt)p);
|
853
|
+
Debug.Assert(zSql != null); /* Reprepare only called for prepare_v2() statements */
|
854
|
+
db = sqlite3VdbeDb(p);
|
855
|
+
Debug.Assert(sqlite3_mutex_held(db.mutex));
|
856
|
+
string dummy = "";
|
857
|
+
rc = sqlite3LockAndPrepare(db, zSql, -1, 0, p, ref pNew, ref dummy);
|
858
|
+
if (rc != 0)
|
859
|
+
{
|
860
|
+
if (rc == SQLITE_NOMEM)
|
861
|
+
{
|
862
|
+
// db.mallocFailed = 1;
|
863
|
+
}
|
864
|
+
Debug.Assert(pNew == null);
|
865
|
+
return rc;
|
866
|
+
}
|
867
|
+
else
|
868
|
+
{
|
869
|
+
Debug.Assert(pNew != null);
|
870
|
+
}
|
871
|
+
sqlite3VdbeSwap((Vdbe)pNew, p);
|
872
|
+
sqlite3TransferBindings(pNew, (sqlite3_stmt)p);
|
873
|
+
sqlite3VdbeResetStepResult((Vdbe)pNew);
|
874
|
+
sqlite3VdbeFinalize((Vdbe)pNew);
|
875
|
+
return SQLITE_OK;
|
876
|
+
}
|
877
|
+
|
878
|
+
|
879
|
+
/*
|
880
|
+
** Two versions of the official API. Legacy and new use. In the legacy
|
881
|
+
** version, the original SQL text is not saved in the prepared statement
|
882
|
+
** and so if a schema change occurs, SQLITE_SCHEMA is returned by
|
883
|
+
** sqlite3_step(). In the new version, the original SQL text is retained
|
884
|
+
** and the statement is automatically recompiled if an schema change
|
885
|
+
** occurs.
|
886
|
+
*/
|
887
|
+
static public int sqlite3_prepare(
|
888
|
+
sqlite3 db, /* Database handle. */
|
889
|
+
string zSql, /* UTF-8 encoded SQL statement. */
|
890
|
+
int nBytes, /* Length of zSql in bytes. */
|
891
|
+
ref sqlite3_stmt ppStmt, /* OUT: A pointer to the prepared statement */
|
892
|
+
ref string pzTail /* OUT: End of parsed string */
|
893
|
+
)
|
894
|
+
{
|
895
|
+
int rc;
|
896
|
+
rc = sqlite3LockAndPrepare(db, zSql, nBytes, 0, null, ref ppStmt, ref pzTail);
|
897
|
+
Debug.Assert(rc == SQLITE_OK || ppStmt == null); /* VERIFY: F13021 */
|
898
|
+
return rc;
|
899
|
+
}
|
900
|
+
|
901
|
+
public static int sqlite3_prepare_v2(
|
902
|
+
sqlite3 db, /* Database handle. */
|
903
|
+
string zSql, /* UTF-8 encoded SQL statement. */
|
904
|
+
int nBytes, /* Length of zSql in bytes. */
|
905
|
+
ref sqlite3_stmt ppStmt, /* OUT: A pointer to the prepared statement */
|
906
|
+
int dummy /* ( No string passed) */
|
907
|
+
)
|
908
|
+
{
|
909
|
+
string pzTail = null;
|
910
|
+
int rc;
|
911
|
+
rc = sqlite3LockAndPrepare(db, zSql, nBytes, 1, null, ref ppStmt, ref pzTail);
|
912
|
+
Debug.Assert(rc == SQLITE_OK || ppStmt == null); /* VERIFY: F13021 */
|
913
|
+
return rc;
|
914
|
+
}
|
915
|
+
|
916
|
+
public static int sqlite3_prepare_v2(
|
917
|
+
sqlite3 db, /* Database handle. */
|
918
|
+
string zSql, /* UTF-8 encoded SQL statement. */
|
919
|
+
int nBytes, /* Length of zSql in bytes. */
|
920
|
+
ref sqlite3_stmt ppStmt, /* OUT: A pointer to the prepared statement */
|
921
|
+
ref string pzTail /* OUT: End of parsed string */
|
922
|
+
)
|
923
|
+
{
|
924
|
+
int rc;
|
925
|
+
rc = sqlite3LockAndPrepare(db, zSql, nBytes, 1, null, ref ppStmt, ref pzTail);
|
926
|
+
Debug.Assert(rc == SQLITE_OK || ppStmt == null); /* VERIFY: F13021 */
|
927
|
+
return rc;
|
928
|
+
}
|
929
|
+
|
930
|
+
|
931
|
+
#if ! SQLITE_OMIT_UTF16
|
932
|
+
|
933
|
+
/*
|
934
|
+
** Compile the UTF-16 encoded SQL statement zSql into a statement handle.
|
935
|
+
*/
|
936
|
+
static int sqlite3Prepare16(
|
937
|
+
sqlite3 db, /* Database handle. */
|
938
|
+
string zSql, /* UTF-8 encoded SQL statement. */
|
939
|
+
int nBytes, /* Length of zSql in bytes. */
|
940
|
+
bool saveSqlFlag, /* True to save SQL text into the sqlite3_stmt */
|
941
|
+
ref sqlite3_stmt ppStmt, /* OUT: A pointer to the prepared statement */
|
942
|
+
ref string pzTail /* OUT: End of parsed string */
|
943
|
+
){
|
944
|
+
/* This function currently works by first transforming the UTF-16
|
945
|
+
** encoded string to UTF-8, then invoking sqlite3_prepare(). The
|
946
|
+
** tricky bit is figuring out the pointer to return in pzTail.
|
947
|
+
*/
|
948
|
+
string zSql8;
|
949
|
+
string zTail8 = "";
|
950
|
+
int rc = SQLITE_OK;
|
951
|
+
|
952
|
+
assert( ppStmt );
|
953
|
+
*ppStmt = 0;
|
954
|
+
if( !sqlite3SafetyCheckOk(db) ){
|
955
|
+
return SQLITE_MISUSE_BKPT;
|
956
|
+
}
|
957
|
+
sqlite3_mutex_enter(db.mutex);
|
958
|
+
zSql8 = sqlite3Utf16to8(db, zSql, nBytes, SQLITE_UTF16NATIVE);
|
959
|
+
if( zSql8 !=""){
|
960
|
+
rc = sqlite3LockAndPrepare(db, zSql8, -1, saveSqlFlag, null, ref ppStmt, ref zTail8);
|
961
|
+
}
|
962
|
+
|
963
|
+
if( zTail8 !="" && pzTail !=""){
|
964
|
+
/* If sqlite3_prepare returns a tail pointer, we calculate the
|
965
|
+
** equivalent pointer into the UTF-16 string by counting the unicode
|
966
|
+
** characters between zSql8 and zTail8, and then returning a pointer
|
967
|
+
** the same number of characters into the UTF-16 string.
|
968
|
+
*/
|
969
|
+
Debugger.Break (); // TODO --
|
970
|
+
// int chars_parsed = sqlite3Utf8CharLen(zSql8, (int)(zTail8-zSql8));
|
971
|
+
// pzTail = (u8 *)zSql + sqlite3Utf16ByteLen(zSql, chars_parsed);
|
972
|
+
}
|
973
|
+
sqlite3DbFree(db,ref zSql8);
|
974
|
+
rc = sqlite3ApiExit(db, rc);
|
975
|
+
sqlite3_mutex_leave(db.mutex);
|
976
|
+
return rc;
|
977
|
+
}
|
978
|
+
|
979
|
+
/*
|
980
|
+
** Two versions of the official API. Legacy and new use. In the legacy
|
981
|
+
** version, the original SQL text is not saved in the prepared statement
|
982
|
+
** and so if a schema change occurs, SQLITE_SCHEMA is returned by
|
983
|
+
** sqlite3_step(). In the new version, the original SQL text is retained
|
984
|
+
** and the statement is automatically recompiled if an schema change
|
985
|
+
** occurs.
|
986
|
+
*/
|
987
|
+
public static int sqlite3_prepare16(
|
988
|
+
sqlite3 db, /* Database handle. */
|
989
|
+
string zSql, /* UTF-8 encoded SQL statement. */
|
990
|
+
int nBytes, /* Length of zSql in bytes. */
|
991
|
+
ref sqlite3_stmt ppStmt, /* OUT: A pointer to the prepared statement */
|
992
|
+
ref string pzTail /* OUT: End of parsed string */
|
993
|
+
){
|
994
|
+
int rc;
|
995
|
+
rc = sqlite3Prepare16(db,zSql,nBytes,false,ref ppStmt,ref pzTail);
|
996
|
+
Debug.Assert( rc==SQLITE_OK || ppStmt==null || ppStmt==null ); /* VERIFY: F13021 */
|
997
|
+
return rc;
|
998
|
+
}
|
999
|
+
public static int sqlite3_prepare16_v2(
|
1000
|
+
sqlite3 db, /* Database handle. */
|
1001
|
+
string zSql, /* UTF-8 encoded SQL statement. */
|
1002
|
+
int nBytes, /* Length of zSql in bytes. */
|
1003
|
+
ref sqlite3_stmt ppStmt, /* OUT: A pointer to the prepared statement */
|
1004
|
+
ref string pzTail /* OUT: End of parsed string */
|
1005
|
+
)
|
1006
|
+
{
|
1007
|
+
int rc;
|
1008
|
+
rc = sqlite3Prepare16(db,zSql,nBytes,true,ref ppStmt,ref pzTail);
|
1009
|
+
Debug.Assert( rc==SQLITE_OK || ppStmt==null || ppStmt==null ); /* VERIFY: F13021 */
|
1010
|
+
return rc;
|
1011
|
+
}
|
1012
|
+
|
1013
|
+
#endif // * SQLITE_OMIT_UTF16 */
|
1014
|
+
}
|
1015
|
+
}
|