rhodes 1.5.5 → 2.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (529) hide show
  1. data/CHANGELOG +5 -0
  2. data/Manifest.txt +214 -32
  3. data/Rakefile +33 -10
  4. data/bin/upgrade-rhodes-app +0 -1
  5. data/lib/build/compileERB/bb.rb +2 -2
  6. data/lib/build/compileERB/default.rb +7 -5
  7. data/lib/build/jake.rb +1 -1
  8. data/lib/extensions/digest-md5/ext.yml +1 -1
  9. data/lib/extensions/digest-md5/ext/Rakefile +35 -36
  10. data/lib/extensions/digest-md5/ext/build.bat +1 -0
  11. data/lib/extensions/digest-md5/ext/digest-md5.vcproj +203 -0
  12. data/lib/extensions/digest-sha1/ext.yml +1 -1
  13. data/lib/extensions/digest/ext.yml +1 -1
  14. data/lib/extensions/digest/ext/Rakefile +35 -39
  15. data/lib/extensions/digest/ext/build.bat +1 -2
  16. data/lib/extensions/digest/ext/digest.vcproj +203 -0
  17. data/lib/framework/rho/render.rb +79 -22
  18. data/lib/framework/rho/rho.rb +294 -56
  19. data/lib/framework/rho/rhoapplication.rb +10 -0
  20. data/lib/framework/rho/rhofsconnector.rb +2 -6
  21. data/lib/framework/rho/rhoutils.rb +56 -14
  22. data/lib/framework/rho/rhoviewhelpers.rb +2 -0
  23. data/lib/framework/rhodes.rb +2 -2
  24. data/lib/framework/rhom/rhom.rb +42 -15
  25. data/lib/framework/rhom/rhom_db_adapter.rb +165 -159
  26. data/lib/framework/rhom/rhom_object.rb +0 -1
  27. data/lib/framework/rhom/rhom_object_factory.rb +343 -166
  28. data/lib/framework/rhom/rhom_source.rb +28 -15
  29. data/lib/framework/version.rb +2 -2
  30. data/lib/rhodes.rb +2 -2
  31. data/platform/android/Rhodes/AndroidManifest.xml +2 -2
  32. data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +39 -44
  33. data/platform/android/Rhodes/jni/include/JNIRhodes.h +1 -1
  34. data/platform/android/Rhodes/jni/include/details/rhojava.inc +23 -20
  35. data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_RhoMenu.h +61 -0
  36. data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_Rhodes.h +16 -0
  37. data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_alert_Alert.h +21 -0
  38. data/platform/android/Rhodes/jni/include/sslimpl.h +1 -1
  39. data/platform/android/Rhodes/jni/src/alert.cpp +32 -5
  40. data/platform/android/Rhodes/jni/src/callbacks.cpp +51 -21
  41. data/platform/android/Rhodes/jni/src/mapview.cpp +3 -8
  42. data/platform/android/Rhodes/jni/src/menu.cpp +70 -0
  43. data/platform/android/Rhodes/jni/src/navbar.cpp +16 -0
  44. data/platform/android/Rhodes/jni/src/rhodes.cpp +37 -0
  45. data/platform/android/Rhodes/jni/src/sslimpl.cpp +3 -3
  46. data/platform/android/Rhodes/jni/src/webview.cpp +21 -7
  47. data/platform/android/Rhodes/res/drawable/alert_alert.png +0 -0
  48. data/platform/android/Rhodes/res/drawable/alert_info.png +0 -0
  49. data/platform/android/Rhodes/res/drawable/alert_question.png +0 -0
  50. data/platform/android/Rhodes/res/drawable/camera.png +0 -0
  51. data/platform/android/Rhodes/res/layout/camera.xml +18 -3
  52. data/platform/android/Rhodes/res/menu/options.xml +0 -10
  53. data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +5 -10
  54. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +12 -0
  55. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +105 -0
  56. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +157 -122
  57. data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +7 -58
  58. data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +16 -0
  59. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +220 -17
  60. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +22 -4
  61. data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +44 -25
  62. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +10 -0
  63. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +3 -0
  64. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +10 -21
  65. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +15 -12
  66. data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java +44 -0
  67. data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java +47 -3
  68. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/MailUriHandler.java +13 -6
  69. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/TelUriHandler.java +11 -5
  70. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/UriHandler.java +1 -4
  71. data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/VideoUriHandler.java +61 -0
  72. data/platform/android/build/RhodesSRC_build.files +3 -0
  73. data/platform/android/build/android.rake +173 -60
  74. data/platform/android/build/androidcommon.rb +1 -2
  75. data/platform/android/build/librhocommon_build.files +5 -0
  76. data/platform/android/build/librhodes_build.files +2 -0
  77. data/platform/android/build/libruby_build.files +2 -1
  78. data/platform/bb/Hsqldb/Hsqldb.jdp +0 -3
  79. data/platform/bb/Hsqldb/src/com/rho/db/FileUtilBB.java +1 -1
  80. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +16 -1
  81. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBRowResult.java +5 -0
  82. data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +25 -4
  83. data/platform/bb/Hsqldb/src/com/rho/db/Journal.java +1 -1
  84. data/platform/bb/Hsqldb/src/com/rho/file/FileAccessBB.java +0 -1
  85. data/platform/bb/Hsqldb/src/j2me/math/Number.java +6 -3
  86. data/platform/bb/Hsqldb/src/org/hsqldb/CompiledStatementExecutor.java +2 -1
  87. data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +1 -0
  88. data/platform/bb/Hsqldb/src/org/hsqldb/Parser.java +1 -0
  89. data/platform/bb/Hsqldb/src/org/hsqldb/Result.java +2 -0
  90. data/platform/bb/Hsqldb/src/org/hsqldb/Select.java +12 -6
  91. data/platform/bb/Hsqldb/src/org/hsqldb/Session.java +19 -12
  92. data/platform/bb/Hsqldb/src/org/hsqldb/Table.java +10 -4
  93. data/platform/bb/Hsqldb/src/org/hsqldb/Token.java +10 -2
  94. data/platform/bb/Hsqldb/src/org/hsqldb/Tokenizer.java +3 -3
  95. data/platform/bb/Hsqldb/src/org/hsqldb/lib/java/JavaSystem.java +1 -1
  96. data/platform/bb/Hsqldb/src/org/hsqldb/persist/HsqlProperties.java +2 -1
  97. data/platform/bb/Hsqldb/src/org/hsqldb/persist/ScaledRAFile.java +1 -1
  98. data/platform/bb/Hsqldb/src/org/hsqldb/scriptio/ScriptReaderText.java +1 -1
  99. data/platform/bb/Hsqldb/src/org/hsqldb/scriptio/ScriptWriterBase.java +1 -1
  100. data/platform/bb/RubyVM/RubyVM.jdp +9 -10
  101. data/platform/bb/build/RubyVM_build.files +9 -7
  102. data/platform/bb/build/bb.rake +13 -3
  103. data/platform/bb/build/hsqldb_build.files +0 -2
  104. data/platform/bb/build/rhodes_build.files +5 -2
  105. data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +8 -0
  106. data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +154 -0
  107. data/platform/bb/rhodes/platform/5.0/com/rho/RhoMainScreen.java +8 -0
  108. data/platform/bb/rhodes/platform/common/com/rho/BrowserAdapter5.java +28 -0
  109. data/platform/bb/rhodes/rhodes.jdp +12 -7
  110. data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +331 -0
  111. data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +28 -0
  112. data/platform/bb/rhodes/src/com/rho/IBrowserAdapter.java +10 -0
  113. data/platform/bb/rhodes/src/com/rho/RhoMainScreen.java +4 -0
  114. data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +2 -4
  115. data/platform/bb/rhodes/src/com/rho/{Jsr75File.java → file/Jsr75File.java} +83 -36
  116. data/platform/bb/{Hsqldb → rhodes}/src/com/rho/file/Jsr75RAFileImpl.java +0 -1
  117. data/platform/bb/{Hsqldb → rhodes}/src/com/rho/file/PersistRAFileImpl.java +0 -2
  118. data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +8 -10
  119. data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +1 -1
  120. data/platform/bb/rhodes/src/com/rho/rubyext/GeoLocation.java +39 -0
  121. data/platform/bb/rhodes/src/com/rho/rubyext/System.java +63 -2
  122. data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +100 -0
  123. data/platform/bb/rhodes/src/rhomobile/LogScreen.java +1 -1
  124. data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +13 -1
  125. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +138 -492
  126. data/platform/bb/rhodes/src/rhomobile/SecondaryResourceFetchThread.java +11 -2
  127. data/platform/bb/rhodes/src/rhomobile/Utilities.java +14 -10
  128. data/platform/bb/rhodes/src/rhomobile/camera/CameraScreen.java +5 -14
  129. data/platform/bb/rhodes/src/rhomobile/camera/ImageBrowserScreen.java +1 -1
  130. data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +2 -2
  131. data/platform/iphone/Classes/AppManager/AppManager.m +37 -14
  132. data/platform/iphone/Classes/Camera/PickImageDelegate.h +15 -4
  133. data/platform/iphone/Classes/Camera/PickImageDelegate.m +53 -50
  134. data/platform/iphone/Classes/DateTimePicker.h +17 -0
  135. data/platform/iphone/Classes/DateTimePicker.m +35 -0
  136. data/platform/iphone/Classes/GeoLocation/LocationController.m +2 -3
  137. data/platform/iphone/Classes/LogOptionsController.m +3 -2
  138. data/platform/iphone/Classes/LogViewController.m +4 -2
  139. data/platform/iphone/Classes/MapView/GoogleGeocoder.m +12 -20
  140. data/platform/iphone/Classes/MapView/MapAnnotation.h +9 -13
  141. data/platform/iphone/Classes/MapView/MapAnnotation.m +17 -65
  142. data/platform/iphone/Classes/MapView/MapViewController.h +1 -7
  143. data/platform/iphone/Classes/MapView/MapViewController.m +51 -25
  144. data/platform/iphone/Classes/NativeBar.h +0 -12
  145. data/platform/iphone/Classes/NativeBar.m +121 -2
  146. data/platform/iphone/Classes/NavBar.h +16 -0
  147. data/platform/iphone/Classes/NavBar.m +115 -0
  148. data/platform/iphone/Classes/RhoAlert.h +19 -0
  149. data/platform/iphone/Classes/RhoAlert.m +258 -0
  150. data/platform/iphone/Classes/RhoDelegate.m +1 -0
  151. data/platform/iphone/Classes/RhoMainView.h +33 -0
  152. data/platform/iphone/Classes/Rhodes.h +56 -0
  153. data/platform/iphone/Classes/Rhodes.m +533 -0
  154. data/platform/iphone/Classes/RingtoneManager.h +17 -0
  155. data/platform/iphone/Classes/RingtoneManager.m +73 -0
  156. data/platform/iphone/Classes/SimpleMainView.h +30 -0
  157. data/platform/iphone/Classes/SimpleMainView.m +380 -0
  158. data/platform/iphone/Classes/TabbedMainView.h +24 -0
  159. data/platform/iphone/Classes/TabbedMainView.m +202 -0
  160. data/platform/iphone/Classes/WebView.m +123 -0
  161. data/platform/iphone/Classes/rho/net/NetRequestImpl.m +2 -2
  162. data/platform/iphone/Classes/rho/net/sslimpl.cpp +13 -1
  163. data/platform/iphone/Classes/rho/net/sslimpl.h +1 -1
  164. data/platform/iphone/Info.plist +1 -1
  165. data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +44 -0
  166. data/platform/iphone/main.m +1 -2
  167. data/platform/iphone/rbuild/iphone.rake +8 -16
  168. data/platform/iphone/rhoextlib/dosyscall.c +1 -1
  169. data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +6 -4
  170. data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +12 -0
  171. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +97 -62
  172. data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +12 -0
  173. data/platform/osx/Rhodes Launcher/launch.rb +14 -21
  174. data/platform/shared/common/AppMenu.cpp +122 -0
  175. data/platform/shared/common/AppMenu.h +46 -0
  176. data/platform/shared/common/PosixThreadImpl.cpp +1 -1
  177. data/platform/shared/common/RhoConf.cpp +27 -2
  178. data/platform/shared/common/RhoConf.h +5 -0
  179. data/platform/shared/common/RhoFilePath.h +21 -0
  180. data/platform/shared/common/RhoStd.h +44 -5
  181. data/platform/shared/common/RhoTime.h +20 -7
  182. data/platform/shared/common/RhodesApp.cpp +236 -177
  183. data/platform/shared/common/RhodesApp.h +36 -13
  184. data/platform/shared/common/SplashScreen.cpp +2 -2
  185. data/platform/shared/common/StringConverter.h +10 -11
  186. data/platform/shared/common/rhoparams.c +0 -6
  187. data/platform/shared/curl/lib/rhossl.c +3 -2
  188. data/platform/shared/curl/lib/url.c +0 -5
  189. data/platform/shared/db/DBAdapter.cpp +304 -81
  190. data/platform/shared/db/DBAdapter.h +24 -7
  191. data/platform/shared/db/DBAttrManager.cpp +83 -30
  192. data/platform/shared/db/DBAttrManager.h +6 -0
  193. data/platform/shared/db/DBResult.h +15 -4
  194. data/platform/shared/json/JSONIterator.cpp +100 -3
  195. data/platform/shared/json/JSONIterator.h +28 -3
  196. data/platform/shared/net/AsyncHttp.cpp +25 -22
  197. data/platform/shared/net/AsyncHttp.h +10 -6
  198. data/platform/shared/net/CURLNetRequest.cpp +115 -36
  199. data/platform/shared/net/CURLNetRequest.h +6 -0
  200. data/platform/shared/net/HttpServer.cpp +6 -4
  201. data/platform/shared/net/HttpServer.h +0 -1
  202. data/platform/shared/net/INetRequest.h +19 -3
  203. data/platform/shared/net/URI.cpp +2 -2
  204. data/platform/shared/net/ssl.cpp +2 -2
  205. data/platform/shared/net/ssl.h +2 -2
  206. data/platform/shared/ruby/ext/alert/alert.i +14 -2
  207. data/platform/shared/ruby/ext/alert/alert_wrap.c +40 -20
  208. data/platform/shared/ruby/ext/asynchttp/asynchttp.i +8 -8
  209. data/platform/shared/ruby/ext/asynchttp/asynchttp_wrap.c +112 -16
  210. data/platform/shared/ruby/ext/geolocation/geolocation.i +16 -12
  211. data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +481 -125
  212. data/platform/shared/ruby/ext/navbar/navbar.i +20 -0
  213. data/platform/shared/ruby/ext/navbar/navbar_wrap.c +1859 -0
  214. data/platform/shared/ruby/ext/rho/extensions.c +1 -1
  215. data/platform/shared/ruby/ext/rho/rhoruby.c +32 -2
  216. data/platform/shared/ruby/ext/rho/rhoruby.h +7 -2
  217. data/platform/shared/ruby/ext/rhoconf/rhoconf.i +4 -0
  218. data/platform/shared/ruby/ext/rhoconf/rhoconf_wrap.c +31 -0
  219. data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +188 -3226
  220. data/platform/shared/ruby/ext/syncengine/syncengine.i +14 -25
  221. data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +96 -104
  222. data/platform/shared/ruby/ext/system/system.i +12 -0
  223. data/platform/shared/ruby/ext/system/system_wrap.c +101 -7
  224. data/platform/shared/ruby/ext/webview/webview.i +20 -15
  225. data/platform/shared/ruby/ext/webview/webview_wrap.c +42 -16
  226. data/platform/shared/ruby/thread_pthread.c +4 -4
  227. data/platform/shared/ruby/thread_win32.c +4 -4
  228. data/platform/shared/ruby/wince/io_wce.c +0 -1
  229. data/platform/shared/rubyJVM/src/com/rho/FilePath.java +18 -2
  230. data/platform/shared/rubyJVM/src/com/rho/IRhoRubyHelper.java +1 -0
  231. data/platform/shared/rubyJVM/src/com/rho/Properties.java +9 -0
  232. data/platform/shared/rubyJVM/src/com/rho/RhoClassFactory.java +2 -3
  233. data/platform/shared/rubyJVM/src/com/rho/RhoConf.java +47 -8
  234. data/platform/shared/rubyJVM/src/com/rho/RhoLogConf.java +1 -0
  235. data/platform/shared/rubyJVM/src/com/rho/RhoLogFileSink.java +1 -0
  236. data/platform/shared/rubyJVM/src/com/rho/RhoRuby.java +43 -5
  237. data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +98 -3
  238. data/platform/shared/rubyJVM/src/com/rho/db/DBAdapter.java +460 -175
  239. data/platform/shared/rubyJVM/src/com/rho/db/DBAttrManager.java +81 -33
  240. data/platform/shared/rubyJVM/src/com/rho/db/IDBCallback.java +3 -5
  241. data/platform/shared/rubyJVM/src/com/rho/db/IDBResult.java +2 -0
  242. data/platform/shared/rubyJVM/src/com/rho/db/IDBStorage.java +2 -0
  243. data/platform/shared/rubyJVM/src/com/rho/{IFile.java → file/IFile.java} +1 -1
  244. data/platform/shared/rubyJVM/src/com/rho/{IFileAccess.java → file/IFileAccess.java} +1 -1
  245. data/platform/shared/rubyJVM/src/com/rho/{IRAFile.java → file/IRAFile.java} +1 -1
  246. data/platform/{bb/Hsqldb/src/com/rho/db → shared/rubyJVM/src/com/rho/file}/RandomAccessFile.java +1 -2
  247. data/platform/shared/rubyJVM/src/com/rho/{SimpleFile.java → file/SimpleFile.java} +5 -1
  248. data/platform/shared/rubyJVM/src/com/rho/net/AsyncHttp.java +23 -18
  249. data/platform/shared/rubyJVM/src/com/rho/net/NetRequest.java +167 -250
  250. data/platform/shared/rubyJVM/src/com/rho/net/RhoConnection.java +100 -30
  251. data/platform/shared/rubyJVM/src/com/rho/net/URI.java +0 -1
  252. data/platform/shared/rubyJVM/src/com/rho/sync/ClientRegister.java +30 -33
  253. data/platform/shared/rubyJVM/src/com/rho/sync/ISyncProtocol.java +20 -0
  254. data/platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java +5 -0
  255. data/platform/shared/rubyJVM/src/com/rho/sync/JSONStructIterator.java +74 -0
  256. data/platform/shared/rubyJVM/src/com/rho/sync/SyncEngine.java +486 -257
  257. data/platform/shared/rubyJVM/src/com/rho/sync/SyncNotify.java +89 -58
  258. data/platform/shared/rubyJVM/src/com/rho/sync/SyncProtocol_3.java +79 -0
  259. data/platform/shared/rubyJVM/src/com/rho/sync/SyncSource.java +634 -495
  260. data/platform/shared/rubyJVM/src/com/rho/sync/SyncThread.java +74 -90
  261. data/platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubySymbol_Methods.java +1 -0
  262. data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyThread.java +6 -0
  263. data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyRuntime.java +6 -2
  264. data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubySymbol.java +17 -1
  265. data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyValue.java +1 -0
  266. data/platform/shared/rubyJVM/src/org/json/me/JSONObject.java +3 -0
  267. data/platform/shared/rubyext/GeoLocation.cpp +23 -0
  268. data/platform/shared/rubyext/GeoLocation.h +2 -0
  269. data/platform/shared/rubyext/RhoRuby.cpp +31 -0
  270. data/platform/shared/rubyext/RhoRuby.h +32 -0
  271. data/platform/shared/rubyext/System.cpp +14 -3
  272. data/platform/shared/rubyext/WebView.h +21 -0
  273. data/platform/shared/sync/ClientRegister.cpp +23 -28
  274. data/platform/shared/sync/ClientRegister.h +6 -2
  275. data/platform/shared/sync/ISyncProtocol.h +29 -0
  276. data/platform/shared/sync/SyncEngine.cpp +450 -190
  277. data/platform/shared/sync/SyncEngine.h +28 -38
  278. data/platform/shared/sync/SyncNotify.cpp +43 -41
  279. data/platform/shared/sync/SyncNotify.h +7 -7
  280. data/platform/shared/sync/SyncProtocol_3.h +86 -0
  281. data/platform/shared/sync/SyncSource.cpp +535 -371
  282. data/platform/shared/sync/SyncSource.h +48 -55
  283. data/platform/shared/sync/SyncThread.cpp +59 -103
  284. data/platform/shared/sync/SyncThread.h +10 -23
  285. data/platform/shared/unzip/unzip.cpp +3 -2
  286. data/platform/shared/unzip/unzip.h +5 -1
  287. data/platform/shared/wtl80/include/atlapp.h +10 -10
  288. data/platform/wm/RhoLib/RhoLib.vcproj +32 -0
  289. data/platform/wm/build/build_inf.js +40 -3
  290. data/platform/wm/build/wm.rake +95 -9
  291. data/platform/wm/rhodes/Alert.cpp +4 -0
  292. data/platform/wm/rhodes/DateTimePicker.cpp +183 -0
  293. data/platform/wm/rhodes/DateTimePicker.h +100 -0
  294. data/platform/wm/rhodes/MainWindow.cpp +222 -209
  295. data/platform/wm/rhodes/MainWindow.h +28 -35
  296. data/platform/wm/rhodes/Rhodes.cpp +20 -60
  297. data/platform/wm/rhodes/Rhodes.rc +41 -7
  298. data/platform/wm/rhodes/Utils.cpp +65 -0
  299. data/platform/wm/rhodes/Utils.h +9 -0
  300. data/platform/wm/rhodes/camera/Camera.cpp +2 -2
  301. data/platform/wm/rhodes/menubar.cpp +2 -33
  302. data/platform/wm/rhodes/menubar.h +0 -14
  303. data/platform/wm/rhodes/resource.h +13 -11
  304. data/platform/wm/rhodes/rho/net/NetRequest.cpp +16 -35
  305. data/platform/wm/rhodes/rho/net/NetRequest.h +8 -2
  306. data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +264 -46
  307. data/platform/wm/rhodes/rho/net/NetRequestImpl.h +14 -4
  308. data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.cpp +1 -1
  309. data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.h +1 -1
  310. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +77 -4
  311. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +63 -0
  312. data/platform/wm/rhodes/rhodes.vcproj +20 -66
  313. data/platform/wm/rhodes/stdafx.h +22 -0
  314. data/platform/wm/rubylib/rubylib.vcproj +4 -0
  315. data/platform/wm/syncengine/syncengine.vcproj +8 -0
  316. data/platform/wm/tools/detool.sln +66 -0
  317. data/platform/wm/tools/detool/DEMComInterface.tlb +0 -0
  318. data/platform/wm/tools/detool/ReadMe.txt +33 -0
  319. data/platform/wm/tools/detool/detool.cpp +559 -0
  320. data/platform/wm/tools/detool/detool.h +5 -0
  321. data/platform/wm/tools/detool/detool.vcproj +233 -0
  322. data/platform/wm/tools/detool/stdafx.cpp +8 -0
  323. data/platform/wm/tools/detool/stdafx.h +15 -0
  324. data/platform/wm/tools/detool/targetver.h +24 -0
  325. data/platform/wm/tools/rhosetup/ReadMe.txt +41 -0
  326. data/platform/wm/tools/rhosetup/rhosetup.cpp +52 -0
  327. data/platform/wm/tools/rhosetup/rhosetup.vcproj +641 -0
  328. data/platform/wm/tools/rhosetup/stdafx.cpp +8 -0
  329. data/platform/wm/tools/rhosetup/stdafx.h +59 -0
  330. data/rakefile.rb +33 -10
  331. data/res/build-tools/db/syncdb.schema +25 -23
  332. data/res/build-tools/db/syncdb.triggers +1 -1
  333. data/res/build-tools/detool.exe +0 -0
  334. data/res/build-tools/rhosetup.dll +0 -0
  335. data/res/generators/rhogen.rb +27 -22
  336. data/res/generators/templates/application/app/Settings/controller.rb +3 -1
  337. data/res/generators/templates/application/app/Settings/home.bb.erb +17 -0
  338. data/res/generators/templates/application/app/Settings/home.erb +21 -12
  339. data/res/generators/templates/application/app/Settings/index.bb.erb +32 -0
  340. data/res/generators/templates/application/app/Settings/index.erb +44 -15
  341. data/res/generators/templates/application/app/Settings/login.bb.erb +35 -0
  342. data/res/generators/templates/application/app/Settings/login.erb +29 -30
  343. data/res/generators/templates/application/app/Settings/reset.bb.erb +15 -0
  344. data/res/generators/templates/application/app/Settings/reset.erb +16 -13
  345. data/res/generators/templates/application/app/Settings/wait.bb.erb +3 -0
  346. data/res/generators/templates/application/app/Settings/wait.erb +4 -4
  347. data/res/generators/templates/application/app/application.rb +8 -0
  348. data/res/generators/templates/application/app/helpers/browser_helper.rb +13 -0
  349. data/res/generators/templates/application/app/index.bb.erb +26 -0
  350. data/res/generators/templates/application/app/index.erb +21 -12
  351. data/res/generators/templates/application/app/layout.erb +9 -11
  352. data/res/generators/templates/application/public/css/android.css +285 -0
  353. data/res/generators/templates/application/public/css/blackberry.css +85 -78
  354. data/res/generators/templates/application/public/css/iphone.css +286 -296
  355. data/res/generators/templates/application/public/css/webkit.css +34 -0
  356. data/res/generators/templates/application/public/css/windows_mobile.css +208 -0
  357. data/res/generators/templates/application/public/icons/Read me first - license.txt +14 -0
  358. data/res/generators/templates/application/public/icons/about.png +0 -0
  359. data/res/generators/templates/application/public/icons/airplane.png +0 -0
  360. data/res/generators/templates/application/public/icons/baby.png +0 -0
  361. data/res/generators/templates/application/public/icons/badge.png +0 -0
  362. data/res/generators/templates/application/public/icons/bandaid.png +0 -0
  363. data/res/generators/templates/application/public/icons/bar-chart.png +0 -0
  364. data/res/generators/templates/application/public/icons/battery.png +0 -0
  365. data/res/generators/templates/application/public/icons/beaker.png +0 -0
  366. data/res/generators/templates/application/public/icons/beaker2.png +0 -0
  367. data/res/generators/templates/application/public/icons/beermug.png +0 -0
  368. data/res/generators/templates/application/public/icons/bird.png +0 -0
  369. data/res/generators/templates/application/public/icons/book.png +0 -0
  370. data/res/generators/templates/application/public/icons/bookmark.png +0 -0
  371. data/res/generators/templates/application/public/icons/brightness.png +0 -0
  372. data/res/generators/templates/application/public/icons/bug.png +0 -0
  373. data/res/generators/templates/application/public/icons/cabinet.png +0 -0
  374. data/res/generators/templates/application/public/icons/calendar.png +0 -0
  375. data/res/generators/templates/application/public/icons/camera.png +0 -0
  376. data/res/generators/templates/application/public/icons/changeName.rb +22 -0
  377. data/res/generators/templates/application/public/icons/chat2.png +0 -0
  378. data/res/generators/templates/application/public/icons/chicken.png +0 -0
  379. data/res/generators/templates/application/public/icons/clock.png +0 -0
  380. data/res/generators/templates/application/public/icons/cloud.png +0 -0
  381. data/res/generators/templates/application/public/icons/coffee.png +0 -0
  382. data/res/generators/templates/application/public/icons/compass.png +0 -0
  383. data/res/generators/templates/application/public/icons/contrast.png +0 -0
  384. data/res/generators/templates/application/public/icons/dashboard.png +0 -0
  385. data/res/generators/templates/application/public/icons/display.png +0 -0
  386. data/res/generators/templates/application/public/icons/dogpaw.png +0 -0
  387. data/res/generators/templates/application/public/icons/download.png +0 -0
  388. data/res/generators/templates/application/public/icons/dumbbell.png +0 -0
  389. data/res/generators/templates/application/public/icons/ekg.png +0 -0
  390. data/res/generators/templates/application/public/icons/envelope.png +0 -0
  391. data/res/generators/templates/application/public/icons/equalizer.png +0 -0
  392. data/res/generators/templates/application/public/icons/eye.png +0 -0
  393. data/res/generators/templates/application/public/icons/film-roll.png +0 -0
  394. data/res/generators/templates/application/public/icons/flag.png +0 -0
  395. data/res/generators/templates/application/public/icons/fork-and-knife.png +0 -0
  396. data/res/generators/templates/application/public/icons/fuel.png +0 -0
  397. data/res/generators/templates/application/public/icons/gameplan.png +0 -0
  398. data/res/generators/templates/application/public/icons/gear.png +0 -0
  399. data/res/generators/templates/application/public/icons/gear2.png +0 -0
  400. data/res/generators/templates/application/public/icons/gift.png +0 -0
  401. data/res/generators/templates/application/public/icons/heart.png +0 -0
  402. data/res/generators/templates/application/public/icons/house.png +0 -0
  403. data/res/generators/templates/application/public/icons/inbox.png +0 -0
  404. data/res/generators/templates/application/public/icons/index-cards.png +0 -0
  405. data/res/generators/templates/application/public/icons/iphone.png +0 -0
  406. data/res/generators/templates/application/public/icons/ipod.png +0 -0
  407. data/res/generators/templates/application/public/icons/key.png +0 -0
  408. data/res/generators/templates/application/public/icons/lifebuoy.png +0 -0
  409. data/res/generators/templates/application/public/icons/lightbulb.png +0 -0
  410. data/res/generators/templates/application/public/icons/line-chart.png +0 -0
  411. data/res/generators/templates/application/public/icons/location.png +0 -0
  412. data/res/generators/templates/application/public/icons/lock.png +0 -0
  413. data/res/generators/templates/application/public/icons/loopback.png +0 -0
  414. data/res/generators/templates/application/public/icons/magnifying-glass.png +0 -0
  415. data/res/generators/templates/application/public/icons/map-marker.png +0 -0
  416. data/res/generators/templates/application/public/icons/map.png +0 -0
  417. data/res/generators/templates/application/public/icons/medical-bag.png +0 -0
  418. data/res/generators/templates/application/public/icons/medical.png +0 -0
  419. data/res/generators/templates/application/public/icons/microphone.png +0 -0
  420. data/res/generators/templates/application/public/icons/movie1.png +0 -0
  421. data/res/generators/templates/application/public/icons/movie2.png +0 -0
  422. data/res/generators/templates/application/public/icons/network.png +0 -0
  423. data/res/generators/templates/application/public/icons/note.png +0 -0
  424. data/res/generators/templates/application/public/icons/outlet.png +0 -0
  425. data/res/generators/templates/application/public/icons/palette.png +0 -0
  426. data/res/generators/templates/application/public/icons/paperclip.png +0 -0
  427. data/res/generators/templates/application/public/icons/phone.png +0 -0
  428. data/res/generators/templates/application/public/icons/photos.png +0 -0
  429. data/res/generators/templates/application/public/icons/piano.png +0 -0
  430. data/res/generators/templates/application/public/icons/picture-frame.png +0 -0
  431. data/res/generators/templates/application/public/icons/pill.png +0 -0
  432. data/res/generators/templates/application/public/icons/pin.png +0 -0
  433. data/res/generators/templates/application/public/icons/pinetree.png +0 -0
  434. data/res/generators/templates/application/public/icons/planet.png +0 -0
  435. data/res/generators/templates/application/public/icons/puzzle.png +0 -0
  436. data/res/generators/templates/application/public/icons/radar.png +0 -0
  437. data/res/generators/templates/application/public/icons/redo.png +0 -0
  438. data/res/generators/templates/application/public/icons/refresh.png +0 -0
  439. data/res/generators/templates/application/public/icons/runner.png +0 -0
  440. data/res/generators/templates/application/public/icons/shoebox.png +0 -0
  441. data/res/generators/templates/application/public/icons/shopping-bag.png +0 -0
  442. data/res/generators/templates/application/public/icons/shopping-cart.png +0 -0
  443. data/res/generators/templates/application/public/icons/shuffle.png +0 -0
  444. data/res/generators/templates/application/public/icons/signpost.png +0 -0
  445. data/res/generators/templates/application/public/icons/skull-n-crossbones.png +0 -0
  446. data/res/generators/templates/application/public/icons/skull.png +0 -0
  447. data/res/generators/templates/application/public/icons/sliders.png +0 -0
  448. data/res/generators/templates/application/public/icons/spraycan.png +0 -0
  449. data/res/generators/templates/application/public/icons/squiggle.png +0 -0
  450. data/res/generators/templates/application/public/icons/star.png +0 -0
  451. data/res/generators/templates/application/public/icons/stopwatch.png +0 -0
  452. data/res/generators/templates/application/public/icons/suitcase.png +0 -0
  453. data/res/generators/templates/application/public/icons/tag.png +0 -0
  454. data/res/generators/templates/application/public/icons/tags.png +0 -0
  455. data/res/generators/templates/application/public/icons/target.png +0 -0
  456. data/res/generators/templates/application/public/icons/testtube.png +0 -0
  457. data/res/generators/templates/application/public/icons/thermometer.png +0 -0
  458. data/res/generators/templates/application/public/icons/toolbox.png +0 -0
  459. data/res/generators/templates/application/public/icons/trophy.png +0 -0
  460. data/res/generators/templates/application/public/icons/tshirt.png +0 -0
  461. data/res/generators/templates/application/public/icons/tv.png +0 -0
  462. data/res/generators/templates/application/public/icons/umbrella.png +0 -0
  463. data/res/generators/templates/application/public/icons/walk.png +0 -0
  464. data/res/generators/templates/application/public/icons/weather.png +0 -0
  465. data/res/generators/templates/application/public/icons/widescreen.png +0 -0
  466. data/res/generators/templates/application/public/icons/wineglass.png +0 -0
  467. data/res/generators/templates/application/public/icons/zap.png +0 -0
  468. data/res/generators/templates/application/public/images/android/btn_check_off.png +0 -0
  469. data/res/generators/templates/application/public/images/android/btn_check_on.png +0 -0
  470. data/res/generators/templates/application/public/images/android/btn_radio_off.png +0 -0
  471. data/res/generators/templates/application/public/images/android/btn_radio_on.png +0 -0
  472. data/res/generators/templates/application/public/images/android/ic_menu_more.png +0 -0
  473. data/res/generators/templates/application/public/images/iphone/disclosure.png +0 -0
  474. data/res/generators/templates/application/public/images/iphone/disclosure_detail.png +0 -0
  475. data/res/generators/templates/application/public/images/iphone/radiobutton.png +0 -0
  476. data/res/generators/templates/application/public/images/iphone/select.png +0 -0
  477. data/res/generators/templates/application/public/images/iphone/switch.png +0 -0
  478. data/res/generators/templates/application/public/images/listArrow.png +0 -0
  479. data/res/generators/templates/application/public/images/listArrowDown.png +0 -0
  480. data/res/generators/templates/model/controller.rb +2 -0
  481. data/res/generators/templates/model/edit.bb.erb +24 -0
  482. data/res/generators/templates/model/edit.erb +21 -25
  483. data/res/generators/templates/model/index.bb.erb +21 -0
  484. data/res/generators/templates/model/index.erb +28 -14
  485. data/res/generators/templates/model/new.bb.erb +24 -0
  486. data/res/generators/templates/model/new.erb +20 -20
  487. data/res/generators/templates/model/show.bb.erb +21 -0
  488. data/res/generators/templates/model/show.erb +15 -15
  489. data/rhobuild.yml +37 -0
  490. data/rhodes.gemspec +1 -1
  491. data/spec/framework_spec/app/Account/config.rb +57 -1
  492. data/spec/framework_spec/app/Case/config.rb +1 -1
  493. data/spec/framework_spec/app/Customer/config.rb +1 -1
  494. data/spec/framework_spec/app/Product/config.rb +15 -1
  495. data/spec/framework_spec/app/spec/fixtures/object_values.txt +90 -90
  496. data/spec/framework_spec/app/spec/pagination/fixtures/object_values.txt +91 -91
  497. data/spec/framework_spec/app/spec/rho_spec.rb +1 -1
  498. data/spec/framework_spec/app/spec/rhom_object_spec.rb +47 -28
  499. data/spec/framework_spec/app/spec/rhom_spec.rb +8 -8
  500. data/spec/framework_spec/app/spec/spec_helper.rb +13 -5
  501. data/spec/framework_spec/app/spec_runner.rb +5 -4
  502. data/spec/framework_spec/public/css/base.css +0 -1
  503. data/spec/framework_spec/public/css/iphone.css +0 -1
  504. data/spec/framework_spec/rhoconfig.txt +3 -1
  505. metadata +220 -37
  506. data/platform/bb/rhodes/src/rhomobile/WebView.java +0 -90
  507. data/platform/iphone/Classes/BarItem.h +0 -27
  508. data/platform/iphone/Classes/BarItem.m +0 -32
  509. data/platform/iphone/Classes/JSString.h +0 -12
  510. data/platform/iphone/Classes/JSString.m +0 -7
  511. data/platform/iphone/Classes/RhoRunnerAppDelegate.h +0 -48
  512. data/platform/iphone/Classes/RhoRunnerAppDelegate.m +0 -617
  513. data/platform/iphone/Classes/Server/ServerHost.h +0 -81
  514. data/platform/iphone/Classes/Server/ServerHost.m +0 -597
  515. data/platform/iphone/Classes/Server/WebViewUrl.h +0 -13
  516. data/platform/iphone/Classes/Server/WebViewUrl.m +0 -8
  517. data/platform/iphone/Classes/TabBarDelegate.h +0 -39
  518. data/platform/iphone/Classes/TabBarDelegate.m +0 -151
  519. data/platform/iphone/Classes/Utils/unzip.cpp +0 -4328
  520. data/platform/iphone/Classes/Utils/unzip.h +0 -234
  521. data/platform/iphone/Classes/WebViewController.h +0 -59
  522. data/platform/iphone/Classes/WebViewController.m +0 -472
  523. data/platform/wm/rhodes/GetURLDialog.cpp +0 -64
  524. data/platform/wm/rhodes/GetURLDialog.h +0 -39
  525. data/res/generators/templates/application/public/css/base.css +0 -39
  526. data/res/generators/templates/application/public/css/rho.css +0 -3
  527. data/res/generators/templates/application/public/css/xhtml.css +0 -114
  528. data/spec/framework_spec/app/Question/config.rb +0 -3
  529. data/spec/generator_spec/source_generator_spec.rb +0 -27
