rroonga 3.0.1-x86-mingw32 → 3.0.2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (374) hide show
  1. data/doc/text/news.textile +21 -0
  2. data/ext/groonga/rb-grn-index-column.c +353 -1
  3. data/ext/groonga/rb-grn-object.c +529 -495
  4. data/ext/groonga/rb-grn-table.c +48 -0
  5. data/ext/groonga/rb-grn-utils.c +585 -418
  6. data/ext/groonga/rb-grn.h +6 -4
  7. data/lib/1.9/groonga.so +0 -0
  8. data/lib/2.0/groonga.so +0 -0
  9. data/lib/groonga/dumper.rb +25 -8
  10. data/lib/groonga/record.rb +21 -2
  11. data/lib/groonga/schema.rb +2 -2
  12. data/rroonga-build.rb +1 -1
  13. data/rroonga.gemspec +2 -0
  14. data/test/test-database-dumper.rb +45 -3
  15. data/test/test-expression-builder.rb +0 -13
  16. data/test/test-fix-size-column.rb +40 -9
  17. data/test/test-index-column.rb +130 -1
  18. data/test/test-record.rb +43 -8
  19. data/test/test-schema-create-table.rb +2 -2
  20. data/test/test-schema-dumper.rb +46 -6
  21. data/test/test-table.rb +4 -3
  22. data/test/test-variable-size-column.rb +115 -26
  23. data/vendor/local/bin/groonga-benchmark.exe +0 -0
  24. data/vendor/local/bin/groonga.exe +0 -0
  25. data/vendor/local/bin/libgcc_s_sjlj-1.dll +0 -0
  26. data/vendor/local/bin/libgroonga-0.dll +0 -0
  27. data/vendor/local/bin/libmecab-1.dll +0 -0
  28. data/vendor/local/bin/libmsgpack-3.dll +0 -0
  29. data/vendor/local/bin/libmsgpackc-2.dll +0 -0
  30. data/vendor/local/bin/libstdc++-6.dll +0 -0
  31. data/vendor/local/bin/mecab.exe +0 -0
  32. data/vendor/local/include/groonga/groonga.h +1 -9
  33. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.a +0 -0
  34. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll +0 -0
  35. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll.a +0 -0
  36. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.la +1 -1
  37. data/vendor/local/lib/groonga/plugins/suggest/suggest.a +0 -0
  38. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll +0 -0
  39. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll.a +0 -0
  40. data/vendor/local/lib/groonga/plugins/suggest/suggest.la +1 -1
  41. data/vendor/local/lib/groonga/plugins/table/table.a +0 -0
  42. data/vendor/local/lib/groonga/plugins/table/table.dll +0 -0
  43. data/vendor/local/lib/groonga/plugins/table/table.dll.a +0 -0
  44. data/vendor/local/lib/groonga/plugins/table/table.la +1 -1
  45. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.a +0 -0
  46. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll +0 -0
  47. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll.a +0 -0
  48. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.la +1 -1
  49. data/vendor/local/lib/libgroonga.a +0 -0
  50. data/vendor/local/lib/libgroonga.dll.a +0 -0
  51. data/vendor/local/lib/libgroonga.la +1 -1
  52. data/vendor/local/lib/libmecab.a +0 -0
  53. data/vendor/local/lib/libmecab.dll.a +0 -0
  54. data/vendor/local/lib/libmsgpack.a +0 -0
  55. data/vendor/local/lib/libmsgpack.dll.a +0 -0
  56. data/vendor/local/lib/libmsgpack.la +1 -1
  57. data/vendor/local/lib/libmsgpackc.a +0 -0
  58. data/vendor/local/lib/libmsgpackc.dll.a +0 -0
  59. data/vendor/local/lib/libmsgpackc.la +1 -1
  60. data/vendor/local/lib/pkgconfig/groonga.pc +2 -2
  61. data/vendor/local/libexec/mecab/mecab-cost-train.exe +0 -0
  62. data/vendor/local/libexec/mecab/mecab-dict-gen.exe +0 -0
  63. data/vendor/local/libexec/mecab/mecab-dict-index.exe +0 -0
  64. data/vendor/local/libexec/mecab/mecab-system-eval.exe +0 -0
  65. data/vendor/local/libexec/mecab/mecab-test-gen.exe +0 -0
  66. data/vendor/local/share/doc/groonga/en/html/.buildinfo +1 -1
  67. data/vendor/local/share/doc/groonga/en/html/_sources/install/centos.txt +3 -3
  68. data/vendor/local/share/doc/groonga/en/html/_sources/install/debian.txt +43 -3
  69. data/vendor/local/share/doc/groonga/en/html/_sources/install/fedora.txt +3 -3
  70. data/vendor/local/share/doc/groonga/en/html/_sources/install/mac_os_x.txt +3 -3
  71. data/vendor/local/share/doc/groonga/en/html/_sources/install/others.txt +3 -3
  72. data/vendor/local/share/doc/groonga/en/html/_sources/install/solaris.txt +3 -3
  73. data/vendor/local/share/doc/groonga/en/html/_sources/install/ubuntu.txt +3 -50
  74. data/vendor/local/share/doc/groonga/en/html/_sources/install/windows.txt +11 -21
  75. data/vendor/local/share/doc/groonga/en/html/_sources/news.txt +51 -0
  76. data/vendor/local/share/doc/groonga/en/html/_sources/reference/api/grn_ctx.txt +49 -0
  77. data/vendor/local/share/doc/groonga/en/html/_sources/reference/api.txt +8 -1
  78. data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/tokenize.txt +196 -0
  79. data/vendor/local/share/doc/groonga/en/html/_sources/reference/normalizers.txt +1 -1
  80. data/vendor/local/share/doc/groonga/en/html/_sources/reference/tokenizers.txt +16 -0
  81. data/vendor/local/share/doc/groonga/en/html/_static/pygments.css +2 -2
  82. data/vendor/local/share/doc/groonga/en/html/characteristic.html +5 -5
  83. data/vendor/local/share/doc/groonga/en/html/community.html +5 -5
  84. data/vendor/local/share/doc/groonga/en/html/contribution/development/com.html +5 -5
  85. data/vendor/local/share/doc/groonga/en/html/contribution/development/document.html +5 -5
  86. data/vendor/local/share/doc/groonga/en/html/contribution/development/query.html +5 -5
  87. data/vendor/local/share/doc/groonga/en/html/contribution/development/release.html +5 -5
  88. data/vendor/local/share/doc/groonga/en/html/contribution/development/repository.html +5 -5
  89. data/vendor/local/share/doc/groonga/en/html/contribution/development/test.html +5 -5
  90. data/vendor/local/share/doc/groonga/en/html/contribution/development.html +5 -5
  91. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/c-api.html +5 -5
  92. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/i18n.html +13 -5
  93. data/vendor/local/share/doc/groonga/en/html/contribution/documentation.html +5 -5
  94. data/vendor/local/share/doc/groonga/en/html/contribution/report.html +5 -5
  95. data/vendor/local/share/doc/groonga/en/html/contribution.html +5 -5
  96. data/vendor/local/share/doc/groonga/en/html/development/travis-ci.html +5 -5
  97. data/vendor/local/share/doc/groonga/en/html/development.html +5 -5
  98. data/vendor/local/share/doc/groonga/en/html/genindex.html +22 -5
  99. data/vendor/local/share/doc/groonga/en/html/geolocation_search.html +5 -5
  100. data/vendor/local/share/doc/groonga/en/html/index.html +19 -14
  101. data/vendor/local/share/doc/groonga/en/html/install/centos.html +8 -8
  102. data/vendor/local/share/doc/groonga/en/html/install/debian.html +48 -12
  103. data/vendor/local/share/doc/groonga/en/html/install/fedora.html +8 -8
  104. data/vendor/local/share/doc/groonga/en/html/install/mac_os_x.html +8 -8
  105. data/vendor/local/share/doc/groonga/en/html/install/others.html +8 -8
  106. data/vendor/local/share/doc/groonga/en/html/install/solaris.html +8 -8
  107. data/vendor/local/share/doc/groonga/en/html/install/ubuntu.html +16 -60
  108. data/vendor/local/share/doc/groonga/en/html/install/windows.html +16 -25
  109. data/vendor/local/share/doc/groonga/en/html/install.html +12 -12
  110. data/vendor/local/share/doc/groonga/en/html/limitations.html +5 -5
  111. data/vendor/local/share/doc/groonga/en/html/news/0.x.html +5 -5
  112. data/vendor/local/share/doc/groonga/en/html/news/1.0.x.html +5 -5
  113. data/vendor/local/share/doc/groonga/en/html/news/1.1.x.html +5 -5
  114. data/vendor/local/share/doc/groonga/en/html/news/1.2.x.html +5 -5
  115. data/vendor/local/share/doc/groonga/en/html/news/senna.html +5 -5
  116. data/vendor/local/share/doc/groonga/en/html/news.html +187 -129
  117. data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
  118. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ctx.html +198 -0
  119. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_expr.html +31 -6
  120. data/vendor/local/share/doc/groonga/en/html/reference/api.html +18 -11
  121. data/vendor/local/share/doc/groonga/en/html/reference/cast.html +5 -5
  122. data/vendor/local/share/doc/groonga/en/html/reference/command/command_version.html +5 -5
  123. data/vendor/local/share/doc/groonga/en/html/reference/command/output_format.html +5 -5
  124. data/vendor/local/share/doc/groonga/en/html/reference/command/return_code.html +5 -5
  125. data/vendor/local/share/doc/groonga/en/html/reference/command.html +7 -6
  126. data/vendor/local/share/doc/groonga/en/html/reference/commands/cache_limit.html +5 -5
  127. data/vendor/local/share/doc/groonga/en/html/reference/commands/check.html +5 -5
  128. data/vendor/local/share/doc/groonga/en/html/reference/commands/clearlock.html +5 -5
  129. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_create.html +5 -5
  130. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_list.html +5 -5
  131. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_remove.html +17 -17
  132. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_rename.html +5 -5
  133. data/vendor/local/share/doc/groonga/en/html/reference/commands/define_selector.html +5 -5
  134. data/vendor/local/share/doc/groonga/en/html/reference/commands/defrag.html +5 -5
  135. data/vendor/local/share/doc/groonga/en/html/reference/commands/delete.html +5 -5
  136. data/vendor/local/share/doc/groonga/en/html/reference/commands/dump.html +5 -5
  137. data/vendor/local/share/doc/groonga/en/html/reference/commands/load.html +5 -5
  138. data/vendor/local/share/doc/groonga/en/html/reference/commands/log_level.html +5 -5
  139. data/vendor/local/share/doc/groonga/en/html/reference/commands/log_put.html +5 -5
  140. data/vendor/local/share/doc/groonga/en/html/reference/commands/log_reopen.html +5 -5
  141. data/vendor/local/share/doc/groonga/en/html/reference/commands/normalize.html +5 -5
  142. data/vendor/local/share/doc/groonga/en/html/reference/commands/quit.html +5 -5
  143. data/vendor/local/share/doc/groonga/en/html/reference/commands/register.html +5 -5
  144. data/vendor/local/share/doc/groonga/en/html/reference/commands/select.html +5 -5
  145. data/vendor/local/share/doc/groonga/en/html/reference/commands/shutdown.html +5 -5
  146. data/vendor/local/share/doc/groonga/en/html/reference/commands/status.html +5 -5
  147. data/vendor/local/share/doc/groonga/en/html/reference/commands/suggest.html +5 -5
  148. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_create.html +5 -5
  149. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_list.html +5 -5
  150. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_remove.html +10 -10
  151. data/vendor/local/share/doc/groonga/en/html/reference/commands/tokenize.html +310 -0
  152. data/vendor/local/share/doc/groonga/en/html/reference/commands/truncate.html +26 -26
  153. data/vendor/local/share/doc/groonga/en/html/reference/commands_not_implemented/add.html +5 -5
  154. data/vendor/local/share/doc/groonga/en/html/reference/commands_not_implemented/get.html +5 -5
  155. data/vendor/local/share/doc/groonga/en/html/reference/commands_not_implemented/set.html +5 -5
  156. data/vendor/local/share/doc/groonga/en/html/reference/executables/grnslap.html +5 -5
  157. data/vendor/local/share/doc/groonga/en/html/reference/executables/grntest.html +5 -5
  158. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-httpd.html +5 -5
  159. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-server-http.html +5 -5
  160. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-create-dataset.html +5 -5
  161. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga.html +5 -5
  162. data/vendor/local/share/doc/groonga/en/html/reference/executables.html +5 -5
  163. data/vendor/local/share/doc/groonga/en/html/reference/function.html +5 -5
  164. data/vendor/local/share/doc/groonga/en/html/reference/functions/edit_distance.html +5 -5
  165. data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_distance.html +5 -5
  166. data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_circle.html +5 -5
  167. data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_rectangle.html +5 -5
  168. data/vendor/local/share/doc/groonga/en/html/reference/functions/now.html +5 -5
  169. data/vendor/local/share/doc/groonga/en/html/reference/functions/query.html +5 -5
  170. data/vendor/local/share/doc/groonga/en/html/reference/functions/rand.html +5 -5
  171. data/vendor/local/share/doc/groonga/en/html/reference/functions/snippet_html.html +5 -5
  172. data/vendor/local/share/doc/groonga/en/html/reference/functions/sub_filter.html +5 -5
  173. data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/query_syntax.html +5 -5
  174. data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/script_syntax.html +5 -5
  175. data/vendor/local/share/doc/groonga/en/html/reference/grn_expr.html +5 -5
  176. data/vendor/local/share/doc/groonga/en/html/reference/indexing.html +5 -5
  177. data/vendor/local/share/doc/groonga/en/html/reference/log.html +5 -5
  178. data/vendor/local/share/doc/groonga/en/html/reference/normalizers.html +6 -6
  179. data/vendor/local/share/doc/groonga/en/html/reference/output.html +5 -5
  180. data/vendor/local/share/doc/groonga/en/html/reference/pseudo_column.html +5 -5
  181. data/vendor/local/share/doc/groonga/en/html/reference/query_expanders/tsv.html +5 -5
  182. data/vendor/local/share/doc/groonga/en/html/reference/query_expanders.html +5 -5
  183. data/vendor/local/share/doc/groonga/en/html/reference/tables.html +5 -5
  184. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers.html +20 -5
  185. data/vendor/local/share/doc/groonga/en/html/reference/types.html +9 -9
  186. data/vendor/local/share/doc/groonga/en/html/reference.html +12 -7
  187. data/vendor/local/share/doc/groonga/en/html/search.html +5 -5
  188. data/vendor/local/share/doc/groonga/en/html/searchindex.js +1 -1
  189. data/vendor/local/share/doc/groonga/en/html/server/gqtp.html +5 -5
  190. data/vendor/local/share/doc/groonga/en/html/server/http/comparison.html +5 -5
  191. data/vendor/local/share/doc/groonga/en/html/server/http/groonga-httpd.html +5 -5
  192. data/vendor/local/share/doc/groonga/en/html/server/http/groonga.html +5 -5
  193. data/vendor/local/share/doc/groonga/en/html/server/http.html +5 -5
  194. data/vendor/local/share/doc/groonga/en/html/server/package.html +5 -5
  195. data/vendor/local/share/doc/groonga/en/html/server.html +5 -5
  196. data/vendor/local/share/doc/groonga/en/html/spec/gqtp.html +5 -5
  197. data/vendor/local/share/doc/groonga/en/html/spec/search.html +5 -5
  198. data/vendor/local/share/doc/groonga/en/html/spec.html +10 -10
  199. data/vendor/local/share/doc/groonga/en/html/suggest/completion.html +5 -5
  200. data/vendor/local/share/doc/groonga/en/html/suggest/correction.html +5 -5
  201. data/vendor/local/share/doc/groonga/en/html/suggest/introduction.html +5 -5
  202. data/vendor/local/share/doc/groonga/en/html/suggest/suggestion.html +5 -5
  203. data/vendor/local/share/doc/groonga/en/html/suggest/tutorial.html +5 -5
  204. data/vendor/local/share/doc/groonga/en/html/suggest.html +5 -5
  205. data/vendor/local/share/doc/groonga/en/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
  206. data/vendor/local/share/doc/groonga/en/html/troubleshooting.html +5 -5
  207. data/vendor/local/share/doc/groonga/en/html/tutorial/data.html +5 -5
  208. data/vendor/local/share/doc/groonga/en/html/tutorial/drilldown.html +5 -5
  209. data/vendor/local/share/doc/groonga/en/html/tutorial/index.html +5 -5
  210. data/vendor/local/share/doc/groonga/en/html/tutorial/introduction.html +5 -5
  211. data/vendor/local/share/doc/groonga/en/html/tutorial/lexicon.html +5 -5
  212. data/vendor/local/share/doc/groonga/en/html/tutorial/match_columns.html +5 -5
  213. data/vendor/local/share/doc/groonga/en/html/tutorial/micro_blog.html +5 -5
  214. data/vendor/local/share/doc/groonga/en/html/tutorial/network.html +5 -5
  215. data/vendor/local/share/doc/groonga/en/html/tutorial/patricia_trie.html +5 -5
  216. data/vendor/local/share/doc/groonga/en/html/tutorial/query_expansion.html +5 -5
  217. data/vendor/local/share/doc/groonga/en/html/tutorial/search.html +5 -5
  218. data/vendor/local/share/doc/groonga/en/html/tutorial.html +5 -5
  219. data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
  220. data/vendor/local/share/doc/groonga/ja/html/_sources/install/centos.txt +3 -3
  221. data/vendor/local/share/doc/groonga/ja/html/_sources/install/debian.txt +43 -3
  222. data/vendor/local/share/doc/groonga/ja/html/_sources/install/fedora.txt +3 -3
  223. data/vendor/local/share/doc/groonga/ja/html/_sources/install/mac_os_x.txt +3 -3
  224. data/vendor/local/share/doc/groonga/ja/html/_sources/install/others.txt +3 -3
  225. data/vendor/local/share/doc/groonga/ja/html/_sources/install/solaris.txt +3 -3
  226. data/vendor/local/share/doc/groonga/ja/html/_sources/install/ubuntu.txt +3 -50
  227. data/vendor/local/share/doc/groonga/ja/html/_sources/install/windows.txt +11 -21
  228. data/vendor/local/share/doc/groonga/ja/html/_sources/news.txt +51 -0
  229. data/vendor/local/share/doc/groonga/ja/html/_sources/reference/api/grn_ctx.txt +49 -0
  230. data/vendor/local/share/doc/groonga/ja/html/_sources/reference/api.txt +8 -1
  231. data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/tokenize.txt +196 -0
  232. data/vendor/local/share/doc/groonga/ja/html/_sources/reference/normalizers.txt +1 -1
  233. data/vendor/local/share/doc/groonga/ja/html/_sources/reference/tokenizers.txt +16 -0
  234. data/vendor/local/share/doc/groonga/ja/html/_static/pygments.css +2 -2
  235. data/vendor/local/share/doc/groonga/ja/html/characteristic.html +5 -5
  236. data/vendor/local/share/doc/groonga/ja/html/community.html +5 -5
  237. data/vendor/local/share/doc/groonga/ja/html/contribution/development/com.html +5 -5
  238. data/vendor/local/share/doc/groonga/ja/html/contribution/development/document.html +5 -5
  239. data/vendor/local/share/doc/groonga/ja/html/contribution/development/query.html +5 -5
  240. data/vendor/local/share/doc/groonga/ja/html/contribution/development/release.html +5 -5
  241. data/vendor/local/share/doc/groonga/ja/html/contribution/development/repository.html +5 -5
  242. data/vendor/local/share/doc/groonga/ja/html/contribution/development/test.html +5 -5
  243. data/vendor/local/share/doc/groonga/ja/html/contribution/development.html +5 -5
  244. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/c-api.html +5 -5
  245. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/i18n.html +17 -9
  246. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +5 -5
  247. data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +5 -5
  248. data/vendor/local/share/doc/groonga/ja/html/contribution.html +5 -5
  249. data/vendor/local/share/doc/groonga/ja/html/development/travis-ci.html +5 -5
  250. data/vendor/local/share/doc/groonga/ja/html/development.html +5 -5
  251. data/vendor/local/share/doc/groonga/ja/html/genindex.html +31 -7
  252. data/vendor/local/share/doc/groonga/ja/html/geolocation_search.html +5 -5
  253. data/vendor/local/share/doc/groonga/ja/html/index.html +19 -14
  254. data/vendor/local/share/doc/groonga/ja/html/install/centos.html +8 -8
  255. data/vendor/local/share/doc/groonga/ja/html/install/debian.html +44 -12
  256. data/vendor/local/share/doc/groonga/ja/html/install/fedora.html +8 -8
  257. data/vendor/local/share/doc/groonga/ja/html/install/mac_os_x.html +8 -8
  258. data/vendor/local/share/doc/groonga/ja/html/install/others.html +8 -8
  259. data/vendor/local/share/doc/groonga/ja/html/install/solaris.html +8 -8
  260. data/vendor/local/share/doc/groonga/ja/html/install/ubuntu.html +16 -56
  261. data/vendor/local/share/doc/groonga/ja/html/install/windows.html +16 -25
  262. data/vendor/local/share/doc/groonga/ja/html/install.html +12 -12
  263. data/vendor/local/share/doc/groonga/ja/html/limitations.html +5 -5
  264. data/vendor/local/share/doc/groonga/ja/html/news/0.x.html +5 -5
  265. data/vendor/local/share/doc/groonga/ja/html/news/1.0.x.html +5 -5
  266. data/vendor/local/share/doc/groonga/ja/html/news/1.1.x.html +5 -5
  267. data/vendor/local/share/doc/groonga/ja/html/news/1.2.x.html +5 -5
  268. data/vendor/local/share/doc/groonga/ja/html/news/senna.html +5 -5
  269. data/vendor/local/share/doc/groonga/ja/html/news.html +178 -129
  270. data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
  271. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ctx.html +195 -0
  272. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_expr.html +31 -6
  273. data/vendor/local/share/doc/groonga/ja/html/reference/api.html +17 -11
  274. data/vendor/local/share/doc/groonga/ja/html/reference/cast.html +5 -5
  275. data/vendor/local/share/doc/groonga/ja/html/reference/command/command_version.html +5 -5
  276. data/vendor/local/share/doc/groonga/ja/html/reference/command/output_format.html +5 -5
  277. data/vendor/local/share/doc/groonga/ja/html/reference/command/return_code.html +5 -5
  278. data/vendor/local/share/doc/groonga/ja/html/reference/command.html +7 -6
  279. data/vendor/local/share/doc/groonga/ja/html/reference/commands/cache_limit.html +5 -5
  280. data/vendor/local/share/doc/groonga/ja/html/reference/commands/check.html +5 -5
  281. data/vendor/local/share/doc/groonga/ja/html/reference/commands/clearlock.html +5 -5
  282. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_create.html +5 -5
  283. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_list.html +5 -5
  284. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_remove.html +17 -17
  285. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_rename.html +5 -5
  286. data/vendor/local/share/doc/groonga/ja/html/reference/commands/define_selector.html +5 -5
  287. data/vendor/local/share/doc/groonga/ja/html/reference/commands/defrag.html +5 -5
  288. data/vendor/local/share/doc/groonga/ja/html/reference/commands/delete.html +5 -5
  289. data/vendor/local/share/doc/groonga/ja/html/reference/commands/dump.html +5 -5
  290. data/vendor/local/share/doc/groonga/ja/html/reference/commands/load.html +5 -5
  291. data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_level.html +5 -5
  292. data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_put.html +5 -5
  293. data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_reopen.html +5 -5
  294. data/vendor/local/share/doc/groonga/ja/html/reference/commands/normalize.html +5 -5
  295. data/vendor/local/share/doc/groonga/ja/html/reference/commands/quit.html +5 -5
  296. data/vendor/local/share/doc/groonga/ja/html/reference/commands/register.html +5 -5
  297. data/vendor/local/share/doc/groonga/ja/html/reference/commands/select.html +5 -5
  298. data/vendor/local/share/doc/groonga/ja/html/reference/commands/shutdown.html +5 -5
  299. data/vendor/local/share/doc/groonga/ja/html/reference/commands/status.html +5 -5
  300. data/vendor/local/share/doc/groonga/ja/html/reference/commands/suggest.html +5 -5
  301. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_create.html +5 -5
  302. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_list.html +5 -5
  303. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_remove.html +10 -10
  304. data/vendor/local/share/doc/groonga/ja/html/reference/commands/tokenize.html +311 -0
  305. data/vendor/local/share/doc/groonga/ja/html/reference/commands/truncate.html +26 -26
  306. data/vendor/local/share/doc/groonga/ja/html/reference/commands_not_implemented/add.html +5 -5
  307. data/vendor/local/share/doc/groonga/ja/html/reference/commands_not_implemented/get.html +5 -5
  308. data/vendor/local/share/doc/groonga/ja/html/reference/commands_not_implemented/set.html +5 -5
  309. data/vendor/local/share/doc/groonga/ja/html/reference/executables/grnslap.html +5 -5
  310. data/vendor/local/share/doc/groonga/ja/html/reference/executables/grntest.html +5 -5
  311. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-httpd.html +5 -5
  312. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-server-http.html +5 -5
  313. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-create-dataset.html +5 -5
  314. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga.html +5 -5
  315. data/vendor/local/share/doc/groonga/ja/html/reference/executables.html +5 -5
  316. data/vendor/local/share/doc/groonga/ja/html/reference/function.html +5 -5
  317. data/vendor/local/share/doc/groonga/ja/html/reference/functions/edit_distance.html +5 -5
  318. data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_distance.html +5 -5
  319. data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_circle.html +5 -5
  320. data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_rectangle.html +5 -5
  321. data/vendor/local/share/doc/groonga/ja/html/reference/functions/now.html +5 -5
  322. data/vendor/local/share/doc/groonga/ja/html/reference/functions/query.html +5 -5
  323. data/vendor/local/share/doc/groonga/ja/html/reference/functions/rand.html +5 -5
  324. data/vendor/local/share/doc/groonga/ja/html/reference/functions/snippet_html.html +5 -5
  325. data/vendor/local/share/doc/groonga/ja/html/reference/functions/sub_filter.html +5 -5
  326. data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/query_syntax.html +5 -5
  327. data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/script_syntax.html +5 -5
  328. data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr.html +5 -5
  329. data/vendor/local/share/doc/groonga/ja/html/reference/indexing.html +5 -5
  330. data/vendor/local/share/doc/groonga/ja/html/reference/log.html +5 -5
  331. data/vendor/local/share/doc/groonga/ja/html/reference/normalizers.html +6 -6
  332. data/vendor/local/share/doc/groonga/ja/html/reference/output.html +5 -5
  333. data/vendor/local/share/doc/groonga/ja/html/reference/pseudo_column.html +5 -5
  334. data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders/tsv.html +5 -5
  335. data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders.html +5 -5
  336. data/vendor/local/share/doc/groonga/ja/html/reference/tables.html +5 -5
  337. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers.html +20 -5
  338. data/vendor/local/share/doc/groonga/ja/html/reference/types.html +9 -9
  339. data/vendor/local/share/doc/groonga/ja/html/reference.html +12 -7
  340. data/vendor/local/share/doc/groonga/ja/html/search.html +5 -5
  341. data/vendor/local/share/doc/groonga/ja/html/searchindex.js +1 -1
  342. data/vendor/local/share/doc/groonga/ja/html/server/gqtp.html +5 -5
  343. data/vendor/local/share/doc/groonga/ja/html/server/http/comparison.html +5 -5
  344. data/vendor/local/share/doc/groonga/ja/html/server/http/groonga-httpd.html +5 -5
  345. data/vendor/local/share/doc/groonga/ja/html/server/http/groonga.html +5 -5
  346. data/vendor/local/share/doc/groonga/ja/html/server/http.html +5 -5
  347. data/vendor/local/share/doc/groonga/ja/html/server/package.html +5 -5
  348. data/vendor/local/share/doc/groonga/ja/html/server.html +5 -5
  349. data/vendor/local/share/doc/groonga/ja/html/spec/gqtp.html +5 -5
  350. data/vendor/local/share/doc/groonga/ja/html/spec/search.html +5 -5
  351. data/vendor/local/share/doc/groonga/ja/html/spec.html +10 -10
  352. data/vendor/local/share/doc/groonga/ja/html/suggest/completion.html +5 -5
  353. data/vendor/local/share/doc/groonga/ja/html/suggest/correction.html +5 -5
  354. data/vendor/local/share/doc/groonga/ja/html/suggest/introduction.html +5 -5
  355. data/vendor/local/share/doc/groonga/ja/html/suggest/suggestion.html +5 -5
  356. data/vendor/local/share/doc/groonga/ja/html/suggest/tutorial.html +5 -5
  357. data/vendor/local/share/doc/groonga/ja/html/suggest.html +5 -5
  358. data/vendor/local/share/doc/groonga/ja/html/troubleshooting/different_results_with_the_same_keyword.html +5 -5
  359. data/vendor/local/share/doc/groonga/ja/html/troubleshooting.html +5 -5
  360. data/vendor/local/share/doc/groonga/ja/html/tutorial/data.html +5 -5
  361. data/vendor/local/share/doc/groonga/ja/html/tutorial/drilldown.html +5 -5
  362. data/vendor/local/share/doc/groonga/ja/html/tutorial/index.html +5 -5
  363. data/vendor/local/share/doc/groonga/ja/html/tutorial/introduction.html +5 -5
  364. data/vendor/local/share/doc/groonga/ja/html/tutorial/lexicon.html +5 -5
  365. data/vendor/local/share/doc/groonga/ja/html/tutorial/match_columns.html +5 -5
  366. data/vendor/local/share/doc/groonga/ja/html/tutorial/micro_blog.html +5 -5
  367. data/vendor/local/share/doc/groonga/ja/html/tutorial/network.html +5 -5
  368. data/vendor/local/share/doc/groonga/ja/html/tutorial/patricia_trie.html +5 -5
  369. data/vendor/local/share/doc/groonga/ja/html/tutorial/query_expansion.html +5 -5
  370. data/vendor/local/share/doc/groonga/ja/html/tutorial/search.html +5 -5
  371. data/vendor/local/share/doc/groonga/ja/html/tutorial.html +5 -5
  372. data/vendor/local/share/man/ja/man1/groonga.1 +3227 -197
  373. data/vendor/local/share/man/man1/groonga.1 +3230 -195
  374. metadata +131 -123
@@ -39,126 +39,126 @@ rb_grn_object_from_ruby_object (VALUE object, grn_ctx **context)
39
39
  return NULL;
40
40
 
41
41
  if (context && *context) {
42
- grn_obj *grn_object;
43
- if (RVAL2CBOOL(rb_obj_is_kind_of(object, rb_cString))) {
44
- const char *name;
45
- unsigned int name_size;
46
-
47
- name = StringValuePtr(object);
48
- name_size = RSTRING_LEN(object);
49
- grn_object = rb_grn_context_get_backward_compatibility(*context,
50
- name,
51
- name_size);
52
- rb_grn_context_check(*context, object);
53
- if (!grn_object)
54
- rb_raise(rb_eArgError,
55
- "unregistered groonga object: name: <%s>",
56
- rb_grn_inspect(object));
57
- return grn_object;
58
- } else if (RVAL2CBOOL(rb_obj_is_kind_of(object, rb_cInteger))) {
59
- grn_object = grn_ctx_at(*context, NUM2UINT(object));
60
- rb_grn_context_check(*context, object);
61
- if (!grn_object)
62
- rb_raise(rb_eArgError,
63
- "unregistered groonga object: ID: <%s>",
64
- rb_grn_inspect(object));
65
- return grn_object;
66
- }
42
+ grn_obj *grn_object;
43
+ if (RVAL2CBOOL(rb_obj_is_kind_of(object, rb_cString))) {
44
+ const char *name;
45
+ unsigned int name_size;
46
+
47
+ name = StringValuePtr(object);
48
+ name_size = RSTRING_LEN(object);
49
+ grn_object = rb_grn_context_get_backward_compatibility(*context,
50
+ name,
51
+ name_size);
52
+ rb_grn_context_check(*context, object);
53
+ if (!grn_object)
54
+ rb_raise(rb_eArgError,
55
+ "unregistered groonga object: name: <%s>",
56
+ rb_grn_inspect(object));
57
+ return grn_object;
58
+ } else if (RVAL2CBOOL(rb_obj_is_kind_of(object, rb_cInteger))) {
59
+ grn_object = grn_ctx_at(*context, NUM2UINT(object));
60
+ rb_grn_context_check(*context, object);
61
+ if (!grn_object)
62
+ rb_raise(rb_eArgError,
63
+ "unregistered groonga object: ID: <%s>",
64
+ rb_grn_inspect(object));
65
+ return grn_object;
66
+ }
67
67
  }