@@ -1,4 +1,4 @@
1
1
  // WARNING! THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT IT MANUALLY!
2
- // Generated Fri Feb 26 17:54:10 +0300 2010
2
+ // Generated Thu Mar 25 14:18:38 +0300 2010
3
3
  void Init_Extensions(void) {
4
4
  }
@@ -40,6 +40,7 @@ extern void Init_MapView(void);
40
40
  extern void Init_RingtoneManager(void);
41
41
  extern void Init_socket(void);
42
42
  extern void Init_AsyncHttp(void);
43
+ extern void Init_NavBar(void);
43
44
  extern void Init_Extensions(void);
44
45
 
45
46
  //RhoSupport extension
@@ -54,6 +55,7 @@ static ID framework_mid;
54
55
  static ID framework_mid2;
55
56
  static ID initApp_mid;
56
57
  static ID activateApp_mid;
58
+ static ID loadServerSources_mid;
57
59
 
58
60
  static char* rb_type_to_s(VALUE obj);
59
61
  //extern int ruby_thread_set_native(rb_thread_t *th);
@@ -161,6 +163,7 @@ void RhoRubyStart()
161
163
  Init_MapView();
162
164
  Init_RingtoneManager();
163
165
  Init_socket();
166
+ Init_NavBar();
164
167
  Init_Extensions();
165
168
 
166
169
  #ifdef ENABLE_RUBY_VM_STAT
@@ -188,6 +191,7 @@ void RhoRubyStart()
188
191
  CONST_ID(framework_mid2, "serve_index");
189
192
  CONST_ID(initApp_mid, "init_app");
190
193
  CONST_ID(activateApp_mid, "activate_app");
194
+ CONST_ID(loadServerSources_mid,"load_server_sources");
191
195
 
192
196
  //moduleRhom = rb_const_get(rb_cObject, rb_intern("Rhom"));
193
197
 
@@ -207,6 +211,11 @@ void rho_ruby_activateApp()
207
211
  rb_funcall(framework, activateApp_mid, 0);
208
212
  }
209
213
 
214
+ void rho_ruby_loadserversources(const char* szData)
215
+ {
216
+ rb_funcall(framework, loadServerSources_mid, 1, rb_str_new2(szData) );
217
+ }
218
+
210
219
  char* RhoRuby_getRhoDBVersion()
211
220
  {
212
221
  VALUE moduleRhodes = rb_const_get(rb_cObject, rb_intern("Rhodes"));
@@ -226,7 +235,7 @@ char* makeControllerCall(char* classname, char* methodname);
226
235
  struct CHashEnumData
227
236
  {
228
237
  void* data;
229
- rho_eachstr_func *func;
238
+ rho_hash_eachstr_func *func;
230
239
  };
231
240
 
232
241
  static int
@@ -250,7 +259,7 @@ hash_each(VALUE key, VALUE value, struct CHashEnumData* pEnumData)
250
259
  return ST_CONTINUE;
251
260
  }
252
261
 
253
- void rho_ruby_enum_strhash(VALUE hash, rho_eachstr_func * func, void* data)
262
+ void rho_ruby_enum_strhash(VALUE hash, rho_hash_eachstr_func * func, void* data)
254
263
  {
255
264
  struct CHashEnumData enumData;
256
265
 
@@ -263,6 +272,27 @@ void rho_ruby_enum_strhash(VALUE hash, rho_eachstr_func * func, void* data)
263
272
  rb_hash_foreach(hash, hash_each, (VALUE)(&enumData));
264
273
  }
265
274
 
275
+ void rho_ruby_enum_strary(VALUE ary, rho_ary_eachstr_func * func, void* data)
276
+ {
277
+ int i = 0;
278
+
279
+ if ( ary ==0 || ary == Qnil )
280
+ return;
281
+
282
+ for (i=0; i<RARRAY_LEN(ary); i++)
283
+ {
284
+ VALUE value = RARRAY_PTR(ary)[i];
285
+ const char* szValue = "";
286
+ if ( value != 0 && value != Qnil )
287
+ {
288
+ VALUE strVal = rb_funcall(value, rb_intern("to_s"), 0);
289
+ szValue = RSTRING_PTR(strVal);
290
+ }
291
+
292
+ (*func)(szValue, data );
293
+ }
294
+ }
295
+
266
296
  VALUE rho_ruby_get_NIL()
267
297
  {
268
298
  return Qnil;
@@ -36,6 +36,7 @@ void RhoRubyInitApp();
36
36
  //void RhoRubyThreadStart();
37
37
  //void RhoRubyThreadStop();
38
38
  void rho_ruby_activateApp();
39
+ void rho_ruby_loadserversources(const char* szData);
39
40
  void rho_ruby_start_threadidle();
40
41
  void rho_ruby_stop_threadidle();
41
42
 
@@ -70,8 +71,12 @@ void rho_ruby_add_to_array(VALUE ar, VALUE val);
70
71
 
71
72
  char* RhoRuby_getRhoDBVersion();
72
73
 
73
- typedef void rho_eachstr_func(const char*, const char*, void*);
74
- void rho_ruby_enum_strhash(VALUE hash, rho_eachstr_func *, void* data);
74
+ typedef void rho_hash_eachstr_func(const char*, const char*, void*);
75
+ void rho_ruby_enum_strhash(VALUE hash, rho_hash_eachstr_func *, void* data);
76
+
77
+ typedef void rho_ary_eachstr_func(const char*, void*);
78
+ void rho_ruby_enum_strary(VALUE ary, rho_ary_eachstr_func *, void* data);
79
+
75
80
  void rho_ruby_set_const(const char* szName, const char* szVal);
76
81
 
77
82
  struct CRhoRubyStringOrInt
@@ -9,9 +9,13 @@
9
9
 
10
10
  extern int rho_conf_send_log();
11
11
  #define send_log rho_conf_send_log
12
+
13
+ extern VALUE rho_conf_is_property_exists(char* name);
14
+ #define is_property_exists rho_conf_is_property_exists
12
15
 
13
16
  %}
14
17
 
15
18
  extern void set_property_by_name(char* name, char* value);
16
19
  extern void show_log();
17
20
  extern int send_log();
21
+ extern VALUE is_property_exists(char* name);
@@ -1553,6 +1553,9 @@ static VALUE mRhoConf;
1553
1553
 
1554
1554
  extern int rho_conf_send_log();
1555
1555
  #define send_log rho_conf_send_log
1556
+
1557
+ extern VALUE rho_conf_is_property_exists(char* name);
1558
+ #define is_property_exists rho_conf_is_property_exists
1556
1559
 
1557
1560
 
1558
1561
 
@@ -1694,6 +1697,33 @@ fail:
1694
1697
  }
1695
1698
 
1696
1699
 
1700
+ SWIGINTERN VALUE
1701
+ _wrap_is_property_exists(int argc, VALUE *argv, VALUE self) {
1702
+ char *arg1 = (char *) 0 ;
1703
+ VALUE result;
1704
+ int res1 ;
1705
+ char *buf1 = 0 ;
1706
+ int alloc1 = 0 ;
1707
+ VALUE vresult = Qnil;
1708
+
1709
+ if ((argc < 1) || (argc > 1)) {
1710
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
1711
+ }
1712
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1713
+ if (!SWIG_IsOK(res1)) {
1714
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "is_property_exists" "', argument " "1"" of type '" "char *""'");
1715
+ }
1716
+ arg1 = (char *)(buf1);
1717
+ result = (VALUE)is_property_exists(arg1);
1718
+ vresult = result;
1719
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1720
+ return vresult;
1721
+ fail:
1722
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
1723
+ return Qnil;
1724
+ }
1725
+
1726
+
1697
1727
 
1698
1728
  /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
1699
1729
 
@@ -1959,5 +1989,6 @@ SWIGEXPORT void Init_RhoConf(void) {
1959
1989
  rb_define_module_function(mRhoConf, "set_property_by_name", _wrap_set_property_by_name, -1);
1960
1990
  rb_define_module_function(mRhoConf, "show_log", _wrap_show_log, -1);
1961
1991
  rb_define_module_function(mRhoConf, "send_log", _wrap_send_log, -1);
1992
+ rb_define_module_function(mRhoConf, "is_property_exists", _wrap_is_property_exists, -1);
1962
1993
  }
1963
1994
 