68
68
 
69
69
  if (!RVAL2CBOOL(rb_obj_is_kind_of(object, rb_cGrnObject))) {
70
- rb_raise(rb_eTypeError, "not a groonga object: <%s>",
71
- rb_grn_inspect(object));
70
+ rb_raise(rb_eTypeError, "not a groonga object: <%s>",
71
+ rb_grn_inspect(object));
72
72
  }
73
73
 
74
74
  Data_Get_Struct(object, RbGrnObject, rb_grn_object);
75
75
  if (!rb_grn_object)
76
- rb_raise(rb_eGrnError, "groonga object is NULL");
76
+ rb_raise(rb_eGrnError, "groonga object is NULL");
77
77
 
78
78
  if (!rb_grn_object->object) {
79
- rb_raise(rb_eGrnClosed,
79
+ rb_raise(rb_eGrnClosed,
80
80
  "can't access already closed groonga object: %s",
81
81
  rb_grn_inspect(CLASS_OF(rb_grn_object->self)));
82
82
  }
83
83
 
84
84
  if (context && !*context)
85
- *context = rb_grn_object->context;
85
+ *context = rb_grn_object->context;
86
86
 
87
87
  return rb_grn_object->object;
88
88
  }
89
89
 
90
90
  static void
91
91
  rb_grn_object_run_finalizer (grn_ctx *context, grn_obj *grn_object,
92
- RbGrnObject *rb_grn_object)
92
+ RbGrnObject *rb_grn_object)
93
93
  {
94
94
  RbGrnContext *rb_grn_context = NULL;
95
95
 
96
96
  if (rb_grn_exited)
97
- return;
97
+ return;
98
98
 
99
99
  grn_obj_set_finalizer(context, grn_object, NULL);
100
100
 
101
101
  debug("finalize: %p:%p:%p:%p:%p:%p %s(%#x)\n",
102
- context, grn_object, rb_grn_object,
103
- rb_grn_object->context, rb_grn_object->object,
104
- rb_grn_object->rb_grn_context,
105
- rb_grn_inspect_type(grn_object->header.type),
106
- grn_object->header.type);
102
+ context, grn_object, rb_grn_object,
103
+ rb_grn_object->context, rb_grn_object->object,
104
+ rb_grn_object->rb_grn_context,
105
+ rb_grn_inspect_type(grn_object->header.type),
106
+ grn_object->header.type);
107
107
 
108
108
  rb_grn_context = rb_grn_object->rb_grn_context;
109
109
  rb_grn_object->have_finalizer = GRN_FALSE;
110
110
 
111
111
  switch (grn_object->header.type) {
112
112
  case GRN_DB:
113
- rb_grn_database_finalizer(context, rb_grn_context,
114
- grn_object, rb_grn_object);
115
- break;
113
+ rb_grn_database_finalizer(context, rb_grn_context,
114
+ grn_object, rb_grn_object);
115
+ break;
116
116
  case GRN_TYPE:
117
117
  case GRN_PROC:
118
118
  case GRN_CURSOR_TABLE_HASH_KEY:
119
119
  case GRN_CURSOR_TABLE_PAT_KEY:
120
120
  case GRN_CURSOR_TABLE_DAT_KEY:
121
121
  case GRN_CURSOR_TABLE_NO_KEY:
122
- break;
122
+ break;
123
123
  case GRN_TABLE_HASH_KEY:
124
124
  case GRN_TABLE_PAT_KEY:
125
125
  case GRN_TABLE_DAT_KEY:
126
- rb_grn_table_key_support_finalizer(context, grn_object,
127
- RB_GRN_TABLE_KEY_SUPPORT(rb_grn_object));
128
- break;
126
+ rb_grn_table_key_support_finalizer(context, grn_object,
127
+ RB_GRN_TABLE_KEY_SUPPORT(rb_grn_object));
128
+ break;
129
129
  case GRN_TABLE_NO_KEY:
130
- rb_grn_table_finalizer(context, grn_object,
131
- RB_GRN_TABLE(rb_grn_object));
132
- break;
130
+ rb_grn_table_finalizer(context, grn_object,
131
+ RB_GRN_TABLE(rb_grn_object));
132
+ break;
133
133
  case GRN_CURSOR_COLUMN_INDEX:
134
- break;
134
+ break;
135
135
  case GRN_COLUMN_FIX_SIZE:
136
136
  case GRN_COLUMN_VAR_SIZE:
137
- rb_grn_column_finalizer(context, grn_object,
138
- RB_GRN_COLUMN(rb_grn_object));
139
- break;
137
+ rb_grn_column_finalizer(context, grn_object,
138
+ RB_GRN_COLUMN(rb_grn_object));
139
+ break;
140
140
  case GRN_COLUMN_INDEX:
141
- rb_grn_index_column_finalizer(context, grn_object,
142
- RB_GRN_INDEX_COLUMN(rb_grn_object));
143
- break;
141
+ rb_grn_index_column_finalizer(context, grn_object,
142
+ RB_GRN_INDEX_COLUMN(rb_grn_object));
143
+ break;
144
144
  case GRN_ACCESSOR:
145
- rb_grn_accessor_finalizer(context, grn_object,
146
- RB_GRN_ACCESSOR(rb_grn_object));
147
- break;
145
+ rb_grn_accessor_finalizer(context, grn_object,
146
+ RB_GRN_ACCESSOR(rb_grn_object));
147
+ break;
148
148
  case GRN_EXPR:
149
- rb_grn_expression_finalizer(context, grn_object,
150
- RB_GRN_EXPRESSION(rb_grn_object));
151
- break;
149
+ rb_grn_expression_finalizer(context, grn_object,
150
+ RB_GRN_EXPRESSION(rb_grn_object));
151
+ break;
152
152
  case GRN_SNIP:
153
- rb_grn_snippet_finalizer(context, grn_object,
154
- RB_GRN_SNIPPET(rb_grn_object));
155
- break;
153
+ rb_grn_snippet_finalizer(context, grn_object,
154
+ RB_GRN_SNIPPET(rb_grn_object));
155
+ break;
156
156
  default:
157
- rb_raise(rb_eTypeError,
158
- "unsupported groonga object type for finalizer: %s(%#x)",
159
- rb_grn_inspect_type(grn_object->header.type),
160
- grn_object->header.type);
161
- break;
157
+ rb_raise(rb_eTypeError,
158
+ "unsupported groonga object type for finalizer: %s(%#x)",
159
+ rb_grn_inspect_type(grn_object->header.type),
160
+ grn_object->header.type);
161
+ break;
162
162
  }
163
163
 
164
164
  rb_grn_object->rb_grn_context = NULL;
@@ -168,13 +168,13 @@ rb_grn_object_run_finalizer (grn_ctx *context, grn_obj *grn_object,
168
168
 
169
169
  static grn_obj *
170
170
  rb_grn_object_finalizer (grn_ctx *context, int n_args, grn_obj **grn_objects,
171
- grn_user_data *user_data)
171
+ grn_user_data *user_data)
172
172
  {
173
173
  RbGrnObject *rb_grn_object;
174
174
  grn_obj *grn_object = *grn_objects;
175
175
 
176
176
  if (rb_grn_exited)
177
- return NULL;
177
+ return NULL;
178
178
 
179
179
  rb_grn_object = user_data->ptr;
180
180
 
@@ -193,30 +193,30 @@ rb_grn_object_free (RbGrnObject *rb_grn_object)
193
193
  context = rb_grn_object->context;
194
194
  grn_object = rb_grn_object->object;
195
195
  debug("rb-free: %p:%p:%p; %d:%d\n", context, grn_object, rb_grn_object,
196
- rb_grn_object->have_finalizer, rb_grn_object->need_close);
196
+ rb_grn_object->have_finalizer, rb_grn_object->need_close);
197
197
  if (!rb_grn_exited && context && grn_object &&
198
- (rb_grn_object->have_finalizer || rb_grn_object->need_close)) {
199
- grn_user_data *user_data = NULL;
200
-
201
- if (rb_grn_object->have_finalizer) {
202
- user_data = grn_obj_user_data(context, grn_object);
203
- }
204
- debug("type: %s(%#x); need_close: %d; user_data: %p; ptr: %p\n",
205
- rb_grn_inspect_type(grn_object->header.type),
206
- grn_object->header.type,
207
- rb_grn_object->need_close,
208
- user_data,
209
- user_data ? user_data->ptr : NULL);
210
- if (rb_grn_object->have_finalizer) {
211
- if (user_data && user_data->ptr) {
212
- rb_grn_object_finalizer(context, 1, &grn_object, user_data);
213
- } else {
214
- rb_grn_object_run_finalizer(context, grn_object, rb_grn_object);
215
- }
216
- }
217
- if (rb_grn_object->need_close) {
218
- grn_obj_unlink(context, grn_object);
219
- }
198
+ (rb_grn_object->have_finalizer || rb_grn_object->need_close)) {
199
+ grn_user_data *user_data = NULL;
200
+
201
+ if (rb_grn_object->have_finalizer) {
202
+ user_data = grn_obj_user_data(context, grn_object);
203
+ }
204
+ debug("type: %s(%#x); need_close: %d; user_data: %p; ptr: %p\n",
205
+ rb_grn_inspect_type(grn_object->header.type),
206
+ grn_object->header.type,
207
+ rb_grn_object->need_close,
208
+ user_data,
209
+ user_data ? user_data->ptr : NULL);
210
+ if (rb_grn_object->have_finalizer) {
211
+ if (user_data && user_data->ptr) {
212
+ rb_grn_object_finalizer(context, 1, &grn_object, user_data);
213
+ } else {
214
+ rb_grn_object_run_finalizer(context, grn_object, rb_grn_object);
215
+ }
216
+ }
217
+ if (rb_grn_object->need_close) {
218
+ grn_obj_unlink(context, grn_object);
219
+ }
220
220
  }
221
221
  xfree(rb_grn_object);
222
222
  }
@@ -228,61 +228,61 @@ rb_grn_object_to_ruby_class (grn_obj *object)
228
228
 
229
229
  switch (object->header.type) {
230
230
  case GRN_DB:
231
- klass = rb_cGrnDatabase;
232
- break;
231
+ klass = rb_cGrnDatabase;
232
+ break;
233
233
  case GRN_TABLE_HASH_KEY:
234
- klass = rb_cGrnHash;
235
- break;
234
+ klass = rb_cGrnHash;
235
+ break;
236
236
  case GRN_TABLE_PAT_KEY:
237
- klass = rb_cGrnPatriciaTrie;
238
- break;
237
+ klass = rb_cGrnPatriciaTrie;
238
+ break;
239
239
  case GRN_TABLE_DAT_KEY:
240
- klass = rb_cGrnDoubleArrayTrie;
241
- break;
240
+ klass = rb_cGrnDoubleArrayTrie;
241
+ break;
242
242
  case GRN_TABLE_NO_KEY:
243
- klass = rb_cGrnArray;
244
- break;
243
+ klass = rb_cGrnArray;
244
+ break;
245
245
  case GRN_TYPE:
246
- klass = rb_cGrnType;
247
- break;
246
+ klass = rb_cGrnType;
247
+ break;
248
248
  case GRN_ACCESSOR:
249
- klass = rb_cGrnAccessor;
250
- break;
249
+ klass = rb_cGrnAccessor;
250
+ break;
251
251
  case GRN_SNIP:
252
- klass = rb_cGrnSnippet;
253
- break;
252
+ klass = rb_cGrnSnippet;
253
+ break;
254
254
  case GRN_PROC:
255
- klass = rb_cGrnProcedure;
256
- break;
255
+ klass = rb_cGrnProcedure;
256
+ break;
257
257
  case GRN_COLUMN_FIX_SIZE:
258
- klass = rb_cGrnFixSizeColumn;
259
- break;
258
+ klass = rb_cGrnFixSizeColumn;
259
+ break;
260
260
  case GRN_COLUMN_VAR_SIZE:
261
- klass = rb_cGrnVariableSizeColumn;
262
- break;
261
+ klass = rb_cGrnVariableSizeColumn;
262
+ break;
263
263
  case GRN_COLUMN_INDEX:
264
- klass = rb_cGrnIndexColumn;
265
- break;
264
+ klass = rb_cGrnIndexColumn;
265
+ break;
266
266
  case GRN_EXPR:
267
- klass = rb_cGrnExpression;
268
- break;
267
+ klass = rb_cGrnExpression;
268
+ break;
269
269
  case GRN_CURSOR_TABLE_HASH_KEY:
270
- klass = rb_cGrnHashCursor;
271
- break;
270
+ klass = rb_cGrnHashCursor;
271
+ break;
272
272
  case GRN_CURSOR_TABLE_PAT_KEY:
273
- klass = rb_cGrnPatriciaTrieCursor;
274
- break;
273
+ klass = rb_cGrnPatriciaTrieCursor;
274
+ break;
275
275
  case GRN_CURSOR_TABLE_DAT_KEY:
276
- klass = rb_cGrnDoubleArrayTrieCursor;
277
- break;
276
+ klass = rb_cGrnDoubleArrayTrieCursor;
277
+ break;
278
278
  case GRN_CURSOR_TABLE_NO_KEY:
279
- klass = rb_cGrnArrayCursor;
280
- break;
279
+ klass = rb_cGrnArrayCursor;
280
+ break;
281
281
  default:
282
- rb_raise(rb_eTypeError,
283
- "unsupported groonga object type for class detection: 0x%x",
284
- object->header.type);
285
- break;
282
+ rb_raise(rb_eTypeError,
283
+ "unsupported groonga object type for class detection: 0x%x",
284
+ object->header.type);
285
+ break;
286
286
  }
287
287
 
288
288
  return klass;
@@ -290,7 +290,7 @@ rb_grn_object_to_ruby_class (grn_obj *object)
290
290
 
291
291
  VALUE
292
292
  rb_grn_object_to_ruby_object (VALUE klass, grn_ctx *context, grn_obj *object,
293
- grn_bool owner)
293
+ grn_bool owner)
294
294
  {
295
295
  RbGrnContext *rb_grn_context;
296
296
  VALUE rb_object, rb_context = Qnil;
@@ -301,7 +301,7 @@ rb_grn_object_to_ruby_object (VALUE klass, grn_ctx *context, grn_obj *object,
301
301
 
302
302
  user_data = grn_obj_user_data(context, object);
303
303
  if (user_data && user_data->ptr) {
304
- return RB_GRN_OBJECT(user_data->ptr)->self;
304
+ return RB_GRN_OBJECT(user_data->ptr)->self;
305
305
  }
306
306
 
307
307
  if (NIL_P(klass))
@@ -309,7 +309,7 @@ rb_grn_object_to_ruby_object (VALUE klass, grn_ctx *context, grn_obj *object,
309
309
 
310
310
  rb_grn_context = GRN_CTX_USER_DATA(context)->ptr;
311
311
  if (rb_grn_context)
312
- rb_context = rb_grn_context->self;
312
+ rb_context = rb_grn_context->self;
313
313
  rb_object = rb_obj_alloc(klass);
314
314
  rb_grn_object_assign(klass, rb_object, rb_context, context, object);
315
315
 
@@ -324,16 +324,16 @@ rb_grn_object_alloc (VALUE klass)
324
324
 
325
325
  static void
326
326
  rb_grn_object_bind_common (VALUE klass, VALUE self, VALUE rb_context,
327
- RbGrnObject *rb_grn_object,
328
- grn_ctx *context, grn_obj *object)
327
+ RbGrnObject *rb_grn_object,
328
+ grn_ctx *context, grn_obj *object)
329
329
  {
330
330
  grn_user_data *user_data;
331
331
  RbGrnContext *rb_grn_context;
332
332
 
333
333
  debug("bind: %p:%p:%p %s(%#x)\n",
334
- context, object, rb_grn_object,
335
- rb_grn_inspect_type(object->header.type),
336
- object->header.type);
334
+ context, object, rb_grn_object,
335
+ rb_grn_inspect_type(object->header.type),
336
+ object->header.type);
337
337
 
338
338
  Data_Get_Struct(rb_context, RbGrnContext, rb_grn_context);
339
339
  rb_grn_object->rb_grn_context = rb_grn_context;
@@ -346,133 +346,133 @@ rb_grn_object_bind_common (VALUE klass, VALUE self, VALUE rb_context,
346
346
 
347
347
  user_data = grn_obj_user_data(context, object);
348
348
  if (user_data) {
349
- debug("set-finalizer: %p:%p:%p %s(%#x)\n",
350
- context, object, rb_grn_object,
351
- rb_grn_inspect_type(object->header.type),
352
- object->header.type);
353
- user_data->ptr = rb_grn_object;
354
- grn_obj_set_finalizer(context, object, rb_grn_object_finalizer);
355
- rb_grn_object->have_finalizer = GRN_TRUE;
349
+ debug("set-finalizer: %p:%p:%p %s(%#x)\n",
350
+ context, object, rb_grn_object,
351
+ rb_grn_inspect_type(object->header.type),
352
+ object->header.type);
353
+ user_data->ptr = rb_grn_object;
354
+ grn_obj_set_finalizer(context, object, rb_grn_object_finalizer);
355
+ rb_grn_object->have_finalizer = GRN_TRUE;
356
356
  } else if (object->header.type == GRN_ACCESSOR) {
357
- debug("set-finalizer(implicit): %p:%p:%p %s(%#x)\n",
358
- context, object, rb_grn_object,
359
- rb_grn_inspect_type(object->header.type),
360
- object->header.type);
361
- /* TODO: We want to call finalizer for GRN_ACCESSOR. */
362
- rb_grn_object->have_finalizer = GRN_FALSE;
357
+ debug("set-finalizer(implicit): %p:%p:%p %s(%#x)\n",
358
+ context, object, rb_grn_object,
359
+ rb_grn_inspect_type(object->header.type),
360
+ object->header.type);
361
+ /* TODO: We want to call finalizer for GRN_ACCESSOR. */
362
+ rb_grn_object->have_finalizer = GRN_FALSE;
363
363
  }
364
364
 
365
365
  switch (object->header.type) {
366
366
  case GRN_PROC:
367
367
  case GRN_TYPE:
368
368
  case GRN_ACCESSOR: /* TODO: We want to close GRN_ACCESSOR. */
369
- rb_grn_object->need_close = GRN_FALSE;
370
- break;
369
+ rb_grn_object->need_close = GRN_FALSE;
370
+ break;
371
371
  default:
372
- if (klass == rb_cGrnVariable)
373
- rb_grn_object->need_close = GRN_FALSE;
374
- break;
372
+ if (klass == rb_cGrnVariable)
373
+ rb_grn_object->need_close = GRN_FALSE;
374
+ break;
375
375
  }
376
376
 
377
377
  rb_grn_object->domain_id = GRN_ID_NIL;
378
378
  if (object)
379
- rb_grn_object->domain_id = object->header.domain;
379
+ rb_grn_object->domain_id = object->header.domain;
380
380
  if (rb_grn_object->domain_id == GRN_ID_NIL)
381
- rb_grn_object->domain = NULL;
381
+ rb_grn_object->domain = NULL;
382
382
  else
383
- rb_grn_object->domain = grn_ctx_at(context, rb_grn_object->domain_id);
383
+ rb_grn_object->domain = grn_ctx_at(context, rb_grn_object->domain_id);
384
384
 
385
385
  rb_grn_object->range_id = GRN_ID_NIL;
386
386
  if (object && object->header.type != GRN_TYPE)
387
- rb_grn_object->range_id = grn_obj_get_range(context, object);
387
+ rb_grn_object->range_id = grn_obj_get_range(context, object);
388
388
  if (rb_grn_object->range_id == GRN_ID_NIL)
389
- rb_grn_object->range = NULL;
389
+ rb_grn_object->range = NULL;
390
390
  else
391
- rb_grn_object->range = grn_ctx_at(context, rb_grn_object->range_id);
391
+ rb_grn_object->range = grn_ctx_at(context, rb_grn_object->range_id);
392
392
 
393
393
  DATA_PTR(self) = rb_grn_object;
394
394
  }
395
395
 
396
396
  void
397
397
  rb_grn_object_assign (VALUE klass, VALUE self, VALUE rb_context,
398
- grn_ctx *context, grn_obj *object)
398
+ grn_ctx *context, grn_obj *object)
399
399
  {
400
400
  void *rb_grn_object;
401
401
 
402
402
  if (!object)
403
- return;
403
+ return;
404
404
 
405
405
  if (NIL_P(klass))
406
- klass = rb_obj_class(self);
406
+ klass = rb_obj_class(self);
407
407
 
408
408
  if (klass == rb_cGrnDatabase ||
409
- (RVAL2CBOOL(rb_obj_is_kind_of(self, rb_cGrnType))) ||
410
- klass == rb_cGrnHashCursor ||
411
- klass == rb_cGrnPatriciaTrieCursor ||
412
- klass == rb_cGrnDoubleArrayTrieCursor ||
413
- klass == rb_cGrnArrayCursor ||
414
- klass == rb_cGrnIndexCursor ||
415
- klass == rb_cGrnProcedure ||
416
- klass == rb_cGrnVariable) {
417
- rb_grn_object = ALLOC(RbGrnObject);
418
- rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
419
- context, object);
409
+ (RVAL2CBOOL(rb_obj_is_kind_of(self, rb_cGrnType))) ||
410
+ klass == rb_cGrnHashCursor ||
411
+ klass == rb_cGrnPatriciaTrieCursor ||
412
+ klass == rb_cGrnDoubleArrayTrieCursor ||
413
+ klass == rb_cGrnArrayCursor ||
414
+ klass == rb_cGrnIndexCursor ||
415
+ klass == rb_cGrnProcedure ||
416
+ klass == rb_cGrnVariable) {
417
+ rb_grn_object = ALLOC(RbGrnObject);
418
+ rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
419
+ context, object);
420
420
  } else if (RVAL2CBOOL(rb_obj_is_kind_of(self, rb_mGrnTableKeySupport))) {
421
- rb_grn_object = ALLOC(RbGrnTableKeySupport);
422
- rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
423
- context, object);
424
- rb_grn_table_key_support_bind(RB_GRN_TABLE_KEY_SUPPORT(rb_grn_object),
425
- context, object);
421
+ rb_grn_object = ALLOC(RbGrnTableKeySupport);
422
+ rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
423
+ context, object);
424
+ rb_grn_table_key_support_bind(RB_GRN_TABLE_KEY_SUPPORT(rb_grn_object),
425
+ context, object);
426
426
  } else if (RVAL2CBOOL(rb_obj_is_kind_of(self, rb_cGrnTable))) {
427
- rb_grn_object = ALLOC(RbGrnTable);
428
- rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
429
- context, object);
430
- rb_grn_table_bind(RB_GRN_TABLE(rb_grn_object), context, object);
427
+ rb_grn_object = ALLOC(RbGrnTable);
428
+ rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
429
+ context, object);
430
+ rb_grn_table_bind(RB_GRN_TABLE(rb_grn_object), context, object);
431
431
  } else if (RVAL2CBOOL(rb_obj_is_kind_of(self, rb_cGrnIndexColumn))) {
432
- rb_grn_object = ALLOC(RbGrnIndexColumn);
433
- rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
434
- context, object);
435
- rb_grn_index_column_bind(RB_GRN_INDEX_COLUMN(rb_grn_object),
436
- context, object);
432
+ rb_grn_object = ALLOC(RbGrnIndexColumn);
433
+ rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
434
+ context, object);
435
+ rb_grn_index_column_bind(RB_GRN_INDEX_COLUMN(rb_grn_object),
436
+ context, object);
437
437
  } else if (RVAL2CBOOL(rb_obj_is_kind_of(self, rb_cGrnColumn))) {
438
- rb_grn_object = ALLOC(RbGrnColumn);
439
- rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
440
- context, object);
441
- rb_grn_column_bind(RB_GRN_COLUMN(rb_grn_object), context, object);
438
+ rb_grn_object = ALLOC(RbGrnColumn);
439
+ rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
440
+ context, object);
441
+ rb_grn_column_bind(RB_GRN_COLUMN(rb_grn_object), context, object);
442
442
  } else if (klass == rb_cGrnAccessor) {
443
- rb_grn_object = ALLOC(RbGrnAccessor);
444
- rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
445
- context, object);
446
- rb_grn_accessor_bind(RB_GRN_ACCESSOR(rb_grn_object), context, object);
443
+ rb_grn_object = ALLOC(RbGrnAccessor);
444
+ rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
445
+ context, object);
446
+ rb_grn_accessor_bind(RB_GRN_ACCESSOR(rb_grn_object), context, object);
447
447
  } else if (klass == rb_cGrnExpression) {
448
- rb_grn_object = ALLOC(RbGrnExpression);
449
- rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
450
- context, object);
451
- rb_grn_expression_bind(RB_GRN_EXPRESSION(rb_grn_object),
452
- context, object);
448
+ rb_grn_object = ALLOC(RbGrnExpression);
449
+ rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
450
+ context, object);
451
+ rb_grn_expression_bind(RB_GRN_EXPRESSION(rb_grn_object),
452
+ context, object);
453
453
  } else if (klass == rb_cGrnSnippet) {
454
- rb_grn_object = ALLOC(RbGrnSnippet);
455
- rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
456
- context, object);
457
- rb_grn_snippet_bind(RB_GRN_SNIPPET(rb_grn_object),
458
- context, object);
454
+ rb_grn_object = ALLOC(RbGrnSnippet);
455
+ rb_grn_object_bind_common(klass, self, rb_context, rb_grn_object,
456
+ context, object);
457
+ rb_grn_snippet_bind(RB_GRN_SNIPPET(rb_grn_object),
458
+ context, object);
459
459
  } else {
460
- rb_raise(rb_eTypeError,
461
- "unsupported groonga object type for assignment: %s(%#x)",
462
- rb_grn_inspect_type(object->header.type),
463
- object->header.type);
460
+ rb_raise(rb_eTypeError,
461
+ "unsupported groonga object type for assignment: %s(%#x)",
462
+ rb_grn_inspect_type(object->header.type),
463
+ object->header.type);
464
464
  }