@@ -8,34 +8,41 @@
8
8
  static VALUE mSqlite3;
9
9
  static VALUE mDatabase;
10
10
 
11
- extern int rho_sync_openDB(const char* szDBPath);
12
- extern int rho_sync_closeDB();
13
- extern int rho_db_startUITransaction();
14
- extern int rho_db_commitUITransaction();
15
- extern int rho_db_rollbackUITransaction();
16
- extern int rho_db_destroy_table(const char* szTableName);
17
- extern int rho_db_is_ui_waitfordb();
18
- extern void* rho_db_get_handle();
11
+ extern int rho_db_open(const char* szDBPath, const char* szDBPartition, void** ppDB);
12
+ //extern int rho_sync_closeDB();
13
+ extern int rho_db_startTransaction(void* pDB);
14
+ extern int rho_db_commitTransaction(void* pDB);
15
+ extern int rho_db_rollbackTransaction(void* pDB);
16
+ extern int rho_db_destroy_tables(void* pDB, unsigned long arInclude, unsigned long arExclude);
17
+ extern void* rho_db_get_handle(void* pDB);
18
+ extern int rho_db_is_ui_waitfordb(void* pDB);
19
+ extern int rho_db_prepare_statement(void* pDB, const char* szSql, int nByte, sqlite3_stmt **ppStmt);
20
+ extern void rho_db_lock(void* pDB);
21
+ extern void rho_db_unlock(void* pDB);
22
+ extern int rho_db_is_table_exist(void* pDB, const char* szTableName);
19
23
 
20
24
  static VALUE db_allocate(VALUE klass)
21
25
  {
22
26
  //sqlite3 **db = malloc(sizeof(sqlite3 **));
23
- return Data_Wrap_Struct(klass, 0, 0, 0);
27
+ void* pDB = malloc(sizeof(void*));
28
+ return Data_Wrap_Struct(klass, 0, 0, pDB);
24
29
  }
25
30
 
26
31
  static VALUE db_init(int argc, VALUE *argv, VALUE self)