465
465
 
466
466
  rb_iv_set(self, "@context", rb_context);
467
467
 
468
468
  debug("assign: %p:%p:%p %s(%#x)\n",
469
- context, object, rb_grn_object,
470
- rb_grn_inspect_type(object->header.type), object->header.type);
469
+ context, object, rb_grn_object,
470
+ rb_grn_inspect_type(object->header.type), object->header.type);
471
471
  }
472
472
 
473
473
  void
474
474
  rb_grn_named_object_bind (RbGrnNamedObject *rb_grn_named_object,
475
- grn_ctx *context, grn_obj *object)
475
+ grn_ctx *context, grn_obj *object)
476
476
  {
477
477
  rb_grn_named_object->name = NULL;
478
478
  rb_grn_named_object->name_size = 0;
@@ -480,35 +480,35 @@ rb_grn_named_object_bind (RbGrnNamedObject *rb_grn_named_object,
480
480
 
481
481
  void
482
482
  rb_grn_named_object_finalizer (grn_ctx *context, grn_obj *grn_object,
483
- RbGrnNamedObject *rb_grn_named_object)
483
+ RbGrnNamedObject *rb_grn_named_object)
484
484
  {
485
485
  if (rb_grn_named_object->name)
486
- xfree(rb_grn_named_object->name);
486
+ xfree(rb_grn_named_object->name);
487
487
  rb_grn_named_object->name = NULL;
488
488
  rb_grn_named_object->name_size = 0;
489
489
  }
490
490
 
491
491
  void
492
492
  rb_grn_named_object_set_name (RbGrnNamedObject *rb_grn_named_object,
493
- const char *name, unsigned name_size)
493
+ const char *name, unsigned name_size)
494
494
  {
495
495
  if (rb_grn_named_object->name) {
496
- xfree(rb_grn_named_object->name);
497
- rb_grn_named_object->name = NULL;
496
+ xfree(rb_grn_named_object->name);
497
+ rb_grn_named_object->name = NULL;
498
498
  }
499
499
  if (name_size > 0) {
500
- RbGrnObject *rb_grn_object;
501
- rb_grn_named_object->name = ALLOC_N(char, name_size + 1);
502
- memcpy(rb_grn_named_object->name, name, name_size);
503
- rb_grn_named_object->name[name_size] = '\0';
504
- rb_grn_object = RB_GRN_OBJECT(rb_grn_named_object);
505
- debug("set-name: %p:%p:%p %s(%#x): <%.*s>\n",
506
- rb_grn_object->context,
507
- rb_grn_object->object,
508
- rb_grn_named_object,
509
- rb_grn_inspect_type(rb_grn_object->object->header.type),
510
- rb_grn_object->object->header.type,
511
- name_size, name);
500
+ RbGrnObject *rb_grn_object;
501
+ rb_grn_named_object->name = ALLOC_N(char, name_size + 1);
502
+ memcpy(rb_grn_named_object->name, name, name_size);
503
+ rb_grn_named_object->name[name_size] = '\0';
504
+ rb_grn_object = RB_GRN_OBJECT(rb_grn_named_object);
505
+ debug("set-name: %p:%p:%p %s(%#x): <%.*s>\n",
506
+ rb_grn_object->context,
507
+ rb_grn_object->object,
508
+ rb_grn_named_object,
509
+ rb_grn_inspect_type(rb_grn_object->object->header.type),
510
+ rb_grn_object->object->header.type,
511
+ name_size, name);
512
512
  }
513
513
  rb_grn_named_object->name_size = name_size;
514
514
  }
@@ -516,28 +516,28 @@ rb_grn_named_object_set_name (RbGrnNamedObject *rb_grn_named_object,
516
516
 
517
517
  void
518
518
  rb_grn_object_deconstruct (RbGrnObject *rb_grn_object,
519
- grn_obj **object,
520
- grn_ctx **context,
521
- grn_id *domain_id,
522
- grn_obj **domain,
523
- grn_id *range_id,
524
- grn_obj **range)
519
+ grn_obj **object,
520
+ grn_ctx **context,
521
+ grn_id *domain_id,
522
+ grn_obj **domain,
523
+ grn_id *range_id,
524
+ grn_obj **range)
525
525
  {
526
526
  if (!rb_grn_object)
527
- return;
527
+ return;
528
528
 
529
529
  if (object)
530
- *object = rb_grn_object->object;
530
+ *object = rb_grn_object->object;
531
531
  if (context)
532
- *context = rb_grn_object->context;
532
+ *context = rb_grn_object->context;
533
533
  if (domain_id)
534
- *domain_id = rb_grn_object->domain_id;
534
+ *domain_id = rb_grn_object->domain_id;
535
535
  if (domain)
536
- *domain = rb_grn_object->domain;
536
+ *domain = rb_grn_object->domain;
537
537
  if (range_id)
538
- *range_id = rb_grn_object->range_id;
538
+ *range_id = rb_grn_object->range_id;
539
539
  if (range)
540
- *range = rb_grn_object->range;
540
+ *range = rb_grn_object->range;
541
541
  }
542
542
 
543
543
  /*
@@ -555,10 +555,10 @@ rb_grn_object_close (VALUE self)
555
555
 
556
556
  rb_grn_object = SELF(self);
557
557
  rb_grn_object_deconstruct(rb_grn_object, &object, &context,
558
- NULL, NULL, NULL, NULL);
558
+ NULL, NULL, NULL, NULL);
559
559
  if (object && context) {
560
- rb_grn_object_run_finalizer(context, object, rb_grn_object);
561
- grn_obj_close(context, object);
560
+ rb_grn_object_run_finalizer(context, object, rb_grn_object);
561
+ grn_obj_close(context, object);
562
562
  }
563
563
 
564
564
  return Qnil;
@@ -578,12 +578,12 @@ rb_grn_object_unlink (VALUE self)
578
578
 
579
579
  rb_grn_object = SELF(self);
580
580
  rb_grn_object_deconstruct(rb_grn_object, &object, &context,
581
- NULL, NULL, NULL, NULL);
581
+ NULL, NULL, NULL, NULL);
582
582
  if (object && context) {
583
- if (!(rb_grn_object->object->header.flags & GRN_OBJ_PERSISTENT)) {
584
- rb_grn_object_run_finalizer(context, object, rb_grn_object);
585
- }
586
- grn_obj_unlink(context, object);
583
+ if (!(rb_grn_object->object->header.flags & GRN_OBJ_PERSISTENT)) {
584
+ rb_grn_object_run_finalizer(context, object, rb_grn_object);
585
+ }
586
+ grn_obj_unlink(context, object);
587
587
  }
588
588
 
589
589
  return Qnil;
@@ -630,16 +630,16 @@ rb_grn_object_inspect_header (VALUE self, VALUE inspected)
630
630
 
631
631
  static VALUE
632
632
  rb_grn_object_inspect_content_id_with_label (VALUE inspected,
633
- grn_ctx *context, grn_obj *object)
633
+ grn_ctx *context, grn_obj *object)
634
634
  {
635
635
  grn_id id;
636
636
 
637
637
  rb_str_cat2(inspected, "id: <");
638
638
  id = grn_obj_id(context, object);
639
639
  if (id == GRN_ID_NIL)
640
- rb_str_cat2(inspected, "nil");
640
+ rb_str_cat2(inspected, "nil");
641
641
  else
642
- rb_str_concat(inspected, rb_obj_as_string(UINT2NUM(id)));
642
+ rb_str_concat(inspected, rb_obj_as_string(UINT2NUM(id)));
643
643
  rb_str_cat2(inspected, ">");
644
644
 
645
645
  return inspected;
@@ -647,24 +647,24 @@ rb_grn_object_inspect_content_id_with_label (VALUE inspected,
647
647
 
648
648
  VALUE
649
649
  rb_grn_object_inspect_object_content_name (VALUE inspected,
650
- grn_ctx *context, grn_obj *object)
650
+ grn_ctx *context, grn_obj *object)
651
651
  {
652
652
  int name_size;
653
653
 
654
654
  name_size = grn_obj_name(context, object, NULL, 0);
655
655
  if (name_size == 0) {
656
- rb_str_cat2(inspected, "(anonymous)");
656
+ rb_str_cat2(inspected, "(anonymous)");
657
657
  } else {
658
- grn_obj name;
659
-
660
- GRN_OBJ_INIT(&name, GRN_BULK, 0, GRN_ID_NIL);
661
- grn_bulk_space(context, &name, name_size);
662
- grn_obj_name(context, object, GRN_BULK_HEAD(&name), name_size);
663
- GRN_TEXT_PUTC(context, &name, '\0');
664
- rb_str_cat2(inspected, "<");
665
- rb_str_cat2(inspected, GRN_BULK_HEAD(&name));
666
- rb_str_cat2(inspected, ">");
667
- grn_obj_unlink(context, &name);
658
+ grn_obj name;
659
+
660
+ GRN_OBJ_INIT(&name, GRN_BULK, 0, GRN_ID_NIL);
661
+ grn_bulk_space(context, &name, name_size);
662
+ grn_obj_name(context, object, GRN_BULK_HEAD(&name), name_size);
663
+ GRN_TEXT_PUTC(context, &name, '\0');
664
+ rb_str_cat2(inspected, "<");
665
+ rb_str_cat2(inspected, GRN_BULK_HEAD(&name));
666
+ rb_str_cat2(inspected, ">");
667
+ grn_obj_unlink(context, &name);
668
668
  }
669
669
 
670
670
  return inspected;
@@ -672,7 +672,7 @@ rb_grn_object_inspect_object_content_name (VALUE inspected,
672
672
 
673
673
  static VALUE
674
674
  rb_grn_object_inspect_content_name_with_label (VALUE inspected,
675
- grn_ctx *context, grn_obj *object)
675
+ grn_ctx *context, grn_obj *object)
676
676
  {
677
677
 
678
678
  rb_str_cat2(inspected, "name: ");
@@ -682,18 +682,18 @@ rb_grn_object_inspect_content_name_with_label (VALUE inspected,
682
682
 
683
683
  static VALUE
684
684
  rb_grn_object_inspect_content_path_with_label (VALUE inspected,
685
- grn_ctx *context, grn_obj *object)
685
+ grn_ctx *context, grn_obj *object)
686
686
  {
687
687
  const char *path;
688
688
 
689
689
  rb_str_cat2(inspected, "path: ");
690
690
  path = grn_obj_path(context, object);
691
691
  if (path) {
692
- rb_str_cat2(inspected, "<");
693
- rb_str_cat2(inspected, path);
694
- rb_str_cat2(inspected, ">");
692
+ rb_str_cat2(inspected, "<");
693
+ rb_str_cat2(inspected, path);
694
+ rb_str_cat2(inspected, ">");
695
695
  } else {
696
- rb_str_cat2(inspected, "(temporary)");
696
+ rb_str_cat2(inspected, "(temporary)");
697
697
  }
698
698
 
699
699
  return inspected;
@@ -701,32 +701,32 @@ rb_grn_object_inspect_content_path_with_label (VALUE inspected,
701
701
 
702
702
  static VALUE
703
703
  rb_grn_object_inspect_content_domain_with_label (VALUE inspected,
704
- grn_ctx *context,
705
- grn_obj *object)
704
+ grn_ctx *context,
705
+ grn_obj *object)
706
706
  {
707
707
  grn_id domain;
708
708
 
709
709
  rb_str_cat2(inspected, "domain: ");
710
710
  domain = object->header.domain;
711
711
  if (domain == GRN_ID_NIL) {
712
- rb_str_cat2(inspected, "(nil)");
712
+ rb_str_cat2(inspected, "(nil)");
713
713
  } else {
714
- grn_obj *domain_object;
715
-
716
- domain_object = grn_ctx_at(context, domain);
717
- if (domain_object) {
718
- if (domain_object == object) {
719
- rb_str_cat2(inspected, "(self)");
720
- } else {
721
- rb_grn_object_inspect_object_content_name(inspected,
722
- context,
723
- domain_object);
724
- }
725
- } else {
726
- rb_str_cat2(inspected, "(");
727
- rb_str_concat(inspected, rb_obj_as_string(UINT2NUM(domain)));
728
- rb_str_cat2(inspected, ")");
729
- }
714
+ grn_obj *domain_object;
715
+
716
+ domain_object = grn_ctx_at(context, domain);
717
+ if (domain_object) {
718
+ if (domain_object == object) {
719
+ rb_str_cat2(inspected, "(self)");
720
+ } else {
721
+ rb_grn_object_inspect_object_content_name(inspected,
722
+ context,
723
+ domain_object);
724
+ }
725
+ } else {
726
+ rb_str_cat2(inspected, "(");
727
+ rb_str_concat(inspected, rb_obj_as_string(UINT2NUM(domain)));
728
+ rb_str_cat2(inspected, ")");
729
+ }
730
730
  }
731
731
 
732
732
  return inspected;
@@ -734,8 +734,8 @@ rb_grn_object_inspect_content_domain_with_label (VALUE inspected,
734
734
 
735
735
  static VALUE
736
736
  rb_grn_object_inspect_content_range_with_label (VALUE inspected,
737
- grn_ctx *context,
738
- grn_obj *object)
737
+ grn_ctx *context,
738
+ grn_obj *object)
739
739
  {
740
740
  grn_id range;
741
741
 
@@ -744,31 +744,31 @@ rb_grn_object_inspect_content_range_with_label (VALUE inspected,
744
744
  range = grn_obj_get_range(context, object);
745
745
  switch (object->header.type) {
746
746
  case GRN_TYPE:
747
- rb_str_cat2(inspected, "<");
748
- rb_str_concat(inspected, rb_inspect(UINT2NUM(range)));
749
- rb_str_cat2(inspected, ">");
750
- break;
747
+ rb_str_cat2(inspected, "<");
748
+ rb_str_concat(inspected, rb_inspect(UINT2NUM(range)));
749
+ rb_str_cat2(inspected, ">");
750
+ break;
751
751
  default:
752
- if (range == GRN_ID_NIL) {
753
- rb_str_cat2(inspected, "(nil)");
754
- } else {
755
- grn_obj *range_object;
756
-
757
- range_object = grn_ctx_at(context, range);
758
- if (range_object) {
759
- if (range_object == object) {
760
- rb_str_cat2(inspected, "(self)");
761
- } else {
762
- rb_grn_object_inspect_object_content_name(inspected,
763
- context,
764
- range_object);
765
- }
766
- } else {
767
- rb_str_cat2(inspected, "(");
768
- rb_str_concat(inspected, rb_obj_as_string(UINT2NUM(range)));
769
- rb_str_cat2(inspected, ")");
770
- }
771
- }
752
+ if (range == GRN_ID_NIL) {
753
+ rb_str_cat2(inspected, "(nil)");
754
+ } else {
755
+ grn_obj *range_object;
756
+
757
+ range_object = grn_ctx_at(context, range);
758
+ if (range_object) {
759
+ if (range_object == object) {
760
+ rb_str_cat2(inspected, "(self)");
761
+ } else {
762
+ rb_grn_object_inspect_object_content_name(inspected,
763
+ context,
764
+ range_object);
765
+ }
766
+ } else {
767
+ rb_str_cat2(inspected, "(");
768
+ rb_str_concat(inspected, rb_obj_as_string(UINT2NUM(range)));
769
+ rb_str_cat2(inspected, ")");
770
+ }
771
+ }
772
772
  }
773
773
 
774
774
  return inspected;
@@ -776,8 +776,8 @@ rb_grn_object_inspect_content_range_with_label (VALUE inspected,
776
776
 
777
777
  static VALUE
778
778
  rb_grn_object_inspect_content_flags_with_label (VALUE inspected,
779
- grn_ctx *context,
780
- grn_obj *object)
779
+ grn_ctx *context,
780
+ grn_obj *object)
781
781
  {
782
782
  grn_obj_flags flags;
783
783
  VALUE inspected_flags;
@@ -789,107 +789,107 @@ rb_grn_object_inspect_content_flags_with_label (VALUE inspected,
789
789
  inspected_flags = rb_ary_new();
790
790
 
791
791
  if (0) {
792
- if (flags & GRN_OBJ_TABLE_HASH_KEY)
793
- rb_ary_push(inspected_flags, rb_str_new2("TABLE_HASH_KEY"));
794
- if (flags & GRN_OBJ_TABLE_PAT_KEY)
795
- rb_ary_push(inspected_flags, rb_str_new2("TABLE_PAT_KEY"));
796
- if (flags & GRN_OBJ_TABLE_DAT_KEY)
797
- rb_ary_push(inspected_flags, rb_str_new2("TABLE_DAT_KEY"));
798
- if (flags & GRN_OBJ_TABLE_NO_KEY)
799
- rb_ary_push(inspected_flags, rb_str_new2("TABLE_NO_KEY"));
792
+ if (flags & GRN_OBJ_TABLE_HASH_KEY)
793
+ rb_ary_push(inspected_flags, rb_str_new2("TABLE_HASH_KEY"));
794
+ if (flags & GRN_OBJ_TABLE_PAT_KEY)
795
+ rb_ary_push(inspected_flags, rb_str_new2("TABLE_PAT_KEY"));
796
+ if (flags & GRN_OBJ_TABLE_DAT_KEY)
797
+ rb_ary_push(inspected_flags, rb_str_new2("TABLE_DAT_KEY"));
798
+ if (flags & GRN_OBJ_TABLE_NO_KEY)
799
+ rb_ary_push(inspected_flags, rb_str_new2("TABLE_NO_KEY"));
800
800
  }
801
801
 
802
802
  switch (object->header.type) {
803
803
  case GRN_COLUMN_FIX_SIZE:
804
804
  case GRN_COLUMN_VAR_SIZE:
805
805
  case GRN_TYPE:
806
- if (flags & GRN_OBJ_KEY_VAR_SIZE) {
807
- rb_ary_push(inspected_flags, rb_str_new2("KEY_VAR_SIZE"));
808
- } else {
809
- switch (flags & GRN_OBJ_KEY_MASK) {
810
- case GRN_OBJ_KEY_UINT:
811
- rb_ary_push(inspected_flags, rb_str_new2("KEY_UINT"));
812
- break;
813
- case GRN_OBJ_KEY_INT:
814
- rb_ary_push(inspected_flags, rb_str_new2("KEY_INT"));
815
- break;
816
- case GRN_OBJ_KEY_FLOAT:
817
- rb_ary_push(inspected_flags, rb_str_new2("KEY_FLOAT"));
818
- break;
819
- case GRN_OBJ_KEY_GEO_POINT:
820
- rb_ary_push(inspected_flags, rb_str_new2("KEY_GEO_POINT"));
821
- break;
822
- default:
823
- break;
824
- }
825
- }
826
- break;
806
+ if (flags & GRN_OBJ_KEY_VAR_SIZE) {
807
+ rb_ary_push(inspected_flags, rb_str_new2("KEY_VAR_SIZE"));
808
+ } else {
809
+ switch (flags & GRN_OBJ_KEY_MASK) {
810
+ case GRN_OBJ_KEY_UINT:
811
+ rb_ary_push(inspected_flags, rb_str_new2("KEY_UINT"));
812
+ break;
813
+ case GRN_OBJ_KEY_INT:
814
+ rb_ary_push(inspected_flags, rb_str_new2("KEY_INT"));
815
+ break;
816
+ case GRN_OBJ_KEY_FLOAT:
817
+ rb_ary_push(inspected_flags, rb_str_new2("KEY_FLOAT"));
818
+ break;
819
+ case GRN_OBJ_KEY_GEO_POINT:
820
+ rb_ary_push(inspected_flags, rb_str_new2("KEY_GEO_POINT"));
821
+ break;
822
+ default:
823
+ break;
824
+ }
825
+ }
826
+ break;
827
827
  default:
828
- break;
828
+ break;
829
829
  }
830
830
 
831
831
  switch (object->header.type) {
832
832
  case GRN_TABLE_HASH_KEY:
833
833
  case GRN_TABLE_PAT_KEY:
834
834
  case GRN_TABLE_DAT_KEY:
835
- if (flags & GRN_OBJ_KEY_WITH_SIS)
836
- rb_ary_push(inspected_flags, rb_str_new2("KEY_WITH_SIS"));
837
- if (flags & GRN_OBJ_KEY_NORMALIZE)
838
- rb_ary_push(inspected_flags, rb_str_new2("KEY_NORMALIZE"));
839
- break;
835
+ if (flags & GRN_OBJ_KEY_WITH_SIS)
836
+ rb_ary_push(inspected_flags, rb_str_new2("KEY_WITH_SIS"));
837
+ if (flags & GRN_OBJ_KEY_NORMALIZE)
838
+ rb_ary_push(inspected_flags, rb_str_new2("KEY_NORMALIZE"));
839
+ break;
840
840
  default:
841
- break;
841
+ break;
842
842
  }
843
843
 
844
844
  if (0) {
845
- if (flags & GRN_OBJ_COLUMN_SCALAR)
846
- rb_ary_push(inspected_flags, rb_str_new2("COLUMN_SCALAR"));
847
- if (flags & GRN_OBJ_COLUMN_VECTOR)
848
- rb_ary_push(inspected_flags, rb_str_new2("COLUMN_VECTOR"));
849
- if (flags & GRN_OBJ_COLUMN_INDEX)
850
- rb_ary_push(inspected_flags, rb_str_new2("COLUMN_INDEX"));
845
+ if (flags & GRN_OBJ_COLUMN_SCALAR)
846
+ rb_ary_push(inspected_flags, rb_str_new2("COLUMN_SCALAR"));
847
+ if (flags & GRN_OBJ_COLUMN_VECTOR)
848
+ rb_ary_push(inspected_flags, rb_str_new2("COLUMN_VECTOR"));
849
+ if (flags & GRN_OBJ_COLUMN_INDEX)
850
+ rb_ary_push(inspected_flags, rb_str_new2("COLUMN_INDEX"));
851
851
  }
852
852
 
853
853
  switch (object->header.type) {
854
854
  case GRN_COLUMN_FIX_SIZE:
855
855
  case GRN_COLUMN_VAR_SIZE:
856
- if (flags & GRN_OBJ_COMPRESS_ZLIB)
857
- rb_ary_push(inspected_flags, rb_str_new2("COMPRESS_ZLIB"));
858
- if (flags & GRN_OBJ_COMPRESS_LZO)
859
- rb_ary_push(inspected_flags, rb_str_new2("COMPRESS_LZO"));
860
- break;
856
+ if (flags & GRN_OBJ_COMPRESS_ZLIB)
857
+ rb_ary_push(inspected_flags, rb_str_new2("COMPRESS_ZLIB"));
858
+ if (flags & GRN_OBJ_COMPRESS_LZO)
859
+ rb_ary_push(inspected_flags, rb_str_new2("COMPRESS_LZO"));
860
+ break;
861
861
  case GRN_COLUMN_INDEX:
862
- if (flags & GRN_OBJ_WITH_SECTION)
863
- rb_ary_push(inspected_flags, rb_str_new2("WITH_SECTION"));
864
- if (flags & GRN_OBJ_WITH_WEIGHT)
865
- rb_ary_push(inspected_flags, rb_str_new2("WITH_WEIGHT"));
866
- if (flags & GRN_OBJ_WITH_POSITION)
867
- rb_ary_push(inspected_flags, rb_str_new2("WITH_POSITION"));
868
- break;
862
+ if (flags & GRN_OBJ_WITH_SECTION)
863
+ rb_ary_push(inspected_flags, rb_str_new2("WITH_SECTION"));
864
+ if (flags & GRN_OBJ_WITH_WEIGHT)
865
+ rb_ary_push(inspected_flags, rb_str_new2("WITH_WEIGHT"));
866
+ if (flags & GRN_OBJ_WITH_POSITION)
867
+ rb_ary_push(inspected_flags, rb_str_new2("WITH_POSITION"));
868
+ break;
869
869
  default:
870
- break;
870
+ break;
871
871
  }
872
872
 
873
873
  if (flags & GRN_OBJ_RING_BUFFER)
874
- rb_ary_push(inspected_flags, rb_str_new2("RING_BUFFER"));
874
+ rb_ary_push(inspected_flags, rb_str_new2("RING_BUFFER"));
875
875
 
876
876
  if (flags & GRN_OBJ_WITH_SUBREC) {
877
- rb_ary_push(inspected_flags, rb_str_new2("WITH_SUBREC"));
878
-
879
- if (flags & GRN_OBJ_UNIT_DOCUMENT_SECTION)
880
- rb_ary_push(inspected_flags, rb_str_new2("UNIT_DOCUMENT_SECTION"));
881
- if (flags & GRN_OBJ_UNIT_DOCUMENT_POSITION)
882
- rb_ary_push(inspected_flags, rb_str_new2("UNIT_DOCUMENT_POSITION"));
883
-
884
- if (flags & GRN_OBJ_UNIT_SECTION_POSITION)
885
- rb_ary_push(inspected_flags, rb_str_new2("UNIT_SECTION_POSITION"));
886
-
887
- if (flags & GRN_OBJ_UNIT_USERDEF_DOCUMENT)
888
- rb_ary_push(inspected_flags, rb_str_new2("UNIT_USERDEF_DOCUMENT"));
889
- if (flags & GRN_OBJ_UNIT_USERDEF_SECTION)
890
- rb_ary_push(inspected_flags, rb_str_new2("UNIT_USERDEF_SECTION"));
891
- if (flags & GRN_OBJ_UNIT_USERDEF_POSITION)
892
- rb_ary_push(inspected_flags, rb_str_new2("UNIT_USERDEF_POSITION"));
877
+ rb_ary_push(inspected_flags, rb_str_new2("WITH_SUBREC"));
878
+
879
+ if (flags & GRN_OBJ_UNIT_DOCUMENT_SECTION)
880
+ rb_ary_push(inspected_flags, rb_str_new2("UNIT_DOCUMENT_SECTION"));
881
+ if (flags & GRN_OBJ_UNIT_DOCUMENT_POSITION)
882
+ rb_ary_push(inspected_flags, rb_str_new2("UNIT_DOCUMENT_POSITION"));
883
+
884
+ if (flags & GRN_OBJ_UNIT_SECTION_POSITION)
885
+ rb_ary_push(inspected_flags, rb_str_new2("UNIT_SECTION_POSITION"));
886
+
887
+ if (flags & GRN_OBJ_UNIT_USERDEF_DOCUMENT)
888
+ rb_ary_push(inspected_flags, rb_str_new2("UNIT_USERDEF_DOCUMENT"));
889
+ if (flags & GRN_OBJ_UNIT_USERDEF_SECTION)
890
+ rb_ary_push(inspected_flags, rb_str_new2("UNIT_USERDEF_SECTION"));
891
+ if (flags & GRN_OBJ_UNIT_USERDEF_POSITION)
892
+ rb_ary_push(inspected_flags, rb_str_new2("UNIT_USERDEF_POSITION"));
893
893
  }
894
894
 
895
895
  rb_str_cat2(inspected, "<");
@@ -901,7 +901,7 @@ rb_grn_object_inspect_content_flags_with_label (VALUE inspected,
901
901
 
902
902
  VALUE
903
903
  rb_grn_object_inspect_object_content (VALUE inspected,
904
- grn_ctx *context, grn_obj *object)
904
+ grn_ctx *context, grn_obj *object)
905
905
  {
906
906
  rb_grn_object_inspect_content_id_with_label(inspected, context, object);
907
907
  rb_str_cat2(inspected, ", ");
@@ -927,18 +927,18 @@ rb_grn_object_inspect_content (VALUE self, VALUE inspected)
927
927
 
928
928
  rb_grn_object = SELF(self);
929
929
  if (!rb_grn_object)
930
- return inspected;
930
+ return inspected;
931
931
 
932
932
  context = rb_grn_object->context;
933
933
  object = rb_grn_object->object;
934
934
 
935
935
  rb_str_cat2(inspected, " ");
936
936
  if (rb_grn_exited) {
937
- rb_str_cat2(inspected, "(finished)");
937
+ rb_str_cat2(inspected, "(finished)");
938
938
  } else if (object) {
939
- rb_grn_object_inspect_object_content(inspected, context, object);
939
+ rb_grn_object_inspect_object_content(inspected, context, object);
940
940
  } else {
941
- rb_str_cat2(inspected, "(closed)");
941
+ rb_str_cat2(inspected, "(closed)");
942
942
  }
943
943
 
944
944
  return inspected;
@@ -986,11 +986,11 @@ rb_grn_object_get_id (VALUE self)
986
986
 
987
987
  rb_grn_object = SELF(self);
988
988
  if (!rb_grn_object->object)
989
- return Qnil;
989
+ return Qnil;
990
990
 
991
991
  id = grn_obj_id(rb_grn_object->context, rb_grn_object->object);
992
992
  if (id == GRN_ID_NIL)
993
- return Qnil;
993
+ return Qnil;
994
994
  else
995
995
  return UINT2NUM(id);
996
996
  }
@@ -1010,14 +1010,14 @@ rb_grn_object_get_path (VALUE self)
1010
1010
 
1011
1011
  rb_grn_object = SELF(self);
1012
1012
  if (!rb_grn_object->object)
1013
- return Qnil;
1013
+ return Qnil;
1014
1014
 
1015
1015
  path = grn_obj_path(rb_grn_object->context, rb_grn_object->object);
1016
1016
 
1017
1017
  if (!path)
1018
- return Qnil;
1018
+ return Qnil;
1019
1019
  else
1020
- return rb_str_new2(path);
1020
+ return rb_str_new2(path);
1021
1021
  }
1022
1022
 
1023
1023
  /*
@@ -1033,7 +1033,7 @@ rb_grn_object_temporary_p (VALUE self)
1033
1033
 
1034
1034
  rb_grn_object = SELF(self);
1035
1035
  if (!rb_grn_object->object)
1036
- return Qnil;
1036
+ return Qnil;
1037
1037
 
1038
1038
  return CBOOL2RVAL(!(rb_grn_object->object->header.flags & GRN_OBJ_PERSISTENT));
1039
1039
  }
@@ -1051,7 +1051,7 @@ rb_grn_object_persistent_p (VALUE self)
1051
1051
 
1052
1052
  rb_grn_object = SELF(self);
1053
1053
  if (!rb_grn_object->object)
1054
- return Qnil;
1054
+ return Qnil;
1055
1055
 
1056
1056
  return CBOOL2RVAL(rb_grn_object->object->header.flags & GRN_OBJ_PERSISTENT);
1057
1057
  }
@@ -1075,20 +1075,20 @@ rb_grn_object_get_domain (VALUE self)
1075
1075
  rb_grn_object = SELF(self);
1076
1076
  object = rb_grn_object->object;
1077
1077
  if (!object)
1078
- return Qnil;
1078
+ return Qnil;
1079
1079
 
1080
1080
  context = rb_grn_object->context;
1081
1081
  domain = object->header.domain;
1082
1082
  if (domain == GRN_ID_NIL) {
1083
- return Qnil;
1083
+ return Qnil;
1084
1084
  } else {
1085
- grn_obj *domain_object;
1085
+ grn_obj *domain_object;
1086
1086
 
1087
- domain_object = grn_ctx_at(context, domain);
1088
- if (domain_object)
1089
- return GRNOBJECT2RVAL(Qnil, context, domain_object, GRN_FALSE);
1090
- else
1091
- return UINT2NUM(domain);
1087
+ domain_object = grn_ctx_at(context, domain);
1088
+ if (domain_object)
1089
+ return GRNOBJECT2RVAL(Qnil, context, domain_object, GRN_FALSE);
1090
+ else
1091
+ return UINT2NUM(domain);
1092
1092
  }
1093
1093
  }
1094
1094
 
@@ -1108,16 +1108,16 @@ rb_grn_object_get_name (VALUE self)
1108
1108
 
1109
1109
  rb_grn_object = SELF(self);
1110
1110
  if (!rb_grn_object->object)
1111
- return Qnil;
1111
+ return Qnil;
1112
1112
 
1113
1113
  name_size = grn_obj_name(rb_grn_object->context, rb_grn_object->object,
1114
- NULL, 0);
1114
+ NULL, 0);
1115
1115
  if (name_size == 0)
1116
- return Qnil;
1116
+ return Qnil;
1117
1117
 
1118
1118
  name = xmalloc(name_size);
1119
1119
  grn_obj_name(rb_grn_object->context, rb_grn_object->object,
1120
- name, name_size);
1120
+ name, name_size);
1121
1121
  rb_name = rb_str_new(name, name_size);
1122
1122
  xfree(name);
1123
1123
 
@@ -1145,20 +1145,20 @@ rb_grn_object_get_range (VALUE self)
1145
1145
  rb_grn_object = SELF(self);
1146
1146
  object = rb_grn_object->object;
1147
1147
  if (!object)
1148
- return Qnil;
1148
+ return Qnil;
1149
1149
 
1150
1150
  context = rb_grn_object->context;
1151
1151
  range = grn_obj_get_range(context, object);
1152
1152
  if (range == GRN_ID_NIL) {
1153
- return Qnil;
1153
+ return Qnil;
1154
1154
  } else {
1155
- grn_obj *range_object;
1155
+ grn_obj *range_object;
1156
1156
 
1157
- range_object = grn_ctx_at(context, range);
1158
- if (range_object)
1159
- return GRNOBJECT2RVAL(Qnil, context, range_object, GRN_FALSE);
1160
- else
1161
- return UINT2NUM(range);
1157
+ range_object = grn_ctx_at(context, range);
1158
+ if (range_object)
1159
+ return GRNOBJECT2RVAL(Qnil, context, range_object, GRN_FALSE);
1160
+ else
1161
+ return UINT2NUM(range);
1162
1162
  }
1163
1163
  }
1164
1164
 
@@ -1210,7 +1210,7 @@ rb_grn_object_array_reference (VALUE self, VALUE rb_id)
1210
1210
  context = rb_grn_object->context;
1211
1211
  object = rb_grn_object->object;
1212
1212
  if (!object)
1213
- return Qnil;
1213
+ return Qnil;
1214
1214
 
1215
1215
  id = NUM2UINT(rb_id);
1216
1216
  range_id = grn_obj_get_range(context, object);
@@ -1221,43 +1221,43 @@ rb_grn_object_array_reference (VALUE self, VALUE rb_id)
1221
1221
  case GRN_TABLE_PAT_KEY:
1222
1222
  case GRN_TABLE_DAT_KEY:
1223
1223
  case GRN_TABLE_NO_KEY:
1224
- GRN_OBJ_INIT(&value, GRN_BULK, 0, GRN_ID_NIL);
1225
- break;
1224
+ GRN_OBJ_INIT(&value, GRN_BULK, 0, GRN_ID_NIL);
1225
+ break;
1226
1226
  case GRN_TYPE:
1227
1227
  case GRN_ACCESSOR: /* FIXME */