27
32
  {
28
33
  const char *szDbName = NULL;
29
- sqlite3 **ppDB = NULL;
34
+ const char *szDbPartition = NULL;
35
+ void **ppDB = NULL;
30
36
  int result;
31
37
 
32
- if ((argc < 1) || (argc > 1))
33
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
38
+ if ((argc < 2) || (argc > 2))
39
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
34
40
 
35
- Data_Get_Struct(self, sqlite3 *, ppDB);
41
+ Data_Get_Struct(self, void *, ppDB);
36
42
  szDbName = STR2CSTR(argv[0]);
43
+ szDbPartition = STR2CSTR(argv[1]);
37
44
 
38
- result = (int)rho_sync_openDB(szDbName);//sqlite3_open(szDbName,ppDB);
45
+ result = (int)rho_db_open(szDbName, szDbPartition, ppDB);//sqlite3_open(szDbName,ppDB);
39
46
  if ( result != SQLITE_OK )
40
47
  rb_raise(rb_eArgError, "could open database:%d",result);
41
48
 
@@ -44,13 +51,13 @@ static VALUE db_init(int argc, VALUE *argv, VALUE self)
44
51
 
45
52
  static VALUE db_close(int argc, VALUE *argv, VALUE self){
46
53
  //sqlite3 * db = NULL;
47
- sqlite3 **ppDB = NULL;
54
+ void **ppDB = NULL;
48
55
  int rc = 0;
49
56
 
50
57
  if (argc > 0)
51
58
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
52
59
 
53
- Data_Get_Struct(self, sqlite3 *, ppDB);
60
+ Data_Get_Struct(self, void *, ppDB);
54
61
 
55
62
  //do not close sync db, close it at exit
56
63
  rc = 0;//rho_sync_closeDB();//sqlite3_close(db);
@@ -60,48 +67,79 @@ static VALUE db_close(int argc, VALUE *argv, VALUE self){
60
67
 
61
68
  static VALUE db_start_transaction(int argc, VALUE *argv, VALUE self){
62
69
  //sqlite3 * db = NULL;
63
- sqlite3 **ppDB = NULL;
70
+ void **ppDB = NULL;
64
71
  int rc = 0;
65
72
 
66
73
  if (argc > 0)
67
74
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
68
75
 
69
- Data_Get_Struct(self, sqlite3 *, ppDB);
76
+ Data_Get_Struct(self, void *, ppDB);
70
77
 
71
- rc = rho_db_startUITransaction();
78
+ rc = rho_db_startTransaction(*ppDB);
72
79
 
73
80
  return INT2NUM(rc);
74
81
  }
75
82
 
76
83
  static VALUE db_commit(int argc, VALUE *argv, VALUE self){
77
84
  //sqlite3 * db = NULL;
78
- sqlite3 **ppDB = NULL;
85
+ void **ppDB = NULL;
79
86
  int rc = 0;
80
87
 
81
88
  if (argc > 0)
82
89
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
83
90
 
84
- Data_Get_Struct(self, sqlite3 *, ppDB);
91
+ Data_Get_Struct(self, void *, ppDB);
85
92
 
86
- rc = rho_db_commitUITransaction();
93
+ rc = rho_db_commitTransaction(*ppDB);
87
94
 
88
95
  return INT2NUM(rc);
89
96
  }
90
97
 
91
98
  static VALUE db_rollback(int argc, VALUE *argv, VALUE self){
92
99
  //sqlite3 * db = NULL;
93
- sqlite3 **ppDB = NULL;
100
+ void **ppDB = NULL;
101
+ int rc = 0;
102
+
103
+ if (argc > 0)
104
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
105
+
106
+ Data_Get_Struct(self, void *, ppDB);
107
+
108
+ rc = rho_db_rollbackTransaction(*ppDB);
109
+
110
+ return INT2NUM(rc);
111
+ }
112
+ /*
113
+ static VALUE db_lock(int argc, VALUE *argv, VALUE self){
114
+ //sqlite3 * db = NULL;
115
+ void **ppDB = NULL;
116
+ int rc = 0;
117
+
118
+ if (argc > 0)
119
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
120
+
121
+ Data_Get_Struct(self, void *, ppDB);
122
+
123
+ rho_db_lock(*ppDB);
124
+
125
+ return INT2NUM(rc);
126
+ }
127
+
128
+ static VALUE db_unlock(int argc, VALUE *argv, VALUE self){
129
+ //sqlite3 * db = NULL;
130
+ void **ppDB = NULL;
94
131
  int rc = 0;
95
132
 
96
133
  if (argc > 0)
97
134
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
98
135
 
99
- Data_Get_Struct(self, sqlite3 *, ppDB);
136
+ Data_Get_Struct(self, void *, ppDB);
100
137
 
101
- rc = rho_db_rollbackUITransaction();
138
+ rho_db_unlock(*ppDB);
102
139
 
103
140
  return INT2NUM(rc);
104
141
  }
142
+ */
105
143
 
106
144
  static VALUE* getColNames(sqlite3_stmt* statement, int nCount)
107
145
  {
@@ -117,35 +155,49 @@ static VALUE* getColNames(sqlite3_stmt* statement, int nCount)
117
155
  return res;
118
156
  }
119
157
 
120
- static VALUE db_destroy_table(int argc, VALUE *argv, VALUE self)
158
+ static VALUE db_destroy_tables(int argc, VALUE *argv, VALUE self)
121
159
  {
122
- //sqlite3 * db = NULL;
123
- sqlite3 **ppDB = NULL;
124
- const char* szTableName = NULL;
160
+ void **ppDB = NULL;
161
+ int rc = 0;
162
+
163
+ if ((argc < 2) || (argc > 2))
164
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
165
+
166
+ Data_Get_Struct(self, void *, ppDB);
167
+
168
+ rc = rho_db_destroy_tables(*ppDB, argv[0], argv[1]);
169
+
170
+ return INT2NUM(rc);
171
+ }
172
+
173
+ static VALUE db_is_table_exist(int argc, VALUE *argv, VALUE self)
174
+ {
175
+ void **ppDB = NULL;
125
176
  int rc = 0;
177
+ const char * szTableName = 0;
126
178
 
127
179
  if ((argc < 1) || (argc > 1))
128
180
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
129
181
 
130
- Data_Get_Struct(self, sqlite3 *, ppDB);
131
- szTableName = RSTRING_PTR(argv[0]);
182
+ Data_Get_Struct(self, void *, ppDB);
183
+ szTableName = RSTRING_PTR(argv[0]);
132
184
 
133
- rc = rho_db_destroy_table(szTableName);
185
+ rc = rho_db_is_table_exist(*ppDB, szTableName);
134
186
 
135
- return INT2NUM(rc);
187
+ return rc ? Qtrue : Qfalse;
136
188
  }
137
189
 
138
190
  static VALUE db_is_ui_waitfordb(int argc, VALUE *argv, VALUE self)
139
191
  {
140
- sqlite3 **ppDB = NULL;
192
+ void **ppDB = NULL;
141
193
  int rc = 0;
142
194
 
143
195
  if (argc > 0)
144
196
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
145
197
 
146
- Data_Get_Struct(self, sqlite3 *, ppDB);
198
+ Data_Get_Struct(self, void *, ppDB);
147
199
 
148
- rc = rho_db_is_ui_waitfordb();
200
+ rc = rho_db_is_ui_waitfordb(*ppDB);
149
201
 
150
202
  return rc == 0 ? Qfalse : Qtrue;
151
203
  }
@@ -153,114 +205,128 @@ static VALUE db_is_ui_waitfordb(int argc, VALUE *argv, VALUE self)
153
205
  static VALUE db_execute(int argc, VALUE *argv, VALUE self)
154
206
  {
155
207
  sqlite3 * db = NULL;
156
- sqlite3 **ppDB = NULL;
208
+ void **ppDB = NULL;
157
209
  sqlite3_stmt *statement = NULL;
158
210
  const char* sql = NULL;
159
211
  VALUE arRes = rb_ary_new();
160
212
  VALUE* colNames = NULL;
161
213
  int nRes = 0;
162
214
  char * szErrMsg = 0;
215
+ int is_batch = 0;
216
+
217
+ if ((argc < 2) || (argc > 3))
218
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
163
219
 
164
- if ((argc < 1) || (argc > 2))
165
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
166
-
167
- Data_Get_Struct(self, sqlite3 *, ppDB);
168
- db = (sqlite3 *)rho_db_get_handle();
220
+ Data_Get_Struct(self, void *, ppDB);
221
+ db = (sqlite3 *)rho_db_get_handle(*ppDB);
169
222
  sql = RSTRING_PTR(argv[0]);
170
-
223
+ is_batch = argv[1] == Qtrue ? 1 : 0;
224
+
171
225
  RAWTRACE1("db_execute: %s", sql);
172
- if ( (nRes = sqlite3_prepare_v2(db, sql, -1, &statement, NULL)) != SQLITE_OK)
173
- {
174
- szErrMsg = (char *)sqlite3_errmsg(db);
175
226
 
176
- rb_raise(rb_eArgError, "could not prepare statement: %d; Message: %s",nRes, (szErrMsg?szErrMsg:""));
227
+ if ( is_batch )
228
+ {
229
+ rho_db_lock(*ppDB);
230
+ nRes = sqlite3_exec(db, sql, NULL, NULL, &szErrMsg);
231
+ rho_db_unlock(*ppDB);
177
232
  }
178
-
179
- if ( argc > 1 )
233
+ else
180
234
  {
181
- int i = 0;
182
- VALUE args = argv[1];
183
- if ( RARRAY_LEN(args) > 0 && TYPE(RARRAY_PTR(args)[0]) == T_ARRAY )
184
- args = RARRAY_PTR(args)[0];
185
-
186
- for( ; i < RARRAY_LEN(args); i++ )
235
+ //nRes = rho_db_prepare_statement(*ppDB, sql, -1, &statement);
236
+ nRes = sqlite3_prepare_v2(db, sql, -1, &statement, NULL);
237
+ if ( nRes != SQLITE_OK)
187
238
  {
188
- VALUE arg = RARRAY_PTR(args)[i];
189
- if (NIL_P(arg))
190
- {
191
- sqlite3_bind_null(statement, i+1);
192
- continue;
193
- }
239
+ szErrMsg = (char *)sqlite3_errmsg(db);
194
240
 
195
- switch( TYPE(arg) )
196
- {
197
- case T_STRING:
198
- sqlite3_bind_text(statement, i+1, RSTRING_PTR(arg), -1, SQLITE_TRANSIENT);
199
- break;
200
- case T_FIXNUM:
201
- case T_FLOAT:
202
- case T_BIGNUM:
203
- sqlite3_bind_int64(statement, i+1, NUM2LL(arg));
204
- break;
205
- default:
206
- //TODO: convert value to string
207
- rb_raise(rb_eArgError, "could not execute statement: not supported arg type.");
208
- break;
209
- }
241
+ rb_raise(rb_eArgError, "could not prepare statement: %d; Message: %s",nRes, (szErrMsg?szErrMsg:""));
210
242
  }
211
- }
212
243
 
213
- rho_sync_lock();
214
-
215
- while( (nRes=sqlite3_step(statement)) == SQLITE_ROW) {
216
- int nCount = sqlite3_data_count(statement);
217
- int nCol = 0;
218
- VALUE hashRec = rb_hash_new();
244
+ if ( argc > 2 )
245
+ {
246
+ int i = 0;
247
+ VALUE args = argv[2];
248
+ if ( RARRAY_LEN(args) > 0 && TYPE(RARRAY_PTR(args)[0]) == T_ARRAY )
249
+ args = RARRAY_PTR(args)[0];
219
250
 
220
- //if ( !colNames )
221
- // colNames = getColNames(statement, nCount);
251
+ for( ; i < RARRAY_LEN(args); i++ )
252
+ {
253
+ VALUE arg = RARRAY_PTR(args)[i];
254
+ if (NIL_P(arg))
255
+ {
256
+ sqlite3_bind_null(statement, i+1);
257
+ continue;
258
+ }
222
259
 
223
- for(;nCol<nCount;nCol++){
224
- int nColType = sqlite3_column_type(statement,nCol);
225
- const char* szColName = sqlite3_column_name(statement,nCol);
226
- VALUE colName = rb_str_new2(szColName);
227
- VALUE colValue = Qnil;
228
-
229
- switch(nColType){
230
- case SQLITE_NULL:
231
- break;
232
- case SQLITE_INTEGER:
260
+ switch( TYPE(arg) )
233
261
  {
234
- sqlite_int64 nVal = sqlite3_column_int64(statement, nCol);
235
- colValue = LL2NUM(nVal);
262
+ case T_STRING:
263
+ sqlite3_bind_text(statement, i+1, RSTRING_PTR(arg), -1, SQLITE_TRANSIENT);
264
+ break;
265
+ case T_FIXNUM:
266
+ case T_FLOAT:
267
+ case T_BIGNUM:
268
+ sqlite3_bind_int64(statement, i+1, NUM2LL(arg));
269
+ break;
270
+ default:
271
+ //TODO: convert value to string
272
+ rb_raise(rb_eArgError, "could not execute statement: not supported arg type.");
236
273
  break;
237
274
  }
238
- default:{
239
- char *text = (char *)sqlite3_column_text(statement, nCol);
240
- colValue = rb_str_new2(text);
241
- break;
242
- }
243
- }
244
-
245
- rb_hash_aset(hashRec, colName/*colNames[nCol]*/, colValue);
246
- }
247
-
248
- rb_ary_push(arRes, hashRec);
249
- }
250
-
251
- if ( nRes != SQLITE_OK && nRes != SQLITE_ROW && nRes != SQLITE_DONE )
252
- {
253
- szErrMsg = (char*)sqlite3_errmsg(db);
275
+ }
276
+ }
254
277
 
255
- rb_raise(rb_eArgError, "could not execute statement: %d; Message: %s",nRes, (szErrMsg?szErrMsg:""));
278
+ rho_db_lock(*ppDB);
279
+ while( (nRes=sqlite3_step(statement)) == SQLITE_ROW) {
280
+ int nCount = sqlite3_data_count(statement);
281
+ int nCol = 0;
282
+ VALUE hashRec = rb_hash_new();
283
+
284
+ //if ( !colNames )
285
+ // colNames = getColNames(statement, nCount);
286
+
287
+ for(;nCol<nCount;nCol++){
288
+ int nColType = sqlite3_column_type(statement,nCol);
289
+ const char* szColName = sqlite3_column_name(statement,nCol);
290
+ VALUE colName = rb_str_new2(szColName);
291
+ VALUE colValue = Qnil;
292
+
293
+ switch(nColType){
294
+ case SQLITE_NULL:
295
+ break;
296
+ case SQLITE_INTEGER:
297
+ {
298
+ sqlite_int64 nVal = sqlite3_column_int64(statement, nCol);
299
+ colValue = LL2NUM(nVal);
300
+ break;
301
+ }
302
+ default:{
303
+ char *text = (char *)sqlite3_column_text(statement, nCol);
304
+ colValue = rb_str_new2(text);
305
+ break;
306
+ }
307
+ }
308
+
309
+ rb_hash_aset(hashRec, colName/*colNames[nCol]*/, colValue);
310
+ }
311
+
312
+ rb_ary_push(arRes, hashRec);
313
+ }
314
+
315
+ rho_db_unlock(*ppDB);
256
316
  }
257
317
 
258
- sqlite3_finalize(statement);
259
-
318
+ if ( statement )
319
+ sqlite3_finalize(statement);
260
320
  if ( colNames )
261
321
  free(colNames);
262
322
 
263
- rho_sync_unlock();
323
+ if ( nRes != SQLITE_OK && nRes != SQLITE_ROW && nRes != SQLITE_DONE )
324
+ {
325
+ if ( !szErrMsg )
326
+ szErrMsg = (char*)sqlite3_errmsg(db);
327
+
328
+ rb_raise(rb_eArgError, "could not execute statement: %d; Message: %s",nRes, (szErrMsg?szErrMsg:""));
329
+ }
264
330
 
265
331
  return arRes;
266
332
  }
@@ -277,3114 +343,10 @@ void Init_sqlite3_api(void)
277
343
  rb_define_method(mDatabase, "start_transaction", db_start_transaction, -1);
278
344
  rb_define_method(mDatabase, "commit", db_commit, -1);
279
345
  rb_define_method(mDatabase, "rollback", db_rollback, -1);
280
- rb_define_method(mDatabase, "destroy_table", db_destroy_table, -1);
281
- rb_define_method(mDatabase, "is_ui_waitfordb", db_is_ui_waitfordb, -1);
282
- }
283
-
284
- #if 0
285
-
286
- /* ----------------------------------------------------------------------------
287
- * This file was automatically generated by SWIG (http://www.swig.org).
288
- * Version 1.3.27
289
- *
290
- * This file is not intended to be easily readable and contains a number of
291
- * coding conventions designed to improve portability and efficiency. Do not make
292
- * changes to this file unless you know what you are doing--modify the SWIG
293
- * interface file instead.
294
- * ----------------------------------------------------------------------------- */
295
-
296
- /***********************************************************************
297
- *
298
- * This section contains generic SWIG labels for method/variable
299
- * declarations/attributes, and other compiler dependent labels.
300
- *
301
- ************************************************************************/
302
-
303
- /* template workaround for compilers that cannot correctly implement the C++ standard */
304
- #ifndef SWIGTEMPLATEDISAMBIGUATOR
305
- # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
306
- # define SWIGTEMPLATEDISAMBIGUATOR template
307
- # else
308
- # define SWIGTEMPLATEDISAMBIGUATOR
309
- # endif
310
- #endif
311
-
312
- /* inline attribute */
313
- #ifndef SWIGINLINE
314
- # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
315
- # define SWIGINLINE inline
316
- # else
317
- # define SWIGINLINE
318
- # endif
319
- #endif
320
-
321
- /* attribute recognised by some compilers to avoid 'unused' warnings */
322
- #ifndef SWIGUNUSED
323
- # if defined(__GNUC__) || defined(__ICC)
324
- # define SWIGUNUSED __attribute__ ((unused))
325
- # else
326
- # define SWIGUNUSED
327
- # endif
328
- #endif
329
-
330
- /* internal SWIG method */
331
- #ifndef SWIGINTERN
332
- # define SWIGINTERN static SWIGUNUSED
333
- #endif
334
-
335
- /* internal inline SWIG method */
336
- #ifndef SWIGINTERNINLINE
337
- # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
338
- #endif
339
-
340
- /* exporting methods for Windows DLLs */
341
- #ifndef SWIGEXPORT
342
- # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
343
- # if defined(STATIC_LINKED)
344
- # define SWIGEXPORT
345
- # else
346
- # define SWIGEXPORT __declspec(dllexport)
347
- # endif
348
- # else
349
- # define SWIGEXPORT
350
- # endif
351
- #endif
352
-
353
- /* calling conventions for Windows */
354
- #ifndef SWIGSTDCALL
355
- # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
356
- # define SWIGSTDCALL __stdcall
357
- # else
358
- # define SWIGSTDCALL
359
- # endif
360
- #endif
361
-
362
-
363
- /* ruby.swg */
364
- /* Implementation : RUBY */
365
- #define SWIGRUBY 1
366
-
367
- #include "ruby.h"
368
-
369
- /* Flags for pointer conversion */
370
- #define SWIG_POINTER_EXCEPTION 0x1
371
- #define SWIG_POINTER_OWN 0x1
372
- #define SWIG_POINTER_DISOWN 0x2
373
- #define SWIG_TRACK_OBJECTS 0x4
374
-
375
- #define NUM2USHRT(n) (\
376
- (0 <= NUM2UINT(n) && NUM2UINT(n) <= USHRT_MAX)\
377
- ? (unsigned short) NUM2UINT(n) \
378
- : (rb_raise(rb_eArgError, "integer %d out of range of `unsigned short'",\
379
- NUM2UINT(n)), (short)0)\
380
- )
381
-
382
- #define NUM2SHRT(n) (\
383
- (SHRT_MIN <= NUM2INT(n) && NUM2INT(n) <= SHRT_MAX)\
384
- ? (short)NUM2INT(n)\
385
- : (rb_raise(rb_eArgError, "integer %d out of range of `short'",\
386
- NUM2INT(n)), (short)0)\
387
- )
388
-
389
- /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
390
- #ifndef NUM2LL
391
- #define NUM2LL(x) NUM2LONG((x))
392
- #endif
393
- #ifndef LL2NUM
394
- #define LL2NUM(x) INT2NUM((long) (x))
395
- #endif
396
- #ifndef ULL2NUM
397
- #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
398
- #endif
399
-
400
- /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
401
- #ifndef NUM2ULL
402
- #ifdef HAVE_LONG_LONG
403
- #define NUM2ULL(x) rb_num2ull((x))
404
- #else
405
- #define NUM2ULL(x) NUM2ULONG(x)
406
- #endif
407
- #endif
408
-
409
- /*
410
- * Need to be very careful about how these macros are defined, especially
411
- * when compiling C++ code or C code with an ANSI C compiler.
412
- *
413
- * VALUEFUNC(f) is a macro used to typecast a C function that implements
414
- * a Ruby method so that it can be passed as an argument to API functions
415
- * like rb_define_method() and rb_define_singleton_method().
416
- *
417
- * VOIDFUNC(f) is a macro used to typecast a C function that implements
418
- * either the "mark" or "free" stuff for a Ruby Data object, so that it
419
- * can be passed as an argument to API functions like Data_Wrap_Struct()
420
- * and Data_Make_Struct().
421
- */
422
-
423
- #ifdef __cplusplus
424
- # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
425
- # define PROTECTFUNC(f) ((VALUE (*)()) f)
426
- # define VALUEFUNC(f) ((VALUE (*)()) f)
427
- # define VOIDFUNC(f) ((void (*)()) f)
428
- # else
429
- # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
430
- # define PROTECTFUNC(f) ((VALUE (*)()) f)
431
- # define VALUEFUNC(f) ((VALUE (*)()) f)
432
- # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
433
- # else /* These definitions should work for Ruby 1.7+ */
434
- # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
435
- # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
436
- # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
437
- # endif
438
- # endif
439
- #else
440
- # define VALUEFUNC(f) (f)
441
- # define VOIDFUNC(f) (f)
442
- #endif
443
-
444
- typedef struct {
445
- VALUE klass;
446
- VALUE mImpl;
447
- void (*mark)(void *);
448
- void (*destroy)(void *);
449
- } swig_class;
450
-
451
- /* Don't use for expressions have side effect */
452
- #ifndef RB_STRING_VALUE
453
- #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
454
- #endif
455
- #ifndef StringValue
456
- #define StringValue(s) RB_STRING_VALUE(s)
457
- #endif
458
- #ifndef StringValuePtr
459
- #define StringValuePtr(s) RSTRING(RB_STRING_VALUE(s))->ptr
460
- #endif
461
- #ifndef StringValueLen
462
- #define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->len
463
- #endif
464
- #ifndef SafeStringValue
465
- #define SafeStringValue(v) do {\
466
- StringValue(v);\
467
- rb_check_safe_str(v);\
468
- } while (0)
469
- #endif
470
-
471
- #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
472
- #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
473
- #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
474
- #endif
475
-
476
- /* Contract support */
477
-
478
- #define SWIG_contract_assert(expr, msg) if (!(expr)) { rb_raise(rb_eRuntimeError, (char *) msg ); } else
479
-
480
-
481
- /***********************************************************************
482
- * swigrun.swg
483
- *
484
- * This file contains generic CAPI SWIG runtime support for pointer
485
- * type checking.
486
- *
487
- ************************************************************************/
488
-
489
- /* This should only be incremented when either the layout of swig_type_info changes,
490
- or for whatever reason, the runtime changes incompatibly */
491
- #define SWIG_RUNTIME_VERSION "2"
492
-
493
- /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
494
- #ifdef SWIG_TYPE_TABLE
495
- # define SWIG_QUOTE_STRING(x) #x
496
- # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
497
- # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
498
- #else
499
- # define SWIG_TYPE_TABLE_NAME
500
- #endif
501
-
502
- /*
503
- You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
504
- creating a static or dynamic library from the swig runtime code.
505
- In 99.9% of the cases, swig just needs to declare them as 'static'.
506
-
507
- But only do this if is strictly necessary, ie, if you have problems
508
- with your compiler or so.
509
- */
510
-
511
- #ifndef SWIGRUNTIME
512
- # define SWIGRUNTIME SWIGINTERN
513
- #endif
514
-
515
- #ifndef SWIGRUNTIMEINLINE
516
- # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
517
- #endif
518
-
519
- #include <string.h>
520
-
521
- #ifdef __cplusplus
522
- extern "C" {
523
- #endif
524
-
525
- typedef void *(*swig_converter_func)(void *);
526
- typedef struct swig_type_info *(*swig_dycast_func)(void **);
527
-
528
- /* Structure to store inforomation on one type */
529
- typedef struct swig_type_info {
530
- const char *name; /* mangled name of this type */
531
- const char *str; /* human readable name of this type */
532
- swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
533
- struct swig_cast_info *cast; /* linked list of types that can cast into this type */
534
- void *clientdata; /* language specific type data */
535
- } swig_type_info;
536
-
537
- /* Structure to store a type and conversion function used for casting */
538
- typedef struct swig_cast_info {
539
- swig_type_info *type; /* pointer to type that is equivalent to this type */
540
- swig_converter_func converter; /* function to cast the void pointers */
541
- struct swig_cast_info *next; /* pointer to next cast in linked list */
542
- struct swig_cast_info *prev; /* pointer to the previous cast */
543
- } swig_cast_info;
544
-
545
- /* Structure used to store module information
546
- * Each module generates one structure like this, and the runtime collects
547
- * all of these structures and stores them in a circularly linked list.*/
548
- typedef struct swig_module_info {
549
- swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
550
- size_t size; /* Number of types in this module */
551
- struct swig_module_info *next; /* Pointer to next element in circularly linked list */
552
- swig_type_info **type_initial; /* Array of initially generated type structures */
553
- swig_cast_info **cast_initial; /* Array of initially generated casting structures */
554
- void *clientdata; /* Language specific module data */
555
- } swig_module_info;
556
-
557
-
558
- /*
559
- Compare two type names skipping the space characters, therefore
560
- "char*" == "char *" and "Class<int>" == "Class<int >", etc.
561
-
562
- Return 0 when the two name types are equivalent, as in
563
- strncmp, but skipping ' '.
564
- */
565
- SWIGRUNTIME int
566
- SWIG_TypeNameComp(const char *f1, const char *l1,
567
- const char *f2, const char *l2) {
568
- for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
569
- while ((*f1 == ' ') && (f1 != l1)) ++f1;
570
- while ((*f2 == ' ') && (f2 != l2)) ++f2;
571
- if (*f1 != *f2) return (int)(*f1 - *f2);
572
- }
573
- return (l1 - f1) - (l2 - f2);
574
- }
575
-
576
- /*
577
- Check type equivalence in a name list like <name1>|<name2>|...
578
- Return 0 if not equal, 1 if equal
579
- */
580
- SWIGRUNTIME int
581
- SWIG_TypeEquiv(const char *nb, const char *tb) {
582
- int equiv = 0;
583
- const char* te = tb + strlen(tb);
584
- const char* ne = nb;
585
- while (!equiv && *ne) {
586
- for (nb = ne; *ne; ++ne) {
587
- if (*ne == '|') break;
588
- }
589
- equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
590
- if (*ne) ++ne;
591
- }
592
- return equiv;
593
- }
594
-
595
- /*
596
- Check type equivalence in a name list like <name1>|<name2>|...
597
- Return 0 if equal, -1 if nb < tb, 1 if nb > tb
598
- */
599
- SWIGRUNTIME int
600
- SWIG_TypeCompare(const char *nb, const char *tb) {
601
- int equiv = 0;
602
- const char* te = tb + strlen(tb);
603
- const char* ne = nb;
604
- while (!equiv && *ne) {
605
- for (nb = ne; *ne; ++ne) {
606
- if (*ne == '|') break;
607
- }
608
- equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
609
- if (*ne) ++ne;
610
- }
611
- return equiv;
612
- }
613
-
614
-
615
- /* think of this as a c++ template<> or a scheme macro */
616
- #define SWIG_TypeCheck_Template(comparison, ty) \
617
- if (ty) { \
618
- swig_cast_info *iter = ty->cast; \
619
- while (iter) { \
620
- if (comparison) { \
621
- if (iter == ty->cast) return iter; \
622
- /* Move iter to the top of the linked list */ \
623
- iter->prev->next = iter->next; \
624
- if (iter->next) \
625
- iter->next->prev = iter->prev; \
626
- iter->next = ty->cast; \
627
- iter->prev = 0; \
628
- if (ty->cast) ty->cast->prev = iter; \
629
- ty->cast = iter; \
630
- return iter; \
631
- } \
632
- iter = iter->next; \
633
- } \
634
- } \
635
- return 0
636
-
637
- /*
638
- Check the typename
639
- */
640
- SWIGRUNTIME swig_cast_info *
641
- SWIG_TypeCheck(const char *c, swig_type_info *ty) {
642
- SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
643
- }
644
-
645
- /* Same as previous function, except strcmp is replaced with a pointer comparison */
646
- SWIGRUNTIME swig_cast_info *
647
- SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
648
- SWIG_TypeCheck_Template(iter->type == from, into);
649
- }
650
-
651
- /*
652
- Cast a pointer up an inheritance hierarchy
653
- */
654
- SWIGRUNTIMEINLINE void *
655
- SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
656
- return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
657
- }
658
-
659
- /*
660
- Dynamic pointer casting. Down an inheritance hierarchy
661
- */
662
- SWIGRUNTIME swig_type_info *
663
- SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
664
- swig_type_info *lastty = ty;
665
- if (!ty || !ty->dcast) return ty;
666
- while (ty && (ty->dcast)) {
667
- ty = (*ty->dcast)(ptr);
668
- if (ty) lastty = ty;
669
- }
670
- return lastty;
671
- }
672
-
673
- /*
674
- Return the name associated with this type
675
- */
676
- SWIGRUNTIMEINLINE const char *
677
- SWIG_TypeName(const swig_type_info *ty) {
678
- return ty->name;
679
- }
680
-
681
- /*
682
- Return the pretty name associated with this type,
683
- that is an unmangled type name in a form presentable to the user.
684
- */
685
- SWIGRUNTIME const char *
686
- SWIG_TypePrettyName(const swig_type_info *type) {
687
- /* The "str" field contains the equivalent pretty names of the
688
- type, separated by vertical-bar characters. We choose
689
- to print the last name, as it is often (?) the most
690
- specific. */
691
- if (type->str != NULL) {
692
- const char *last_name = type->str;
693
- const char *s;
694
- for (s = type->str; *s; s++)
695
- if (*s == '|') last_name = s+1;
696
- return last_name;
697
- }
698
- else
699
- return type->name;
700
- }
701
-
702
- /*
703
- Set the clientdata field for a type
704
- */
705
- SWIGRUNTIME void
706
- SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
707
- swig_cast_info *cast = ti->cast;
708
- /* if (ti->clientdata == clientdata) return; */
709
- ti->clientdata = clientdata;
710
-
711
- while (cast) {
712
- if (!cast->converter) {
713
- swig_type_info *tc = cast->type;
714
- if (!tc->clientdata) {
715
- SWIG_TypeClientData(tc, clientdata);
716
- }
717
- }
718
- cast = cast->next;
719
- }
720
- }
721
-
722
- /*
723
- Search for a swig_type_info structure only by mangled name
724
- Search is a O(log #types)
725
-
726
- We start searching at module start, and finish searching when start == end.
727
- Note: if start == end at the beginning of the function, we go all the way around
728
- the circular list.
729
- */
730
- SWIGRUNTIME swig_type_info *
731
- SWIG_MangledTypeQueryModule(swig_module_info *start,
732
- swig_module_info *end,
733
- const char *name) {
734
- swig_module_info *iter = start;
735
- do {
736
- if (iter->size) {
737
- register size_t l = 0;
738
- register size_t r = iter->size - 1;
739
- do {
740
- /* since l+r >= 0, we can (>> 1) instead (/ 2) */
741
- register size_t i = (l + r) >> 1;
742
- const char *iname = iter->types[i]->name;
743
- if (iname) {
744
- register int compare = strcmp(name, iname);
745
- if (compare == 0) {
746
- return iter->types[i];
747
- } else if (compare < 0) {
748
- if (i) {
749
- r = i - 1;
750
- } else {
751
- break;
752
- }
753
- } else if (compare > 0) {
754
- l = i + 1;
755
- }
756
- } else {
757
- break; /* should never happen */
758
- }
759
- } while (l <= r);
760
- }
761
- iter = iter->next;
762
- } while (iter != end);
763
- return 0;
764
- }
765
-
766
- /*
767
- Search for a swig_type_info structure for either a mangled name or a human readable name.
768
- It first searches the mangled names of the types, which is a O(log #types)
769
- If a type is not found it then searches the human readable names, which is O(#types).
770
-
771
- We start searching at module start, and finish searching when start == end.
772
- Note: if start == end at the beginning of the function, we go all the way around
773
- the circular list.
774
- */
775
- SWIGRUNTIME swig_type_info *
776
- SWIG_TypeQueryModule(swig_module_info *start,
777
- swig_module_info *end,
778
- const char *name) {
779
- /* STEP 1: Search the name field using binary search */
780
- swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
781
- if (ret) {
782
- return ret;
783
- } else {
784
- /* STEP 2: If the type hasn't been found, do a complete search
785
- of the str field (the human readable name) */
786
- swig_module_info *iter = start;
787
- do {
788
- register size_t i = 0;
789
- for (; i < iter->size; ++i) {
790
- if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
791
- return iter->types[i];
792
- }
793
- iter = iter->next;
794
- } while (iter != end);
795
- }
796
-
797
- /* neither found a match */
798
- return 0;
799
- }
800
-
801
-
802
- /*
803
- Pack binary data into a string
804
- */
805
- SWIGRUNTIME char *
806
- SWIG_PackData(char *c, void *ptr, size_t sz) {
807
- static const char hex[17] = "0123456789abcdef";
808
- register const unsigned char *u = (unsigned char *) ptr;
809
- register const unsigned char *eu = u + sz;
810
- for (; u != eu; ++u) {
811
- register unsigned char uu = *u;
812
- *(c++) = hex[(uu & 0xf0) >> 4];
813
- *(c++) = hex[uu & 0xf];
814
- }
815
- return c;
816
- }
817
-
818
- /*
819
- Unpack binary data from a string
820
- */
821
- SWIGRUNTIME const char *
822
- SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
823
- register unsigned char *u = (unsigned char *) ptr;
824
- register const unsigned char *eu = u + sz;
825
- for (; u != eu; ++u) {
826
- register char d = *(c++);
827
- register unsigned char uu = 0;
828
- if ((d >= '0') && (d <= '9'))
829
- uu = ((d - '0') << 4);
830
- else if ((d >= 'a') && (d <= 'f'))
831
- uu = ((d - ('a'-10)) << 4);
832
- else
833
- return (char *) 0;
834
- d = *(c++);
835
- if ((d >= '0') && (d <= '9'))
836
- uu |= (d - '0');
837
- else if ((d >= 'a') && (d <= 'f'))
838
- uu |= (d - ('a'-10));
839
- else
840
- return (char *) 0;
841
- *u = uu;
842
- }
843
- return c;
844
- }
845
-
846
- /*
847
- Pack 'void *' into a string buffer.
848
- */
849
- SWIGRUNTIME char *
850
- SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
851
- char *r = buff;
852
- if ((2*sizeof(void *) + 2) > bsz) return 0;
853
- *(r++) = '_';
854
- r = SWIG_PackData(r,&ptr,sizeof(void *));
855
- if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
856
- strcpy(r,name);
857
- return buff;
858
- }
859
-
860
- SWIGRUNTIME const char *
861
- SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
862
- if (*c != '_') {
863
- if (strcmp(c,"NULL") == 0) {
864
- *ptr = (void *) 0;
865
- return name;
866
- } else {
867
- return 0;
868
- }
869
- }
870
- return SWIG_UnpackData(++c,ptr,sizeof(void *));
871
- }
872
-
873
- SWIGRUNTIME char *
874
- SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
875
- char *r = buff;
876
- size_t lname = (name ? strlen(name) : 0);
877
- if ((2*sz + 2 + lname) > bsz) return 0;
878
- *(r++) = '_';
879
- r = SWIG_PackData(r,ptr,sz);
880
- if (lname) {
881
- strncpy(r,name,lname+1);
882
- } else {
883
- *r = 0;
884
- }
885
- return buff;
886
- }
887
-
888
- SWIGRUNTIME const char *
889
- SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
890
- if (*c != '_') {
891
- if (strcmp(c,"NULL") == 0) {
892
- memset(ptr,0,sz);
893
- return name;
894
- } else {
895
- return 0;
896
- }
897
- }
898
- return SWIG_UnpackData(++c,ptr,sz);
899
- }
900
-
901
- #ifdef __cplusplus
902
- }
903
- #endif
904
-
905
- /***********************************************************************
906
- * rubytracking.swg
907
- *
908
- * This file contains support for tracking mappings from
909
- * Ruby objects to C++ objects. This functionality is needed
910
- * to implement mark functions for Ruby's mark and sweep
911
- * garbage collector.
912
- ************************************************************************/
913
-
914
- /* Global Ruby hash table to store Trackings from C/C++
915
- structs to Ruby Objects. */
916
- static VALUE swig_ruby_trackings;
917
-
918
- /* Setup a Ruby hash table to store Trackings */
919
- static void SWIG_RubyInitializeTrackings() {
920
- /* Create a ruby hash table to store Trackings from C++
921
- objects to Ruby objects. Also make sure to tell
922
- the garabage collector about the hash table. */
923
- swig_ruby_trackings = rb_hash_new();
924
- rb_gc_register_address(&swig_ruby_trackings);
925
- }
926
-
927
- /* Get a Ruby number to reference a pointer */
928
- static VALUE SWIG_RubyPtrToReference(void* ptr) {
929
- /* We cast the pointer to an unsigned long
930
- and then store a reference to it using
931
- a Ruby number object. */
932
-
933
- /* Convert the pointer to a Ruby number */
934
- unsigned long value = (unsigned long) ptr;
935
- return LONG2NUM(value);
936
- }
937
-
938
- /* Get a Ruby number to reference an object */
939
- static VALUE SWIG_RubyObjectToReference(VALUE object) {
940
- /* We cast the object to an unsigned long
941
- and then store a reference to it using
942
- a Ruby number object. */
943
-
944
- /* Convert the Object to a Ruby number */
945
- unsigned long value = (unsigned long) object;
946
- return LONG2NUM(value);
947
- }
948
-
949
- /* Get a Ruby object from a previously stored reference */
950
- static VALUE SWIG_RubyReferenceToObject(VALUE reference) {
951
- /* The provided Ruby number object is a reference
952
- to the Ruby object we want.*/
953
-
954
- /* First convert the Ruby number to a C number */
955
- unsigned long value = NUM2LONG(reference);
956
- return (VALUE) value;
957
- }
958
-
959
- /* Add a Tracking from a C/C++ struct to a Ruby object */
960
- static void SWIG_RubyAddTracking(void* ptr, VALUE object) {
961
- /* In a Ruby hash table we store the pointer and
962
- the associated Ruby object. The trick here is
963
- that we cannot store the Ruby object directly - if
964
- we do then it cannot be garbage collected. So
965
- instead we typecast it as a unsigned long and
966
- convert it to a Ruby number object.*/
967
-
968
- /* Get a reference to the pointer as a Ruby number */
969
- VALUE key = SWIG_RubyPtrToReference(ptr);
970
-
971
- /* Get a reference to the Ruby object as a Ruby number */
972
- VALUE value = SWIG_RubyObjectToReference(object);
973
-
974
- /* Store the mapping to the global hash table. */
975
- rb_hash_aset(swig_ruby_trackings, key, value);
976
- }
977
-
978
- /* Get the Ruby object that owns the specified C/C++ struct */
979
- static VALUE SWIG_RubyInstanceFor(void* ptr) {
980
- /* Get a reference to the pointer as a Ruby number */
981
- VALUE key = SWIG_RubyPtrToReference(ptr);
982
-
983
- /* Now lookup the value stored in the global hash table */
984
- VALUE value = rb_hash_aref(swig_ruby_trackings, key);
985
-
986
- if (value == Qnil) {
987
- /* No object exists - return nil. */
988
- return Qnil;
989
- }
990
- else {
991
- /* Convert this value to Ruby object */
992
- return SWIG_RubyReferenceToObject(value);
993
- }
994
- }
995
-
996
- /* Remove a Tracking from a C/C++ struct to a Ruby object */
997
- static void SWIG_RubyRemoveTracking(void* ptr) {
998
- /* Get a reference to the pointer as a Ruby number */
999
- VALUE key = SWIG_RubyPtrToReference(ptr);
1000
-
1001
- /* Define delete method - in C++ this could be marked as
1002
- static but unfortunately not in C. */
1003
- VALUE delete_function = rb_intern("delete");
1004
-
1005
- /* Delete the object from the hash table by calling Ruby's
1006
- do this we need to call the Hash.delete method.*/
1007
- rb_funcall(swig_ruby_trackings, delete_function, 1, key);
1008
- }
1009
-
1010
- /* This is a helper method that unlinks a Ruby object from its
1011
- underlying C++ object. This is needed if the lifetime of the
1012
- Ruby object is longer than the C++ object */
1013
- static void SWIG_RubyUnlinkObjects(void* ptr) {
1014
- VALUE object = SWIG_RubyInstanceFor(ptr);
1015
-
1016
- if (object != Qnil) {
1017
- DATA_PTR(object) = 0;
1018
- }
1019
- }
1020
-
1021
- /* Common SWIG API */
1022
- #define SWIG_ConvertPtr(obj, pp, type, flags) \
1023
- SWIG_Ruby_ConvertPtr(obj, pp, type, flags)
1024
- #define SWIG_NewPointerObj(p, type, flags) \
1025
- SWIG_Ruby_NewPointerObj(p, type, flags)
1026
- #define SWIG_MustGetPtr(p, type, argnum, flags) \
1027
- SWIG_Ruby_MustGetPtr(p, type, argnum, flags)
1028
- #define SWIG_GetModule(clientdata) \
1029
- SWIG_Ruby_GetModule()
1030
- #define SWIG_SetModule(clientdata, pointer) \
1031
- SWIG_Ruby_SetModule(pointer)
1032
-
1033
- /* Ruby-specific SWIG API */
1034
-
1035
- #define SWIG_InitRuntime() \
1036
- SWIG_Ruby_InitRuntime()
1037
- #define SWIG_define_class(ty) \
1038
- SWIG_Ruby_define_class(ty)
1039
- #define SWIG_NewClassInstance(value, ty) \
1040
- SWIG_Ruby_NewClassInstance(value, ty)
1041
- #define SWIG_MangleStr(value) \
1042
- SWIG_Ruby_MangleStr(value)
1043
- #define SWIG_CheckConvert(value, ty) \
1044
- SWIG_Ruby_CheckConvert(value, ty)
1045
- #define SWIG_NewPackedObj(ptr, sz, ty) \
1046
- SWIG_Ruby_NewPackedObj(ptr, sz, ty)
1047
- #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \
1048
- SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1049
-
1050
- /* rubydef.swg */
1051
- #ifdef __cplusplus
1052
- extern "C" {
1053
- #endif
1054
-
1055
- static VALUE _mSWIG = Qnil;
1056
- static VALUE _cSWIG_Pointer = Qnil;
1057
- static VALUE swig_runtime_data_type_pointer = Qnil;
1058
-
1059
- /* Initialize Ruby runtime support */
1060
- static void
1061
- SWIG_Ruby_InitRuntime(void)
1062
- {
1063
- if (_mSWIG == Qnil) {
1064
- _mSWIG = rb_define_module("SWIG");
1065
- }
1066
- }
1067
-
1068
- /* Define Ruby class for C type */
1069
- static void
1070
- SWIG_Ruby_define_class(swig_type_info *type)
1071
- {
1072
- VALUE klass;
1073
- char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1074
- sprintf(klass_name, "TYPE%s", type->name);
1075
- if (NIL_P(_cSWIG_Pointer)) {
1076
- _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1077
- rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1078
- }
1079
- klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1080
- free((void *) klass_name);
1081
- }
1082
-
1083
- /* Create a new pointer object */
1084
- static VALUE
1085
- SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1086
- {
1087
- int own = flags & SWIG_POINTER_OWN;
1088
- int track = flags & SWIG_TRACK_OBJECTS;
1089
-
1090
- char *klass_name;
1091
- swig_class *sklass;
1092
- VALUE klass;
1093
- VALUE obj;
1094
-
1095
- if (!ptr)
1096
- return Qnil;
1097
-
1098
- /* Have we already wrapped this pointer? */
1099
- if (track) {
1100
- obj = SWIG_RubyInstanceFor(ptr);
1101
- if (obj != Qnil) {
1102
- return obj;
1103
- }
1104
- }
1105
-
1106
- if (type->clientdata) {
1107
- sklass = (swig_class *) type->clientdata;
1108
- obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
1109
- } else {
1110
- klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1111
- sprintf(klass_name, "TYPE%s", type->name);
1112
- klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1113
- free((void *) klass_name);
1114
- obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1115
- }
1116
- rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1117
-
1118
- /* Keep track of this object if necessary */
1119
- if (track) {
1120
- SWIG_RubyAddTracking(ptr, obj);
1121
- }
1122
-
1123
- return obj;
1124
- }
1125
-
1126
- /* Create a new class instance (always owned) */
1127
- static VALUE
1128
- SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1129
- {
1130
- VALUE obj;
1131
- swig_class *sklass = (swig_class *) type->clientdata;
1132
- obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1133
- rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1134
- return obj;
1135
- }
1136
-
1137
- /* Get type mangle from class name */
1138
- static SWIGINLINE char *
1139
- SWIG_Ruby_MangleStr(VALUE obj)
1140
- {
1141
- VALUE stype = rb_iv_get(obj, "__swigtype__");
1142
- return StringValuePtr(stype);
1143
- }
1144
-
1145
- /* Convert a pointer value */
1146
- static int
1147
- SWIG_Ruby_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
1148
- {
1149
- char *c;
1150
- swig_cast_info *tc;
1151
-
1152
- /* Grab the pointer */
1153
- if (NIL_P(obj)) {
1154
- *ptr = 0;
1155
- return 0;
1156
- } else {
1157
- Data_Get_Struct(obj, void, *ptr);
1158
- }
1159
-
1160
- /* Check to see if the input object is giving up ownership
1161
- of the underlying C struct or C++ object. If so then we
1162
- need to reset the destructor since the Ruby object no
1163
- longer owns the underlying C++ object.*/
1164
- if (flags & SWIG_POINTER_DISOWN) {
1165
- if (flags & SWIG_TRACK_OBJECTS) {
1166
- /* We are tracking objects. Thus we change the destructor
1167
- * to SWIG_RubyRemoveTracking. This allows us to
1168
- * remove the mapping from the C++ to Ruby object
1169
- * when the Ruby object is garbage collected. If we don't
1170
- * do this, then it is possible we will return a reference
1171
- * to a Ruby object that no longer exists thereby crashing Ruby. */
1172
- RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1173
- } else {
1174
- RDATA(obj)->dfree = 0;
1175
- }
1176
- }
1177
-
1178
- /* Do type-checking if type info was provided */
1179
- if (ty) {
1180
- if (ty->clientdata) {
1181
- if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1182
- if (*ptr == 0)
1183
- rb_raise(rb_eRuntimeError, "This %s already released", ty->str);
1184
- return 0;
1185
- }
1186
- }
1187
- if ((c = SWIG_MangleStr(obj)) == NULL) {
1188
- if (flags & SWIG_POINTER_EXCEPTION)
1189
- rb_raise(rb_eTypeError, "Expected %s", ty->str);
1190
- else
1191
- return -1;
1192
- }
1193
- tc = SWIG_TypeCheck(c, ty);
1194
- if (!tc) {
1195
- if (flags & SWIG_POINTER_EXCEPTION)
1196
- rb_raise(rb_eTypeError, "Expected %s", ty->str);
1197
- else
1198
- return -1;
1199
- }
1200
- *ptr = SWIG_TypeCast(tc, *ptr);
1201
- }
1202
- return 0;
1203
- }
1204
-
1205
- /* Convert a pointer value, signal an exception on a type mismatch */
1206
- static SWIGINLINE void *
1207
- SWIG_Ruby_MustGetPtr(VALUE obj, swig_type_info *ty, int argnum, int flags)
1208
- {
1209
- void *result;
1210
- SWIG_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION);
1211
- return result;
1212
- }
1213
-
1214
- /* Check convert */
1215
- static SWIGINLINE int
1216
- SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1217
- {
1218
- char *c = SWIG_MangleStr(obj);
1219
- if (!c)
1220
- return 0;
1221
- return SWIG_TypeCheck(c,ty) != 0;
1222
- }
1223
-
1224
- static VALUE
1225
- SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1226
- char result[1024];
1227
- char *r = result;
1228
- if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1229
- *(r++) = '_';
1230
- r = SWIG_PackData(r, ptr, sz);
1231
- strcpy(r, type->name);
1232
- return rb_str_new2(result);
1233
- }
1234
-
1235
- /* Convert a packed value value */
1236
- static void
1237
- SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty, int flags) {
1238
- swig_cast_info *tc;
1239
- const char *c;
1240
-
1241
- if (TYPE(obj) != T_STRING) goto type_error;
1242
- c = StringValuePtr(obj);
1243
- /* Pointer values must start with leading underscore */
1244
- if (*c != '_') goto type_error;
1245
- c++;
1246
- c = SWIG_UnpackData(c, ptr, sz);
1247
- if (ty) {
1248
- tc = SWIG_TypeCheck(c, ty);
1249
- if (!tc) goto type_error;
1250
- }
1251
- return;
1252
-
1253
- type_error:
1254
-
1255
- if (flags) {
1256
- if (ty) {
1257
- rb_raise(rb_eTypeError, "Type error. Expected %s", ty->name);
1258
- } else {
1259
- rb_raise(rb_eTypeError, "Expected a pointer");
1260
- }
1261
- }
1262
- }
1263
-
1264
- static swig_module_info *SWIG_Ruby_GetModule() {
1265
- VALUE pointer;
1266
- swig_module_info *ret = 0;
1267
-
1268
- /* first check if pointer already created */
1269
- pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1270
- if (pointer != Qnil) {
1271
- Data_Get_Struct(pointer, swig_module_info, ret);
1272
- }
1273
- return ret;
1274
- }
1275
-
1276
- static void SWIG_Ruby_SetModule(swig_module_info *pointer) {
1277
- /* register a new class */
1278
- VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1279
- /* create and store the structure pointer to a global variable */
1280
- swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1281
- rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1282
- }
1283
-
1284
- #ifdef __cplusplus
1285
- }
1286
- #endif
1287
-
1288
-
1289
-
1290
- /* -------- TYPES TABLE (BEGIN) -------- */
1291
-
1292
- #define SWIGTYPE_p_CallbackData swig_types[0]
1293
- #define SWIGTYPE_p_f_p_sqlite3_context__void swig_types[1]
1294
- #define SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void swig_types[2]
1295
- #define SWIGTYPE_p_f_p_void__void swig_types[3]
1296
- #define SWIGTYPE_p_f_p_void_int__int swig_types[4]
1297
- #define SWIGTYPE_p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int swig_types[5]
1298
- #define SWIGTYPE_p_f_p_void_p_q_const__char__void swig_types[6]
1299
- #define SWIGTYPE_p_p_char swig_types[7]
1300
- #define SWIGTYPE_p_p_sqlite3 swig_types[8]
1301
- #define SWIGTYPE_p_p_sqlite3_stmt swig_types[9]
1302
- #define SWIGTYPE_p_p_void swig_types[10]
1303
- #define SWIGTYPE_p_sqlite3 swig_types[11]
1304
- #define SWIGTYPE_p_sqlite3_context swig_types[12]
1305
- #define SWIGTYPE_p_sqlite3_stmt swig_types[13]
1306
- #define SWIGTYPE_p_sqlite3_value swig_types[14]
1307
- #define SWIGTYPE_p_sqlite_int64 swig_types[15]
1308
- #define SWIGTYPE_p_unsigned_long swig_types[16]
1309
- #define SWIGTYPE_p_void swig_types[17]
1310
- static swig_type_info *swig_types[19];
1311
- static swig_module_info swig_module = {swig_types, 18, 0, 0, 0, 0};
1312
- #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1313
- #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1314
-
1315
- /* -------- TYPES TABLE (END) -------- */
1316
-
1317
- #define SWIG_init Init_API
1318
- #define SWIG_name "SQLite3::Driver::Native::API"
1319
-
1320
- static VALUE mAPI;
1321
-
1322
- static void SWIG_AsVal(VALUE obj, int *val)
1323
- {
1324
- *val = (int) NUM2INT(obj);
1325
- }
1326
-
1327
-
1328
- #ifdef __cplusplus
1329
- extern "C" {
1330
- #endif
1331
- #ifdef HAVE_SYS_TIME_H
1332
- # include <sys/time.h>
1333
- struct timeval rb_time_timeval(VALUE);
1334
- #endif
1335
- #ifdef __cplusplus
1336
- }
1337
- #endif
1338
-
1339
-
1340
- #ifdef __cplusplus
1341
- extern "C" {
1342
- #endif
1343
- //trv #include "rubyio.h"
1344
- #ifdef __cplusplus
1345
- }
1346
- #endif
1347
-
1348
-
1349
- #include "sqlite3.h"
1350
- #include "ruby.h"
1351
-
1352
- #ifndef RSTRING_PTR
1353
- #define RSTRING_PTR(s) (RSTRING(s)->ptr)
1354
- #endif
1355
-
1356
- #ifndef RSTRING_LEN
1357
- #define RSTRING_LEN(s) (RSTRING(s)->len)
1358
- #endif
1359
-
1360
- #define Init_API Init_sqlite3_api
1361
-
1362
- struct CallbackData {
1363
- VALUE proc;
1364
- VALUE proc2;
1365
- VALUE data;
1366
- };
1367
-
1368
- typedef struct CallbackData CallbackData;
1369
- typedef void RUBY_BLOB;
1370
- typedef void RUBY_VALBLOB;
1371
-
1372
- int Sqlite3_ruby_busy_handler(void* data,int value) {
1373
- VALUE result;
1374
- CallbackData *cb = (CallbackData*)data;
1375
- result = rb_funcall(
1376
- cb->proc, rb_intern("call"), 2, cb->data, INT2FIX(value) );
1377
- return FIX2INT(result);
1378
- }
1379
-
1380
- static void mark_CallbackData(void* ptr) {
1381
- CallbackData* cb = (CallbackData*)ptr;
1382
- if (cb->proc != Qnil)
1383
- rb_gc_mark(cb->proc);
1384
- if (cb->proc2 != Qnil)
1385
- rb_gc_mark(cb->proc2);
1386
- if (cb->data != Qnil)
1387
- rb_gc_mark(cb->data);
1388
- }
1389
-
1390
- int Sqlite3_ruby_authorizer(void* data,int type,
1391
- const char* a,const char* b,const char* c,const char* d)
1392
- {
1393
- VALUE result;
1394
- CallbackData *cb = (CallbackData*)data;
1395
- result = rb_funcall(
1396
- cb->proc, rb_intern("call"), 6, cb->data, INT2FIX(type),
1397
- ( a ? rb_str_new2(a) : Qnil ), ( b ? rb_str_new2(b) : Qnil ),
1398
- ( c ? rb_str_new2(c) : Qnil ), ( d ? rb_str_new2(d) : Qnil ) );
1399
- return FIX2INT(result);
1400
- }
1401
-
1402
- void Sqlite3_ruby_trace(void* data, const char *sql) {
1403
- CallbackData *cb = (CallbackData*)data;
1404
- rb_funcall( cb->proc, rb_intern("call"), 2, cb->data,
1405
- sql ? rb_str_new2(sql) : Qnil );
1406
- }
1407
-
1408
- void Sqlite3_ruby_function_step(sqlite3_context* ctx,int n,
1409
- sqlite3_value** args)
1410
- {
1411
- CallbackData *data;
1412
- VALUE rb_args;
1413
- VALUE *rb_context;
1414
- int idx;
1415
-
1416
- data = (CallbackData*)sqlite3_user_data(ctx);
1417
-
1418
- if( data->proc2 != Qnil ) {
1419
- rb_context = (VALUE*)sqlite3_aggregate_context(ctx,sizeof(VALUE));
1420
- if( *rb_context == 0 ) {
1421
- *rb_context = rb_hash_new();
1422
- rb_gc_register_address( rb_context );
1423
- }
1424
- }
1425
-
1426
- rb_args = rb_ary_new2(n+1);
1427
- rb_ary_push( rb_args, SWIG_NewPointerObj(ctx,SWIGTYPE_p_sqlite3_context,0) );
1428
- for( idx = 0; idx < n; idx++ ) {
1429
- rb_ary_push( rb_args, SWIG_NewPointerObj(args[idx],
1430
- SWIGTYPE_p_sqlite3_value,0) );
1431
- }
1432
-
1433
- rb_apply( data->proc, rb_intern("call"), rb_args );
1434
- }
1435
-
1436
- void Sqlite3_ruby_function_final(sqlite3_context *ctx) {
1437
- VALUE *rb_context;
1438
- CallbackData *data;
1439
-
1440
- rb_context = (VALUE*)sqlite3_aggregate_context(ctx,sizeof(VALUE));
1441
- if( *rb_context == 0 ) {
1442
- *rb_context = rb_hash_new();
1443
- rb_gc_register_address( rb_context );
1444
- }
1445
-
1446
- data = (CallbackData*)sqlite3_user_data(ctx);
1447
-
1448
- rb_funcall( data->proc2, rb_intern("call"), 1,
1449
- SWIG_NewPointerObj(ctx,SWIGTYPE_p_sqlite3_context,0) );
1450
-
1451
- rb_gc_unregister_address( rb_context );
1452
- }
1453
-
1454
- swig_class cCallbackData;
1455
-
1456
- static VALUE
1457
- _wrap_CallbackData_proc_set(int argc, VALUE *argv, VALUE self) {
1458
- struct CallbackData *arg1 = (struct CallbackData *) 0 ;
1459
- VALUE arg2 ;
1460
-
1461
- if ((argc < 1) || (argc > 1))
1462
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1463
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
1464
- arg2 = argv[0];
1465
- if (arg1) (arg1)->proc = arg2;
1466
-
1467
- return Qnil;
1468
- }
1469
-
1470
-
1471
- static VALUE
1472
- _wrap_CallbackData_proc_get(int argc, VALUE *argv, VALUE self) {
1473
- struct CallbackData *arg1 = (struct CallbackData *) 0 ;
1474
- VALUE result;
1475
- VALUE vresult = Qnil;
1476
-
1477
- if ((argc < 0) || (argc > 0))
1478
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1479
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
1480
- result = (VALUE) ((arg1)->proc);
1481
-
1482
- vresult = result;
1483
- return vresult;
1484
- }
1485
-
1486
-
1487
- static VALUE
1488
- _wrap_CallbackData_proc2_set(int argc, VALUE *argv, VALUE self) {
1489
- struct CallbackData *arg1 = (struct CallbackData *) 0 ;
1490
- VALUE arg2 ;
1491
-
1492
- if ((argc < 1) || (argc > 1))
1493
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1494
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
1495
- arg2 = argv[0];
1496
- if (arg1) (arg1)->proc2 = arg2;
1497
-
1498
- return Qnil;
1499
- }
1500
-
1501
-
1502
- static VALUE
1503
- _wrap_CallbackData_proc2_get(int argc, VALUE *argv, VALUE self) {
1504
- struct CallbackData *arg1 = (struct CallbackData *) 0 ;
1505
- VALUE result;
1506
- VALUE vresult = Qnil;
1507
-
1508
- if ((argc < 0) || (argc > 0))
1509
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1510
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
1511
- result = (VALUE) ((arg1)->proc2);
1512
-
1513
- vresult = result;
1514
- return vresult;
1515
- }
1516
-
1517
-
1518
- static VALUE
1519
- _wrap_CallbackData_data_set(int argc, VALUE *argv, VALUE self) {
1520
- struct CallbackData *arg1 = (struct CallbackData *) 0 ;
1521
- VALUE arg2 ;
1522
-
1523
- if ((argc < 1) || (argc > 1))
1524
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1525
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
1526
- arg2 = argv[0];
1527
- if (arg1) (arg1)->data = arg2;
1528
-
1529
- return Qnil;
1530
- }
1531
-
1532
-
1533
- static VALUE
1534
- _wrap_CallbackData_data_get(int argc, VALUE *argv, VALUE self) {
1535
- struct CallbackData *arg1 = (struct CallbackData *) 0 ;
1536
- VALUE result;
1537
- VALUE vresult = Qnil;
1538
-
1539
- if ((argc < 0) || (argc > 0))
1540
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1541
- SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_CallbackData, 0);
1542
- result = (VALUE) ((arg1)->data);
1543
-
1544
- vresult = result;
1545
- return vresult;
1546
- }
1547
-
1548
-
1549
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
1550
- static VALUE
1551
- _wrap_CallbackData_allocate(VALUE self) {
1552
- #else
1553
- static VALUE
1554
- _wrap_CallbackData_allocate(int argc, VALUE *argv, VALUE self) {
1555
- #endif
1556
-
1557
-
1558
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_CallbackData);
1559
- #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
1560
- rb_obj_call_init(vresult, argc, argv);
1561
- #endif
1562
- return vresult;
1563
- }
1564
-
1565
-
1566
- static VALUE
1567
- _wrap_new_CallbackData(int argc, VALUE *argv, VALUE self) {
1568
- struct CallbackData *result;
1569
-
1570
- if ((argc < 0) || (argc > 0))
1571
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1572
- result = (struct CallbackData *)(struct CallbackData *) calloc(1, sizeof(struct CallbackData));
1573
- DATA_PTR(self) = result;
1574
-
1575
- return self;
1576
- }
1577
-
1578
-
1579
- static void
1580
- free_CallbackData(struct CallbackData *arg1) {
1581
- free((char *) arg1);
1582
- }
1583
-
1584
- static VALUE
1585
- _wrap_sqlite3_libversion(int argc, VALUE *argv, VALUE self) {
1586
- char *result;
1587
- VALUE vresult = Qnil;
1588
-
1589
- if ((argc < 0) || (argc > 0))
1590
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
1591
- result = (char *)sqlite3_libversion();
1592
-
1593
- {
1594
- vresult = result ? rb_str_new2(result) : Qnil;
1595
- }
1596
- return vresult;
1597
- }
1598
-
1599
-
1600
- static VALUE
1601
- _wrap_sqlite3_close(int argc, VALUE *argv, VALUE self) {
1602
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1603
- int result;
1604
- VALUE vresult = Qnil;
1605
-
1606
- if ((argc < 1) || (argc > 1))
1607
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1608
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1609
- result = (int)sqlite3_close(arg1);
1610
-
1611
- vresult = INT2NUM(result);
1612
- return vresult;
1613
- }
1614
-
1615
-
1616
- static VALUE
1617
- _wrap_sqlite3_last_insert_rowid(int argc, VALUE *argv, VALUE self) {
1618
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1619
- sqlite_int64 result;
1620
- VALUE vresult = Qnil;
1621
-
1622
- if ((argc < 1) || (argc > 1))
1623
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1624
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1625
- result = sqlite3_last_insert_rowid(arg1);
1626
-
1627
- {
1628
- vresult = rb_ll2inum( result );
1629
- }
1630
- return vresult;
1631
- }
1632
-
1633
-
1634
- static VALUE
1635
- _wrap_sqlite3_changes(int argc, VALUE *argv, VALUE self) {
1636
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1637
- int result;
1638
- VALUE vresult = Qnil;
1639
-
1640
- if ((argc < 1) || (argc > 1))
1641
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1642
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1643
- result = (int)sqlite3_changes(arg1);
1644
-
1645
- vresult = INT2NUM(result);
1646
- return vresult;
1647
- }
1648
-
1649
-
1650
- static VALUE
1651
- _wrap_sqlite3_total_changes(int argc, VALUE *argv, VALUE self) {
1652
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1653
- int result;
1654
- VALUE vresult = Qnil;
1655
-
1656
- if ((argc < 1) || (argc > 1))
1657
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1658
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1659
- result = (int)sqlite3_total_changes(arg1);
1660
-
1661
- vresult = INT2NUM(result);
1662
- return vresult;
1663
- }
1664
-
1665
-
1666
- static VALUE
1667
- _wrap_sqlite3_interrupt(int argc, VALUE *argv, VALUE self) {
1668
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1669
-
1670
- if ((argc < 1) || (argc > 1))
1671
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1672
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1673
- sqlite3_interrupt(arg1);
1674
-
1675
- return Qnil;
1676
- }
1677
-
1678
-
1679
- static VALUE
1680
- _wrap_sqlite3_complete(int argc, VALUE *argv, VALUE self) {
1681
- char *arg1 = (char *) 0 ;
1682
- int result;
1683
- VALUE vresult = Qnil;
1684
-
1685
- if ((argc < 1) || (argc > 1))
1686
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1687
- arg1 = StringValuePtr(argv[0]);
1688
- result = (int)sqlite3_complete((char const *)arg1);
1689
-
1690
- vresult = INT2NUM(result);
1691
- return vresult;
1692
- }
1693
-
1694
-
1695
- static VALUE
1696
- _wrap_sqlite3_complete16(int argc, VALUE *argv, VALUE self) {
1697
- void *arg1 = (void *) 0 ;
1698
- int result;
1699
- VALUE vresult = Qnil;
1700
-
1701
- if ((argc < 1) || (argc > 1))
1702
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1703
- {
1704
- arg1 = (void*)RSTRING_PTR(argv[0]);
1705
- }
1706
- result = (int)sqlite3_complete16((void const *)arg1);
1707
-
1708
- vresult = INT2NUM(result);
1709
- return vresult;
1710
- }
1711
-
1712
-
1713
- static VALUE
1714
- _wrap_sqlite3_busy_handler(int argc, VALUE *argv, VALUE self) {
1715
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1716
- int (*arg2)(void *,int) = (int (*)(void *,int)) 0 ;
1717
- void *arg3 = (void *) 0 ;
1718
- int result;
1719
- VALUE vresult = Qnil;
1720
-
1721
- if ((argc < 3) || (argc > 3))
1722
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1723
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1724
- SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_f_p_void_int__int, 0);
1725
- SWIG_ConvertPtr(argv[2], (void **) &arg3, 0, SWIG_POINTER_EXCEPTION|0);
1726
- result = (int)sqlite3_busy_handler(arg1,arg2,arg3);
1727
-
1728
- vresult = INT2NUM(result);
1729
- return vresult;
1730
- }
1731
-
1732
-
1733
- static VALUE
1734
- _wrap_sqlite3_busy_timeout(int argc, VALUE *argv, VALUE self) {
1735
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1736
- int arg2 ;
1737
- int result;
1738
- VALUE vresult = Qnil;
1739
-
1740
- if ((argc < 2) || (argc > 2))
1741
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1742
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1743
- arg2 = NUM2INT(argv[1]);
1744
- result = (int)sqlite3_busy_timeout(arg1,arg2);
1745
-
1746
- vresult = INT2NUM(result);
1747
- return vresult;
1748
- }
1749
-
1750
-
1751
- static VALUE
1752
- _wrap_sqlite3_set_authorizer(int argc, VALUE *argv, VALUE self) {
1753
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1754
- int (*arg2)(void *,int,char const *,char const *,char const *,char const *) = (int (*)(void *,int,char const *,char const *,char const *,char const *)) 0 ;
1755
- void *arg3 = (void *) 0 ;
1756
- int result;
1757
- VALUE vresult = Qnil;
1758
-
1759
- if ((argc < 3) || (argc > 3))
1760
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1761
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1762
- SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int, 0);
1763
- SWIG_ConvertPtr(argv[2], (void **) &arg3, 0, SWIG_POINTER_EXCEPTION|0);
1764
- result = (int)sqlite3_set_authorizer(arg1,arg2,arg3);
1765
-
1766
- vresult = INT2NUM(result);
1767
- return vresult;
1768
- }
1769
-
1770
-
1771
- static VALUE
1772
- _wrap_sqlite3_trace(int argc, VALUE *argv, VALUE self) {
1773
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1774
- void (*arg2)(void *,char const *) = (void (*)(void *,char const *)) 0 ;
1775
- void *arg3 = (void *) 0 ;
1776
- int result;
1777
- VALUE vresult = Qnil;
1778
-
1779
- if ((argc < 3) || (argc > 3))
1780
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1781
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1782
- SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_f_p_void_p_q_const__char__void, 0);
1783
- SWIG_ConvertPtr(argv[2], (void **) &arg3, 0, SWIG_POINTER_EXCEPTION|0);
1784
- result = (int)sqlite3_trace(arg1,arg2,arg3);
1785
-
1786
- vresult = INT2NUM(result);
1787
- return vresult;
1788
- }
1789
-
1790
- void setup_delete_db_callback(sqlite3 * db);
1791
- static VALUE
1792
- _wrap_sqlite3_open(int argc, VALUE *argv, VALUE self) {
1793
- char *arg1 = (char *) 0 ;
1794
- sqlite3 **arg2 = (sqlite3 **) 0 ;
1795
- int result;
1796
- VALUE vresult = Qnil;
1797
-
1798
- if ((argc < 1) || (argc > 1))
1799
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1800
- {
1801
- arg1 = STR2CSTR(argv[0]);
1802
- arg2 = (sqlite3**)malloc( sizeof( sqlite3* ) );
1803
- }
1804
- result = (int)sqlite3_open((char const *)arg1,arg2);
1805
- setup_delete_db_callback(*arg2);
1806
-
1807
- vresult = INT2NUM(result);
1808
- {
1809
- VALUE ary;
1810
- ary = rb_ary_new2(2);
1811
- rb_ary_push( ary, vresult );
1812
- rb_ary_push( ary, SWIG_NewPointerObj( *arg2, SWIGTYPE_p_sqlite3, 0 ) );
1813
- free( arg2 );
1814
- vresult = ary;
1815
- }
1816
- return vresult;
1817
- }
1818
-
1819
-
1820
- static VALUE
1821
- _wrap_sqlite3_open16(int argc, VALUE *argv, VALUE self) {
1822
- void *arg1 = (void *) 0 ;
1823
- sqlite3 **arg2 = (sqlite3 **) 0 ;
1824
- int result;
1825
- VALUE vresult = Qnil;
1826
-
1827
- if ((argc < 1) || (argc > 1))
1828
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1829
- {
1830
- arg1 = (void*)RSTRING_PTR(argv[0]);
1831
- arg2 = (sqlite3**)malloc( sizeof( sqlite3* ) );
1832
- }
1833
- result = (int)sqlite3_open16((void const *)arg1,arg2);
1834
-
1835
- vresult = INT2NUM(result);
1836
- {
1837
- VALUE ary;
1838
- ary = rb_ary_new2(2);
1839
- rb_ary_push( ary, vresult );
1840
- rb_ary_push( ary, SWIG_NewPointerObj( *arg2, SWIGTYPE_p_sqlite3, 0 ) );
1841
- free( arg2 );
1842
- vresult = ary;
1843
- }
1844
- return vresult;
1845
- }
1846
-
1847
-
1848
- static VALUE
1849
- _wrap_sqlite3_errcode(int argc, VALUE *argv, VALUE self) {
1850
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1851
- int result;
1852
- VALUE vresult = Qnil;
1853
-
1854
- if ((argc < 1) || (argc > 1))
1855
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1856
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1857
- result = (int)sqlite3_errcode(arg1);
1858
-
1859
- vresult = INT2NUM(result);
1860
- return vresult;
1861
- }
1862
-
1863
-
1864
- static VALUE
1865
- _wrap_sqlite3_errmsg(int argc, VALUE *argv, VALUE self) {
1866
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1867
- char *result;
1868
- VALUE vresult = Qnil;
1869
-
1870
- if ((argc < 1) || (argc > 1))
1871
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1872
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1873
- result = (char *)sqlite3_errmsg(arg1);
1874
-
1875
- {
1876
- vresult = result ? rb_str_new2(result) : Qnil;
1877
- }
1878
- return vresult;
1879
- }
1880
-
1881
-
1882
- static VALUE
1883
- _wrap_sqlite3_errmsg16(int argc, VALUE *argv, VALUE self) {
1884
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1885
- void *result;
1886
- VALUE vresult = Qnil;
1887
-
1888
- if ((argc < 1) || (argc > 1))
1889
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
1890
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1891
- result = (void *)sqlite3_errmsg16(arg1);
1892
-
1893
- {
1894
- int i;
1895
- if( result ) {
1896
- for( i = 0; ((char*)result)[i]; i += 2 );
1897
- vresult = rb_str_new( (char*)result, i );
1898
- } else vresult = Qnil;
1899
- }
1900
- return vresult;
1901
- }
1902
-
1903
-
1904
- static VALUE
1905
- _wrap_sqlite3_prepare(int argc, VALUE *argv, VALUE self) {
1906
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1907
- char *arg2 = (char *) 0 ;
1908
- int arg3 ;
1909
- sqlite3_stmt **arg4 = (sqlite3_stmt **) 0 ;
1910
- char **arg5 = (char **) 0 ;
1911
- int result;
1912
- sqlite3_stmt *stmt2 ;
1913
- char *errmsg2 ;
1914
- VALUE vresult = Qnil;
1915
-
1916
- if ((argc < 2) || (argc > 2))
1917
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1918
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1919
- {
1920
- arg2 = RSTRING_PTR(argv[1]);
1921
- arg3 = RSTRING_LEN(argv[1]);
1922
- arg4 = &stmt2;
1923
- arg5 = &errmsg2;
1924
- }
1925
- result = (int)sqlite3_prepare(arg1,(char const *)arg2,arg3,arg4,(char const **)arg5);
1926
-
1927
- vresult = INT2NUM(result);
1928
- {
1929
- VALUE ary;
1930
- ary = rb_ary_new2(3);
1931
- rb_ary_push( ary, vresult );
1932
- rb_ary_push( ary, SWIG_NewPointerObj( stmt2, SWIGTYPE_p_sqlite3_stmt, 0 ) );
1933
- rb_ary_push( ary, errmsg2 ? rb_str_new2( errmsg2 ) : Qnil );
1934
- vresult = ary;
1935
- }
1936
- return vresult;
1937
- }
1938
-
1939
-
1940
- static VALUE
1941
- _wrap_sqlite3_prepare16(int argc, VALUE *argv, VALUE self) {
1942
- sqlite3 *arg1 = (sqlite3 *) 0 ;
1943
- void *arg2 = (void *) 0 ;
1944
- int arg3 ;
1945
- sqlite3_stmt **arg4 = (sqlite3_stmt **) 0 ;
1946
- void **arg5 = (void **) 0 ;
1947
- int result;
1948
- sqlite3_stmt *stmt2 ;
1949
- void *errmsg2 ;
1950
- VALUE vresult = Qnil;
1951
-
1952
- if ((argc < 2) || (argc > 2))
1953
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
1954
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
1955
- {
1956
- arg2 = RSTRING_PTR(argv[1]);
1957
- arg3 = RSTRING_LEN(argv[1]);
1958
- arg4 = &stmt2;
1959
- arg5 = &errmsg2;
1960
- }
1961
- result = (int)sqlite3_prepare16(arg1,(void const *)arg2,arg3,arg4,(void const **)arg5);
1962
-
1963
- vresult = INT2NUM(result);
1964
- {
1965
- VALUE ary;
1966
- int i;
1967
-
1968
- for( i = 0; ((char*)errmsg2)[i]; i += 2 );
1969
-
1970
- ary = rb_ary_new2(3);
1971
- rb_ary_push( ary, vresult );
1972
- rb_ary_push( ary, SWIG_NewPointerObj( stmt2, SWIGTYPE_p_sqlite3_stmt, 0 ) );
1973
- rb_ary_push( ary, errmsg2 ? rb_str_new( (char*)errmsg2, i ) : Qnil );
1974
- vresult = ary;
1975
- }
1976
- return vresult;
1977
- }
1978
-
1979
-
1980
- static VALUE
1981
- _wrap_sqlite3_bind_blob(int argc, VALUE *argv, VALUE self) {
1982
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
1983
- int arg2 ;
1984
- void *arg3 = (void *) 0 ;
1985
- int arg4 ;
1986
- void (*arg5)(void *) = (void (*)(void *)) 0 ;
1987
- int result;
1988
- VALUE vresult = Qnil;
1989
-
1990
- if ((argc < 3) || (argc > 3))
1991
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
1992
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
1993
- arg2 = NUM2INT(argv[1]);
1994
- {
1995
- arg3 = (void*)RSTRING_PTR(argv[2]);
1996
- arg4 = RSTRING_LEN(argv[2]);
1997
- arg5 = SQLITE_TRANSIENT;
1998
- }
1999
- result = (int)sqlite3_bind_blob(arg1,arg2,(void const *)arg3,arg4,arg5);
2000
-
2001
- vresult = INT2NUM(result);
2002
- return vresult;
2003
- }
2004
-
2005
-
2006
- static VALUE
2007
- _wrap_sqlite3_bind_double(int argc, VALUE *argv, VALUE self) {
2008
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2009
- int arg2 ;
2010
- double arg3 ;
2011
- int result;
2012
- VALUE vresult = Qnil;
2013
-
2014
- if ((argc < 3) || (argc > 3))
2015
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
2016
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2017
- arg2 = NUM2INT(argv[1]);
2018
- arg3 = (double) NUM2DBL(argv[2]);
2019
- result = (int)sqlite3_bind_double(arg1,arg2,arg3);
2020
-
2021
- vresult = INT2NUM(result);
2022
- return vresult;
2023
- }
2024
-
2025
-
2026
- static VALUE
2027
- _wrap_sqlite3_bind_int(int argc, VALUE *argv, VALUE self) {
2028
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2029
- int arg2 ;
2030
- int arg3 ;
2031
- int result;
2032
- VALUE vresult = Qnil;
2033
-
2034
- if ((argc < 3) || (argc > 3))
2035
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
2036
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2037
- arg2 = NUM2INT(argv[1]);
2038
- arg3 = NUM2INT(argv[2]);
2039
- result = (int)sqlite3_bind_int(arg1,arg2,arg3);
2040
-
2041
- vresult = INT2NUM(result);
2042
- return vresult;
2043
- }
2044
-
2045
-
2046
- static VALUE
2047
- _wrap_sqlite3_bind_int64(int argc, VALUE *argv, VALUE self) {
2048
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2049
- int arg2 ;
2050
- sqlite_int64 arg3 ;
2051
- int result;
2052
- VALUE vresult = Qnil;
2053
-
2054
- if ((argc < 3) || (argc > 3))
2055
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
2056
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2057
- arg2 = NUM2INT(argv[1]);
2058
- {
2059
- arg3 = rb_num2ll( argv[2] );
2060
- }
2061
- result = (int)sqlite3_bind_int64(arg1,arg2,arg3);
2062
-
2063
- vresult = INT2NUM(result);
2064
- return vresult;
2065
- }
2066
-
2067
-
2068
- static VALUE
2069
- _wrap_sqlite3_bind_null(int argc, VALUE *argv, VALUE self) {
2070
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2071
- int arg2 ;
2072
- int result;
2073
- VALUE vresult = Qnil;
2074
-
2075
- if ((argc < 2) || (argc > 2))
2076
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2077
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2078
- arg2 = NUM2INT(argv[1]);
2079
- result = (int)sqlite3_bind_null(arg1,arg2);
2080
-
2081
- vresult = INT2NUM(result);
2082
- return vresult;
2083
- }
2084
-
2085
-
2086
- static VALUE
2087
- _wrap_sqlite3_bind_text(int argc, VALUE *argv, VALUE self) {
2088
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2089
- int arg2 ;
2090
- char *arg3 = (char *) 0 ;
2091
- int arg4 ;
2092
- void (*arg5)(void *) = (void (*)(void *)) 0 ;
2093
- int result;
2094
- VALUE vresult = Qnil;
2095
-
2096
- if ((argc < 3) || (argc > 3))
2097
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
2098
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2099
- arg2 = NUM2INT(argv[1]);
2100
- {
2101
- arg3 = RSTRING_PTR(argv[2]);
2102
- arg4 = RSTRING_LEN(argv[2]);
2103
- arg5 = SQLITE_TRANSIENT;
2104
- }
2105
- result = (int)sqlite3_bind_text(arg1,arg2,(char const *)arg3,arg4,arg5);
2106
-
2107
- vresult = INT2NUM(result);
2108
- return vresult;
2109
- }
2110
-
2111
-
2112
- static VALUE
2113
- _wrap_sqlite3_bind_text16(int argc, VALUE *argv, VALUE self) {
2114
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2115
- int arg2 ;
2116
- void *arg3 = (void *) 0 ;
2117
- int arg4 ;
2118
- void (*arg5)(void *) = (void (*)(void *)) 0 ;
2119
- int result;
2120
- VALUE vresult = Qnil;
2121
-
2122
- if ((argc < 3) || (argc > 3))
2123
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc);
2124
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2125
- arg2 = NUM2INT(argv[1]);
2126
- {
2127
- arg3 = (void*)RSTRING_PTR(argv[2]);
2128
- arg4 = RSTRING_LEN(argv[2]);
2129
- arg5 = SQLITE_TRANSIENT;
2130
- }
2131
- result = (int)sqlite3_bind_text16(arg1,arg2,(void const *)arg3,arg4,arg5);
2132
-
2133
- vresult = INT2NUM(result);
2134
- return vresult;
2135
- }
2136
-
2137
-
2138
- static VALUE
2139
- _wrap_sqlite3_bind_parameter_count(int argc, VALUE *argv, VALUE self) {
2140
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2141
- int result;
2142
- VALUE vresult = Qnil;
2143
-
2144
- if ((argc < 1) || (argc > 1))
2145
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2146
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2147
- result = (int)sqlite3_bind_parameter_count(arg1);
2148
-
2149
- vresult = INT2NUM(result);
2150
- return vresult;
2151
- }
2152
-
2153
-
2154
- static VALUE
2155
- _wrap_sqlite3_bind_parameter_name(int argc, VALUE *argv, VALUE self) {
2156
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2157
- int arg2 ;
2158
- char *result;
2159
- VALUE vresult = Qnil;
2160
-
2161
- if ((argc < 2) || (argc > 2))
2162
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2163
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2164
- arg2 = NUM2INT(argv[1]);
2165
- result = (char *)sqlite3_bind_parameter_name(arg1,arg2);
2166
-
2167
- {
2168
- vresult = result ? rb_str_new2(result) : Qnil;
2169
- }
2170
- return vresult;
2171
- }
2172
-
2173
-
2174
- static VALUE
2175
- _wrap_sqlite3_bind_parameter_index(int argc, VALUE *argv, VALUE self) {
2176
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2177
- char *arg2 = (char *) 0 ;
2178
- int result;
2179
- VALUE vresult = Qnil;
2180
-
2181
- if ((argc < 2) || (argc > 2))
2182
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2183
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2184
- arg2 = StringValuePtr(argv[1]);
2185
- result = (int)sqlite3_bind_parameter_index(arg1,(char const *)arg2);
2186
-
2187
- vresult = INT2NUM(result);
2188
- return vresult;
2189
- }
2190
-
2191
-
2192
- static VALUE
2193
- _wrap_sqlite3_column_count(int argc, VALUE *argv, VALUE self) {
2194
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2195
- int result;
2196
- VALUE vresult = Qnil;
2197
-
2198
- if ((argc < 1) || (argc > 1))
2199
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2200
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2201
- result = (int)sqlite3_column_count(arg1);
2202
-
2203
- vresult = INT2NUM(result);
2204
- return vresult;
2205
- }
2206
-
2207
-
2208
- static VALUE
2209
- _wrap_sqlite3_column_name(int argc, VALUE *argv, VALUE self) {
2210
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2211
- int arg2 ;
2212
- char *result;
2213
- VALUE vresult = Qnil;
2214
-
2215
- if ((argc < 2) || (argc > 2))
2216
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2217
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2218
- arg2 = NUM2INT(argv[1]);
2219
- result = (char *)sqlite3_column_name(arg1,arg2);
2220
-
2221
- {
2222
- vresult = result ? rb_str_new2(result) : Qnil;
2223
- }
2224
- return vresult;
2225
- }
2226
-
2227
-
2228
- static VALUE
2229
- _wrap_sqlite3_column_name16(int argc, VALUE *argv, VALUE self) {
2230
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2231
- int arg2 ;
2232
- void *result;
2233
- VALUE vresult = Qnil;
2234
-
2235
- if ((argc < 2) || (argc > 2))
2236
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2237
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2238
- arg2 = NUM2INT(argv[1]);
2239
- result = (void *)sqlite3_column_name16(arg1,arg2);
2240
-
2241
- {
2242
- int i;
2243
- if( result ) {
2244
- for( i = 0; ((char*)result)[i]; i += 2 );
2245
- vresult = rb_str_new( (char*)result, i );
2246
- } else vresult = Qnil;
2247
- }
2248
- return vresult;
2249
- }
2250
-
2251
-
2252
- static VALUE
2253
- _wrap_sqlite3_column_decltype(int argc, VALUE *argv, VALUE self) {
2254
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2255
- int arg2 ;
2256
- char *result;
2257
- VALUE vresult = Qnil;
2258
-
2259
- if ((argc < 2) || (argc > 2))
2260
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2261
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2262
- arg2 = NUM2INT(argv[1]);
2263
- result = (char *)sqlite3_column_decltype(arg1,arg2);
2264
-
2265
- {
2266
- vresult = result ? rb_str_new2(result) : Qnil;
2267
- }
2268
- return vresult;
2269
- }
2270
-
2271
-
2272
- static VALUE
2273
- _wrap_sqlite3_column_decltype16(int argc, VALUE *argv, VALUE self) {
2274
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2275
- int arg2 ;
2276
- void *result;
2277
- VALUE vresult = Qnil;
2278
-
2279
- if ((argc < 2) || (argc > 2))
2280
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2281
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2282
- arg2 = NUM2INT(argv[1]);
2283
- result = (void *)sqlite3_column_decltype16(arg1,arg2);
2284
-
2285
- {
2286
- int i;
2287
- if( result ) {
2288
- for( i = 0; ((char*)result)[i]; i += 2 );
2289
- vresult = rb_str_new( (char*)result, i );
2290
- } else vresult = Qnil;
2291
- }
2292
- return vresult;
2293
- }
2294
-
2295
-
2296
- static VALUE
2297
- _wrap_sqlite3_step(int argc, VALUE *argv, VALUE self) {
2298
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2299
- int result;
2300
- VALUE vresult = Qnil;
2301
-
2302
- if ((argc < 1) || (argc > 1))
2303
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2304
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2305
- result = (int)sqlite3_step(arg1);
2306
-
2307
- vresult = INT2NUM(result);
2308
- return vresult;
2309
- }
2310
-
2311
-
2312
- static VALUE
2313
- _wrap_sqlite3_data_count(int argc, VALUE *argv, VALUE self) {
2314
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2315
- int result;
2316
- VALUE vresult = Qnil;
2317
-
2318
- if ((argc < 1) || (argc > 1))
2319
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2320
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2321
- result = (int)sqlite3_data_count(arg1);
2322
-
2323
- vresult = INT2NUM(result);
2324
- return vresult;
2325
- }
2326
-
2327
-
2328
- static VALUE
2329
- _wrap_sqlite3_column_blob(int argc, VALUE *argv, VALUE self) {
2330
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2331
- int arg2 ;
2332
- RUBY_BLOB *result;
2333
- VALUE vresult = Qnil;
2334
-
2335
- if ((argc < 2) || (argc > 2))
2336
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2337
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2338
- arg2 = NUM2INT(argv[1]);
2339
- result = (RUBY_BLOB *)sqlite3_column_blob(arg1,arg2);
2340
-
2341
- {
2342
- vresult = result ?
2343
- rb_str_new( (char*)result, sqlite3_column_bytes( arg1, arg2 ) ) : Qnil;
2344
- }
2345
- return vresult;
2346
- }
2347
-
2348
-
2349
- static VALUE
2350
- _wrap_sqlite3_column_bytes(int argc, VALUE *argv, VALUE self) {
2351
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2352
- int arg2 ;
2353
- int result;
2354
- VALUE vresult = Qnil;
2355
-
2356
- if ((argc < 2) || (argc > 2))
2357
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2358
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2359
- arg2 = NUM2INT(argv[1]);
2360
- result = (int)sqlite3_column_bytes(arg1,arg2);
2361
-
2362
- vresult = INT2NUM(result);
2363
- return vresult;
2364
- }
2365
-
2366
-
2367
- static VALUE
2368
- _wrap_sqlite3_column_bytes16(int argc, VALUE *argv, VALUE self) {
2369
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2370
- int arg2 ;
2371
- int result;
2372
- VALUE vresult = Qnil;
2373
-
2374
- if ((argc < 2) || (argc > 2))
2375
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2376
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2377
- arg2 = NUM2INT(argv[1]);
2378
- result = (int)sqlite3_column_bytes16(arg1,arg2);
2379
-
2380
- vresult = INT2NUM(result);
2381
- return vresult;
2382
- }
2383
-
2384
-
2385
- static VALUE
2386
- _wrap_sqlite3_column_double(int argc, VALUE *argv, VALUE self) {
2387
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2388
- int arg2 ;
2389
- double result;
2390
- VALUE vresult = Qnil;
2391
-
2392
- if ((argc < 2) || (argc > 2))
2393
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2394
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2395
- arg2 = NUM2INT(argv[1]);
2396
- result = (double)sqlite3_column_double(arg1,arg2);
2397
-
2398
- vresult = rb_float_new(result);
2399
- return vresult;
2400
- }
2401
-
2402
-
2403
- static VALUE
2404
- _wrap_sqlite3_column_int(int argc, VALUE *argv, VALUE self) {
2405
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2406
- int arg2 ;
2407
- double result;
2408
- VALUE vresult = Qnil;
2409
-
2410
- if ((argc < 2) || (argc > 2))
2411
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2412
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2413
- arg2 = NUM2INT(argv[1]);
2414
- result = (double)sqlite3_column_int(arg1,arg2);
2415
-
2416
- vresult = rb_float_new(result);
2417
- return vresult;
2418
- }
2419
-
2420
-
2421
- static VALUE
2422
- _wrap_sqlite3_column_int64(int argc, VALUE *argv, VALUE self) {
2423
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2424
- int arg2 ;
2425
- sqlite_int64 result;
2426
- VALUE vresult = Qnil;
2427
-
2428
- if ((argc < 2) || (argc > 2))
2429
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2430
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2431
- arg2 = NUM2INT(argv[1]);
2432
- result = sqlite3_column_int64(arg1,arg2);
2433
-
2434
- {
2435
- vresult = rb_ll2inum( result );
2436
- }
2437
- return vresult;
2438
- }
2439
-
2440
-
2441
- static VALUE
2442
- _wrap_sqlite3_column_text(int argc, VALUE *argv, VALUE self) {
2443
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2444
- int arg2 ;
2445
- char *result;
2446
- VALUE vresult = Qnil;
2447
-
2448
- if ((argc < 2) || (argc > 2))
2449
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2450
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2451
- arg2 = NUM2INT(argv[1]);
2452
- result = (char *)sqlite3_column_text(arg1,arg2);
2453
-
2454
- {
2455
- vresult = result ? rb_str_new2(result) : Qnil;
2456
- }
2457
- return vresult;
2458
- }
2459
-
2460
-
2461
- static VALUE
2462
- _wrap_sqlite3_column_text16(int argc, VALUE *argv, VALUE self) {
2463
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2464
- int arg2 ;
2465
- void *result;
2466
- VALUE vresult = Qnil;
2467
-
2468
- if ((argc < 2) || (argc > 2))
2469
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2470
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2471
- arg2 = NUM2INT(argv[1]);
2472
- result = (void *)sqlite3_column_text16(arg1,arg2);
2473
-
2474
- {
2475
- int i;
2476
- if( result ) {
2477
- for( i = 0; ((char*)result)[i]; i += 2 );
2478
- vresult = rb_str_new( (char*)result, i );
2479
- } else vresult = Qnil;
2480
- }
2481
- return vresult;
2482
- }
2483
-
2484
-
2485
- static VALUE
2486
- _wrap_sqlite3_column_type(int argc, VALUE *argv, VALUE self) {
2487
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2488
- int arg2 ;
2489
- int result;
2490
- VALUE vresult = Qnil;
2491
-
2492
- if ((argc < 2) || (argc > 2))
2493
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2494
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2495
- arg2 = NUM2INT(argv[1]);
2496
- result = (int)sqlite3_column_type(arg1,arg2);
2497
-
2498
- vresult = INT2NUM(result);
2499
- return vresult;
2500
- }
2501
-
2502
-
2503
- static VALUE
2504
- _wrap_sqlite3_finalize(int argc, VALUE *argv, VALUE self) {
2505
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2506
- int result;
2507
- VALUE vresult = Qnil;
2508
-
2509
- if ((argc < 1) || (argc > 1))
2510
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2511
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2512
- result = (int)sqlite3_finalize(arg1);
2513
-
2514
- vresult = INT2NUM(result);
2515
- return vresult;
2516
- }
2517
-
2518
-
2519
- static VALUE
2520
- _wrap_sqlite3_reset(int argc, VALUE *argv, VALUE self) {
2521
- sqlite3_stmt *arg1 = (sqlite3_stmt *) 0 ;
2522
- int result;
2523
- VALUE vresult = Qnil;
2524
-
2525
- if ((argc < 1) || (argc > 1))
2526
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2527
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_stmt, 0);
2528
- result = (int)sqlite3_reset(arg1);
2529
-
2530
- vresult = INT2NUM(result);
2531
- return vresult;
2532
- }
2533
-
2534
-
2535
- static VALUE
2536
- _wrap_sqlite3_create_function(int argc, VALUE *argv, VALUE self) {
2537
- sqlite3 *arg1 = (sqlite3 *) 0 ;
2538
- char *arg2 = (char *) 0 ;
2539
- int arg3 ;
2540
- int arg4 ;
2541
- void *arg5 = (void *) 0 ;
2542
- void (*arg6)(sqlite3_context *,int,sqlite3_value **) = (void (*)(sqlite3_context *,int,sqlite3_value **)) 0 ;
2543
- void (*arg7)(sqlite3_context *,int,sqlite3_value **) = (void (*)(sqlite3_context *,int,sqlite3_value **)) 0 ;
2544
- void (*arg8)(sqlite3_context *) = (void (*)(sqlite3_context *)) 0 ;
2545
- int result;
2546
- VALUE vresult = Qnil;
2547
-
2548
- if ((argc < 8) || (argc > 8))
2549
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 8)",argc);
2550
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
2551
- arg2 = StringValuePtr(argv[1]);
2552
- arg3 = NUM2INT(argv[2]);
2553
- arg4 = NUM2INT(argv[3]);
2554
- SWIG_ConvertPtr(argv[4], (void **) &arg5, 0, SWIG_POINTER_EXCEPTION|0);
2555
- SWIG_ConvertPtr(argv[5], (void **) &arg6, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0);
2556
- SWIG_ConvertPtr(argv[6], (void **) &arg7, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0);
2557
- SWIG_ConvertPtr(argv[7], (void **) &arg8, SWIGTYPE_p_f_p_sqlite3_context__void, 0);
2558
- result = (int)sqlite3_create_function(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8);
2559
-
2560
- vresult = INT2NUM(result);
2561
- return vresult;
2562
- }
2563
-
2564
-
2565
- static VALUE
2566
- _wrap_sqlite3_create_function16(int argc, VALUE *argv, VALUE self) {
2567
- sqlite3 *arg1 = (sqlite3 *) 0 ;
2568
- void *arg2 = (void *) 0 ;
2569
- int arg3 ;
2570
- int arg4 ;
2571
- void *arg5 = (void *) 0 ;
2572
- void (*arg6)(sqlite3_context *,int,sqlite3_value **) = (void (*)(sqlite3_context *,int,sqlite3_value **)) 0 ;
2573
- void (*arg7)(sqlite3_context *,int,sqlite3_value **) = (void (*)(sqlite3_context *,int,sqlite3_value **)) 0 ;
2574
- void (*arg8)(sqlite3_context *) = (void (*)(sqlite3_context *)) 0 ;
2575
- int result;
2576
- VALUE vresult = Qnil;
2577
-
2578
- if ((argc < 8) || (argc > 8))
2579
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 8)",argc);
2580
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3, 0);
2581
- {
2582
- arg2 = (void*)RSTRING_PTR(argv[1]);
2583
- }
2584
- arg3 = NUM2INT(argv[2]);
2585
- arg4 = NUM2INT(argv[3]);
2586
- SWIG_ConvertPtr(argv[4], (void **) &arg5, 0, SWIG_POINTER_EXCEPTION|0);
2587
- SWIG_ConvertPtr(argv[5], (void **) &arg6, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0);
2588
- SWIG_ConvertPtr(argv[6], (void **) &arg7, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0);
2589
- SWIG_ConvertPtr(argv[7], (void **) &arg8, SWIGTYPE_p_f_p_sqlite3_context__void, 0);
2590
- result = (int)sqlite3_create_function16(arg1,(void const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8);
2591
-
2592
- vresult = INT2NUM(result);
2593
- return vresult;
2594
- }
2595
-
2596
-
2597
- static VALUE
2598
- _wrap_sqlite3_aggregate_count(int argc, VALUE *argv, VALUE self) {
2599
- sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2600
- int result;
2601
- VALUE vresult = Qnil;
2602
-
2603
- if ((argc < 1) || (argc > 1))
2604
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2605
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2606
- result = (int)sqlite3_aggregate_count(arg1);
2607
-
2608
- vresult = INT2NUM(result);
2609
- return vresult;
2610
- }
2611
-
2612
-
2613
- static VALUE
2614
- _wrap_sqlite3_value_blob(int argc, VALUE *argv, VALUE self) {
2615
- sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2616
- RUBY_VALBLOB *result;
2617
- VALUE vresult = Qnil;
2618
-
2619
- if ((argc < 1) || (argc > 1))
2620
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2621
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2622
- result = (RUBY_VALBLOB *)sqlite3_value_blob(arg1);
2623
-
2624
- {
2625
- vresult = result ? rb_str_new( (char*)result, sqlite3_value_bytes( arg1 ) ) : Qnil;
2626
- }
2627
- return vresult;
2628
- }
2629
-
2630
-
2631
- static VALUE
2632
- _wrap_sqlite3_value_bytes(int argc, VALUE *argv, VALUE self) {
2633
- sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2634
- int result;
2635
- VALUE vresult = Qnil;
2636
-
2637
- if ((argc < 1) || (argc > 1))
2638
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2639
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2640
- result = (int)sqlite3_value_bytes(arg1);
2641
-
2642
- vresult = INT2NUM(result);
2643
- return vresult;
2644
- }
2645
-
2646
-
2647
- static VALUE
2648
- _wrap_sqlite3_value_bytes16(int argc, VALUE *argv, VALUE self) {
2649
- sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2650
- int result;
2651
- VALUE vresult = Qnil;
2652
-
2653
- if ((argc < 1) || (argc > 1))
2654
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2655
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2656
- result = (int)sqlite3_value_bytes16(arg1);
2657
-
2658
- vresult = INT2NUM(result);
2659
- return vresult;
2660
- }
2661
-
2662
-
2663
- static VALUE
2664
- _wrap_sqlite3_value_double(int argc, VALUE *argv, VALUE self) {
2665
- sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2666
- double result;
2667
- VALUE vresult = Qnil;
2668
-
2669
- if ((argc < 1) || (argc > 1))
2670
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2671
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2672
- result = (double)sqlite3_value_double(arg1);
2673
-
2674
- vresult = rb_float_new(result);
2675
- return vresult;
2676
- }
2677
-
2678
-
2679
- static VALUE
2680
- _wrap_sqlite3_value_int(int argc, VALUE *argv, VALUE self) {
2681
- sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2682
- int result;
2683
- VALUE vresult = Qnil;
2684
-
2685
- if ((argc < 1) || (argc > 1))
2686
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2687
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2688
- result = (int)sqlite3_value_int(arg1);
2689
-
2690
- vresult = INT2NUM(result);
2691
- return vresult;
2692
- }
2693
-
2694
-
2695
- static VALUE
2696
- _wrap_sqlite3_value_int64(int argc, VALUE *argv, VALUE self) {
2697
- sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2698
- sqlite_int64 result;
2699
- VALUE vresult = Qnil;
2700
-
2701
- if ((argc < 1) || (argc > 1))
2702
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2703
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2704
- result = sqlite3_value_int64(arg1);
2705
-
2706
- {
2707
- vresult = rb_ll2inum( result );
2708
- }
2709
- return vresult;
2710
- }
2711
-
2712
-
2713
- static VALUE
2714
- _wrap_sqlite3_value_text(int argc, VALUE *argv, VALUE self) {
2715
- sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2716
- char *result;
2717
- VALUE vresult = Qnil;
2718
-
2719
- if ((argc < 1) || (argc > 1))
2720
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2721
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2722
- result = (char *)sqlite3_value_text(arg1);
2723
-
2724
- {
2725
- vresult = result ? rb_str_new2(result) : Qnil;
2726
- }
2727
- return vresult;
2728
- }
2729
-
2730
-
2731
- static VALUE
2732
- _wrap_sqlite3_value_text16(int argc, VALUE *argv, VALUE self) {
2733
- sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2734
- void *result;
2735
- VALUE vresult = Qnil;
2736
-
2737
- if ((argc < 1) || (argc > 1))
2738
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2739
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2740
- result = (void *)sqlite3_value_text16(arg1);
2741
-
2742
- {
2743
- int i;
2744
- if( result ) {
2745
- for( i = 0; ((char*)result)[i]; i += 2 );
2746
- vresult = rb_str_new( (char*)result, i );
2747
- } else vresult = Qnil;
2748
- }
2749
- return vresult;
2750
- }
2751
-
2752
-
2753
- static VALUE
2754
- _wrap_sqlite3_value_text16le(int argc, VALUE *argv, VALUE self) {
2755
- sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2756
- void *result;
2757
- VALUE vresult = Qnil;
2758
-
2759
- if ((argc < 1) || (argc > 1))
2760
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2761
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2762
- result = (void *)sqlite3_value_text16le(arg1);
2763
-
2764
- {
2765
- int i;
2766
- if( result ) {
2767
- for( i = 0; ((char*)result)[i]; i += 2 );
2768
- vresult = rb_str_new( (char*)result, i );
2769
- } else vresult = Qnil;
2770
- }
2771
- return vresult;
2772
- }
2773
-
2774
-
2775
- static VALUE
2776
- _wrap_sqlite3_value_text16be(int argc, VALUE *argv, VALUE self) {
2777
- sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2778
- void *result;
2779
- VALUE vresult = Qnil;
2780
-
2781
- if ((argc < 1) || (argc > 1))
2782
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2783
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2784
- result = (void *)sqlite3_value_text16be(arg1);
2785
-
2786
- {
2787
- int i;
2788
- if( result ) {
2789
- for( i = 0; ((char*)result)[i]; i += 2 );
2790
- vresult = rb_str_new( (char*)result, i );
2791
- } else vresult = Qnil;
2792
- }
2793
- return vresult;
2794
- }
2795
-
2796
-
2797
- static VALUE
2798
- _wrap_sqlite3_value_type(int argc, VALUE *argv, VALUE self) {
2799
- sqlite3_value *arg1 = (sqlite3_value *) 0 ;
2800
- int result;
2801
- VALUE vresult = Qnil;
2802
-
2803
- if ((argc < 1) || (argc > 1))
2804
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
2805
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_value, 0);
2806
- result = (int)sqlite3_value_type(arg1);
2807
-
2808
- vresult = INT2NUM(result);
2809
- return vresult;
2810
- }
2811
-
2812
-
2813
- static VALUE
2814
- _wrap_sqlite3_result_blob(int argc, VALUE *argv, VALUE self) {
2815
- sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2816
- void *arg2 = (void *) 0 ;
2817
- int arg3 ;
2818
- void (*arg4)(void *) = (void (*)(void *)) 0 ;
2819
-
2820
- if ((argc < 2) || (argc > 2))
2821
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2822
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2823
- {
2824
- arg2 = (void*)RSTRING_PTR(argv[1]);
2825
- arg3 = RSTRING_LEN(argv[1]);
2826
- arg4 = SQLITE_TRANSIENT;
2827
- }
2828
- sqlite3_result_blob(arg1,(void const *)arg2,arg3,arg4);
2829
-
2830
- return Qnil;
2831
- }
2832
-
2833
-
2834
- static VALUE
2835
- _wrap_sqlite3_result_double(int argc, VALUE *argv, VALUE self) {
2836
- sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2837
- double arg2 ;
2838
-
2839
- if ((argc < 2) || (argc > 2))
2840
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2841
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2842
- arg2 = (double) NUM2DBL(argv[1]);
2843
- sqlite3_result_double(arg1,arg2);
2844
-
2845
- return Qnil;
2846
- }
2847
-
2848
-
2849
- static VALUE
2850
- _wrap_sqlite3_result_error(int argc, VALUE *argv, VALUE self) {
2851
- sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2852
- char *arg2 = (char *) 0 ;
2853
- int arg3 ;
2854
-
2855
- if ((argc < 2) || (argc > 2))
2856
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2857
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2858
- {
2859
- arg2 = RSTRING_PTR(argv[1]);
2860
- arg3 = RSTRING_LEN(argv[1]);
2861
- }
2862
- sqlite3_result_error(arg1,(char const *)arg2,arg3);
2863
-
2864
- return Qnil;
2865
- }
2866
-
2867
-
2868
- static VALUE
2869
- _wrap_sqlite3_result_error16(int argc, VALUE *argv, VALUE self) {
2870
- sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2871
- void *arg2 = (void *) 0 ;
2872
- int arg3 ;
2873
-
2874
- if ((argc < 2) || (argc > 2))
2875
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2876
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2877
- {
2878
- arg2 = (void*)RSTRING_PTR(argv[1]);
2879
- arg3 = RSTRING_LEN(argv[1]);
2880
- }
2881
- sqlite3_result_error16(arg1,(void const *)arg2,arg3);
2882
-
2883
- return Qnil;
2884
- }
2885
-
2886
-
2887
- static VALUE
2888
- _wrap_sqlite3_result_int(int argc, VALUE *argv, VALUE self) {
2889
- sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2890
- int arg2 ;
2891
-
2892
- if ((argc < 2) || (argc > 2))
2893
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2894
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2895
- arg2 = NUM2INT(argv[1]);
2896
- sqlite3_result_int(arg1,arg2);
2897
-
2898
- return Qnil;
2899
- }
2900
-
2901
-
2902
- static VALUE
2903
- _wrap_sqlite3_result_int64(int argc, VALUE *argv, VALUE self) {
2904
- sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2905
- sqlite_int64 arg2 ;
2906
-
2907
- if ((argc < 2) || (argc > 2))
2908
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2909
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2910
- {
2911
- arg2 = rb_num2ll( argv[1] );
2912
- }
2913
- sqlite3_result_int64(arg1,arg2);
2914
-
2915
- return Qnil;
2916
- }
2917
-
2918
-
2919
- static VALUE
2920
- _wrap_sqlite3_result_text(int argc, VALUE *argv, VALUE self) {
2921
- sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2922
- char *arg2 = (char *) 0 ;
2923
- int arg3 ;
2924
- void (*arg4)(void *) = (void (*)(void *)) 0 ;
2925
-
2926
- if ((argc < 2) || (argc > 2))
2927
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2928
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2929
- {
2930
- arg2 = RSTRING_PTR(argv[1]);
2931
- arg3 = RSTRING_LEN(argv[1]);
2932
- arg4 = SQLITE_TRANSIENT;
2933
- }
2934
- sqlite3_result_text(arg1,(char const *)arg2,arg3,arg4);
2935
-
2936
- return Qnil;
2937
- }
2938
-
2939
-
2940
- static VALUE
2941
- _wrap_sqlite3_result_text16(int argc, VALUE *argv, VALUE self) {
2942
- sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2943
- void *arg2 = (void *) 0 ;
2944
- int arg3 ;
2945
- void (*arg4)(void *) = (void (*)(void *)) 0 ;
2946
-
2947
- if ((argc < 2) || (argc > 2))
2948
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2949
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2950
- {
2951
- arg2 = (void*)RSTRING_PTR(argv[1]);
2952
- arg3 = RSTRING_LEN(argv[1]);
2953
- arg4 = SQLITE_TRANSIENT;
2954
- }
2955
- sqlite3_result_text16(arg1,(void const *)arg2,arg3,arg4);
2956
-
2957
- return Qnil;
2958
- }
2959
-
2960
-
2961
- static VALUE
2962
- _wrap_sqlite3_result_text16le(int argc, VALUE *argv, VALUE self) {
2963
- sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2964
- void *arg2 = (void *) 0 ;
2965
- int arg3 ;
2966
- void (*arg4)(void *) = (void (*)(void *)) 0 ;
2967
-
2968
- if ((argc < 2) || (argc > 2))
2969
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2970
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2971
- {
2972
- arg2 = (void*)RSTRING_PTR(argv[1]);
2973
- arg3 = RSTRING_LEN(argv[1]);
2974
- arg4 = SQLITE_TRANSIENT;
2975
- }
2976
- sqlite3_result_text16le(arg1,(void const *)arg2,arg3,arg4);
2977
-
2978
- return Qnil;
2979
- }
2980
-
2981
-
2982
- static VALUE
2983
- _wrap_sqlite3_result_text16be(int argc, VALUE *argv, VALUE self) {
2984
- sqlite3_context *arg1 = (sqlite3_context *) 0 ;
2985
- void *arg2 = (void *) 0 ;
2986
- int arg3 ;
2987
- void (*arg4)(void *) = (void (*)(void *)) 0 ;
2988
-
2989
- if ((argc < 2) || (argc > 2))
2990
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
2991
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
2992
- {
2993
- arg2 = (void*)RSTRING_PTR(argv[1]);
2994
- arg3 = RSTRING_LEN(argv[1]);
2995
- arg4 = SQLITE_TRANSIENT;
2996
- }
2997
- sqlite3_result_text16be(arg1,(void const *)arg2,arg3,arg4);
2998
-
2999
- return Qnil;
3000
- }
3001
-
3002
-
3003
- static VALUE
3004
- _wrap_sqlite3_result_value(int argc, VALUE *argv, VALUE self) {
3005
- sqlite3_context *arg1 = (sqlite3_context *) 0 ;
3006
- sqlite3_value *arg2 = (sqlite3_value *) 0 ;
3007
-
3008
- if ((argc < 2) || (argc > 2))
3009
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
3010
- SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_sqlite3_context, 0);
3011
- SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_sqlite3_value, 0);
3012
- sqlite3_result_value(arg1,arg2);
3013
-
3014
- return Qnil;
3015
- }
3016
-
3017
-
3018
- static VALUE
3019
- _wrap_sqlite3_aggregate_context(int argc, VALUE *argv, VALUE self) {
3020
- sqlite3_context *arg1 = (sqlite3_context *) 0 ;
3021
- int arg2 ;
3022
- VALUE *result;
3023
- VALUE vresult = Qnil;
3024
-
3025
- if ((argc < 1) || (argc > 1))
3026
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
3027
- {
3028
- SWIG_ConvertPtr(argv[0],(void**)&arg1, SWIGTYPE_p_sqlite3_context, 1);
3029
- arg2 = 4;
3030
- }
3031
- result = (VALUE *)sqlite3_aggregate_context(arg1,arg2);
3032
-
3033
- {
3034
- vresult = *(VALUE*)result;
3035
- }
3036
- return vresult;
3037
- }
3038
-
3039
-
3040
-
3041
- /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
3042
-
3043
- static swig_type_info _swigt__p_CallbackData = {"_p_CallbackData", "struct CallbackData *", 0, 0, 0};
3044
- static swig_type_info _swigt__p_f_p_sqlite3_context__void = {"_p_f_p_sqlite3_context__void", "void (*)(sqlite3_context *)", 0, 0, 0};
3045
- static swig_type_info _swigt__p_f_p_sqlite3_context_int_p_p_sqlite3_value__void = {"_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void", "void (*)(sqlite3_context *,int,sqlite3_value **)", 0, 0, 0};
3046
- static swig_type_info _swigt__p_f_p_void__void = {"_p_f_p_void__void", "void (*)(void *)", 0, 0, 0};
3047
- static swig_type_info _swigt__p_f_p_void_int__int = {"_p_f_p_void_int__int", "int (*)(void *,int)", 0, 0, 0};
3048
- static swig_type_info _swigt__p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int = {"_p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int", "int (*)(void *,int,char const *,char const *,char const *,char const *)", 0, 0, 0};
3049
- static swig_type_info _swigt__p_f_p_void_p_q_const__char__void = {"_p_f_p_void_p_q_const__char__void", "void (*)(void *,char const *)", 0, 0, 0};
3050
- static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, 0};
3051
- static swig_type_info _swigt__p_p_sqlite3 = {"_p_p_sqlite3", "sqlite3 **", 0, 0, 0};
3052
- static swig_type_info _swigt__p_p_sqlite3_stmt = {"_p_p_sqlite3_stmt", "sqlite3_stmt **", 0, 0, 0};
3053
- static swig_type_info _swigt__p_p_void = {"_p_p_void", "void **", 0, 0, 0};
3054
- static swig_type_info _swigt__p_sqlite3 = {"_p_sqlite3", "sqlite3 *", 0, 0, 0};
3055
- static swig_type_info _swigt__p_sqlite3_context = {"_p_sqlite3_context", "sqlite3_context *", 0, 0, 0};
3056
- static swig_type_info _swigt__p_sqlite3_stmt = {"_p_sqlite3_stmt", "sqlite3_stmt *", 0, 0, 0};
3057
- static swig_type_info _swigt__p_sqlite3_value = {"_p_sqlite3_value", "sqlite3_value *", 0, 0, 0};
3058
- static swig_type_info _swigt__p_sqlite_int64 = {"_p_sqlite_int64", "sqlite_int64 *", 0, 0, 0};
3059
- static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "unsigned long *|VALUE *", 0, 0, 0};
3060
- static swig_type_info _swigt__p_void = {"_p_void", "void *|RUBY_VALBLOB *", 0, 0, 0};
3061
-
3062
- static swig_type_info *swig_type_initial[] = {
3063
- &_swigt__p_CallbackData,
3064
- &_swigt__p_f_p_sqlite3_context__void,
3065
- &_swigt__p_f_p_sqlite3_context_int_p_p_sqlite3_value__void,
3066
- &_swigt__p_f_p_void__void,
3067
- &_swigt__p_f_p_void_int__int,
3068
- &_swigt__p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int,
3069
- &_swigt__p_f_p_void_p_q_const__char__void,
3070
- &_swigt__p_p_char,
3071
- &_swigt__p_p_sqlite3,
3072
- &_swigt__p_p_sqlite3_stmt,
3073
- &_swigt__p_p_void,
3074
- &_swigt__p_sqlite3,
3075
- &_swigt__p_sqlite3_context,
3076
- &_swigt__p_sqlite3_stmt,
3077
- &_swigt__p_sqlite3_value,
3078
- &_swigt__p_sqlite_int64,
3079
- &_swigt__p_unsigned_long,
3080
- &_swigt__p_void,
3081
- };
3082
-
3083
- static swig_cast_info _swigc__p_CallbackData[] = { {&_swigt__p_CallbackData, 0, 0, 0},{0, 0, 0, 0}};
3084
- static swig_cast_info _swigc__p_f_p_sqlite3_context__void[] = { {&_swigt__p_f_p_sqlite3_context__void, 0, 0, 0},{0, 0, 0, 0}};
3085
- static swig_cast_info _swigc__p_f_p_sqlite3_context_int_p_p_sqlite3_value__void[] = { {&_swigt__p_f_p_sqlite3_context_int_p_p_sqlite3_value__void, 0, 0, 0},{0, 0, 0, 0}};
3086
- static swig_cast_info _swigc__p_f_p_void__void[] = { {&_swigt__p_f_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
3087
- static swig_cast_info _swigc__p_f_p_void_int__int[] = { {&_swigt__p_f_p_void_int__int, 0, 0, 0},{0, 0, 0, 0}};
3088
- static swig_cast_info _swigc__p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int[] = { {&_swigt__p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int, 0, 0, 0},{0, 0, 0, 0}};
3089
- static swig_cast_info _swigc__p_f_p_void_p_q_const__char__void[] = { {&_swigt__p_f_p_void_p_q_const__char__void, 0, 0, 0},{0, 0, 0, 0}};
3090
- static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
3091
- static swig_cast_info _swigc__p_p_sqlite3[] = { {&_swigt__p_p_sqlite3, 0, 0, 0},{0, 0, 0, 0}};
3092
- static swig_cast_info _swigc__p_p_sqlite3_stmt[] = { {&_swigt__p_p_sqlite3_stmt, 0, 0, 0},{0, 0, 0, 0}};
3093
- static swig_cast_info _swigc__p_p_void[] = { {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}};
3094
- static swig_cast_info _swigc__p_sqlite3[] = { {&_swigt__p_sqlite3, 0, 0, 0},{0, 0, 0, 0}};
3095
- static swig_cast_info _swigc__p_sqlite3_context[] = { {&_swigt__p_sqlite3_context, 0, 0, 0},{0, 0, 0, 0}};
3096
- static swig_cast_info _swigc__p_sqlite3_stmt[] = { {&_swigt__p_sqlite3_stmt, 0, 0, 0},{0, 0, 0, 0}};
3097
- static swig_cast_info _swigc__p_sqlite3_value[] = { {&_swigt__p_sqlite3_value, 0, 0, 0},{0, 0, 0, 0}};
3098
- static swig_cast_info _swigc__p_sqlite_int64[] = { {&_swigt__p_sqlite_int64, 0, 0, 0},{0, 0, 0, 0}};
3099
- static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
3100
- static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
3101
-
3102
- static swig_cast_info *swig_cast_initial[] = {
3103
- _swigc__p_CallbackData,
3104
- _swigc__p_f_p_sqlite3_context__void,
3105
- _swigc__p_f_p_sqlite3_context_int_p_p_sqlite3_value__void,
3106
- _swigc__p_f_p_void__void,
3107
- _swigc__p_f_p_void_int__int,
3108
- _swigc__p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int,
3109
- _swigc__p_f_p_void_p_q_const__char__void,
3110
- _swigc__p_p_char,
3111
- _swigc__p_p_sqlite3,
3112
- _swigc__p_p_sqlite3_stmt,
3113
- _swigc__p_p_void,
3114
- _swigc__p_sqlite3,
3115
- _swigc__p_sqlite3_context,
3116
- _swigc__p_sqlite3_stmt,
3117
- _swigc__p_sqlite3_value,
3118
- _swigc__p_sqlite_int64,
3119
- _swigc__p_unsigned_long,
3120
- _swigc__p_void,
3121
- };
3122
-
3123
-
3124
- /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3125
-
3126
- /*************************************************************************
3127
- * Type initialization:
3128
- * This problem is tough by the requirement that no dynamic
3129
- * memory is used. Also, since swig_type_info structures store pointers to
3130
- * swig_cast_info structures and swig_cast_info structures store pointers back
3131
- * to swig_type_info structures, we need some lookup code at initialization.
3132
- * The idea is that swig generates all the structures that are needed.
3133
- * The runtime then collects these partially filled structures.
3134
- * The SWIG_InitializeModule function takes these initial arrays out of
3135
- * swig_module, and does all the lookup, filling in the swig_module.types
3136
- * array with the correct data and linking the correct swig_cast_info
3137
- * structures together.
3138
-
3139
- * The generated swig_type_info structures are assigned staticly to an initial
3140
- * array. We just loop though that array, and handle each type individually.
3141
- * First we lookup if this type has been already loaded, and if so, use the
3142
- * loaded structure instead of the generated one. Then we have to fill in the
3143
- * cast linked list. The cast data is initially stored in something like a
3144
- * two-dimensional array. Each row corresponds to a type (there are the same
3145
- * number of rows as there are in the swig_type_initial array). Each entry in
3146
- * a column is one of the swig_cast_info structures for that type.
3147
- * The cast_initial array is actually an array of arrays, because each row has
3148
- * a variable number of columns. So to actually build the cast linked list,
3149
- * we find the array of casts associated with the type, and loop through it
3150
- * adding the casts to the list. The one last trick we need to do is making
3151
- * sure the type pointer in the swig_cast_info struct is correct.
3152
-
3153
- * First off, we lookup the cast->type name to see if it is already loaded.
3154
- * There are three cases to handle:
3155
- * 1) If the cast->type has already been loaded AND the type we are adding
3156
- * casting info to has not been loaded (it is in this module), THEN we
3157
- * replace the cast->type pointer with the type pointer that has already
3158
- * been loaded.
3159
- * 2) If BOTH types (the one we are adding casting info to, and the
3160
- * cast->type) are loaded, THEN the cast info has already been loaded by
3161
- * the previous module so we just ignore it.
3162
- * 3) Finally, if cast->type has not already been loaded, then we add that
3163
- * swig_cast_info to the linked list (because the cast->type) pointer will
3164
- * be correct.
3165
- **/
3166
-
3167
- #ifdef __cplusplus
3168
- extern "C" {
3169
- #endif
3170
-
3171
- SWIGRUNTIME void
3172
- SWIG_InitializeModule(void *clientdata) {
3173
- swig_type_info *type, *ret;
3174
- swig_cast_info *cast;
3175
- size_t i;
3176
- swig_module_info *module_head;
3177
- static int init_run = 0;
3178
-
3179
- clientdata = clientdata;
3180
-
3181
- if (init_run) return;
3182
- init_run = 1;
3183
-
3184
- /* Initialize the swig_module */
3185
- swig_module.type_initial = swig_type_initial;
3186
- swig_module.cast_initial = swig_cast_initial;
3187
-
3188
- /* Try and load any already created modules */
3189
- module_head = SWIG_GetModule(clientdata);
3190
- if (module_head) {
3191
- swig_module.next = module_head->next;
3192
- module_head->next = &swig_module;
3193
- } else {
3194
- /* This is the first module loaded */
3195
- swig_module.next = &swig_module;
3196
- SWIG_SetModule(clientdata, &swig_module);
3197
- }
3198
-
3199
- /* Now work on filling in swig_module.types */
3200
- for (i = 0; i < swig_module.size; ++i) {
3201
- type = 0;
3202
-
3203
- /* if there is another module already loaded */
3204
- if (swig_module.next != &swig_module) {
3205
- type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
3206
- }
3207
- if (type) {
3208
- /* Overwrite clientdata field */
3209
- if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
3210
- } else {
3211
- type = swig_module.type_initial[i];
3212
- }
3213
-
3214
- /* Insert casting types */
3215
- cast = swig_module.cast_initial[i];
3216
- while (cast->type) {
3217
-
3218
- /* Don't need to add information already in the list */
3219
- ret = 0;
3220
- if (swig_module.next != &swig_module) {
3221
- ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3222
- }
3223
- if (ret && type == swig_module.type_initial[i]) {
3224
- cast->type = ret;
3225
- ret = 0;
3226
- }
3227
-
3228
- if (!ret) {
3229
- if (type->cast) {
3230
- type->cast->prev = cast;
3231
- cast->next = type->cast;
3232
- }
3233
- type->cast = cast;
3234
- }
3235
-
3236
- cast++;
3237
- }
3238
-
3239
- /* Set entry in modules->types array equal to the type */
3240
- swig_module.types[i] = type;
3241
- }
3242
- swig_module.types[i] = 0;
3243
- }
3244
-
3245
- /* This function will propagate the clientdata field of type to
3246
- * any new swig_type_info structures that have been added into the list
3247
- * of equivalent types. It is like calling
3248
- * SWIG_TypeClientData(type, clientdata) a second time.
3249
- */
3250
- SWIGRUNTIME void
3251
- SWIG_PropagateClientData(void) {
3252
- size_t i;
3253
- swig_cast_info *equiv;
3254
- static int init_run = 0;
3255
-
3256
- if (init_run) return;
3257
- init_run = 1;
3258
-
3259
- for (i = 0; i < swig_module.size; i++) {
3260
- if (swig_module.types[i]->clientdata) {
3261
- equiv = swig_module.types[i]->cast;
3262
- while (equiv) {
3263
- if (!equiv->converter) {
3264
- if (equiv->type && !equiv->type->clientdata)
3265
- SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
3266
- }
3267
- equiv = equiv->next;
3268
- }
3269
- }
3270
- }
3271
- }
3272
-
3273
- #ifdef __cplusplus
3274
- }
3275
- #endif
3276
-
3277
-
3278
- #ifdef __cplusplus
3279
- extern "C"
3280
- #endif
3281
-
3282
- SWIGEXPORT void Init_API(void) {
3283
- size_t i;
3284
-
3285
- SWIG_InitRuntime();
3286
- mAPI = rb_define_module("SQLite3");
3287
- mAPI = rb_define_module_under(mAPI, "Driver");
3288
- mAPI = rb_define_module_under(mAPI, "Native");
3289
- mAPI = rb_define_module_under(mAPI, "API");
3290
-
3291
- SWIG_InitializeModule(0);
3292
- for (i = 0; i < swig_module.size; i++) {
3293
- SWIG_define_class(swig_module.types[i]);
3294
- }
3295
-
3296
- SWIG_RubyInitializeTrackings();
3297
-
3298
- cCallbackData.klass = rb_define_class_under(mAPI, "CallbackData", rb_cObject);
3299
- SWIG_TypeClientData(SWIGTYPE_p_CallbackData, (void *) &cCallbackData);
3300
- rb_define_alloc_func(cCallbackData.klass, _wrap_CallbackData_allocate);
3301
- rb_define_method(cCallbackData.klass, "initialize", _wrap_new_CallbackData, -1);
3302
- rb_define_method(cCallbackData.klass, "proc=", _wrap_CallbackData_proc_set, -1);
3303
- rb_define_method(cCallbackData.klass, "proc", _wrap_CallbackData_proc_get, -1);
3304
- rb_define_method(cCallbackData.klass, "proc2=", _wrap_CallbackData_proc2_set, -1);
3305
- rb_define_method(cCallbackData.klass, "proc2", _wrap_CallbackData_proc2_get, -1);
3306
- rb_define_method(cCallbackData.klass, "data=", _wrap_CallbackData_data_set, -1);
3307
- rb_define_method(cCallbackData.klass, "data", _wrap_CallbackData_data_get, -1);
3308
- cCallbackData.mark = (void (*)(void *)) mark_CallbackData;
3309
- cCallbackData.destroy = (void (*)(void *)) free_CallbackData;
3310
- rb_define_const(mAPI,"Sqlite3_ruby_busy_handler", SWIG_NewPointerObj((void *) Sqlite3_ruby_busy_handler, SWIGTYPE_p_f_p_void_int__int,0));
3311
- rb_define_const(mAPI,"Sqlite3_ruby_authorizer", SWIG_NewPointerObj((void *) Sqlite3_ruby_authorizer, SWIGTYPE_p_f_p_void_int_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char__int,0));
3312
- rb_define_const(mAPI,"Sqlite3_ruby_trace", SWIG_NewPointerObj((void *) Sqlite3_ruby_trace, SWIGTYPE_p_f_p_void_p_q_const__char__void,0));
3313
- rb_define_const(mAPI,"Sqlite3_ruby_function_step", SWIG_NewPointerObj((void *) Sqlite3_ruby_function_step, SWIGTYPE_p_f_p_sqlite3_context_int_p_p_sqlite3_value__void,0));
3314
- rb_define_const(mAPI,"Sqlite3_ruby_function_final", SWIG_NewPointerObj((void *) Sqlite3_ruby_function_final, SWIGTYPE_p_f_p_sqlite3_context__void,0));
3315
- rb_define_module_function(mAPI, "sqlite3_libversion", _wrap_sqlite3_libversion, -1);
3316
- rb_define_module_function(mAPI, "sqlite3_close", _wrap_sqlite3_close, -1);
3317
- rb_define_module_function(mAPI, "sqlite3_last_insert_rowid", _wrap_sqlite3_last_insert_rowid, -1);
3318
- rb_define_module_function(mAPI, "sqlite3_changes", _wrap_sqlite3_changes, -1);
3319
- rb_define_module_function(mAPI, "sqlite3_total_changes", _wrap_sqlite3_total_changes, -1);
3320
- rb_define_module_function(mAPI, "sqlite3_interrupt", _wrap_sqlite3_interrupt, -1);
3321
- rb_define_module_function(mAPI, "sqlite3_complete", _wrap_sqlite3_complete, -1);
3322
- rb_define_module_function(mAPI, "sqlite3_complete16", _wrap_sqlite3_complete16, -1);
3323
- rb_define_module_function(mAPI, "sqlite3_busy_handler", _wrap_sqlite3_busy_handler, -1);
3324
- rb_define_module_function(mAPI, "sqlite3_busy_timeout", _wrap_sqlite3_busy_timeout, -1);
3325
- rb_define_module_function(mAPI, "sqlite3_set_authorizer", _wrap_sqlite3_set_authorizer, -1);
3326
- rb_define_module_function(mAPI, "sqlite3_trace", _wrap_sqlite3_trace, -1);
3327
- rb_define_module_function(mAPI, "sqlite3_open", _wrap_sqlite3_open, -1);
3328
- rb_define_module_function(mAPI, "sqlite3_open16", _wrap_sqlite3_open16, -1);
3329
- rb_define_module_function(mAPI, "sqlite3_errcode", _wrap_sqlite3_errcode, -1);
3330
- rb_define_module_function(mAPI, "sqlite3_errmsg", _wrap_sqlite3_errmsg, -1);
3331
- rb_define_module_function(mAPI, "sqlite3_errmsg16", _wrap_sqlite3_errmsg16, -1);
3332
- rb_define_module_function(mAPI, "sqlite3_prepare", _wrap_sqlite3_prepare, -1);
3333
- rb_define_module_function(mAPI, "sqlite3_prepare16", _wrap_sqlite3_prepare16, -1);
3334
- rb_define_module_function(mAPI, "sqlite3_bind_blob", _wrap_sqlite3_bind_blob, -1);
3335
- rb_define_module_function(mAPI, "sqlite3_bind_double", _wrap_sqlite3_bind_double, -1);
3336
- rb_define_module_function(mAPI, "sqlite3_bind_int", _wrap_sqlite3_bind_int, -1);
3337
- rb_define_module_function(mAPI, "sqlite3_bind_int64", _wrap_sqlite3_bind_int64, -1);
3338
- rb_define_module_function(mAPI, "sqlite3_bind_null", _wrap_sqlite3_bind_null, -1);
3339
- rb_define_module_function(mAPI, "sqlite3_bind_text", _wrap_sqlite3_bind_text, -1);
3340
- rb_define_module_function(mAPI, "sqlite3_bind_text16", _wrap_sqlite3_bind_text16, -1);
3341
- rb_define_module_function(mAPI, "sqlite3_bind_parameter_count", _wrap_sqlite3_bind_parameter_count, -1);
3342
- rb_define_module_function(mAPI, "sqlite3_bind_parameter_name", _wrap_sqlite3_bind_parameter_name, -1);
3343
- rb_define_module_function(mAPI, "sqlite3_bind_parameter_index", _wrap_sqlite3_bind_parameter_index, -1);
3344
- rb_define_module_function(mAPI, "sqlite3_column_count", _wrap_sqlite3_column_count, -1);
3345
- rb_define_module_function(mAPI, "sqlite3_column_name", _wrap_sqlite3_column_name, -1);
3346
- rb_define_module_function(mAPI, "sqlite3_column_name16", _wrap_sqlite3_column_name16, -1);
3347
- rb_define_module_function(mAPI, "sqlite3_column_decltype", _wrap_sqlite3_column_decltype, -1);
3348
- rb_define_module_function(mAPI, "sqlite3_column_decltype16", _wrap_sqlite3_column_decltype16, -1);
3349
- rb_define_module_function(mAPI, "sqlite3_step", _wrap_sqlite3_step, -1);
3350
- rb_define_module_function(mAPI, "sqlite3_data_count", _wrap_sqlite3_data_count, -1);
3351
- rb_define_module_function(mAPI, "sqlite3_column_blob", _wrap_sqlite3_column_blob, -1);
3352
- rb_define_module_function(mAPI, "sqlite3_column_bytes", _wrap_sqlite3_column_bytes, -1);
3353
- rb_define_module_function(mAPI, "sqlite3_column_bytes16", _wrap_sqlite3_column_bytes16, -1);
3354
- rb_define_module_function(mAPI, "sqlite3_column_double", _wrap_sqlite3_column_double, -1);
3355
- rb_define_module_function(mAPI, "sqlite3_column_int", _wrap_sqlite3_column_int, -1);
3356
- rb_define_module_function(mAPI, "sqlite3_column_int64", _wrap_sqlite3_column_int64, -1);
3357
- rb_define_module_function(mAPI, "sqlite3_column_text", _wrap_sqlite3_column_text, -1);
3358
- rb_define_module_function(mAPI, "sqlite3_column_text16", _wrap_sqlite3_column_text16, -1);
3359
- rb_define_module_function(mAPI, "sqlite3_column_type", _wrap_sqlite3_column_type, -1);
3360
- rb_define_module_function(mAPI, "sqlite3_finalize", _wrap_sqlite3_finalize, -1);
3361
- rb_define_module_function(mAPI, "sqlite3_reset", _wrap_sqlite3_reset, -1);
3362
- rb_define_module_function(mAPI, "sqlite3_create_function", _wrap_sqlite3_create_function, -1);
3363
- rb_define_module_function(mAPI, "sqlite3_create_function16", _wrap_sqlite3_create_function16, -1);
3364
- rb_define_module_function(mAPI, "sqlite3_aggregate_count", _wrap_sqlite3_aggregate_count, -1);
3365
- rb_define_module_function(mAPI, "sqlite3_value_blob", _wrap_sqlite3_value_blob, -1);
3366
- rb_define_module_function(mAPI, "sqlite3_value_bytes", _wrap_sqlite3_value_bytes, -1);
3367
- rb_define_module_function(mAPI, "sqlite3_value_bytes16", _wrap_sqlite3_value_bytes16, -1);
3368
- rb_define_module_function(mAPI, "sqlite3_value_double", _wrap_sqlite3_value_double, -1);
3369
- rb_define_module_function(mAPI, "sqlite3_value_int", _wrap_sqlite3_value_int, -1);
3370
- rb_define_module_function(mAPI, "sqlite3_value_int64", _wrap_sqlite3_value_int64, -1);
3371
- rb_define_module_function(mAPI, "sqlite3_value_text", _wrap_sqlite3_value_text, -1);
3372
- rb_define_module_function(mAPI, "sqlite3_value_text16", _wrap_sqlite3_value_text16, -1);
3373
- rb_define_module_function(mAPI, "sqlite3_value_text16le", _wrap_sqlite3_value_text16le, -1);
3374
- rb_define_module_function(mAPI, "sqlite3_value_text16be", _wrap_sqlite3_value_text16be, -1);
3375
- rb_define_module_function(mAPI, "sqlite3_value_type", _wrap_sqlite3_value_type, -1);
3376
- rb_define_module_function(mAPI, "sqlite3_result_blob", _wrap_sqlite3_result_blob, -1);
3377
- rb_define_module_function(mAPI, "sqlite3_result_double", _wrap_sqlite3_result_double, -1);
3378
- rb_define_module_function(mAPI, "sqlite3_result_error", _wrap_sqlite3_result_error, -1);
3379
- rb_define_module_function(mAPI, "sqlite3_result_error16", _wrap_sqlite3_result_error16, -1);
3380
- rb_define_module_function(mAPI, "sqlite3_result_int", _wrap_sqlite3_result_int, -1);
3381
- rb_define_module_function(mAPI, "sqlite3_result_int64", _wrap_sqlite3_result_int64, -1);
3382
- rb_define_module_function(mAPI, "sqlite3_result_text", _wrap_sqlite3_result_text, -1);
3383
- rb_define_module_function(mAPI, "sqlite3_result_text16", _wrap_sqlite3_result_text16, -1);
3384
- rb_define_module_function(mAPI, "sqlite3_result_text16le", _wrap_sqlite3_result_text16le, -1);
3385
- rb_define_module_function(mAPI, "sqlite3_result_text16be", _wrap_sqlite3_result_text16be, -1);
3386
- rb_define_module_function(mAPI, "sqlite3_result_value", _wrap_sqlite3_result_value, -1);
3387
- rb_define_module_function(mAPI, "sqlite3_aggregate_context", _wrap_sqlite3_aggregate_context, -1);
346
+ // rb_define_method(mDatabase, "lock_db", db_lock, -1);
347
+ // rb_define_method(mDatabase, "unlock_db", db_unlock, -1);
348
+ rb_define_method(mDatabase, "destroy_tables", db_destroy_tables, -1);
349
+ rb_define_method(mDatabase, "table_exist?", db_is_table_exist, -1);
350
+ rb_define_method(mDatabase, "is_ui_waitfordb", db_is_ui_waitfordb, -1);
3388
351
  }
3389
352
 
3390
- #endif //0