1228
- GRN_OBJ_INIT(&value, GRN_BULK, 0, range_id);
1229
- break;
1228
+ GRN_OBJ_INIT(&value, GRN_BULK, 0, range_id);
1229
+ break;
1230
1230
  case GRN_COLUMN_VAR_SIZE:
1231
1231
  case GRN_COLUMN_FIX_SIZE:
1232
- switch (object->header.flags & GRN_OBJ_COLUMN_TYPE_MASK) {
1233
- case GRN_OBJ_COLUMN_VECTOR:
1234
- GRN_OBJ_INIT(&value, GRN_VECTOR, 0, range_id);
1235
- break;
1236
- case GRN_OBJ_COLUMN_SCALAR:
1237
- GRN_OBJ_INIT(&value, GRN_BULK, 0, range_id);
1238
- break;
1239
- default:
1240
- rb_raise(rb_eGrnError, "unsupported column type: %u: %s",
1241
- range_type, rb_grn_inspect(self));
1242
- break;
1243
- }
1244
- break;
1232
+ switch (object->header.flags & GRN_OBJ_COLUMN_TYPE_MASK) {
1233
+ case GRN_OBJ_COLUMN_VECTOR:
1234
+ GRN_OBJ_INIT(&value, GRN_VECTOR, 0, range_id);
1235
+ break;
1236
+ case GRN_OBJ_COLUMN_SCALAR:
1237
+ GRN_OBJ_INIT(&value, GRN_BULK, 0, range_id);
1238
+ break;
1239
+ default:
1240
+ rb_raise(rb_eGrnError, "unsupported column type: %u: %s",
1241
+ range_type, rb_grn_inspect(self));
1242
+ break;
1243
+ }
1244
+ break;
1245
1245
  case GRN_COLUMN_INDEX:
1246
- GRN_UINT32_INIT(&value, 0);
1247
- break;
1246
+ GRN_UINT32_INIT(&value, 0);
1247
+ break;
1248
1248
  default:
1249
- rb_raise(rb_eGrnError,
1250
- "unsupported type: %s", rb_grn_inspect(self));
1251
- break;
1249
+ rb_raise(rb_eGrnError,
1250
+ "unsupported type: %s", rb_grn_inspect(self));
1251
+ break;
1252
1252
  }
1253
1253
 
1254
1254
  grn_obj_get_value(context, object, id, &value);
1255
1255
  exception = rb_grn_context_to_exception(context, self);
1256
1256
  if (NIL_P(exception))
1257
- rb_value = GRNVALUE2RVAL(context, &value, range, self);
1257
+ rb_value = GRNVALUE2RVAL(context, &value, range, self);
1258
1258
  grn_obj_unlink(context, &value);
1259
1259
  if (!NIL_P(exception))
1260
- rb_exc_raise(exception);
1260
+ rb_exc_raise(exception);
1261
1261
 
1262
1262
  return rb_value;
1263
1263
  }
@@ -1269,68 +1269,103 @@ rb_uvector_value_p (RbGrnObject *rb_grn_object, VALUE rb_value)
1269
1269
 
1270
1270
  switch (rb_grn_object->range->header.type) {
1271
1271
  case GRN_TYPE:
1272
- /* TODO: support not sizeof(grn_id) uvector. */
1273
- /*
1274
- if (!(rb_grn_object->range->header.flags | GRN_OBJ_KEY_VAR_SIZE)) {
1275
- return GRN_TRUE;
1276
- }
1277
- */
1278
- break;
1272
+ if (!(rb_grn_object->range->header.flags & GRN_OBJ_KEY_VAR_SIZE)) {
1273
+ return GRN_TRUE;
1274
+ }
1275
+ break;
1279
1276
  case GRN_TABLE_HASH_KEY:
1280
1277
  case GRN_TABLE_PAT_KEY:
1281
1278
  case GRN_TABLE_DAT_KEY:
1282
1279
  case GRN_TABLE_NO_KEY:
1283
- first_element = rb_ary_entry(rb_value, 0);
1284
- if (rb_respond_to(first_element, rb_intern("record_raw_id"))) {
1285
- return GRN_TRUE;
1286
- }
1287
- break;
1280
+ first_element = rb_ary_entry(rb_value, 0);
1281
+ if (rb_respond_to(first_element, rb_intern("record_raw_id"))) {
1282
+ return GRN_TRUE;
1283
+ }
1284
+ break;
1288
1285
  default:
1289
- break;
1286
+ break;
1290
1287
  }
1291
1288
 
1292
1289
  return GRN_FALSE;
1293
1290
  }
1294
1291
 
1295
- VALUE
1296
- rb_grn_object_set_raw (RbGrnObject *rb_grn_object, grn_id id,
1297
- VALUE rb_value, int flags, VALUE related_object)
1292
+ typedef struct {
1293
+ RbGrnObject *rb_grn_object;
1294
+ grn_id id;
1295
+ grn_obj value;
1296
+ VALUE rb_value;
1297
+ int flags;
1298
+ VALUE related_object;
1299
+ } SetRawData;
1300
+
1301
+ static VALUE
1302
+ rb_grn_object_set_raw_body (VALUE user_data)
1298
1303
  {
1304
+ SetRawData *data = (SetRawData *)user_data;
1305
+ RbGrnObject *rb_grn_object;
1299
1306
  grn_ctx *context;
1300
- grn_obj value;
1307
+ grn_obj *value;
1301
1308
  grn_rc rc;
1302
- VALUE exception, rb_values;
1309
+ VALUE rb_value, rb_values;
1310
+ VALUE related_object;
1303
1311
 
1312
+ rb_grn_object = data->rb_grn_object;
1304
1313
  context = rb_grn_object->context;
1314
+ value = &(data->value);
1315
+ rb_value = data->rb_value;
1305
1316
  rb_values = rb_grn_check_convert_to_array(rb_value);
1317
+ related_object = data->related_object;
1306
1318
  if (NIL_P(rb_values)) {
1307
- if (NIL_P(rb_value)) {
1308
- GRN_OBJ_INIT(&value, GRN_BULK, 0, GRN_ID_NIL);
1309
- } else {
1310
- GRN_OBJ_INIT(&value, GRN_BULK, 0, GRN_ID_NIL);
1311
- RVAL2GRNBULK(rb_value, context, &value);
1312
- }
1319
+ if (NIL_P(rb_value)) {
1320
+ GRN_OBJ_INIT(value, GRN_BULK, 0, GRN_ID_NIL);
1321
+ } else {
1322
+ GRN_OBJ_INIT(value, GRN_BULK, 0, GRN_ID_NIL);
1323
+ RVAL2GRNBULK(rb_value, context, value);
1324
+ }
1313
1325
  } else {
1314
- if (rb_uvector_value_p(rb_grn_object, rb_values)) {
1315
- GRN_OBJ_INIT(&value, GRN_UVECTOR, 0,
1316
- rb_grn_object->object->header.domain);
1317
- RVAL2GRNUVECTOR(rb_values, context, &value, related_object);
1318
- } else {
1319
- GRN_OBJ_INIT(&value, GRN_VECTOR, 0, GRN_ID_NIL);
1320
- RVAL2GRNVECTOR(rb_values, context, &value);
1321
- }
1326
+ if (rb_uvector_value_p(rb_grn_object, rb_values)) {
1327
+ GRN_OBJ_INIT(value, GRN_UVECTOR, 0, rb_grn_object->range_id);
1328
+ RVAL2GRNUVECTOR(rb_values, context, value, related_object);
1329
+ } else {
1330
+ GRN_OBJ_INIT(value, GRN_VECTOR, 0, GRN_ID_NIL);
1331
+ RVAL2GRNVECTOR(rb_values, context, value);
1332
+ }
1322
1333
  }
1323
- rc = grn_obj_set_value(context, rb_grn_object->object, id,
1324
- &value, flags);
1325
- exception = rb_grn_context_to_exception(context, related_object);
1326
- grn_obj_unlink(context, &value);
1327
- if (!NIL_P(exception))
1328
- rb_exc_raise(exception);
1334
+ rc = grn_obj_set_value(context, rb_grn_object->object, data->id,
1335
+ value, data->flags);
1336
+ rb_grn_context_check(context, related_object);
1329
1337
  rb_grn_rc_check(rc, related_object);
1330
1338
 
1331
1339
  return Qnil;
1332
1340
  }
1333
1341
 
1342
+ static VALUE
1343
+ rb_grn_object_set_raw_ensure (VALUE user_data)
1344
+ {
1345
+ SetRawData *data = (SetRawData *)user_data;
1346
+
1347
+ grn_obj_unlink(data->rb_grn_object->context, &(data->value));
1348
+
1349
+ return Qnil;
1350
+ }
1351
+
1352
+ VALUE
1353
+ rb_grn_object_set_raw (RbGrnObject *rb_grn_object, grn_id id,
1354
+ VALUE rb_value, int flags, VALUE related_object)
1355
+ {
1356
+ SetRawData data;
1357
+
1358
+ data.rb_grn_object = rb_grn_object;
1359
+ data.id = id;
1360
+ GRN_VOID_INIT(&(data.value));
1361
+ data.rb_value = rb_value;
1362
+ data.flags = flags;
1363
+ data.related_object = related_object;
1364
+
1365
+ return rb_ensure(rb_grn_object_set_raw_body, (VALUE)(&data),
1366
+ rb_grn_object_set_raw_ensure, (VALUE)(&data));
1367
+ }
1368
+
1334
1369
  static VALUE
1335
1370
  rb_grn_object_set (VALUE self, VALUE rb_id, VALUE rb_value, int flags)
1336
1371
  {
@@ -1339,7 +1374,7 @@ rb_grn_object_set (VALUE self, VALUE rb_id, VALUE rb_value, int flags)
1339
1374
 
1340
1375
  rb_grn_object = SELF(self);
1341
1376
  if (!rb_grn_object->object)
1342
- return Qnil;
1377
+ return Qnil;
1343
1378
 
1344
1379
  id = NUM2UINT(rb_id);
1345
1380
 
@@ -1395,7 +1430,7 @@ rb_grn_object_remove (VALUE self)
1395
1430
 
1396
1431
  rb_grn_object = SELF(self);
1397
1432
  if (!rb_grn_object->object)
1398
- return Qnil;
1433
+ return Qnil;
1399
1434
 
1400
1435
  context = rb_grn_object->context;
1401
1436
  rc = grn_obj_remove(context, rb_grn_object->object);
@@ -1414,10 +1449,10 @@ rb_grn_object_builtin_p (VALUE self)
1414
1449
  grn_bool builtin = GRN_FALSE;
1415
1450
 
1416
1451
  rb_grn_object_deconstruct(SELF(self), &object, &context,
1417
- NULL, NULL, NULL, NULL);
1452
+ NULL, NULL, NULL, NULL);
1418
1453
 
1419
1454
  if (context && object) {
1420
- builtin = grn_obj_is_builtin(context, object);
1455
+ builtin = grn_obj_is_builtin(context, object);
1421
1456
  }
1422
1457
 
1423
1458
  return CBOOL2RVAL(builtin);
@@ -1441,7 +1476,7 @@ rb_grn_init_object (VALUE mGrn)
1441
1476
 
1442
1477
  rb_define_method(rb_cGrnObject, "temporary?", rb_grn_object_temporary_p, 0);
1443
1478
  rb_define_method(rb_cGrnObject, "persistent?",
1444
- rb_grn_object_persistent_p, 0);
1479
+ rb_grn_object_persistent_p, 0);
1445
1480
 
1446
1481
  rb_define_method(rb_cGrnObject, "==", rb_grn_object_equal, 1);
1447
1482
 
@@ -1458,5 +1493,4 @@ rb_grn_init_object (VALUE mGrn)
1458
1493
  rb_define_method(rb_cGrnObject, "remove", rb_grn_object_remove, 0);
1459
1494
 
1460
1495
  rb_define_method(rb_cGrnObject, "builtin?", rb_grn_object_builtin_p, 0);
1461
-
1462
1496
  }