rroonga 4.0.6-x64-mingw32 → 4.0.7-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (599) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/doc/text/news.textile +14 -2
  4. data/ext/groonga/extconf.rb +0 -3
  5. data/ext/groonga/rb-grn-expression.c +1 -6
  6. data/ext/groonga/rb-grn-index-column.c +96 -0
  7. data/ext/groonga/rb-grn-index-cursor.c +32 -8
  8. data/ext/groonga/rb-grn-posting.c +26 -6
  9. data/ext/groonga/rb-grn-utils.c +27 -0
  10. data/ext/groonga/rb-grn.h +4 -1
  11. data/lib/1.9/groonga.so +0 -0
  12. data/lib/2.0/groonga.so +0 -0
  13. data/lib/2.1/groonga.so +0 -0
  14. data/rroonga-build.rb +3 -3
  15. data/test/test-column.rb +50 -12
  16. data/test/test-expression-builder.rb +1 -1
  17. data/test/test-expression.rb +80 -25
  18. data/test/test-index-column.rb +41 -0
  19. data/test/test-index-cursor.rb +21 -1
  20. data/test/test-table-key-support.rb +59 -1
  21. data/vendor/local/bin/groonga-benchmark.exe +0 -0
  22. data/vendor/local/bin/groonga.exe +0 -0
  23. data/vendor/local/bin/libgcc_s_sjlj-1.dll +0 -0
  24. data/vendor/local/bin/libgroonga-0.dll +0 -0
  25. data/vendor/local/bin/libmecab-1.dll +0 -0
  26. data/vendor/local/bin/libmsgpack-3.dll +0 -0
  27. data/vendor/local/bin/libmsgpackc-2.dll +0 -0
  28. data/vendor/local/bin/libonig-5.dll +0 -0
  29. data/vendor/local/bin/libstdc++-6.dll +0 -0
  30. data/vendor/local/bin/libwinpthread-1.dll +0 -0
  31. data/vendor/local/bin/lz4 +0 -0
  32. data/vendor/local/bin/lz4c +0 -0
  33. data/vendor/local/bin/lz4cat +0 -0
  34. data/vendor/local/bin/mecab-config +2 -2
  35. data/vendor/local/bin/mecab.exe +0 -0
  36. data/vendor/local/bin/onig-config +1 -1
  37. data/vendor/local/bin/zlib1.dll +0 -0
  38. data/vendor/local/etc/groonga/groonga.conf +1 -1
  39. data/vendor/local/etc/groonga/httpd/fastcgi.conf +25 -0
  40. data/vendor/local/etc/groonga/httpd/fastcgi.conf.default +25 -0
  41. data/vendor/local/etc/groonga/httpd/fastcgi_params +24 -0
  42. data/vendor/local/etc/groonga/httpd/fastcgi_params.default +24 -0
  43. data/vendor/local/etc/groonga/httpd/groonga-httpd.conf +2 -2
  44. data/vendor/local/etc/groonga/httpd/html/50x.html +21 -0
  45. data/vendor/local/etc/groonga/httpd/html/index.html +25 -0
  46. data/vendor/local/etc/groonga/httpd/koi-utf +109 -0
  47. data/vendor/local/etc/groonga/httpd/koi-win +103 -0
  48. data/vendor/local/etc/groonga/httpd/mime.types +89 -0
  49. data/vendor/local/etc/groonga/httpd/mime.types.default +89 -0
  50. data/vendor/local/etc/groonga/httpd/nginx.conf.default +117 -0
  51. data/vendor/local/etc/groonga/httpd/scgi_params +16 -0
  52. data/vendor/local/etc/groonga/httpd/scgi_params.default +16 -0
  53. data/vendor/local/etc/groonga/httpd/uwsgi_params +16 -0
  54. data/vendor/local/etc/groonga/httpd/uwsgi_params.default +16 -0
  55. data/vendor/local/etc/groonga/httpd/win-utf +126 -0
  56. data/vendor/local/include/groonga/groonga.h +5 -2095
  57. data/vendor/local/include/groonga/groonga/expr.h +108 -0
  58. data/vendor/local/include/groonga/groonga/groonga.h +2031 -0
  59. data/vendor/local/include/groonga/groonga/ii.h +46 -0
  60. data/vendor/local/include/groonga/groonga/nfkc.h +3 -3
  61. data/vendor/local/include/groonga/groonga/plugin.h +5 -3
  62. data/vendor/local/include/groonga/groonga/token.h +136 -0
  63. data/vendor/local/include/groonga/groonga/token_filter.h +4 -6
  64. data/vendor/local/include/groonga/groonga/tokenizer.h +60 -55
  65. data/vendor/local/include/groonga/groonga/util.h +40 -0
  66. data/vendor/local/include/lz4.h +323 -0
  67. data/vendor/local/include/lz4hc.h +223 -0
  68. data/vendor/local/include/zconf.h +511 -0
  69. data/vendor/local/include/zlib.h +1768 -0
  70. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.a +0 -0
  71. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll +0 -0
  72. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.dll.a +0 -0
  73. data/vendor/local/lib/groonga/plugins/query_expanders/tsv.la +3 -3
  74. data/vendor/local/lib/groonga/plugins/ruby/eval.a +0 -0
  75. data/vendor/local/lib/groonga/plugins/ruby/eval.dll +0 -0
  76. data/vendor/local/lib/groonga/plugins/ruby/eval.dll.a +0 -0
  77. data/vendor/local/lib/groonga/plugins/ruby/eval.la +3 -3
  78. data/vendor/local/lib/groonga/plugins/ruby/load.a +0 -0
  79. data/vendor/local/lib/groonga/plugins/ruby/load.dll +0 -0
  80. data/vendor/local/lib/groonga/plugins/ruby/load.dll.a +0 -0
  81. data/vendor/local/lib/groonga/plugins/ruby/load.la +3 -3
  82. data/vendor/local/lib/groonga/plugins/suggest/suggest.a +0 -0
  83. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll +0 -0
  84. data/vendor/local/lib/groonga/plugins/suggest/suggest.dll.a +0 -0
  85. data/vendor/local/lib/groonga/plugins/suggest/suggest.la +3 -3
  86. data/vendor/local/lib/groonga/plugins/table/table.a +0 -0
  87. data/vendor/local/lib/groonga/plugins/table/table.dll +0 -0
  88. data/vendor/local/lib/groonga/plugins/table/table.dll.a +0 -0
  89. data/vendor/local/lib/groonga/plugins/table/table.la +3 -3
  90. data/vendor/local/lib/groonga/plugins/token_filters/stop_word.a +0 -0
  91. data/vendor/local/lib/groonga/plugins/token_filters/stop_word.dll +0 -0
  92. data/vendor/local/lib/groonga/plugins/token_filters/stop_word.dll.a +0 -0
  93. data/vendor/local/lib/groonga/plugins/token_filters/stop_word.la +3 -3
  94. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.a +0 -0
  95. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll +0 -0
  96. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.dll.a +0 -0
  97. data/vendor/local/lib/groonga/plugins/tokenizers/mecab.la +3 -3
  98. data/vendor/local/lib/groonga/scripts/ruby/scan_info_builder.rb +22 -0
  99. data/vendor/local/lib/libgroonga.a +0 -0
  100. data/vendor/local/lib/libgroonga.dll.a +0 -0
  101. data/vendor/local/lib/libgroonga.la +3 -3
  102. data/vendor/local/lib/liblz4.a +0 -0
  103. data/vendor/local/lib/liblz4.dll +0 -0
  104. data/vendor/local/lib/liblz4.dll.1 +0 -0
  105. data/vendor/local/lib/liblz4.dll.1.4.0 +0 -0
  106. data/vendor/local/lib/libmecab.a +0 -0
  107. data/vendor/local/lib/libmecab.dll.a +0 -0
  108. data/vendor/local/lib/libmecab.la +3 -3
  109. data/vendor/local/lib/libmsgpack.a +0 -0
  110. data/vendor/local/lib/libmsgpack.dll.a +0 -0
  111. data/vendor/local/lib/libmsgpack.la +3 -3
  112. data/vendor/local/lib/libmsgpackc.a +0 -0
  113. data/vendor/local/lib/libmsgpackc.dll.a +0 -0
  114. data/vendor/local/lib/libmsgpackc.la +3 -3
  115. data/vendor/local/lib/libonig.a +0 -0
  116. data/vendor/local/lib/libonig.dll.a +0 -0
  117. data/vendor/local/lib/libonig.la +2 -2
  118. data/vendor/local/lib/libz.a +0 -0
  119. data/vendor/local/lib/libz.dll.a +0 -0
  120. data/vendor/local/lib/pkgconfig/groonga.pc +3 -3
  121. data/vendor/local/lib/pkgconfig/liblz4.pc +14 -0
  122. data/vendor/local/lib/pkgconfig/msgpack.pc +1 -1
  123. data/vendor/local/lib/pkgconfig/oniguruma.pc +6 -6
  124. data/vendor/local/lib/pkgconfig/zlib.pc +13 -0
  125. data/vendor/local/libexec/mecab/mecab-cost-train.exe +0 -0
  126. data/vendor/local/libexec/mecab/mecab-dict-gen.exe +0 -0
  127. data/vendor/local/libexec/mecab/mecab-dict-index.exe +0 -0
  128. data/vendor/local/libexec/mecab/mecab-system-eval.exe +0 -0
  129. data/vendor/local/libexec/mecab/mecab-test-gen.exe +0 -0
  130. data/vendor/local/sbin/groonga-httpd-restart +1 -1
  131. data/vendor/local/sbin/groonga-httpd.exe +0 -0
  132. data/vendor/local/share/doc/groonga/en/html/.buildinfo +1 -1
  133. data/vendor/local/share/doc/groonga/en/html/_sources/contribution/development/release.txt +3 -24
  134. data/vendor/local/share/doc/groonga/en/html/_sources/contribution/documentation/introduction.txt +3 -3
  135. data/vendor/local/share/doc/groonga/en/html/_sources/development/travis-ci.txt +1 -1
  136. data/vendor/local/share/doc/groonga/en/html/_sources/install/centos.txt +3 -3
  137. data/vendor/local/share/doc/groonga/en/html/_sources/install/debian.txt +3 -3
  138. data/vendor/local/share/doc/groonga/en/html/_sources/install/fedora.txt +3 -3
  139. data/vendor/local/share/doc/groonga/en/html/_sources/install/mac_os_x.txt +3 -3
  140. data/vendor/local/share/doc/groonga/en/html/_sources/install/others.txt +7 -19
  141. data/vendor/local/share/doc/groonga/en/html/_sources/install/solaris.txt +3 -3
  142. data/vendor/local/share/doc/groonga/en/html/_sources/install/ubuntu.txt +4 -4
  143. data/vendor/local/share/doc/groonga/en/html/_sources/install/windows.txt +9 -9
  144. data/vendor/local/share/doc/groonga/en/html/_sources/limitations.txt +1 -1
  145. data/vendor/local/share/doc/groonga/en/html/_sources/news.txt +88 -3
  146. data/vendor/local/share/doc/groonga/en/html/_sources/reference/api/grn_content_type.txt +39 -0
  147. data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/range_filter.txt +28 -0
  148. data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/table_create.txt +1 -1
  149. data/vendor/local/share/doc/groonga/en/html/_sources/reference/commands/table_tokenize.txt +109 -0
  150. data/vendor/local/share/doc/groonga/en/html/_sources/reference/functions/in_values.txt +30 -0
  151. data/vendor/local/share/doc/groonga/en/html/_sources/reference/token_filters.txt +111 -0
  152. data/vendor/local/share/doc/groonga/en/html/_sources/server/http.txt +0 -4
  153. data/vendor/local/share/doc/groonga/en/html/_sources/server/package.txt +54 -50
  154. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/data.txt +1 -1
  155. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/drilldown.txt +1 -1
  156. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/index.txt +1 -1
  157. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/network.txt +1 -1
  158. data/vendor/local/share/doc/groonga/en/html/_sources/tutorial/search.txt +1 -1
  159. data/vendor/local/share/doc/groonga/en/html/_static/basic.css +67 -5
  160. data/vendor/local/share/doc/groonga/en/html/_static/doctools.js +25 -0
  161. data/vendor/local/share/doc/groonga/en/html/_static/down-pressed.png +0 -0
  162. data/vendor/local/share/doc/groonga/en/html/_static/down.png +0 -0
  163. data/vendor/local/share/doc/groonga/en/html/_static/file.png +0 -0
  164. data/vendor/local/share/doc/groonga/en/html/_static/jquery-1.11.1.js +10308 -0
  165. data/vendor/local/share/doc/groonga/en/html/_static/jquery.js +4 -9404
  166. data/vendor/local/share/doc/groonga/en/html/_static/minus.png +0 -0
  167. data/vendor/local/share/doc/groonga/en/html/_static/plus.png +0 -0
  168. data/vendor/local/share/doc/groonga/en/html/_static/underscore-1.3.1.js +999 -0
  169. data/vendor/local/share/doc/groonga/en/html/_static/underscore.js +31 -1415
  170. data/vendor/local/share/doc/groonga/en/html/_static/up-pressed.png +0 -0
  171. data/vendor/local/share/doc/groonga/en/html/_static/up.png +0 -0
  172. data/vendor/local/share/doc/groonga/en/html/_static/websupport.js +14 -14
  173. data/vendor/local/share/doc/groonga/en/html/characteristic.html +19 -17
  174. data/vendor/local/share/doc/groonga/en/html/client.html +19 -17
  175. data/vendor/local/share/doc/groonga/en/html/community.html +19 -17
  176. data/vendor/local/share/doc/groonga/en/html/contribution.html +24 -23
  177. data/vendor/local/share/doc/groonga/en/html/contribution/development.html +19 -17
  178. data/vendor/local/share/doc/groonga/en/html/contribution/development/com.html +19 -17
  179. data/vendor/local/share/doc/groonga/en/html/contribution/development/cooperation.html +19 -17
  180. data/vendor/local/share/doc/groonga/en/html/contribution/development/query.html +19 -17
  181. data/vendor/local/share/doc/groonga/en/html/contribution/development/release.html +40 -58
  182. data/vendor/local/share/doc/groonga/en/html/contribution/development/repository.html +19 -17
  183. data/vendor/local/share/doc/groonga/en/html/contribution/development/test.html +19 -17
  184. data/vendor/local/share/doc/groonga/en/html/contribution/documentation.html +19 -17
  185. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/c-api.html +19 -17
  186. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/i18n.html +19 -17
  187. data/vendor/local/share/doc/groonga/en/html/contribution/documentation/introduction.html +30 -28
  188. data/vendor/local/share/doc/groonga/en/html/contribution/report.html +19 -17
  189. data/vendor/local/share/doc/groonga/en/html/development.html +19 -17
  190. data/vendor/local/share/doc/groonga/en/html/development/travis-ci.html +27 -25
  191. data/vendor/local/share/doc/groonga/en/html/genindex.html +12 -12
  192. data/vendor/local/share/doc/groonga/en/html/index.html +81 -77
  193. data/vendor/local/share/doc/groonga/en/html/install.html +33 -31
  194. data/vendor/local/share/doc/groonga/en/html/install/centos.html +33 -34
  195. data/vendor/local/share/doc/groonga/en/html/install/debian.html +26 -25
  196. data/vendor/local/share/doc/groonga/en/html/install/fedora.html +28 -27
  197. data/vendor/local/share/doc/groonga/en/html/install/mac_os_x.html +24 -22
  198. data/vendor/local/share/doc/groonga/en/html/install/others.html +93 -103
  199. data/vendor/local/share/doc/groonga/en/html/install/solaris.html +24 -22
  200. data/vendor/local/share/doc/groonga/en/html/install/ubuntu.html +28 -27
  201. data/vendor/local/share/doc/groonga/en/html/install/windows.html +32 -30
  202. data/vendor/local/share/doc/groonga/en/html/limitations.html +20 -18
  203. data/vendor/local/share/doc/groonga/en/html/news.html +210 -116
  204. data/vendor/local/share/doc/groonga/en/html/news/0.x.html +19 -17
  205. data/vendor/local/share/doc/groonga/en/html/news/1.0.x.html +20 -18
  206. data/vendor/local/share/doc/groonga/en/html/news/1.1.x.html +19 -17
  207. data/vendor/local/share/doc/groonga/en/html/news/1.2.x.html +34 -32
  208. data/vendor/local/share/doc/groonga/en/html/news/1.3.x.html +29 -27
  209. data/vendor/local/share/doc/groonga/en/html/news/2.x.html +99 -97
  210. data/vendor/local/share/doc/groonga/en/html/news/3.x.html +71 -69
  211. data/vendor/local/share/doc/groonga/en/html/news/senna.html +19 -17
  212. data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
  213. data/vendor/local/share/doc/groonga/en/html/reference.html +78 -74
  214. data/vendor/local/share/doc/groonga/en/html/reference/api.html +39 -37
  215. data/vendor/local/share/doc/groonga/en/html/reference/api/global_configurations.html +33 -31
  216. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_cache.html +45 -43
  217. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_column.html +65 -63
  218. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_command_version.html +29 -27
  219. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_content_type.html +174 -0
  220. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ctx.html +63 -61
  221. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_db.html +33 -31
  222. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_encoding.html +30 -28
  223. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_expr.html +66 -64
  224. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_geo.html +28 -26
  225. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_hook.html +31 -29
  226. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_ii.html +29 -27
  227. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_index_cursor.html +28 -26
  228. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_info.html +28 -26
  229. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_match_escalation.html +27 -25
  230. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_obj.html +76 -74
  231. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_proc.html +31 -29
  232. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_search.html +26 -24
  233. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_table.html +62 -60
  234. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_table_cursor.html +51 -49
  235. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_type.html +27 -25
  236. data/vendor/local/share/doc/groonga/en/html/reference/api/grn_user_data.html +24 -22
  237. data/vendor/local/share/doc/groonga/en/html/reference/api/plugin.html +42 -40
  238. data/vendor/local/share/doc/groonga/en/html/reference/cast.html +19 -17
  239. data/vendor/local/share/doc/groonga/en/html/reference/column.html +21 -19
  240. data/vendor/local/share/doc/groonga/en/html/reference/columns/pseudo.html +24 -22
  241. data/vendor/local/share/doc/groonga/en/html/reference/columns/vector.html +61 -59
  242. data/vendor/local/share/doc/groonga/en/html/reference/command.html +52 -49
  243. data/vendor/local/share/doc/groonga/en/html/reference/command/command_version.html +19 -17
  244. data/vendor/local/share/doc/groonga/en/html/reference/command/output_format.html +55 -53
  245. data/vendor/local/share/doc/groonga/en/html/reference/command/return_code.html +96 -94
  246. data/vendor/local/share/doc/groonga/en/html/reference/commands/cache_limit.html +40 -38
  247. data/vendor/local/share/doc/groonga/en/html/reference/commands/check.html +45 -43
  248. data/vendor/local/share/doc/groonga/en/html/reference/commands/clearlock.html +25 -23
  249. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_create.html +41 -39
  250. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_list.html +72 -70
  251. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_remove.html +26 -24
  252. data/vendor/local/share/doc/groonga/en/html/reference/commands/column_rename.html +43 -41
  253. data/vendor/local/share/doc/groonga/en/html/reference/commands/define_selector.html +39 -37
  254. data/vendor/local/share/doc/groonga/en/html/reference/commands/defrag.html +26 -24
  255. data/vendor/local/share/doc/groonga/en/html/reference/commands/delete.html +35 -33
  256. data/vendor/local/share/doc/groonga/en/html/reference/commands/dump.html +24 -22
  257. data/vendor/local/share/doc/groonga/en/html/reference/commands/load.html +42 -40
  258. data/vendor/local/share/doc/groonga/en/html/reference/commands/log_level.html +25 -23
  259. data/vendor/local/share/doc/groonga/en/html/reference/commands/log_put.html +26 -24
  260. data/vendor/local/share/doc/groonga/en/html/reference/commands/log_reopen.html +24 -22
  261. data/vendor/local/share/doc/groonga/en/html/reference/commands/normalize.html +61 -59
  262. data/vendor/local/share/doc/groonga/en/html/reference/commands/normalizer_list.html +31 -29
  263. data/vendor/local/share/doc/groonga/en/html/reference/commands/quit.html +27 -25
  264. data/vendor/local/share/doc/groonga/en/html/reference/commands/range_filter.html +166 -0
  265. data/vendor/local/share/doc/groonga/en/html/reference/commands/register.html +51 -49
  266. data/vendor/local/share/doc/groonga/en/html/reference/commands/ruby_eval.html +55 -53
  267. data/vendor/local/share/doc/groonga/en/html/reference/commands/ruby_load.html +55 -53
  268. data/vendor/local/share/doc/groonga/en/html/reference/commands/select.html +385 -383
  269. data/vendor/local/share/doc/groonga/en/html/reference/commands/shutdown.html +39 -37
  270. data/vendor/local/share/doc/groonga/en/html/reference/commands/status.html +42 -40
  271. data/vendor/local/share/doc/groonga/en/html/reference/commands/suggest.html +83 -81
  272. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_create.html +149 -147
  273. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_list.html +51 -49
  274. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_remove.html +41 -39
  275. data/vendor/local/share/doc/groonga/en/html/reference/commands/table_tokenize.html +276 -0
  276. data/vendor/local/share/doc/groonga/en/html/reference/commands/tokenize.html +103 -101
  277. data/vendor/local/share/doc/groonga/en/html/reference/commands/tokenizer_list.html +47 -45
  278. data/vendor/local/share/doc/groonga/en/html/reference/commands/truncate.html +48 -46
  279. data/vendor/local/share/doc/groonga/en/html/reference/executables.html +19 -17
  280. data/vendor/local/share/doc/groonga/en/html/reference/executables/grnslap.html +22 -20
  281. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-benchmark.html +28 -26
  282. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-httpd.html +75 -73
  283. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-server-http.html +19 -17
  284. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-create-dataset.html +19 -17
  285. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-httpd.html +44 -42
  286. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga-suggest-learner.html +36 -34
  287. data/vendor/local/share/doc/groonga/en/html/reference/executables/groonga.html +57 -55
  288. data/vendor/local/share/doc/groonga/en/html/reference/function.html +26 -23
  289. data/vendor/local/share/doc/groonga/en/html/reference/functions/between.html +42 -40
  290. data/vendor/local/share/doc/groonga/en/html/reference/functions/edit_distance.html +21 -19
  291. data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_distance.html +81 -79
  292. data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_circle.html +32 -30
  293. data/vendor/local/share/doc/groonga/en/html/reference/functions/geo_in_rectangle.html +22 -20
  294. data/vendor/local/share/doc/groonga/en/html/reference/functions/highlight_full.html +53 -51
  295. data/vendor/local/share/doc/groonga/en/html/reference/functions/highlight_html.html +41 -39
  296. data/vendor/local/share/doc/groonga/en/html/reference/functions/html_untag.html +35 -33
  297. data/vendor/local/share/doc/groonga/en/html/reference/functions/in_values.html +164 -0
  298. data/vendor/local/share/doc/groonga/en/html/reference/functions/now.html +40 -38
  299. data/vendor/local/share/doc/groonga/en/html/reference/functions/query.html +76 -74
  300. data/vendor/local/share/doc/groonga/en/html/reference/functions/rand.html +42 -40
  301. data/vendor/local/share/doc/groonga/en/html/reference/functions/snippet_html.html +66 -64
  302. data/vendor/local/share/doc/groonga/en/html/reference/functions/sub_filter.html +59 -57
  303. data/vendor/local/share/doc/groonga/en/html/reference/grn_expr.html +26 -24
  304. data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/query_syntax.html +210 -208
  305. data/vendor/local/share/doc/groonga/en/html/reference/grn_expr/script_syntax.html +262 -260
  306. data/vendor/local/share/doc/groonga/en/html/reference/indexing.html +21 -19
  307. data/vendor/local/share/doc/groonga/en/html/reference/log.html +22 -20
  308. data/vendor/local/share/doc/groonga/en/html/reference/normalizers.html +54 -52
  309. data/vendor/local/share/doc/groonga/en/html/reference/operations.html +23 -21
  310. data/vendor/local/share/doc/groonga/en/html/reference/operations/geolocation_search.html +19 -17
  311. data/vendor/local/share/doc/groonga/en/html/reference/output.html +34 -32
  312. data/vendor/local/share/doc/groonga/en/html/reference/query_expanders.html +19 -17
  313. data/vendor/local/share/doc/groonga/en/html/reference/query_expanders/tsv.html +57 -55
  314. data/vendor/local/share/doc/groonga/en/html/reference/suggest.html +19 -17
  315. data/vendor/local/share/doc/groonga/en/html/reference/suggest/completion.html +19 -17
  316. data/vendor/local/share/doc/groonga/en/html/reference/suggest/correction.html +19 -17
  317. data/vendor/local/share/doc/groonga/en/html/reference/suggest/introduction.html +19 -17
  318. data/vendor/local/share/doc/groonga/en/html/reference/suggest/suggestion.html +19 -17
  319. data/vendor/local/share/doc/groonga/en/html/reference/tables.html +54 -52
  320. data/vendor/local/share/doc/groonga/en/html/reference/token_filters.html +323 -0
  321. data/vendor/local/share/doc/groonga/en/html/reference/tokenizers.html +19 -17
  322. data/vendor/local/share/doc/groonga/en/html/reference/tuning.html +29 -27
  323. data/vendor/local/share/doc/groonga/en/html/reference/types.html +40 -38
  324. data/vendor/local/share/doc/groonga/en/html/search.html +11 -11
  325. data/vendor/local/share/doc/groonga/en/html/searchindex.js +1 -1
  326. data/vendor/local/share/doc/groonga/en/html/server.html +21 -19
  327. data/vendor/local/share/doc/groonga/en/html/server/gqtp.html +19 -17
  328. data/vendor/local/share/doc/groonga/en/html/server/http.html +19 -21
  329. data/vendor/local/share/doc/groonga/en/html/server/http/comparison.html +33 -31
  330. data/vendor/local/share/doc/groonga/en/html/server/http/groonga-httpd.html +19 -17
  331. data/vendor/local/share/doc/groonga/en/html/server/http/groonga.html +19 -17
  332. data/vendor/local/share/doc/groonga/en/html/server/package.html +92 -85
  333. data/vendor/local/share/doc/groonga/en/html/spec.html +19 -17
  334. data/vendor/local/share/doc/groonga/en/html/spec/gqtp.html +127 -125
  335. data/vendor/local/share/doc/groonga/en/html/spec/search.html +19 -17
  336. data/vendor/local/share/doc/groonga/en/html/troubleshooting.html +19 -17
  337. data/vendor/local/share/doc/groonga/en/html/troubleshooting/different_results_with_the_same_keyword.html +19 -17
  338. data/vendor/local/share/doc/groonga/en/html/troubleshooting/mmap_cannot_allocate_memory.html +20 -18
  339. data/vendor/local/share/doc/groonga/en/html/tutorial.html +20 -18
  340. data/vendor/local/share/doc/groonga/en/html/tutorial/data.html +19 -17
  341. data/vendor/local/share/doc/groonga/en/html/tutorial/drilldown.html +33 -31
  342. data/vendor/local/share/doc/groonga/en/html/tutorial/index.html +22 -20
  343. data/vendor/local/share/doc/groonga/en/html/tutorial/introduction.html +19 -17
  344. data/vendor/local/share/doc/groonga/en/html/tutorial/lexicon.html +19 -17
  345. data/vendor/local/share/doc/groonga/en/html/tutorial/match_columns.html +23 -21
  346. data/vendor/local/share/doc/groonga/en/html/tutorial/micro_blog.html +52 -50
  347. data/vendor/local/share/doc/groonga/en/html/tutorial/network.html +19 -17
  348. data/vendor/local/share/doc/groonga/en/html/tutorial/patricia_trie.html +20 -18
  349. data/vendor/local/share/doc/groonga/en/html/tutorial/query_expansion.html +22 -20
  350. data/vendor/local/share/doc/groonga/en/html/tutorial/search.html +35 -33
  351. data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
  352. data/vendor/local/share/doc/groonga/ja/html/_sources/contribution/development/release.txt +3 -24
  353. data/vendor/local/share/doc/groonga/ja/html/_sources/contribution/documentation/introduction.txt +3 -3
  354. data/vendor/local/share/doc/groonga/ja/html/_sources/development/travis-ci.txt +1 -1
  355. data/vendor/local/share/doc/groonga/ja/html/_sources/install/centos.txt +3 -3
  356. data/vendor/local/share/doc/groonga/ja/html/_sources/install/debian.txt +3 -3
  357. data/vendor/local/share/doc/groonga/ja/html/_sources/install/fedora.txt +3 -3
  358. data/vendor/local/share/doc/groonga/ja/html/_sources/install/mac_os_x.txt +3 -3
  359. data/vendor/local/share/doc/groonga/ja/html/_sources/install/others.txt +7 -19
  360. data/vendor/local/share/doc/groonga/ja/html/_sources/install/solaris.txt +3 -3
  361. data/vendor/local/share/doc/groonga/ja/html/_sources/install/ubuntu.txt +4 -4
  362. data/vendor/local/share/doc/groonga/ja/html/_sources/install/windows.txt +9 -9
  363. data/vendor/local/share/doc/groonga/ja/html/_sources/limitations.txt +1 -1
  364. data/vendor/local/share/doc/groonga/ja/html/_sources/news.txt +88 -3
  365. data/vendor/local/share/doc/groonga/ja/html/_sources/reference/api/grn_content_type.txt +39 -0
  366. data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/range_filter.txt +28 -0
  367. data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/table_create.txt +1 -1
  368. data/vendor/local/share/doc/groonga/ja/html/_sources/reference/commands/table_tokenize.txt +109 -0
  369. data/vendor/local/share/doc/groonga/ja/html/_sources/reference/functions/in_values.txt +30 -0
  370. data/vendor/local/share/doc/groonga/ja/html/_sources/reference/token_filters.txt +111 -0
  371. data/vendor/local/share/doc/groonga/ja/html/_sources/server/http.txt +0 -4
  372. data/vendor/local/share/doc/groonga/ja/html/_sources/server/package.txt +54 -50
  373. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/data.txt +1 -1
  374. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/drilldown.txt +1 -1
  375. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/index.txt +1 -1
  376. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/network.txt +1 -1
  377. data/vendor/local/share/doc/groonga/ja/html/_sources/tutorial/search.txt +1 -1
  378. data/vendor/local/share/doc/groonga/ja/html/_static/basic.css +67 -5
  379. data/vendor/local/share/doc/groonga/ja/html/_static/doctools.js +25 -0
  380. data/vendor/local/share/doc/groonga/ja/html/_static/down-pressed.png +0 -0
  381. data/vendor/local/share/doc/groonga/ja/html/_static/down.png +0 -0
  382. data/vendor/local/share/doc/groonga/ja/html/_static/file.png +0 -0
  383. data/vendor/local/share/doc/groonga/ja/html/_static/jquery-1.11.1.js +10308 -0
  384. data/vendor/local/share/doc/groonga/ja/html/_static/jquery.js +4 -9404
  385. data/vendor/local/share/doc/groonga/ja/html/_static/minus.png +0 -0
  386. data/vendor/local/share/doc/groonga/ja/html/_static/plus.png +0 -0
  387. data/vendor/local/share/doc/groonga/ja/html/_static/underscore-1.3.1.js +999 -0
  388. data/vendor/local/share/doc/groonga/ja/html/_static/underscore.js +31 -1415
  389. data/vendor/local/share/doc/groonga/ja/html/_static/up-pressed.png +0 -0
  390. data/vendor/local/share/doc/groonga/ja/html/_static/up.png +0 -0
  391. data/vendor/local/share/doc/groonga/ja/html/_static/websupport.js +14 -14
  392. data/vendor/local/share/doc/groonga/ja/html/characteristic.html +19 -17
  393. data/vendor/local/share/doc/groonga/ja/html/client.html +19 -17
  394. data/vendor/local/share/doc/groonga/ja/html/community.html +19 -17
  395. data/vendor/local/share/doc/groonga/ja/html/contribution.html +24 -23
  396. data/vendor/local/share/doc/groonga/ja/html/contribution/development.html +19 -17
  397. data/vendor/local/share/doc/groonga/ja/html/contribution/development/com.html +19 -17
  398. data/vendor/local/share/doc/groonga/ja/html/contribution/development/cooperation.html +19 -17
  399. data/vendor/local/share/doc/groonga/ja/html/contribution/development/query.html +19 -17
  400. data/vendor/local/share/doc/groonga/ja/html/contribution/development/release.html +40 -58
  401. data/vendor/local/share/doc/groonga/ja/html/contribution/development/repository.html +19 -17
  402. data/vendor/local/share/doc/groonga/ja/html/contribution/development/test.html +19 -17
  403. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +19 -17
  404. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/c-api.html +19 -17
  405. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/i18n.html +19 -17
  406. data/vendor/local/share/doc/groonga/ja/html/contribution/documentation/introduction.html +30 -28
  407. data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +19 -17
  408. data/vendor/local/share/doc/groonga/ja/html/development.html +19 -17
  409. data/vendor/local/share/doc/groonga/ja/html/development/travis-ci.html +22 -20
  410. data/vendor/local/share/doc/groonga/ja/html/genindex.html +12 -12
  411. data/vendor/local/share/doc/groonga/ja/html/index.html +82 -78
  412. data/vendor/local/share/doc/groonga/ja/html/install.html +33 -31
  413. data/vendor/local/share/doc/groonga/ja/html/install/centos.html +36 -40
  414. data/vendor/local/share/doc/groonga/ja/html/install/debian.html +27 -27
  415. data/vendor/local/share/doc/groonga/ja/html/install/fedora.html +29 -29
  416. data/vendor/local/share/doc/groonga/ja/html/install/mac_os_x.html +24 -22
  417. data/vendor/local/share/doc/groonga/ja/html/install/others.html +84 -90
  418. data/vendor/local/share/doc/groonga/ja/html/install/solaris.html +23 -21
  419. data/vendor/local/share/doc/groonga/ja/html/install/ubuntu.html +29 -29
  420. data/vendor/local/share/doc/groonga/ja/html/install/windows.html +31 -29
  421. data/vendor/local/share/doc/groonga/ja/html/limitations.html +21 -19
  422. data/vendor/local/share/doc/groonga/ja/html/news.html +233 -147
  423. data/vendor/local/share/doc/groonga/ja/html/news/0.x.html +19 -17
  424. data/vendor/local/share/doc/groonga/ja/html/news/1.0.x.html +20 -18
  425. data/vendor/local/share/doc/groonga/ja/html/news/1.1.x.html +19 -17
  426. data/vendor/local/share/doc/groonga/ja/html/news/1.2.x.html +34 -32
  427. data/vendor/local/share/doc/groonga/ja/html/news/1.3.x.html +29 -27
  428. data/vendor/local/share/doc/groonga/ja/html/news/2.x.html +93 -91
  429. data/vendor/local/share/doc/groonga/ja/html/news/3.x.html +61 -59
  430. data/vendor/local/share/doc/groonga/ja/html/news/senna.html +19 -17
  431. data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
  432. data/vendor/local/share/doc/groonga/ja/html/reference.html +79 -75
  433. data/vendor/local/share/doc/groonga/ja/html/reference/api.html +39 -37
  434. data/vendor/local/share/doc/groonga/ja/html/reference/api/global_configurations.html +33 -31
  435. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_cache.html +39 -37
  436. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_column.html +59 -57
  437. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_command_version.html +29 -27
  438. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_content_type.html +176 -0
  439. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ctx.html +61 -59
  440. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_db.html +32 -30
  441. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_encoding.html +30 -28
  442. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_expr.html +53 -51
  443. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_geo.html +28 -26
  444. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_hook.html +31 -29
  445. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_ii.html +29 -27
  446. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_index_cursor.html +28 -26
  447. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_info.html +28 -26
  448. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_match_escalation.html +27 -25
  449. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_obj.html +76 -74
  450. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_proc.html +31 -29
  451. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_search.html +26 -24
  452. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_table.html +62 -60
  453. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_table_cursor.html +51 -49
  454. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_type.html +27 -25
  455. data/vendor/local/share/doc/groonga/ja/html/reference/api/grn_user_data.html +24 -22
  456. data/vendor/local/share/doc/groonga/ja/html/reference/api/plugin.html +42 -40
  457. data/vendor/local/share/doc/groonga/ja/html/reference/cast.html +19 -17
  458. data/vendor/local/share/doc/groonga/ja/html/reference/column.html +21 -19
  459. data/vendor/local/share/doc/groonga/ja/html/reference/columns/pseudo.html +24 -22
  460. data/vendor/local/share/doc/groonga/ja/html/reference/columns/vector.html +51 -49
  461. data/vendor/local/share/doc/groonga/ja/html/reference/command.html +52 -49
  462. data/vendor/local/share/doc/groonga/ja/html/reference/command/command_version.html +19 -17
  463. data/vendor/local/share/doc/groonga/ja/html/reference/command/output_format.html +45 -43
  464. data/vendor/local/share/doc/groonga/ja/html/reference/command/return_code.html +95 -93
  465. data/vendor/local/share/doc/groonga/ja/html/reference/commands/cache_limit.html +37 -35
  466. data/vendor/local/share/doc/groonga/ja/html/reference/commands/check.html +45 -43
  467. data/vendor/local/share/doc/groonga/ja/html/reference/commands/clearlock.html +25 -23
  468. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_create.html +41 -39
  469. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_list.html +64 -62
  470. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_remove.html +26 -24
  471. data/vendor/local/share/doc/groonga/ja/html/reference/commands/column_rename.html +40 -38
  472. data/vendor/local/share/doc/groonga/ja/html/reference/commands/define_selector.html +39 -37
  473. data/vendor/local/share/doc/groonga/ja/html/reference/commands/defrag.html +26 -24
  474. data/vendor/local/share/doc/groonga/ja/html/reference/commands/delete.html +34 -32
  475. data/vendor/local/share/doc/groonga/ja/html/reference/commands/dump.html +24 -22
  476. data/vendor/local/share/doc/groonga/ja/html/reference/commands/load.html +35 -33
  477. data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_level.html +25 -23
  478. data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_put.html +26 -24
  479. data/vendor/local/share/doc/groonga/ja/html/reference/commands/log_reopen.html +24 -22
  480. data/vendor/local/share/doc/groonga/ja/html/reference/commands/normalize.html +56 -54
  481. data/vendor/local/share/doc/groonga/ja/html/reference/commands/normalizer_list.html +31 -29
  482. data/vendor/local/share/doc/groonga/ja/html/reference/commands/quit.html +27 -25
  483. data/vendor/local/share/doc/groonga/ja/html/reference/commands/range_filter.html +167 -0
  484. data/vendor/local/share/doc/groonga/ja/html/reference/commands/register.html +47 -45
  485. data/vendor/local/share/doc/groonga/ja/html/reference/commands/ruby_eval.html +55 -53
  486. data/vendor/local/share/doc/groonga/ja/html/reference/commands/ruby_load.html +55 -53
  487. data/vendor/local/share/doc/groonga/ja/html/reference/commands/select.html +256 -254
  488. data/vendor/local/share/doc/groonga/ja/html/reference/commands/shutdown.html +39 -37
  489. data/vendor/local/share/doc/groonga/ja/html/reference/commands/status.html +40 -38
  490. data/vendor/local/share/doc/groonga/ja/html/reference/commands/suggest.html +80 -78
  491. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_create.html +125 -123
  492. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_list.html +51 -49
  493. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_remove.html +41 -39
  494. data/vendor/local/share/doc/groonga/ja/html/reference/commands/table_tokenize.html +268 -0
  495. data/vendor/local/share/doc/groonga/ja/html/reference/commands/tokenize.html +89 -87
  496. data/vendor/local/share/doc/groonga/ja/html/reference/commands/tokenizer_list.html +47 -45
  497. data/vendor/local/share/doc/groonga/ja/html/reference/commands/truncate.html +48 -46
  498. data/vendor/local/share/doc/groonga/ja/html/reference/executables.html +19 -17
  499. data/vendor/local/share/doc/groonga/ja/html/reference/executables/grnslap.html +22 -20
  500. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-benchmark.html +28 -26
  501. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-httpd.html +63 -61
  502. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-server-http.html +19 -17
  503. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-create-dataset.html +19 -17
  504. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-httpd.html +44 -42
  505. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga-suggest-learner.html +36 -34
  506. data/vendor/local/share/doc/groonga/ja/html/reference/executables/groonga.html +57 -55
  507. data/vendor/local/share/doc/groonga/ja/html/reference/function.html +26 -23
  508. data/vendor/local/share/doc/groonga/ja/html/reference/functions/between.html +42 -40
  509. data/vendor/local/share/doc/groonga/ja/html/reference/functions/edit_distance.html +21 -19
  510. data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_distance.html +65 -63
  511. data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_circle.html +32 -30
  512. data/vendor/local/share/doc/groonga/ja/html/reference/functions/geo_in_rectangle.html +22 -20
  513. data/vendor/local/share/doc/groonga/ja/html/reference/functions/highlight_full.html +43 -41
  514. data/vendor/local/share/doc/groonga/ja/html/reference/functions/highlight_html.html +32 -30
  515. data/vendor/local/share/doc/groonga/ja/html/reference/functions/html_untag.html +35 -33
  516. data/vendor/local/share/doc/groonga/ja/html/reference/functions/in_values.html +165 -0
  517. data/vendor/local/share/doc/groonga/ja/html/reference/functions/now.html +40 -38
  518. data/vendor/local/share/doc/groonga/ja/html/reference/functions/query.html +69 -67
  519. data/vendor/local/share/doc/groonga/ja/html/reference/functions/rand.html +42 -40
  520. data/vendor/local/share/doc/groonga/ja/html/reference/functions/snippet_html.html +52 -50
  521. data/vendor/local/share/doc/groonga/ja/html/reference/functions/sub_filter.html +51 -49
  522. data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr.html +23 -21
  523. data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/query_syntax.html +115 -113
  524. data/vendor/local/share/doc/groonga/ja/html/reference/grn_expr/script_syntax.html +179 -177
  525. data/vendor/local/share/doc/groonga/ja/html/reference/indexing.html +20 -18
  526. data/vendor/local/share/doc/groonga/ja/html/reference/log.html +22 -20
  527. data/vendor/local/share/doc/groonga/ja/html/reference/normalizers.html +43 -41
  528. data/vendor/local/share/doc/groonga/ja/html/reference/operations.html +23 -21
  529. data/vendor/local/share/doc/groonga/ja/html/reference/operations/geolocation_search.html +19 -17
  530. data/vendor/local/share/doc/groonga/ja/html/reference/output.html +30 -28
  531. data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders.html +23 -21
  532. data/vendor/local/share/doc/groonga/ja/html/reference/query_expanders/tsv.html +36 -34
  533. data/vendor/local/share/doc/groonga/ja/html/reference/suggest.html +20 -18
  534. data/vendor/local/share/doc/groonga/ja/html/reference/suggest/completion.html +19 -17
  535. data/vendor/local/share/doc/groonga/ja/html/reference/suggest/correction.html +19 -17
  536. data/vendor/local/share/doc/groonga/ja/html/reference/suggest/introduction.html +19 -17
  537. data/vendor/local/share/doc/groonga/ja/html/reference/suggest/suggestion.html +21 -19
  538. data/vendor/local/share/doc/groonga/ja/html/reference/tables.html +44 -42
  539. data/vendor/local/share/doc/groonga/ja/html/reference/token_filters.html +316 -0
  540. data/vendor/local/share/doc/groonga/ja/html/reference/tokenizers.html +23 -21
  541. data/vendor/local/share/doc/groonga/ja/html/reference/tuning.html +29 -27
  542. data/vendor/local/share/doc/groonga/ja/html/reference/types.html +38 -36
  543. data/vendor/local/share/doc/groonga/ja/html/search.html +11 -11
  544. data/vendor/local/share/doc/groonga/ja/html/searchindex.js +1 -1
  545. data/vendor/local/share/doc/groonga/ja/html/server.html +21 -19
  546. data/vendor/local/share/doc/groonga/ja/html/server/gqtp.html +19 -17
  547. data/vendor/local/share/doc/groonga/ja/html/server/http.html +19 -21
  548. data/vendor/local/share/doc/groonga/ja/html/server/http/comparison.html +27 -25
  549. data/vendor/local/share/doc/groonga/ja/html/server/http/groonga-httpd.html +19 -17
  550. data/vendor/local/share/doc/groonga/ja/html/server/http/groonga.html +19 -17
  551. data/vendor/local/share/doc/groonga/ja/html/server/package.html +91 -82
  552. data/vendor/local/share/doc/groonga/ja/html/spec.html +19 -17
  553. data/vendor/local/share/doc/groonga/ja/html/spec/gqtp.html +126 -124
  554. data/vendor/local/share/doc/groonga/ja/html/spec/search.html +19 -17
  555. data/vendor/local/share/doc/groonga/ja/html/troubleshooting.html +19 -17
  556. data/vendor/local/share/doc/groonga/ja/html/troubleshooting/different_results_with_the_same_keyword.html +19 -17
  557. data/vendor/local/share/doc/groonga/ja/html/troubleshooting/mmap_cannot_allocate_memory.html +20 -18
  558. data/vendor/local/share/doc/groonga/ja/html/tutorial.html +20 -18
  559. data/vendor/local/share/doc/groonga/ja/html/tutorial/data.html +19 -17
  560. data/vendor/local/share/doc/groonga/ja/html/tutorial/drilldown.html +32 -30
  561. data/vendor/local/share/doc/groonga/ja/html/tutorial/index.html +19 -17
  562. data/vendor/local/share/doc/groonga/ja/html/tutorial/introduction.html +19 -17
  563. data/vendor/local/share/doc/groonga/ja/html/tutorial/lexicon.html +19 -17
  564. data/vendor/local/share/doc/groonga/ja/html/tutorial/match_columns.html +25 -23
  565. data/vendor/local/share/doc/groonga/ja/html/tutorial/micro_blog.html +49 -47
  566. data/vendor/local/share/doc/groonga/ja/html/tutorial/network.html +19 -17
  567. data/vendor/local/share/doc/groonga/ja/html/tutorial/patricia_trie.html +20 -18
  568. data/vendor/local/share/doc/groonga/ja/html/tutorial/query_expansion.html +22 -20
  569. data/vendor/local/share/doc/groonga/ja/html/tutorial/search.html +33 -31
  570. data/vendor/local/share/groonga/examples/dictionary/edict/edict-import.sh +0 -0
  571. data/vendor/local/share/groonga/examples/dictionary/edict/edict2grn.rb +0 -0
  572. data/vendor/local/share/groonga/examples/dictionary/eijiro/eijiro-import.sh +0 -0
  573. data/vendor/local/share/groonga/examples/dictionary/eijiro/eijiro2grn.rb +0 -0
  574. data/vendor/local/share/groonga/examples/dictionary/gene95/gene-import.sh +0 -0
  575. data/vendor/local/share/groonga/examples/dictionary/gene95/gene2grn.rb +0 -0
  576. data/vendor/local/share/groonga/examples/dictionary/html/index.html +1 -1
  577. data/vendor/local/share/groonga/examples/dictionary/html/js/jquery-1.7.2.js +9404 -0
  578. data/vendor/local/share/groonga/examples/dictionary/html/js/jquery-ui-1.8.18.custom.js +11802 -0
  579. data/vendor/local/share/groonga/examples/dictionary/init-db.sh +0 -0
  580. data/vendor/local/share/groonga/examples/dictionary/jmdict/jmdict.rb +0 -0
  581. data/vendor/local/share/groonga/html/admin/index.html +2 -2
  582. data/vendor/local/share/groonga/html/admin/index.ja.html +2 -2
  583. data/vendor/local/share/groonga/html/admin/js/jquery-1.7.2.js +9404 -0
  584. data/vendor/local/share/groonga/html/admin/js/jquery-ui-1.8.18.custom.js +11802 -0
  585. data/vendor/local/share/groonga/html/admin/js/jquery.flot-0.7.js +2599 -0
  586. data/vendor/local/share/license/lz4/LICENSE +24 -0
  587. data/vendor/local/share/license/zlib/README +115 -0
  588. data/vendor/local/share/man/ja/man1/groonga.1 +183 -215
  589. data/vendor/local/share/man/man1/groonga.1 +188 -227
  590. data/vendor/local/share/man/man1/lz4.1 +88 -0
  591. data/vendor/local/share/man/man1/lz4c.1 +33 -0
  592. data/vendor/local/share/man/man1/lz4cat.1 +32 -0
  593. metadata +118 -51
  594. data/vendor/local/bin/libgcc_s_seh-1.dll +0 -0
  595. data/vendor/local/share/groonga/examples/dictionary/html/js/jquery-1.7.2.min.js +0 -4
  596. data/vendor/local/share/groonga/examples/dictionary/html/js/jquery-ui-1.8.18.custom.min.js +0 -356
  597. data/vendor/local/share/groonga/html/admin/js/jquery-1.7.2.min.js +0 -4
  598. data/vendor/local/share/groonga/html/admin/js/jquery-ui-1.8.18.custom.min.js +0 -356
  599. data/vendor/local/share/groonga/html/admin/js/jquery.flot-0.7.min.js +0 -6
@@ -0,0 +1,108 @@
1
+ /*
2
+ Copyright(C) 2009-2014 Brazil
3
+
4
+ This library is free software; you can redistribute it and/or
5
+ modify it under the terms of the GNU Lesser General Public
6
+ License as published by the Free Software Foundation; either
7
+ version 2.1 of the License, or (at your option) any later version.
8
+
9
+ This library is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ Lesser General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Lesser General Public
15
+ License along with this library; if not, write to the Free Software
16
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+ */
18
+ #ifndef GROONGA_EXPR_H
19
+ #define GROONGA_EXPR_H
20
+
21
+ #ifdef __cplusplus
22
+ extern "C" {
23
+ #endif
24
+
25
+ GRN_API grn_obj *grn_expr_create(grn_ctx *ctx, const char *name, unsigned int name_size);
26
+ GRN_API grn_rc grn_expr_close(grn_ctx *ctx, grn_obj *expr);
27
+ GRN_API grn_obj *grn_expr_add_var(grn_ctx *ctx, grn_obj *expr,
28
+ const char *name, unsigned int name_size);
29
+ GRN_API grn_obj *grn_expr_get_var(grn_ctx *ctx, grn_obj *expr,
30
+ const char *name, unsigned int name_size);
31
+ GRN_API grn_obj *grn_expr_get_var_by_offset(grn_ctx *ctx, grn_obj *expr, unsigned int offset);
32
+ GRN_API grn_rc grn_expr_clear_vars(grn_ctx *ctx, grn_obj *expr);
33
+
34
+
35
+ GRN_API grn_obj *grn_expr_append_obj(grn_ctx *ctx, grn_obj *expr, grn_obj *obj,
36
+ grn_operator op, int nargs);
37
+ GRN_API grn_obj *grn_expr_append_const(grn_ctx *ctx, grn_obj *expr, grn_obj *obj,
38
+ grn_operator op, int nargs);
39
+ GRN_API grn_obj *grn_expr_append_const_str(grn_ctx *ctx, grn_obj *expr,
40
+ const char *str, unsigned int str_size,
41
+ grn_operator op, int nargs);
42
+ GRN_API grn_obj *grn_expr_append_const_int(grn_ctx *ctx, grn_obj *expr, int i,
43
+ grn_operator op, int nargs);
44
+ GRN_API grn_rc grn_expr_append_op(grn_ctx *ctx, grn_obj *expr, grn_operator op, int nargs);
45
+
46
+ GRN_API grn_rc grn_expr_get_keywords(grn_ctx *ctx, grn_obj *expr, grn_obj *keywords);
47
+
48
+ GRN_API grn_rc grn_expr_syntax_escape(grn_ctx *ctx,
49
+ const char *query, int query_size,
50
+ const char *target_characters,
51
+ char escape_character,
52
+ grn_obj *escaped_query);
53
+ GRN_API grn_rc grn_expr_syntax_escape_query(grn_ctx *ctx,
54
+ const char *query, int query_size,
55
+ grn_obj *escaped_query);
56
+
57
+ GRN_API grn_rc grn_expr_compile(grn_ctx *ctx, grn_obj *expr);
58
+ GRN_API grn_rc grn_expr_dump_plan(grn_ctx *ctx, grn_obj *expr, grn_obj *buffer);
59
+ GRN_API grn_obj *grn_expr_exec(grn_ctx *ctx, grn_obj *expr, int nargs);
60
+
61
+ GRN_API grn_obj *grn_expr_alloc(grn_ctx *ctx, grn_obj *expr,
62
+ grn_id domain, grn_obj_flags flags);
63
+
64
+ #define GRN_EXPR_CREATE_FOR_QUERY(ctx,table,expr,var) do {\
65
+ if (((expr) = grn_expr_create((ctx), NULL, 0)) &&\
66
+ ((var) = grn_expr_add_var((ctx), (expr), NULL, 0))) {\
67
+ GRN_RECORD_INIT((var), 0, grn_obj_id((ctx), (table)));\
68
+ } else {\
69
+ (var) = NULL;\
70
+ }\
71
+ } while (0)
72
+
73
+ typedef unsigned int grn_expr_flags;
74
+
75
+ #define GRN_EXPR_SYNTAX_QUERY (0x00)
76
+ #define GRN_EXPR_SYNTAX_SCRIPT (0x01)
77
+ #define GRN_EXPR_SYNTAX_OUTPUT_COLUMNS (0x20)
78
+ #define GRN_EXPR_SYNTAX_ADJUSTER (0x40)
79
+ #define GRN_EXPR_ALLOW_PRAGMA (0x02)
80
+ #define GRN_EXPR_ALLOW_COLUMN (0x04)
81
+ #define GRN_EXPR_ALLOW_UPDATE (0x08)
82
+ #define GRN_EXPR_ALLOW_LEADING_NOT (0x10)
83
+
84
+ GRN_API grn_rc grn_expr_parse(grn_ctx *ctx, grn_obj *expr,
85
+ const char *str, unsigned int str_size,
86
+ grn_obj *default_column, grn_operator default_mode,
87
+ grn_operator default_op, grn_expr_flags flags);
88
+
89
+ GRN_API grn_obj *grn_expr_snip(grn_ctx *ctx, grn_obj *expr, int flags,
90
+ unsigned int width, unsigned int max_results,
91
+ unsigned int n_tags,
92
+ const char **opentags, unsigned int *opentag_lens,
93
+ const char **closetags, unsigned int *closetag_lens,
94
+ grn_snip_mapping *mapping);
95
+ GRN_API grn_rc grn_expr_snip_add_conditions(grn_ctx *ctx,
96
+ grn_obj *expr,
97
+ grn_obj *snip,
98
+ unsigned int n_tags,
99
+ const char **opentags,
100
+ unsigned int *opentag_lens,
101
+ const char **closetags,
102
+ unsigned int *closetag_lens);
103
+
104
+ #ifdef __cplusplus
105
+ }
106
+ #endif
107
+
108
+ #endif /* GROONGA_EXPR_H */
@@ -0,0 +1,2031 @@
1
+ /*
2
+ Copyright(C) 2009-2014 Brazil
3
+
4
+ This library is free software; you can redistribute it and/or
5
+ modify it under the terms of the GNU Lesser General Public
6
+ License as published by the Free Software Foundation; either
7
+ version 2.1 of the License, or (at your option) any later version.
8
+
9
+ This library is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ Lesser General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Lesser General Public
15
+ License along with this library; if not, write to the Free Software
16
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+ */
18
+ #ifndef GROONGA_GROONGA_H
19
+ #define GROONGA_GROONGA_H
20
+
21
+ #ifdef __cplusplus
22
+ extern "C" {
23
+ #endif
24
+
25
+ #include <stdarg.h>
26
+
27
+ #ifndef GRN_API
28
+ # if defined(_WIN32) || defined(_WIN64)
29
+ # define GRN_API __declspec(dllimport)
30
+ # else
31
+ # define GRN_API
32
+ # endif /* defined(_WIN32) || defined(_WIN64) */
33
+ #endif /* GRN_API */
34
+
35
+ typedef unsigned int grn_id;
36
+ typedef unsigned char grn_bool;
37
+
38
+ #define GRN_ID_NIL (0x00)
39
+ #define GRN_ID_MAX (0x3fffffff)
40
+
41
+ #define GRN_TRUE (1)
42
+ #define GRN_FALSE (0)
43
+
44
+ typedef enum {
45
+ GRN_SUCCESS = 0,
46
+ GRN_END_OF_DATA = 1,
47
+ GRN_UNKNOWN_ERROR = -1,
48
+ GRN_OPERATION_NOT_PERMITTED = -2,
49
+ GRN_NO_SUCH_FILE_OR_DIRECTORY = -3,
50
+ GRN_NO_SUCH_PROCESS = -4,
51
+ GRN_INTERRUPTED_FUNCTION_CALL = -5,
52
+ GRN_INPUT_OUTPUT_ERROR = -6,
53
+ GRN_NO_SUCH_DEVICE_OR_ADDRESS = -7,
54
+ GRN_ARG_LIST_TOO_LONG = -8,
55
+ GRN_EXEC_FORMAT_ERROR = -9,
56
+ GRN_BAD_FILE_DESCRIPTOR = -10,
57
+ GRN_NO_CHILD_PROCESSES = -11,
58
+ GRN_RESOURCE_TEMPORARILY_UNAVAILABLE = -12,
59
+ GRN_NOT_ENOUGH_SPACE = -13,
60
+ GRN_PERMISSION_DENIED = -14,
61
+ GRN_BAD_ADDRESS = -15,
62
+ GRN_RESOURCE_BUSY = -16,
63
+ GRN_FILE_EXISTS = -17,
64
+ GRN_IMPROPER_LINK = -18,
65
+ GRN_NO_SUCH_DEVICE = -19,
66
+ GRN_NOT_A_DIRECTORY = -20,
67
+ GRN_IS_A_DIRECTORY = -21,
68
+ GRN_INVALID_ARGUMENT = -22,
69
+ GRN_TOO_MANY_OPEN_FILES_IN_SYSTEM = -23,
70
+ GRN_TOO_MANY_OPEN_FILES = -24,
71
+ GRN_INAPPROPRIATE_I_O_CONTROL_OPERATION = -25,
72
+ GRN_FILE_TOO_LARGE = -26,
73
+ GRN_NO_SPACE_LEFT_ON_DEVICE = -27,
74
+ GRN_INVALID_SEEK = -28,
75
+ GRN_READ_ONLY_FILE_SYSTEM = -29,
76
+ GRN_TOO_MANY_LINKS = -30,
77
+ GRN_BROKEN_PIPE = -31,
78
+ GRN_DOMAIN_ERROR = -32,
79
+ GRN_RESULT_TOO_LARGE = -33,
80
+ GRN_RESOURCE_DEADLOCK_AVOIDED = -34,
81
+ GRN_NO_MEMORY_AVAILABLE = -35,
82
+ GRN_FILENAME_TOO_LONG = -36,
83
+ GRN_NO_LOCKS_AVAILABLE = -37,
84
+ GRN_FUNCTION_NOT_IMPLEMENTED = -38,
85
+ GRN_DIRECTORY_NOT_EMPTY = -39,
86
+ GRN_ILLEGAL_BYTE_SEQUENCE = -40,
87
+ GRN_SOCKET_NOT_INITIALIZED = -41,
88
+ GRN_OPERATION_WOULD_BLOCK = -42,
89
+ GRN_ADDRESS_IS_NOT_AVAILABLE = -43,
90
+ GRN_NETWORK_IS_DOWN = -44,
91
+ GRN_NO_BUFFER = -45,
92
+ GRN_SOCKET_IS_ALREADY_CONNECTED = -46,
93
+ GRN_SOCKET_IS_NOT_CONNECTED = -47,
94
+ GRN_SOCKET_IS_ALREADY_SHUTDOWNED = -48,
95
+ GRN_OPERATION_TIMEOUT = -49,
96
+ GRN_CONNECTION_REFUSED = -50,
97
+ GRN_RANGE_ERROR = -51,
98
+ GRN_TOKENIZER_ERROR = -52,
99
+ GRN_FILE_CORRUPT = -53,
100
+ GRN_INVALID_FORMAT = -54,
101
+ GRN_OBJECT_CORRUPT = -55,
102
+ GRN_TOO_MANY_SYMBOLIC_LINKS = -56,
103
+ GRN_NOT_SOCKET = -57,
104
+ GRN_OPERATION_NOT_SUPPORTED = -58,
105
+ GRN_ADDRESS_IS_IN_USE = -59,
106
+ GRN_ZLIB_ERROR = -60,
107
+ GRN_LZ4_ERROR = -61,
108
+ /* Just for backward compatibility. We'll remove it at 5.0.0. */
109
+ #define GRN_LZO_ERROR GRN_LZ4_ERROR
110
+ GRN_STACK_OVER_FLOW = -62,
111
+ GRN_SYNTAX_ERROR = -63,
112
+ GRN_RETRY_MAX = -64,
113
+ GRN_INCOMPATIBLE_FILE_FORMAT = -65,
114
+ GRN_UPDATE_NOT_ALLOWED = -66,
115
+ GRN_TOO_SMALL_OFFSET = -67,
116
+ GRN_TOO_LARGE_OFFSET = -68,
117
+ GRN_TOO_SMALL_LIMIT = -69,
118
+ GRN_CAS_ERROR = -70,
119
+ GRN_UNSUPPORTED_COMMAND_VERSION = -71,
120
+ GRN_NORMALIZER_ERROR = -72,
121
+ GRN_TOKEN_FILTER_ERROR = -73,
122
+ } grn_rc;
123
+
124
+ GRN_API grn_rc grn_init(void);
125
+ GRN_API grn_rc grn_fin(void);
126
+
127
+ typedef enum {
128
+ GRN_ENC_DEFAULT = 0,
129
+ GRN_ENC_NONE,
130
+ GRN_ENC_EUC_JP,
131
+ GRN_ENC_UTF8,
132
+ GRN_ENC_SJIS,
133
+ GRN_ENC_LATIN1,
134
+ GRN_ENC_KOI8R
135
+ } grn_encoding;
136
+
137
+ typedef enum {
138
+ GRN_COMMAND_VERSION_DEFAULT = 0,
139
+ GRN_COMMAND_VERSION_1,
140
+ GRN_COMMAND_VERSION_2
141
+ } grn_command_version;
142
+
143
+ #define GRN_COMMAND_VERSION_MIN GRN_COMMAND_VERSION_1
144
+ #define GRN_COMMAND_VERSION_STABLE GRN_COMMAND_VERSION_1
145
+ #define GRN_COMMAND_VERSION_MAX GRN_COMMAND_VERSION_2
146
+
147
+ typedef enum {
148
+ GRN_LOG_NONE = 0,
149
+ GRN_LOG_EMERG,
150
+ GRN_LOG_ALERT,
151
+ GRN_LOG_CRIT,
152
+ GRN_LOG_ERROR,
153
+ GRN_LOG_WARNING,
154
+ GRN_LOG_NOTICE,
155
+ GRN_LOG_INFO,
156
+ GRN_LOG_DEBUG,
157
+ GRN_LOG_DUMP
158
+ } grn_log_level;
159
+
160
+ /* query log flags */
161
+ #define GRN_QUERY_LOG_NONE (0x00)
162
+ #define GRN_QUERY_LOG_COMMAND (0x01<<0)
163
+ #define GRN_QUERY_LOG_RESULT_CODE (0x01<<1)
164
+ #define GRN_QUERY_LOG_DESTINATION (0x01<<2)
165
+ #define GRN_QUERY_LOG_CACHE (0x01<<3)
166
+ #define GRN_QUERY_LOG_SIZE (0x01<<4)
167
+ #define GRN_QUERY_LOG_SCORE (0x01<<5)
168
+ #define GRN_QUERY_LOG_ALL\
169
+ (GRN_QUERY_LOG_COMMAND |\
170
+ GRN_QUERY_LOG_RESULT_CODE |\
171
+ GRN_QUERY_LOG_DESTINATION |\
172
+ GRN_QUERY_LOG_CACHE |\
173
+ GRN_QUERY_LOG_SIZE |\
174
+ GRN_QUERY_LOG_SCORE)
175
+ #define GRN_QUERY_LOG_DEFAULT GRN_QUERY_LOG_ALL
176
+
177
+ typedef enum {
178
+ GRN_CONTENT_NONE = 0,
179
+ GRN_CONTENT_TSV,
180
+ GRN_CONTENT_JSON,
181
+ GRN_CONTENT_XML,
182
+ GRN_CONTENT_MSGPACK
183
+ } grn_content_type;
184
+
185
+ typedef struct _grn_obj grn_obj;
186
+ typedef struct _grn_ctx grn_ctx;
187
+
188
+ #define GRN_CTX_MSGSIZE (0x80)
189
+ #define GRN_CTX_FIN (0xff)
190
+
191
+ typedef union {
192
+ int int_value;
193
+ grn_id id;
194
+ void *ptr;
195
+ } grn_user_data;
196
+
197
+ typedef grn_obj *grn_proc_func(grn_ctx *ctx, int nargs, grn_obj **args,
198
+ grn_user_data *user_data);
199
+
200
+ struct _grn_ctx {
201
+ grn_rc rc;
202
+ int flags;
203
+ grn_encoding encoding;
204
+ unsigned char ntrace;
205
+ unsigned char errlvl;
206
+ unsigned char stat;
207
+ unsigned int seqno;
208
+ unsigned int subno;
209
+ unsigned int seqno2;
210
+ unsigned int errline;
211
+ grn_user_data user_data;
212
+ grn_ctx *prev;
213
+ grn_ctx *next;
214
+ const char *errfile;
215
+ const char *errfunc;
216
+ struct _grn_ctx_impl *impl;
217
+ void *trace[16];
218
+ char errbuf[GRN_CTX_MSGSIZE];
219
+ };
220
+
221
+ #define GRN_CTX_USER_DATA(ctx) (&((ctx)->user_data))
222
+
223
+ /* Deprecated since 4.0.3. Don't use it. */
224
+ #define GRN_CTX_USE_QL (0x03)
225
+ /* Deprecated since 4.0.3. Don't use it. */
226
+ #define GRN_CTX_BATCH_MODE (0x04)
227
+ #define GRN_CTX_PER_DB (0x08)
228
+
229
+ GRN_API grn_rc grn_ctx_init(grn_ctx *ctx, int flags);
230
+ GRN_API grn_rc grn_ctx_fin(grn_ctx *ctx);
231
+ GRN_API grn_ctx *grn_ctx_open(int flags);
232
+ GRN_API grn_rc grn_ctx_close(grn_ctx *ctx);
233
+ GRN_API grn_rc grn_ctx_set_finalizer(grn_ctx *ctx, grn_proc_func *func);
234
+
235
+ GRN_API grn_encoding grn_get_default_encoding(void);
236
+ GRN_API grn_rc grn_set_default_encoding(grn_encoding encoding);
237
+
238
+ #define GRN_CTX_GET_ENCODING(ctx) ((ctx)->encoding)
239
+ #define GRN_CTX_SET_ENCODING(ctx,enc) \
240
+ ((ctx)->encoding = (enc == GRN_ENC_DEFAULT) ? grn_get_default_encoding() : enc)
241
+
242
+ GRN_API const char *grn_get_version(void);
243
+ GRN_API const char *grn_get_package(void);
244
+
245
+ GRN_API grn_command_version grn_get_default_command_version(void);
246
+ GRN_API grn_rc grn_set_default_command_version(grn_command_version version);
247
+ GRN_API grn_command_version grn_ctx_get_command_version(grn_ctx *ctx);
248
+ GRN_API grn_rc grn_ctx_set_command_version(grn_ctx *ctx, grn_command_version version);
249
+ GRN_API long long int grn_ctx_get_match_escalation_threshold(grn_ctx *ctx);
250
+ GRN_API grn_rc grn_ctx_set_match_escalation_threshold(grn_ctx *ctx, long long int threshold);
251
+ GRN_API long long int grn_get_default_match_escalation_threshold(void);
252
+ GRN_API grn_rc grn_set_default_match_escalation_threshold(long long int threshold);
253
+
254
+ GRN_API int grn_get_lock_timeout(void);
255
+ GRN_API grn_rc grn_set_lock_timeout(int timeout);
256
+
257
+ /* cache */
258
+ #define GRN_CACHE_DEFAULT_MAX_N_ENTRIES 100
259
+ typedef struct _grn_cache grn_cache;
260
+
261
+ GRN_API grn_cache *grn_cache_open(grn_ctx *ctx);
262
+ GRN_API grn_rc grn_cache_close(grn_ctx *ctx, grn_cache *cache);
263
+
264
+ GRN_API grn_rc grn_cache_current_set(grn_ctx *ctx, grn_cache *cache);
265
+ GRN_API grn_cache *grn_cache_current_get(grn_ctx *ctx);
266
+
267
+ GRN_API grn_rc grn_cache_set_max_n_entries(grn_ctx *ctx,
268
+ grn_cache *cache,
269
+ unsigned int n);
270
+ GRN_API unsigned int grn_cache_get_max_n_entries(grn_ctx *ctx,
271
+ grn_cache *cache);
272
+
273
+ /* grn_encoding */
274
+
275
+ GRN_API const char *grn_encoding_to_string(grn_encoding encoding);
276
+ GRN_API grn_encoding grn_encoding_parse(const char *name);
277
+
278
+ /* obj */
279
+
280
+ typedef unsigned short int grn_obj_flags;
281
+
282
+ #define GRN_OBJ_TABLE_TYPE_MASK (0x07)
283
+ #define GRN_OBJ_TABLE_HASH_KEY (0x00)
284
+ #define GRN_OBJ_TABLE_PAT_KEY (0x01)
285
+ #define GRN_OBJ_TABLE_DAT_KEY (0x02)
286
+ #define GRN_OBJ_TABLE_NO_KEY (0x03)
287
+
288
+ #define GRN_OBJ_KEY_MASK (0x07<<3)
289
+ #define GRN_OBJ_KEY_UINT (0x00<<3)
290
+ #define GRN_OBJ_KEY_INT (0x01<<3)
291
+ #define GRN_OBJ_KEY_FLOAT (0x02<<3)
292
+ #define GRN_OBJ_KEY_GEO_POINT (0x03<<3)
293
+
294
+ #define GRN_OBJ_KEY_WITH_SIS (0x01<<6)
295
+ #define GRN_OBJ_KEY_NORMALIZE (0x01<<7)
296
+
297
+ #define GRN_OBJ_COLUMN_TYPE_MASK (0x07)
298
+ #define GRN_OBJ_COLUMN_SCALAR (0x00)
299
+ #define GRN_OBJ_COLUMN_VECTOR (0x01)
300
+ #define GRN_OBJ_COLUMN_INDEX (0x02)
301
+
302
+ #define GRN_OBJ_COMPRESS_MASK (0x07<<4)
303
+ #define GRN_OBJ_COMPRESS_NONE (0x00<<4)
304
+ #define GRN_OBJ_COMPRESS_ZLIB (0x01<<4)
305
+ #define GRN_OBJ_COMPRESS_LZ4 (0x02<<4)
306
+ /* Just for backward compatibility. We'll remove it at 5.0.0. */
307
+ #define GRN_OBJ_COMPRESS_LZO GRN_OBJ_COMPRESS_LZ4
308
+
309
+ #define GRN_OBJ_WITH_SECTION (0x01<<7)
310
+ #define GRN_OBJ_WITH_WEIGHT (0x01<<8)
311
+ #define GRN_OBJ_WITH_POSITION (0x01<<9)
312
+ #define GRN_OBJ_RING_BUFFER (0x01<<10)
313
+
314
+ #define GRN_OBJ_UNIT_MASK (0x0f<<8)
315
+ #define GRN_OBJ_UNIT_DOCUMENT_NONE (0x00<<8)
316
+ #define GRN_OBJ_UNIT_DOCUMENT_SECTION (0x01<<8)
317
+ #define GRN_OBJ_UNIT_DOCUMENT_POSITION (0x02<<8)
318
+ #define GRN_OBJ_UNIT_SECTION_NONE (0x03<<8)
319
+ #define GRN_OBJ_UNIT_SECTION_POSITION (0x04<<8)
320
+ #define GRN_OBJ_UNIT_POSITION_NONE (0x05<<8)
321
+ #define GRN_OBJ_UNIT_USERDEF_DOCUMENT (0x06<<8)
322
+ #define GRN_OBJ_UNIT_USERDEF_SECTION (0x07<<8)
323
+ #define GRN_OBJ_UNIT_USERDEF_POSITION (0x08<<8)
324
+
325
+ #define GRN_OBJ_NO_SUBREC (0x00<<13)
326
+ #define GRN_OBJ_WITH_SUBREC (0x01<<13)
327
+
328
+ #define GRN_OBJ_KEY_VAR_SIZE (0x01<<14)
329
+
330
+ #define GRN_OBJ_TEMPORARY (0x00<<15)
331
+ #define GRN_OBJ_PERSISTENT (0x01<<15)
332
+
333
+ /* obj types */
334
+
335
+ #define GRN_VOID (0x00)
336
+ #define GRN_BULK (0x02)
337
+ #define GRN_PTR (0x03)
338
+ #define GRN_UVECTOR (0x04) /* vector of grn_id */
339
+ #define GRN_PVECTOR (0x05) /* vector of grn_obj* */
340
+ #define GRN_VECTOR (0x06) /* vector of arbitrary data */
341
+ #define GRN_MSG (0x07)
342
+ #define GRN_QUERY (0x08)
343
+ #define GRN_ACCESSOR (0x09)
344
+ #define GRN_SNIP (0x0b)
345
+ #define GRN_PATSNIP (0x0c)
346
+ #define GRN_STRING (0x0d)
347
+ #define GRN_CURSOR_TABLE_HASH_KEY (0x10)
348
+ #define GRN_CURSOR_TABLE_PAT_KEY (0x11)
349
+ #define GRN_CURSOR_TABLE_DAT_KEY (0x12)
350
+ #define GRN_CURSOR_TABLE_NO_KEY (0x13)
351
+ #define GRN_CURSOR_COLUMN_INDEX (0x18)
352
+ #define GRN_CURSOR_COLUMN_GEO_INDEX (0x1a)
353
+ #define GRN_TYPE (0x20)
354
+ #define GRN_PROC (0x21)
355
+ #define GRN_EXPR (0x22)
356
+ #define GRN_TABLE_HASH_KEY (0x30)
357
+ #define GRN_TABLE_PAT_KEY (0x31)
358
+ #define GRN_TABLE_DAT_KEY (0x32)
359
+ #define GRN_TABLE_NO_KEY (0x33)
360
+ #define GRN_DB (0x37)
361
+ #define GRN_COLUMN_FIX_SIZE (0x40)
362
+ #define GRN_COLUMN_VAR_SIZE (0x41)
363
+ #define GRN_COLUMN_INDEX (0x48)
364
+
365
+ typedef struct _grn_section grn_section;
366
+ typedef struct _grn_obj_header grn_obj_header;
367
+
368
+ struct _grn_section {
369
+ unsigned int offset;
370
+ unsigned int length;
371
+ unsigned int weight;
372
+ grn_id domain;
373
+ };
374
+
375
+ struct _grn_obj_header {
376
+ unsigned char type;
377
+ unsigned char impl_flags;
378
+ grn_obj_flags flags;
379
+ grn_id domain;
380
+ };
381
+
382
+ struct _grn_obj {
383
+ grn_obj_header header;
384
+ union {
385
+ struct {
386
+ char *head;
387
+ char *curr;
388
+ char *tail;
389
+ } b;
390
+ struct {
391
+ grn_obj *body;
392
+ grn_section *sections;
393
+ int n_sections;
394
+ } v;
395
+ } u;
396
+ };
397
+
398
+ #define GRN_OBJ_REFER (0x01<<0)
399
+ #define GRN_OBJ_OUTPLACE (0x01<<1)
400
+
401
+ #define GRN_OBJ_INIT(obj,obj_type,obj_flags,obj_domain) do { \
402
+ (obj)->header.type = (obj_type);\
403
+ (obj)->header.impl_flags = (obj_flags);\
404
+ (obj)->header.flags = 0;\
405
+ (obj)->header.domain = (obj_domain);\
406
+ (obj)->u.b.head = NULL;\
407
+ (obj)->u.b.curr = NULL;\
408
+ (obj)->u.b.tail = NULL;\
409
+ } while (0)
410
+
411
+ #define GRN_OBJ_FIN(ctx,obj) (grn_obj_close((ctx), (obj)))
412
+
413
+ typedef struct _grn_db_create_optarg grn_db_create_optarg;
414
+
415
+ struct _grn_db_create_optarg {
416
+ char **builtin_type_names;
417
+ int n_builtin_type_names;
418
+ };
419
+
420
+ GRN_API grn_obj *grn_db_create(grn_ctx *ctx, const char *path, grn_db_create_optarg *optarg);
421
+
422
+ #define GRN_DB_OPEN_OR_CREATE(ctx,path,optarg,db) \
423
+ (((db) = grn_db_open((ctx), (path))) || (db = grn_db_create((ctx), (path), (optarg))))
424
+
425
+ GRN_API grn_obj *grn_db_open(grn_ctx *ctx, const char *path);
426
+ GRN_API void grn_db_touch(grn_ctx *ctx, grn_obj *db);
427
+
428
+ GRN_API grn_rc grn_ctx_use(grn_ctx *ctx, grn_obj *db);
429
+ GRN_API grn_obj *grn_ctx_db(grn_ctx *ctx);
430
+ GRN_API grn_obj *grn_ctx_get(grn_ctx *ctx, const char *name, int name_size);
431
+
432
+ typedef enum {
433
+ GRN_DB_VOID = 0,
434
+ GRN_DB_DB,
435
+ GRN_DB_OBJECT,
436
+ GRN_DB_BOOL,
437
+ GRN_DB_INT8,
438
+ GRN_DB_UINT8,
439
+ GRN_DB_INT16,
440
+ GRN_DB_UINT16,
441
+ GRN_DB_INT32,
442
+ GRN_DB_UINT32,
443
+ GRN_DB_INT64,
444
+ GRN_DB_UINT64,
445
+ GRN_DB_FLOAT,
446
+ GRN_DB_TIME,
447
+ GRN_DB_SHORT_TEXT,
448
+ GRN_DB_TEXT,
449
+ GRN_DB_LONG_TEXT,
450
+ GRN_DB_TOKYO_GEO_POINT,
451
+ GRN_DB_WGS84_GEO_POINT
452
+ } grn_builtin_type;
453
+
454
+ typedef enum {
455
+ GRN_DB_MECAB = 64,
456
+ GRN_DB_DELIMIT,
457
+ GRN_DB_UNIGRAM,
458
+ GRN_DB_BIGRAM,
459
+ GRN_DB_TRIGRAM
460
+ } grn_builtin_tokenizer;
461
+
462
+ GRN_API grn_obj *grn_ctx_at(grn_ctx *ctx, grn_id id);
463
+
464
+ GRN_API grn_obj *grn_type_create(grn_ctx *ctx, const char *name, unsigned int name_size,
465
+ grn_obj_flags flags, unsigned int size);
466
+
467
+ GRN_API grn_rc grn_plugin_register(grn_ctx *ctx, const char *name);
468
+ GRN_API grn_rc grn_plugin_register_by_path(grn_ctx *ctx, const char *path);
469
+ GRN_API const char *grn_plugin_get_system_plugins_dir(void);
470
+ GRN_API const char *grn_plugin_get_suffix(void);
471
+
472
+ typedef struct {
473
+ const char *name;
474
+ unsigned int name_size;
475
+ grn_obj value;
476
+ } grn_expr_var;
477
+
478
+ typedef grn_rc (*grn_plugin_func)(grn_ctx *ctx);
479
+
480
+ typedef enum {
481
+ GRN_PROC_INVALID = 0,
482
+ GRN_PROC_TOKENIZER,
483
+ GRN_PROC_COMMAND,
484
+ GRN_PROC_FUNCTION,
485
+ GRN_PROC_HOOK,
486
+ GRN_PROC_NORMALIZER,
487
+ GRN_PROC_TOKEN_FILTER
488
+ } grn_proc_type;
489
+
490
+ GRN_API grn_obj *grn_proc_create(grn_ctx *ctx,
491
+ const char *name, int name_size, grn_proc_type type,
492
+ grn_proc_func *init, grn_proc_func *next, grn_proc_func *fin,
493
+ unsigned int nvars, grn_expr_var *vars);
494
+ GRN_API grn_obj *grn_proc_get_info(grn_ctx *ctx, grn_user_data *user_data,
495
+ grn_expr_var **vars, unsigned int *nvars, grn_obj **caller);
496
+ GRN_API grn_proc_type grn_proc_get_type(grn_ctx *ctx, grn_obj *proc);
497
+
498
+ /*-------------------------------------------------------------
499
+ * API for table
500
+ */
501
+
502
+ #define GRN_TABLE_MAX_KEY_SIZE (0x1000)
503
+
504
+ GRN_API grn_obj *grn_table_create(grn_ctx *ctx,
505
+ const char *name, unsigned int name_size,
506
+ const char *path, grn_obj_flags flags,
507
+ grn_obj *key_type, grn_obj *value_type);
508
+
509
+ #define GRN_TABLE_OPEN_OR_CREATE(ctx,name,name_size,path,flags,key_type,value_type,table) \
510
+ (((table) = grn_ctx_get((ctx), (name), (name_size))) ||\
511
+ ((table) = grn_table_create((ctx), (name), (name_size), (path), (flags), (key_type), (value_type))))
512
+
513
+ /* TODO: int *added -> grn_bool *added */
514
+ GRN_API grn_id grn_table_add(grn_ctx *ctx, grn_obj *table,
515
+ const void *key, unsigned int key_size, int *added);
516
+ GRN_API grn_id grn_table_get(grn_ctx *ctx, grn_obj *table,
517
+ const void *key, unsigned int key_size);
518
+ GRN_API grn_id grn_table_at(grn_ctx *ctx, grn_obj *table, grn_id id);
519
+ GRN_API grn_id grn_table_lcp_search(grn_ctx *ctx, grn_obj *table,
520
+ const void *key, unsigned int key_size);
521
+ GRN_API int grn_table_get_key(grn_ctx *ctx, grn_obj *table,
522
+ grn_id id, void *keybuf, int buf_size);
523
+ GRN_API grn_rc grn_table_delete(grn_ctx *ctx, grn_obj *table,
524
+ const void *key, unsigned int key_size);
525
+ GRN_API grn_rc grn_table_delete_by_id(grn_ctx *ctx, grn_obj *table, grn_id id);
526
+ GRN_API grn_rc grn_table_update_by_id(grn_ctx *ctx, grn_obj *table, grn_id id,
527
+ const void *dest_key, unsigned int dest_key_size);
528
+ GRN_API grn_rc grn_table_update(grn_ctx *ctx, grn_obj *table,
529
+ const void *src_key, unsigned int src_key_size,
530
+ const void *dest_key, unsigned int dest_key_size);
531
+ GRN_API grn_rc grn_table_truncate(grn_ctx *ctx, grn_obj *table);
532
+
533
+ typedef grn_obj grn_table_cursor;
534
+
535
+ #define GRN_CURSOR_ASCENDING (0x00<<0)
536
+ #define GRN_CURSOR_DESCENDING (0x01<<0)
537
+ #define GRN_CURSOR_GE (0x00<<1)
538
+ #define GRN_CURSOR_GT (0x01<<1)
539
+ #define GRN_CURSOR_LE (0x00<<2)
540
+ #define GRN_CURSOR_LT (0x01<<2)
541
+ #define GRN_CURSOR_BY_KEY (0x00<<3)
542
+ #define GRN_CURSOR_BY_ID (0x01<<3)
543
+ #define GRN_CURSOR_PREFIX (0x01<<4)
544
+ #define GRN_CURSOR_SIZE_BY_BIT (0x01<<5)
545
+ #define GRN_CURSOR_RK (0x01<<6)
546
+
547
+ GRN_API grn_table_cursor *grn_table_cursor_open(grn_ctx *ctx, grn_obj *table,
548
+ const void *min, unsigned int min_size,
549
+ const void *max, unsigned int max_size,
550
+ int offset, int limit, int flags);
551
+ GRN_API grn_rc grn_table_cursor_close(grn_ctx *ctx, grn_table_cursor *tc);
552
+ GRN_API grn_id grn_table_cursor_next(grn_ctx *ctx, grn_table_cursor *tc);
553
+ GRN_API int grn_table_cursor_get_key(grn_ctx *ctx, grn_table_cursor *tc, void **key);
554
+ GRN_API int grn_table_cursor_get_value(grn_ctx *ctx, grn_table_cursor *tc, void **value);
555
+ GRN_API grn_rc grn_table_cursor_set_value(grn_ctx *ctx, grn_table_cursor *tc,
556
+ const void *value, int flags);
557
+ GRN_API grn_rc grn_table_cursor_delete(grn_ctx *ctx, grn_table_cursor *tc);
558
+ GRN_API grn_obj *grn_table_cursor_table(grn_ctx *ctx, grn_table_cursor *tc);
559
+
560
+ typedef struct {
561
+ grn_id rid;
562
+ grn_id sid;
563
+ unsigned int pos;
564
+ unsigned int tf;
565
+ unsigned int weight;
566
+ unsigned int rest;
567
+ } grn_posting;
568
+
569
+ GRN_API grn_obj *grn_index_cursor_open(grn_ctx *ctx, grn_table_cursor *tc, grn_obj *index,
570
+ grn_id rid_min, grn_id rid_max, int flags);
571
+ GRN_API grn_posting *grn_index_cursor_next(grn_ctx *ctx, grn_obj *ic, grn_id *tid);
572
+
573
+ #define GRN_TABLE_EACH(ctx,table,head,tail,id,key,key_size,value,block) do {\
574
+ (ctx)->errlvl = GRN_LOG_NOTICE;\
575
+ (ctx)->rc = GRN_SUCCESS;\
576
+ if ((ctx)->seqno & 1) {\
577
+ (ctx)->subno++;\
578
+ } else {\
579
+ (ctx)->seqno++;\
580
+ }\
581
+ if (table) {\
582
+ switch ((table)->header.type) {\
583
+ case GRN_TABLE_PAT_KEY :\
584
+ GRN_PAT_EACH((ctx), (grn_pat *)(table), (id), (key), (key_size), (value), block);\
585
+ break;\
586
+ case GRN_TABLE_DAT_KEY :\
587
+ GRN_DAT_EACH((ctx), (grn_dat *)(table), (id), (key), (key_size), block);\
588
+ break;\
589
+ case GRN_TABLE_HASH_KEY :\
590
+ GRN_HASH_EACH((ctx), (grn_hash *)(table), (id), (key), (key_size), (value), block);\
591
+ break;\
592
+ case GRN_TABLE_NO_KEY :\
593
+ GRN_ARRAY_EACH((ctx), (grn_array *)(table), (head), (tail), (id), (value), block);\
594
+ break;\
595
+ }\
596
+ }\
597
+ if ((ctx)->subno) {\
598
+ (ctx)->subno--;\
599
+ } else {\
600
+ (ctx)->seqno++;\
601
+ }\
602
+ } while (0)
603
+
604
+ typedef struct _grn_table_sort_key grn_table_sort_key;
605
+ typedef unsigned char grn_table_sort_flags;
606
+
607
+ #define GRN_TABLE_SORT_ASC (0x00<<0)
608
+ #define GRN_TABLE_SORT_DESC (0x01<<0)
609
+
610
+ struct _grn_table_sort_key {
611
+ grn_obj *key;
612
+ grn_table_sort_flags flags;
613
+ int offset;
614
+ };
615
+
616
+ GRN_API int grn_table_sort(grn_ctx *ctx, grn_obj *table, int offset, int limit,
617
+ grn_obj *result, grn_table_sort_key *keys, int n_keys);
618
+
619
+ typedef struct _grn_table_group_result grn_table_group_result;
620
+ typedef unsigned int grn_table_group_flags;
621
+
622
+ #define GRN_TABLE_GROUP_CALC_COUNT (0x01<<3)
623
+ #define GRN_TABLE_GROUP_CALC_MAX (0x01<<4)
624
+ #define GRN_TABLE_GROUP_CALC_MIN (0x01<<5)
625
+ #define GRN_TABLE_GROUP_CALC_SUM (0x01<<6)
626
+ #define GRN_TABLE_GROUP_CALC_AVG (0x01<<7)
627
+
628
+ typedef enum {
629
+ GRN_OP_PUSH = 0,
630
+ GRN_OP_POP,
631
+ GRN_OP_NOP,
632
+ GRN_OP_CALL,
633
+ GRN_OP_INTERN,
634
+ GRN_OP_GET_REF,
635
+ GRN_OP_GET_VALUE,
636
+ GRN_OP_AND,
637
+ GRN_OP_AND_NOT,
638
+ /* Deprecated. Just for backward compatibility. */
639
+ #define GRN_OP_BUT GRN_OP_AND_NOT
640
+ GRN_OP_OR,
641
+ GRN_OP_ASSIGN,
642
+ GRN_OP_STAR_ASSIGN,
643
+ GRN_OP_SLASH_ASSIGN,
644
+ GRN_OP_MOD_ASSIGN,
645
+ GRN_OP_PLUS_ASSIGN,
646
+ GRN_OP_MINUS_ASSIGN,
647
+ GRN_OP_SHIFTL_ASSIGN,
648
+ GRN_OP_SHIFTR_ASSIGN,
649
+ GRN_OP_SHIFTRR_ASSIGN,
650
+ GRN_OP_AND_ASSIGN,
651
+ GRN_OP_XOR_ASSIGN,
652
+ GRN_OP_OR_ASSIGN,
653
+ GRN_OP_JUMP,
654
+ GRN_OP_CJUMP,
655
+ GRN_OP_COMMA,
656
+ GRN_OP_BITWISE_OR,
657
+ GRN_OP_BITWISE_XOR,
658
+ GRN_OP_BITWISE_AND,
659
+ GRN_OP_BITWISE_NOT,
660
+ GRN_OP_EQUAL,
661
+ GRN_OP_NOT_EQUAL,
662
+ GRN_OP_LESS,
663
+ GRN_OP_GREATER,
664
+ GRN_OP_LESS_EQUAL,
665
+ GRN_OP_GREATER_EQUAL,
666
+ GRN_OP_IN,
667
+ GRN_OP_MATCH,
668
+ GRN_OP_NEAR,
669
+ GRN_OP_NEAR2,
670
+ GRN_OP_SIMILAR,
671
+ GRN_OP_TERM_EXTRACT,
672
+ GRN_OP_SHIFTL,
673
+ GRN_OP_SHIFTR,
674
+ GRN_OP_SHIFTRR,
675
+ GRN_OP_PLUS,
676
+ GRN_OP_MINUS,
677
+ GRN_OP_STAR,
678
+ GRN_OP_SLASH,
679
+ GRN_OP_MOD,
680
+ GRN_OP_DELETE,
681
+ GRN_OP_INCR,
682
+ GRN_OP_DECR,
683
+ GRN_OP_INCR_POST,
684
+ GRN_OP_DECR_POST,
685
+ GRN_OP_NOT,
686
+ GRN_OP_ADJUST,
687
+ GRN_OP_EXACT,
688
+ GRN_OP_LCP,
689
+ GRN_OP_PARTIAL,
690
+ GRN_OP_UNSPLIT,
691
+ GRN_OP_PREFIX,
692
+ GRN_OP_SUFFIX,
693
+ GRN_OP_GEO_DISTANCE1,
694
+ GRN_OP_GEO_DISTANCE2,
695
+ GRN_OP_GEO_DISTANCE3,
696
+ GRN_OP_GEO_DISTANCE4,
697
+ GRN_OP_GEO_WITHINP5,
698
+ GRN_OP_GEO_WITHINP6,
699
+ GRN_OP_GEO_WITHINP8,
700
+ GRN_OP_OBJ_SEARCH,
701
+ GRN_OP_EXPR_GET_VAR,
702
+ GRN_OP_TABLE_CREATE,
703
+ GRN_OP_TABLE_SELECT,
704
+ GRN_OP_TABLE_SORT,
705
+ GRN_OP_TABLE_GROUP,
706
+ GRN_OP_JSON_PUT,
707
+ GRN_OP_GET_MEMBER
708
+ } grn_operator;
709
+
710
+ GRN_API const char *grn_operator_to_string(grn_operator op);
711
+
712
+ struct _grn_table_group_result {
713
+ grn_obj *table;
714
+ unsigned char key_begin;
715
+ unsigned char key_end;
716
+ int limit;
717
+ grn_table_group_flags flags;
718
+ grn_operator op;
719
+ };
720
+
721
+ GRN_API grn_rc grn_table_group(grn_ctx *ctx, grn_obj *table,
722
+ grn_table_sort_key *keys, int n_keys,
723
+ grn_table_group_result *results, int n_results);
724
+ GRN_API grn_rc grn_table_setoperation(grn_ctx *ctx, grn_obj *table1, grn_obj *table2,
725
+ grn_obj *res, grn_operator op);
726
+ GRN_API grn_rc grn_table_difference(grn_ctx *ctx, grn_obj *table1, grn_obj *table2,
727
+ grn_obj *res1, grn_obj *res2);
728
+ GRN_API int grn_table_columns(grn_ctx *ctx, grn_obj *table,
729
+ const char *name, unsigned int name_size,
730
+ grn_obj *res);
731
+
732
+ GRN_API grn_obj *grn_obj_column(grn_ctx *ctx, grn_obj *table,
733
+ const char *name, unsigned int name_size);
734
+
735
+ GRN_API unsigned int grn_table_size(grn_ctx *ctx, grn_obj *table);
736
+
737
+ /*-------------------------------------------------------------
738
+ * API for column
739
+ */
740
+
741
+ #define GRN_COLUMN_NAME_ID "_id"
742
+ #define GRN_COLUMN_NAME_ID_LEN (sizeof(GRN_COLUMN_NAME_ID) - 1)
743
+ #define GRN_COLUMN_NAME_KEY "_key"
744
+ #define GRN_COLUMN_NAME_KEY_LEN (sizeof(GRN_COLUMN_NAME_KEY) - 1)
745
+ #define GRN_COLUMN_NAME_VALUE "_value"
746
+ #define GRN_COLUMN_NAME_VALUE_LEN (sizeof(GRN_COLUMN_NAME_VALUE) - 1)
747
+ #define GRN_COLUMN_NAME_SCORE "_score"
748
+ #define GRN_COLUMN_NAME_SCORE_LEN (sizeof(GRN_COLUMN_NAME_SCORE) - 1)
749
+ #define GRN_COLUMN_NAME_NSUBRECS "_nsubrecs"
750
+ #define GRN_COLUMN_NAME_NSUBRECS_LEN (sizeof(GRN_COLUMN_NAME_NSUBRECS) - 1)
751
+
752
+ GRN_API grn_obj *grn_column_create(grn_ctx *ctx, grn_obj *table,
753
+ const char *name, unsigned int name_size,
754
+ const char *path, grn_obj_flags flags, grn_obj *type);
755
+
756
+ #define GRN_COLUMN_OPEN_OR_CREATE(ctx,table,name,name_size,path,flags,type,column) \
757
+ (((column) = grn_obj_column((ctx), (table), (name), (name_size))) ||\
758
+ ((column) = grn_column_create((ctx), (table), (name), (name_size), (path), (flags), (type))))
759
+
760
+ GRN_API grn_rc grn_column_index_update(grn_ctx *ctx, grn_obj *column,
761
+ grn_id id, unsigned int section,
762
+ grn_obj *oldvalue, grn_obj *newvalue);
763
+ GRN_API grn_obj *grn_column_table(grn_ctx *ctx, grn_obj *column);
764
+
765
+ /*-------------------------------------------------------------
766
+ * API for db, table and/or column
767
+ */
768
+
769
+ typedef enum {
770
+ GRN_INFO_ENCODING = 0,
771
+ GRN_INFO_SOURCE,
772
+ GRN_INFO_DEFAULT_TOKENIZER,
773
+ GRN_INFO_ELEMENT_SIZE,
774
+ GRN_INFO_CURR_MAX,
775
+ GRN_INFO_MAX_ELEMENT_SIZE,
776
+ GRN_INFO_SEG_SIZE,
777
+ GRN_INFO_CHUNK_SIZE,
778
+ GRN_INFO_MAX_SECTION,
779
+ GRN_INFO_HOOK_LOCAL_DATA,
780
+ GRN_INFO_ELEMENT_A,
781
+ GRN_INFO_ELEMENT_CHUNK,
782
+ GRN_INFO_ELEMENT_CHUNK_SIZE,
783
+ GRN_INFO_ELEMENT_BUFFER_FREE,
784
+ GRN_INFO_ELEMENT_NTERMS,
785
+ GRN_INFO_ELEMENT_NTERMS_VOID,
786
+ GRN_INFO_ELEMENT_SIZE_IN_CHUNK,
787
+ GRN_INFO_ELEMENT_POS_IN_CHUNK,
788
+ GRN_INFO_ELEMENT_SIZE_IN_BUFFER,
789
+ GRN_INFO_ELEMENT_POS_IN_BUFFER,
790
+ GRN_INFO_ELEMENT_ESTIMATE_SIZE,
791
+ GRN_INFO_NGRAM_UNIT_SIZE,
792
+ /*
793
+ GRN_INFO_VERSION,
794
+ GRN_INFO_CONFIGURE_OPTIONS,
795
+ GRN_INFO_CONFIG_PATH,
796
+ */
797
+ GRN_INFO_PARTIAL_MATCH_THRESHOLD,
798
+ GRN_INFO_II_SPLIT_THRESHOLD,
799
+ GRN_INFO_SUPPORT_ZLIB,
800
+ GRN_INFO_SUPPORT_LZ4,
801
+ /* Just for backward compatibility. We'll remove it at 5.0.0. */
802
+ #define GRN_INFO_SUPPORT_LZO GRN_INFO_SUPPORT_LZ4
803
+ GRN_INFO_NORMALIZER,
804
+ GRN_INFO_TOKEN_FILTERS
805
+ } grn_info_type;
806
+
807
+ GRN_API grn_obj *grn_obj_get_info(grn_ctx *ctx, grn_obj *obj, grn_info_type type, grn_obj *valuebuf);
808
+ GRN_API grn_rc grn_obj_set_info(grn_ctx *ctx, grn_obj *obj, grn_info_type type, grn_obj *value);
809
+ GRN_API grn_obj *grn_obj_get_element_info(grn_ctx *ctx, grn_obj *obj, grn_id id,
810
+ grn_info_type type, grn_obj *value);
811
+ GRN_API grn_rc grn_obj_set_element_info(grn_ctx *ctx, grn_obj *obj, grn_id id,
812
+ grn_info_type type, grn_obj *value);
813
+
814
+ GRN_API grn_bool grn_obj_is_builtin(grn_ctx *ctx, grn_obj *obj);
815
+
816
+ GRN_API grn_obj *grn_obj_get_value(grn_ctx *ctx, grn_obj *obj, grn_id id, grn_obj *value);
817
+ GRN_API int grn_obj_get_values(grn_ctx *ctx, grn_obj *obj, grn_id offset, void **values);
818
+
819
+ #define GRN_COLUMN_EACH(ctx,column,id,value,block) do {\
820
+ int _n;\
821
+ grn_id id = 1;\
822
+ while ((_n = grn_obj_get_values(ctx, column, id, (void **)&value)) > 0) {\
823
+ for (; _n; _n--, id++, value++) {\
824
+ block\
825
+ }\
826
+ }\
827
+ } while (0)
828
+
829
+ #define GRN_OBJ_SET_MASK (0x07)
830
+ #define GRN_OBJ_SET (0x01)
831
+ #define GRN_OBJ_INCR (0x02)
832
+ #define GRN_OBJ_DECR (0x03)
833
+ #define GRN_OBJ_APPEND (0x04)
834
+ #define GRN_OBJ_PREPEND (0x05)
835
+ #define GRN_OBJ_GET (0x01<<4)
836
+ #define GRN_OBJ_COMPARE (0x01<<5)
837
+ #define GRN_OBJ_LOCK (0x01<<6)
838
+ #define GRN_OBJ_UNLOCK (0x01<<7)
839
+
840
+ GRN_API grn_rc grn_obj_set_value(grn_ctx *ctx, grn_obj *obj, grn_id id, grn_obj *value, int flags);
841
+ GRN_API grn_rc grn_obj_remove(grn_ctx *ctx, grn_obj *obj);
842
+ GRN_API grn_rc grn_obj_rename(grn_ctx *ctx, grn_obj *obj,
843
+ const char *name, unsigned int name_size);
844
+ GRN_API grn_rc grn_table_rename(grn_ctx *ctx, grn_obj *table,
845
+ const char *name, unsigned int name_size);
846
+
847
+ GRN_API grn_rc grn_column_rename(grn_ctx *ctx, grn_obj *column,
848
+ const char *name, unsigned int name_size);
849
+
850
+ GRN_API grn_rc grn_obj_close(grn_ctx *ctx, grn_obj *obj);
851
+ GRN_API grn_rc grn_obj_reinit(grn_ctx *ctx, grn_obj *obj, grn_id domain, unsigned char flags);
852
+ GRN_API void grn_obj_unlink(grn_ctx *ctx, grn_obj *obj);
853
+
854
+ GRN_API grn_user_data *grn_obj_user_data(grn_ctx *ctx, grn_obj *obj);
855
+
856
+ GRN_API grn_rc grn_obj_set_finalizer(grn_ctx *ctx, grn_obj *obj, grn_proc_func *func);
857
+
858
+ GRN_API const char *grn_obj_path(grn_ctx *ctx, grn_obj *obj);
859
+ GRN_API int grn_obj_name(grn_ctx *ctx, grn_obj *obj, char *namebuf, int buf_size);
860
+
861
+ GRN_API int grn_column_name(grn_ctx *ctx, grn_obj *obj, char *namebuf, int buf_size);
862
+
863
+ GRN_API grn_id grn_obj_get_range(grn_ctx *ctx, grn_obj *obj);
864
+
865
+ #define GRN_OBJ_GET_DOMAIN(obj) \
866
+ ((obj)->header.type == GRN_TABLE_NO_KEY ? GRN_ID_NIL : (obj)->header.domain)
867
+
868
+ GRN_API int grn_obj_expire(grn_ctx *ctx, grn_obj *obj, int threshold);
869
+ GRN_API int grn_obj_check(grn_ctx *ctx, grn_obj *obj);
870
+ GRN_API grn_rc grn_obj_lock(grn_ctx *ctx, grn_obj *obj, grn_id id, int timeout);
871
+ GRN_API grn_rc grn_obj_unlock(grn_ctx *ctx, grn_obj *obj, grn_id id);
872
+ GRN_API grn_rc grn_obj_clear_lock(grn_ctx *ctx, grn_obj *obj);
873
+ GRN_API unsigned int grn_obj_is_locked(grn_ctx *ctx, grn_obj *obj);
874
+ GRN_API int grn_obj_defrag(grn_ctx *ctx, grn_obj *obj, int threshold);
875
+
876
+ GRN_API grn_obj *grn_obj_db(grn_ctx *ctx, grn_obj *obj);
877
+
878
+ GRN_API grn_id grn_obj_id(grn_ctx *ctx, grn_obj *obj);
879
+
880
+ typedef struct _grn_search_optarg grn_search_optarg;
881
+
882
+ struct _grn_search_optarg {
883
+ grn_operator mode;
884
+ int similarity_threshold;
885
+ int max_interval;
886
+ int *weight_vector;
887
+ int vector_size;
888
+ grn_obj *proc;
889
+ int max_size;
890
+ };
891
+
892
+ GRN_API grn_rc grn_obj_search(grn_ctx *ctx, grn_obj *obj, grn_obj *query,
893
+ grn_obj *res, grn_operator op, grn_search_optarg *optarg);
894
+
895
+ typedef grn_rc grn_selector_func(grn_ctx *ctx, grn_obj *table, grn_obj *index,
896
+ int nargs, grn_obj **args,
897
+ grn_obj *res, grn_operator op);
898
+
899
+ GRN_API grn_rc grn_proc_set_selector(grn_ctx *ctx, grn_obj *proc,
900
+ grn_selector_func selector);
901
+
902
+ /*-------------------------------------------------------------
903
+ * grn_vector
904
+ */
905
+
906
+ GRN_API unsigned int grn_vector_size(grn_ctx *ctx, grn_obj *vector);
907
+
908
+ GRN_API grn_rc grn_vector_add_element(grn_ctx *ctx, grn_obj *vector,
909
+ const char *str, unsigned int str_len,
910
+ unsigned int weight, grn_id domain);
911
+
912
+ GRN_API unsigned int grn_vector_get_element(grn_ctx *ctx, grn_obj *vector,
913
+ unsigned int offset, const char **str,
914
+ unsigned int *weight, grn_id *domain);
915
+
916
+ /*-------------------------------------------------------------
917
+ * grn_uvector
918
+ */
919
+
920
+ GRN_API unsigned int grn_uvector_size(grn_ctx *ctx, grn_obj *uvector);
921
+
922
+ GRN_API grn_rc grn_uvector_add_element(grn_ctx *ctx, grn_obj *vector,
923
+ grn_id id, unsigned int weight);
924
+
925
+ GRN_API grn_id grn_uvector_get_element(grn_ctx *ctx, grn_obj *uvector,
926
+ unsigned int offset,
927
+ unsigned int *weight);
928
+
929
+ /*-------------------------------------------------------------
930
+ * API for hook
931
+ */
932
+
933
+ GRN_API int grn_proc_call_next(grn_ctx *ctx, grn_obj *exec_info, grn_obj *in, grn_obj *out);
934
+ GRN_API void *grn_proc_get_ctx_local_data(grn_ctx *ctx, grn_obj *exec_info);
935
+ GRN_API void *grn_proc_get_hook_local_data(grn_ctx *ctx, grn_obj *exec_info);
936
+
937
+ typedef enum {
938
+ GRN_HOOK_SET = 0,
939
+ GRN_HOOK_GET,
940
+ GRN_HOOK_INSERT,
941
+ GRN_HOOK_DELETE,
942
+ GRN_HOOK_SELECT
943
+ } grn_hook_entry;
944
+
945
+ GRN_API grn_rc grn_obj_add_hook(grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry,
946
+ int offset, grn_obj *proc, grn_obj *data);
947
+ GRN_API int grn_obj_get_nhooks(grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry);
948
+ GRN_API grn_obj *grn_obj_get_hook(grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry,
949
+ int offset, grn_obj *data);
950
+ GRN_API grn_rc grn_obj_delete_hook(grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry, int offset);
951
+
952
+ GRN_API grn_obj *grn_obj_open(grn_ctx *ctx, unsigned char type, grn_obj_flags flags, grn_id domain);
953
+
954
+ GRN_API int grn_column_index(grn_ctx *ctx, grn_obj *column, grn_operator op,
955
+ grn_obj **indexbuf, int buf_size, int *section);
956
+
957
+ GRN_API grn_rc grn_obj_delete_by_id(grn_ctx *ctx, grn_obj *db, grn_id id, grn_bool removep);
958
+ GRN_API grn_rc grn_obj_path_by_id(grn_ctx *ctx, grn_obj *db, grn_id id, char *buffer);
959
+
960
+ /* geo */
961
+
962
+ typedef struct {
963
+ int latitude;
964
+ int longitude;
965
+ } grn_geo_point;
966
+
967
+ GRN_API grn_rc grn_geo_select_in_rectangle(grn_ctx *ctx,
968
+ grn_obj *index,
969
+ grn_obj *top_left_point,
970
+ grn_obj *bottom_right_point,
971
+ grn_obj *res,
972
+ grn_operator op);
973
+ GRN_API unsigned int grn_geo_estimate_size_in_rectangle(grn_ctx *ctx,
974
+ grn_obj *index,
975
+ grn_obj *top_left_point,
976
+ grn_obj *bottom_right_point);
977
+ /* Deprecated since 4.0.8. Use grn_geo_estimate_size_in_rectangle() instead. */
978
+ GRN_API int grn_geo_estimate_in_rectangle(grn_ctx *ctx,
979
+ grn_obj *index,
980
+ grn_obj *top_left_point,
981
+ grn_obj *bottom_right_point);
982
+ GRN_API grn_obj *grn_geo_cursor_open_in_rectangle(grn_ctx *ctx,
983
+ grn_obj *index,
984
+ grn_obj *top_left_point,
985
+ grn_obj *bottom_right_point,
986
+ int offset,
987
+ int limit);
988
+ GRN_API grn_posting *grn_geo_cursor_next(grn_ctx *ctx, grn_obj *cursor);
989
+
990
+
991
+ /* query & snippet */
992
+
993
+ #ifndef GRN_QUERY_AND
994
+ #define GRN_QUERY_AND '+'
995
+ #endif /* GRN_QUERY_AND */
996
+ #ifndef GRN_QUERY_AND_NOT
997
+ # ifdef GRN_QUERY_BUT
998
+ /* Deprecated. Just for backward compatibility. */
999
+ # define GRN_QUERY_AND_NOT GRN_QUERY_BUT
1000
+ # else
1001
+ # define GRN_QUERY_AND_NOT '-'
1002
+ # endif /* GRN_QUERY_BUT */
1003
+ #endif /* GRN_QUERY_AND_NOT */
1004
+ #ifndef GRN_QUERY_ADJ_INC
1005
+ #define GRN_QUERY_ADJ_INC '>'
1006
+ #endif /* GRN_QUERY_ADJ_POS2 */
1007
+ #ifndef GRN_QUERY_ADJ_DEC
1008
+ #define GRN_QUERY_ADJ_DEC '<'
1009
+ #endif /* GRN_QUERY_ADJ_POS1 */
1010
+ #ifndef GRN_QUERY_ADJ_NEG
1011
+ #define GRN_QUERY_ADJ_NEG '~'
1012
+ #endif /* GRN_QUERY_ADJ_NEG */
1013
+ #ifndef GRN_QUERY_PREFIX
1014
+ #define GRN_QUERY_PREFIX '*'
1015
+ #endif /* GRN_QUERY_PREFIX */
1016
+ #ifndef GRN_QUERY_PARENL
1017
+ #define GRN_QUERY_PARENL '('
1018
+ #endif /* GRN_QUERY_PARENL */
1019
+ #ifndef GRN_QUERY_PARENR
1020
+ #define GRN_QUERY_PARENR ')'
1021
+ #endif /* GRN_QUERY_PARENR */
1022
+ #ifndef GRN_QUERY_QUOTEL
1023
+ #define GRN_QUERY_QUOTEL '"'
1024
+ #endif /* GRN_QUERY_QUOTEL */
1025
+ #ifndef GRN_QUERY_QUOTER
1026
+ #define GRN_QUERY_QUOTER '"'
1027
+ #endif /* GRN_QUERY_QUOTER */
1028
+ #ifndef GRN_QUERY_ESCAPE
1029
+ #define GRN_QUERY_ESCAPE '\\'
1030
+ #endif /* GRN_QUERY_ESCAPE */
1031
+ #ifndef GRN_QUERY_COLUMN
1032
+ #define GRN_QUERY_COLUMN ':'
1033
+ #endif /* GRN_QUERY_COLUMN */
1034
+
1035
+ typedef struct _grn_snip_mapping grn_snip_mapping;
1036
+
1037
+ struct _grn_snip_mapping {
1038
+ void *dummy;
1039
+ };
1040
+
1041
+ #define GRN_SNIP_NORMALIZE (0x01<<0)
1042
+ #define GRN_SNIP_COPY_TAG (0x01<<1)
1043
+ #define GRN_SNIP_SKIP_LEADING_SPACES (0x01<<2)
1044
+
1045
+ #define GRN_SNIP_MAPPING_HTML_ESCAPE ((grn_snip_mapping *)-1)
1046
+
1047
+ GRN_API grn_obj *grn_snip_open(grn_ctx *ctx, int flags, unsigned int width,
1048
+ unsigned int max_results,
1049
+ const char *defaultopentag, unsigned int defaultopentag_len,
1050
+ const char *defaultclosetag, unsigned int defaultclosetag_len,
1051
+ grn_snip_mapping *mapping);
1052
+ GRN_API grn_rc grn_snip_add_cond(grn_ctx *ctx, grn_obj *snip,
1053
+ const char *keyword, unsigned int keyword_len,
1054
+ const char *opentag, unsigned int opentag_len,
1055
+ const char *closetag, unsigned int closetag_len);
1056
+ GRN_API grn_rc grn_snip_set_normalizer(grn_ctx *ctx, grn_obj *snip,
1057
+ grn_obj *normalizer);
1058
+ GRN_API grn_obj *grn_snip_get_normalizer(grn_ctx *ctx, grn_obj *snip);
1059
+ GRN_API grn_rc grn_snip_exec(grn_ctx *ctx, grn_obj *snip,
1060
+ const char *string, unsigned int string_len,
1061
+ unsigned int *nresults, unsigned int *max_tagged_len);
1062
+ GRN_API grn_rc grn_snip_get_result(grn_ctx *ctx, grn_obj *snip, const unsigned int index,
1063
+ char *result, unsigned int *result_len);
1064
+
1065
+ /* log */
1066
+
1067
+ #define GRN_LOG_TIME (0x01<<0)
1068
+ #define GRN_LOG_TITLE (0x01<<1)
1069
+ #define GRN_LOG_MESSAGE (0x01<<2)
1070
+ #define GRN_LOG_LOCATION (0x01<<3)
1071
+
1072
+ /* Deprecated since 2.1.2. Use grn_logger instead. */
1073
+ typedef struct _grn_logger_info grn_logger_info;
1074
+
1075
+ /* Deprecated since 2.1.2. Use grn_logger instead. */
1076
+ struct _grn_logger_info {
1077
+ grn_log_level max_level;
1078
+ int flags;
1079
+ void (*func)(int, const char *, const char *, const char *, const char *, void *);
1080
+ void *func_arg;
1081
+ };
1082
+
1083
+ /* Deprecated since 2.1.2. Use grn_logger_set() instead. */
1084
+ GRN_API grn_rc grn_logger_info_set(grn_ctx *ctx, const grn_logger_info *info);
1085
+
1086
+ typedef struct _grn_logger grn_logger;
1087
+
1088
+ struct _grn_logger {
1089
+ grn_log_level max_level;
1090
+ int flags;
1091
+ void *user_data;
1092
+ void (*log)(grn_ctx *ctx, grn_log_level level,
1093
+ const char *timestamp, const char *title, const char *message,
1094
+ const char *location, void *user_data);
1095
+ void (*reopen)(grn_ctx *ctx, void *user_data);
1096
+ void (*fin)(grn_ctx *ctx, void *user_data);
1097
+ };
1098
+
1099
+ GRN_API grn_rc grn_logger_set(grn_ctx *ctx, const grn_logger *logger);
1100
+
1101
+ GRN_API void grn_logger_set_max_level(grn_ctx *ctx, grn_log_level max_level);
1102
+ GRN_API grn_log_level grn_logger_get_max_level(grn_ctx *ctx);
1103
+
1104
+ #ifdef __GNUC__
1105
+ #define GRN_ATTRIBUTE_PRINTF(fmt_pos) \
1106
+ __attribute__ ((format(printf, fmt_pos, fmt_pos + 1)))
1107
+ #else
1108
+ #define GRN_ATTRIBUTE_PRINTF(fmt_pos)
1109
+ #endif /* __GNUC__ */
1110
+
1111
+ GRN_API void grn_logger_put(grn_ctx *ctx, grn_log_level level,
1112
+ const char *file, int line, const char *func, const char *fmt, ...) GRN_ATTRIBUTE_PRINTF(6);
1113
+ GRN_API void grn_logger_reopen(grn_ctx *ctx);
1114
+
1115
+ GRN_API grn_bool grn_logger_pass(grn_ctx *ctx, grn_log_level level);
1116
+
1117
+ #ifndef GRN_LOG_DEFAULT_LEVEL
1118
+ #define GRN_LOG_DEFAULT_LEVEL GRN_LOG_NOTICE
1119
+ #endif /* GRN_LOG_DEFAULT_LEVEL */
1120
+
1121
+ GRN_API void grn_default_logger_set_max_level(grn_log_level level);
1122
+ GRN_API grn_log_level grn_default_logger_get_max_level(void);
1123
+ GRN_API void grn_default_logger_set_path(const char *path);
1124
+ GRN_API const char *grn_default_logger_get_path(void);
1125
+
1126
+ #define GRN_LOG(ctx,level,...) do {\
1127
+ if (grn_logger_pass(ctx, level)) {\
1128
+ grn_logger_put(ctx, (level), __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__); \
1129
+ }\
1130
+ } while (0)
1131
+
1132
+ typedef struct _grn_query_logger grn_query_logger;
1133
+
1134
+ struct _grn_query_logger {
1135
+ unsigned int flags;
1136
+ void *user_data;
1137
+ void (*log)(grn_ctx *ctx, unsigned int flag,
1138
+ const char *timestamp, const char *info, const char *message,
1139
+ void *user_data);
1140
+ void (*reopen)(grn_ctx *ctx, void *user_data);
1141
+ void (*fin)(grn_ctx *ctx, void *user_data);
1142
+ };
1143
+
1144
+ GRN_API grn_rc grn_query_logger_set(grn_ctx *ctx, const grn_query_logger *logger);
1145
+
1146
+ GRN_API void grn_query_logger_put(grn_ctx *ctx, unsigned int flag,
1147
+ const char *mark,
1148
+ const char *format, ...) GRN_ATTRIBUTE_PRINTF(4);
1149
+ GRN_API void grn_query_logger_reopen(grn_ctx *ctx);
1150
+
1151
+ GRN_API grn_bool grn_query_logger_pass(grn_ctx *ctx, unsigned int flag);
1152
+
1153
+ GRN_API void grn_default_query_logger_set_flags(unsigned int flags);
1154
+ GRN_API unsigned int grn_default_query_logger_get_flags(void);
1155
+ GRN_API void grn_default_query_logger_set_path(const char *path);
1156
+ GRN_API const char *grn_default_query_logger_get_path(void);
1157
+
1158
+ #define GRN_QUERY_LOG(ctx, flag, mark, format, ...) do {\
1159
+ if (grn_query_logger_pass(ctx, flag)) {\
1160
+ grn_query_logger_put(ctx, (flag), (mark), format, __VA_ARGS__);\
1161
+ }\
1162
+ } while (0)
1163
+
1164
+ /* grn_bulk */
1165
+
1166
+ #define GRN_BULK_BUFSIZE (sizeof(grn_obj) - sizeof(grn_obj_header))
1167
+ /* This assumes that GRN_BULK_BUFSIZE is less than 32 (= 0x20). */
1168
+ #define GRN_BULK_BUFSIZE_MAX 0x1f
1169
+ #define GRN_BULK_SIZE_IN_FLAGS(flags) ((flags) & GRN_BULK_BUFSIZE_MAX)
1170
+ #define GRN_BULK_OUTP(bulk) ((bulk)->header.impl_flags & GRN_OBJ_OUTPLACE)
1171
+ #define GRN_BULK_REWIND(bulk) do {\
1172
+ if ((bulk)->header.type == GRN_VECTOR) {\
1173
+ grn_obj *_body = (bulk)->u.v.body;\
1174
+ if (_body) {\
1175
+ if (GRN_BULK_OUTP(_body)) {\
1176
+ (_body)->u.b.curr = (_body)->u.b.head;\
1177
+ } else {\
1178
+ (_body)->header.flags &= ~GRN_BULK_BUFSIZE_MAX;\
1179
+ }\
1180
+ }\
1181
+ (bulk)->u.v.n_sections = 0;\
1182
+ } else {\
1183
+ if (GRN_BULK_OUTP(bulk)) {\
1184
+ (bulk)->u.b.curr = (bulk)->u.b.head;\
1185
+ } else {\
1186
+ (bulk)->header.flags &= ~GRN_BULK_BUFSIZE_MAX;\
1187
+ }\
1188
+ }\
1189
+ } while (0)
1190
+ #define GRN_BULK_WSIZE(bulk) \
1191
+ (GRN_BULK_OUTP(bulk)\
1192
+ ? ((bulk)->u.b.tail - (bulk)->u.b.head)\
1193
+ : GRN_BULK_BUFSIZE)
1194
+ #define GRN_BULK_REST(bulk) \
1195
+ (GRN_BULK_OUTP(bulk)\
1196
+ ? ((bulk)->u.b.tail - (bulk)->u.b.curr)\
1197
+ : GRN_BULK_BUFSIZE - GRN_BULK_SIZE_IN_FLAGS((bulk)->header.flags))
1198
+ #define GRN_BULK_VSIZE(bulk) \
1199
+ (GRN_BULK_OUTP(bulk)\
1200
+ ? ((bulk)->u.b.curr - (bulk)->u.b.head)\
1201
+ : GRN_BULK_SIZE_IN_FLAGS((bulk)->header.flags))
1202
+ #define GRN_BULK_EMPTYP(bulk) \
1203
+ (GRN_BULK_OUTP(bulk)\
1204
+ ? ((bulk)->u.b.curr == (bulk)->u.b.head)\
1205
+ : !(GRN_BULK_SIZE_IN_FLAGS((bulk)->header.flags)))
1206
+ #define GRN_BULK_HEAD(bulk) \
1207
+ (GRN_BULK_OUTP(bulk)\
1208
+ ? ((bulk)->u.b.head)\
1209
+ : (char *)&((bulk)->u.b.head))
1210
+ #define GRN_BULK_CURR(bulk) \
1211
+ (GRN_BULK_OUTP(bulk)\
1212
+ ? ((bulk)->u.b.curr)\
1213
+ : (char *)&((bulk)->u.b.head) + GRN_BULK_SIZE_IN_FLAGS((bulk)->header.flags))
1214
+ #define GRN_BULK_TAIL(bulk) \
1215
+ (GRN_BULK_OUTP(bulk)\
1216
+ ? ((bulk)->u.b.tail)\
1217
+ : (char *)&((bulk)[1]))
1218
+
1219
+ GRN_API grn_rc grn_bulk_reinit(grn_ctx *ctx, grn_obj *bulk, unsigned int size);
1220
+ GRN_API grn_rc grn_bulk_resize(grn_ctx *ctx, grn_obj *bulk, unsigned int newsize);
1221
+ GRN_API grn_rc grn_bulk_write(grn_ctx *ctx, grn_obj *bulk,
1222
+ const char *str, unsigned int len);
1223
+ GRN_API grn_rc grn_bulk_write_from(grn_ctx *ctx, grn_obj *bulk,
1224
+ const char *str, unsigned int from, unsigned int len);
1225
+ GRN_API grn_rc grn_bulk_reserve(grn_ctx *ctx, grn_obj *bulk, unsigned int len);
1226
+ GRN_API grn_rc grn_bulk_space(grn_ctx *ctx, grn_obj *bulk, unsigned int len);
1227
+ GRN_API grn_rc grn_bulk_truncate(grn_ctx *ctx, grn_obj *bulk, unsigned int len);
1228
+ GRN_API grn_rc grn_bulk_fin(grn_ctx *ctx, grn_obj *bulk);
1229
+
1230
+ /* grn_text */
1231
+
1232
+ GRN_API grn_rc grn_text_itoa(grn_ctx *ctx, grn_obj *bulk, int i);
1233
+ GRN_API grn_rc grn_text_itoa_padded(grn_ctx *ctx, grn_obj *bulk, int i, char ch, unsigned int len);
1234
+ GRN_API grn_rc grn_text_lltoa(grn_ctx *ctx, grn_obj *bulk, long long int i);
1235
+ GRN_API grn_rc grn_text_ftoa(grn_ctx *ctx, grn_obj *bulk, double d);
1236
+ GRN_API grn_rc grn_text_itoh(grn_ctx *ctx, grn_obj *bulk, int i, unsigned int len);
1237
+ GRN_API grn_rc grn_text_itob(grn_ctx *ctx, grn_obj *bulk, grn_id id);
1238
+ GRN_API grn_rc grn_text_lltob32h(grn_ctx *ctx, grn_obj *bulk, long long int i);
1239
+ GRN_API grn_rc grn_text_benc(grn_ctx *ctx, grn_obj *bulk, unsigned int v);
1240
+ GRN_API grn_rc grn_text_esc(grn_ctx *ctx, grn_obj *bulk, const char *s, unsigned int len);
1241
+ GRN_API grn_rc grn_text_urlenc(grn_ctx *ctx, grn_obj *buf,
1242
+ const char *str, unsigned int len);
1243
+ GRN_API const char *grn_text_urldec(grn_ctx *ctx, grn_obj *buf,
1244
+ const char *s, const char *e, char d);
1245
+ GRN_API grn_rc grn_text_escape_xml(grn_ctx *ctx, grn_obj *buf,
1246
+ const char *s, unsigned int len);
1247
+ GRN_API grn_rc grn_text_time2rfc1123(grn_ctx *ctx, grn_obj *bulk, int sec);
1248
+ GRN_API grn_rc grn_text_printf(grn_ctx *ctx, grn_obj *bulk,
1249
+ const char *format, ...) GRN_ATTRIBUTE_PRINTF(3);
1250
+ GRN_API grn_rc grn_text_vprintf(grn_ctx *ctx, grn_obj *bulk,
1251
+ const char *format, va_list args);
1252
+
1253
+ typedef struct _grn_obj_format grn_obj_format;
1254
+
1255
+ #define GRN_OBJ_FORMAT_WITH_COLUMN_NAMES (0x01<<0)
1256
+ #define GRN_OBJ_FORMAT_AS_ARRAY (0x01<<3)
1257
+ /* Deprecated since 4.0.1. It will be removed at 5.0.0.
1258
+ Use GRN_OBJ_FORMAT_AS_ARRAY instead.*/
1259
+ #define GRN_OBJ_FORMAT_ASARRAY GRN_OBJ_FORMAT_AS_ARRAY
1260
+ #define GRN_OBJ_FORMAT_WITH_WEIGHT (0x01<<4)
1261
+
1262
+ struct _grn_obj_format {
1263
+ grn_obj columns;
1264
+ const void *min;
1265
+ const void *max;
1266
+ unsigned int min_size;
1267
+ unsigned int max_size;
1268
+ int nhits;
1269
+ int offset;
1270
+ int limit;
1271
+ int hits_offset;
1272
+ int flags;
1273
+ grn_obj *expression;
1274
+ };
1275
+
1276
+ #define GRN_OBJ_FORMAT_INIT(format,format_nhits,format_offset,format_limit,format_hits_offset) do { \
1277
+ GRN_PTR_INIT(&(format)->columns, GRN_OBJ_VECTOR, GRN_ID_NIL);\
1278
+ (format)->nhits = (format_nhits);\
1279
+ (format)->offset = (format_offset);\
1280
+ (format)->limit = (format_limit);\
1281
+ (format)->hits_offset = (format_hits_offset);\
1282
+ (format)->flags = 0;\
1283
+ (format)->expression = NULL;\
1284
+ } while (0)
1285
+
1286
+ #define GRN_OBJ_FORMAT_FIN(ctx,format) do {\
1287
+ int ncolumns = GRN_BULK_VSIZE(&(format)->columns) / sizeof(grn_obj *);\
1288
+ grn_obj **columns = (grn_obj **)GRN_BULK_HEAD(&(format)->columns);\
1289
+ while (ncolumns--) { grn_obj_unlink((ctx), *columns++); }\
1290
+ GRN_OBJ_FIN((ctx), &(format)->columns);\
1291
+ if ((format)->expression) { GRN_OBJ_FIN((ctx), (format)->expression); } \
1292
+ } while (0)
1293
+
1294
+ GRN_API void grn_output_obj(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type,
1295
+ grn_obj *obj, grn_obj_format *format);
1296
+ GRN_API void grn_output_envelope(grn_ctx *ctx, grn_rc rc,
1297
+ grn_obj *head, grn_obj *body, grn_obj *foot,
1298
+ const char *file, int line);
1299
+
1300
+ GRN_API void grn_ctx_output_array_open(grn_ctx *ctx,
1301
+ const char *name, int nelements);
1302
+ GRN_API void grn_ctx_output_array_close(grn_ctx *ctx);
1303
+ GRN_API void grn_ctx_output_map_open(grn_ctx *ctx,
1304
+ const char *name, int nelements);
1305
+ GRN_API void grn_ctx_output_map_close(grn_ctx *ctx);
1306
+ GRN_API void grn_ctx_output_int32(grn_ctx *ctx, int value);
1307
+ GRN_API void grn_ctx_output_int64(grn_ctx *ctx, long long int value);
1308
+ GRN_API void grn_ctx_output_float(grn_ctx *ctx, double value);
1309
+ GRN_API void grn_ctx_output_cstr(grn_ctx *ctx, const char *value);
1310
+ GRN_API void grn_ctx_output_str(grn_ctx *ctx,
1311
+ const char *value, unsigned int value_len);
1312
+ GRN_API void grn_ctx_output_bool(grn_ctx *ctx, grn_bool value);
1313
+ GRN_API void grn_ctx_output_obj(grn_ctx *ctx,
1314
+ grn_obj *value, grn_obj_format *format);
1315
+
1316
+
1317
+ GRN_API grn_content_type grn_ctx_get_output_type(grn_ctx *ctx);
1318
+ GRN_API grn_rc grn_ctx_set_output_type(grn_ctx *ctx, grn_content_type type);
1319
+ GRN_API const char *grn_ctx_get_mime_type(grn_ctx *ctx);
1320
+ GRN_API void grn_ctx_recv_handler_set(grn_ctx *,
1321
+ void (*func)(grn_ctx *, int, void *),
1322
+ void *func_arg);
1323
+
1324
+ /* obsolete */
1325
+ GRN_API grn_rc grn_text_otoj(grn_ctx *ctx, grn_obj *bulk, grn_obj *obj,
1326
+ grn_obj_format *format);
1327
+
1328
+ /* various values exchanged via grn_obj */
1329
+
1330
+ #define GRN_OBJ_DO_SHALLOW_COPY (GRN_OBJ_REFER|GRN_OBJ_OUTPLACE)
1331
+ #define GRN_OBJ_VECTOR (0x01<<7)
1332
+
1333
+ #define GRN_OBJ_MUTABLE(obj) ((obj) && (obj)->header.type <= GRN_VECTOR)
1334
+
1335
+ #define GRN_VALUE_FIX_SIZE_INIT(obj,flags,domain)\
1336
+ GRN_OBJ_INIT((obj), ((flags) & GRN_OBJ_VECTOR) ? GRN_UVECTOR : GRN_BULK,\
1337
+ ((flags) & GRN_OBJ_DO_SHALLOW_COPY), (domain))
1338
+ #define GRN_VALUE_VAR_SIZE_INIT(obj,flags,domain)\
1339
+ GRN_OBJ_INIT((obj), ((flags) & GRN_OBJ_VECTOR) ? GRN_VECTOR : GRN_BULK,\
1340
+ ((flags) & GRN_OBJ_DO_SHALLOW_COPY), (domain))
1341
+
1342
+ #define GRN_VOID_INIT(obj) GRN_OBJ_INIT((obj), GRN_VOID, 0, GRN_DB_VOID)
1343
+ #define GRN_TEXT_INIT(obj,flags) \
1344
+ GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_TEXT)
1345
+ #define GRN_SHORT_TEXT_INIT(obj,flags) \
1346
+ GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_SHORT_TEXT)
1347
+ #define GRN_LONG_TEXT_INIT(obj,flags) \
1348
+ GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_LONG_TEXT)
1349
+ #define GRN_TEXT_SET_REF(obj,str,len) do {\
1350
+ (obj)->u.b.head = (char *)(str);\
1351
+ (obj)->u.b.curr = (char *)(str) + (len);\
1352
+ } while (0)
1353
+ #define GRN_TEXT_SET(ctx,obj,str,len) do {\
1354
+ if ((obj)->header.impl_flags & GRN_OBJ_REFER) {\
1355
+ GRN_TEXT_SET_REF((obj), (str), (len));\
1356
+ } else {\
1357
+ grn_bulk_write_from((ctx), (obj), (const char *)(str), 0, (unsigned int)(len));\
1358
+ }\
1359
+ } while (0)
1360
+ #define GRN_TEXT_PUT(ctx,obj,str,len) \
1361
+ grn_bulk_write((ctx), (obj), (const char *)(str), (unsigned int)(len))
1362
+ #define GRN_TEXT_PUTC(ctx,obj,c) do {\
1363
+ char _c = (c); grn_bulk_write((ctx), (obj), &_c, 1);\
1364
+ } while (0)
1365
+
1366
+ #define GRN_TEXT_PUTS(ctx,obj,str) GRN_TEXT_PUT((ctx), (obj), (str), strlen(str))
1367
+ #define GRN_TEXT_SETS(ctx,obj,str) GRN_TEXT_SET((ctx), (obj), (str), strlen(str))
1368
+ #define GRN_TEXT_VALUE(obj) GRN_BULK_HEAD(obj)
1369
+ #define GRN_TEXT_LEN(obj) GRN_BULK_VSIZE(obj)
1370
+
1371
+ #define GRN_BOOL_INIT(obj,flags) \
1372
+ GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_BOOL)
1373
+ #define GRN_INT8_INIT(obj,flags) \
1374
+ GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT8)
1375
+ #define GRN_UINT8_INIT(obj,flags) \
1376
+ GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT8)
1377
+ #define GRN_INT16_INIT(obj,flags) \
1378
+ GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT16)
1379
+ #define GRN_UINT16_INIT(obj,flags) \
1380
+ GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT16)
1381
+ #define GRN_INT32_INIT(obj,flags) \
1382
+ GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT32)
1383
+ #define GRN_UINT32_INIT(obj,flags) \
1384
+ GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT32)
1385
+ #define GRN_INT64_INIT(obj,flags) \
1386
+ GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT64)
1387
+ #define GRN_UINT64_INIT(obj,flags) \
1388
+ GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT64)
1389
+ #define GRN_FLOAT_INIT(obj,flags) \
1390
+ GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_FLOAT)
1391
+ #define GRN_TIME_INIT(obj,flags) \
1392
+ GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_TIME)
1393
+ #define GRN_RECORD_INIT GRN_VALUE_FIX_SIZE_INIT
1394
+ #define GRN_PTR_INIT(obj,flags,domain)\
1395
+ GRN_OBJ_INIT((obj), ((flags) & GRN_OBJ_VECTOR) ? GRN_PVECTOR : GRN_PTR,\
1396
+ ((flags) & GRN_OBJ_DO_SHALLOW_COPY), (domain))
1397
+ #define GRN_TOKYO_GEO_POINT_INIT(obj,flags) \
1398
+ GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_TOKYO_GEO_POINT)
1399
+ #define GRN_WGS84_GEO_POINT_INIT(obj,flags) \
1400
+ GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_WGS84_GEO_POINT)
1401
+
1402
+ #define GRN_BOOL_SET(ctx,obj,val) do {\
1403
+ unsigned char _val = (unsigned char)(val);\
1404
+ grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(unsigned char));\
1405
+ } while (0)
1406
+ #define GRN_INT8_SET(ctx,obj,val) do {\
1407
+ signed char _val = (signed char)(val);\
1408
+ grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(signed char));\
1409
+ } while (0)
1410
+ #define GRN_UINT8_SET(ctx,obj,val) do {\
1411
+ unsigned char _val = (unsigned char)(val);\
1412
+ grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(unsigned char));\
1413
+ } while (0)
1414
+ #define GRN_INT16_SET(ctx,obj,val) do {\
1415
+ signed short _val = (signed short)(val);\
1416
+ grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(signed short));\
1417
+ } while (0)
1418
+ #define GRN_UINT16_SET(ctx,obj,val) do {\
1419
+ unsigned short _val = (unsigned short)(val);\
1420
+ grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(unsigned short));\
1421
+ } while (0)
1422
+ #define GRN_INT32_SET(ctx,obj,val) do {\
1423
+ int _val = (int)(val);\
1424
+ grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(int));\
1425
+ } while (0)
1426
+ #define GRN_UINT32_SET(ctx,obj,val) do {\
1427
+ unsigned int _val = (unsigned int)(val);\
1428
+ grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(unsigned int));\
1429
+ } while (0)
1430
+ #define GRN_INT64_SET(ctx,obj,val) do {\
1431
+ long long int _val = (long long int)(val);\
1432
+ grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(long long int));\
1433
+ } while (0)
1434
+ #define GRN_UINT64_SET(ctx,obj,val) do {\
1435
+ long long unsigned int _val = (long long unsigned int)(val);\
1436
+ grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(long long unsigned int));\
1437
+ } while (0)
1438
+ #define GRN_FLOAT_SET(ctx,obj,val) do {\
1439
+ double _val = (double)(val);\
1440
+ grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(double));\
1441
+ } while (0)
1442
+ #define GRN_TIME_SET GRN_INT64_SET
1443
+ #define GRN_RECORD_SET(ctx,obj,val) do {\
1444
+ grn_id _val = (grn_id)(val);\
1445
+ grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(grn_id));\
1446
+ } while (0)
1447
+ #define GRN_PTR_SET(ctx,obj,val) do {\
1448
+ grn_obj *_val = (grn_obj *)(val);\
1449
+ grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(grn_obj *));\
1450
+ } while (0)
1451
+
1452
+ #define GRN_GEO_DEGREE2MSEC(degree)\
1453
+ ((int)((degree) * 3600 * 1000 + ((degree) > 0 ? 0.5 : -0.5)))
1454
+ #define GRN_GEO_MSEC2DEGREE(msec)\
1455
+ ((((int)(msec)) / 3600.0) * 0.001)
1456
+
1457
+ #define GRN_GEO_POINT_SET(ctx,obj,_latitude,_longitude) do {\
1458
+ grn_geo_point _val;\
1459
+ _val.latitude = (int)(_latitude);\
1460
+ _val.longitude = (int)(_longitude);\
1461
+ grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(grn_geo_point));\
1462
+ } while (0)
1463
+
1464
+ #define GRN_BOOL_SET_AT(ctx,obj,offset,val) do {\
1465
+ unsigned char _val = (unsigned char)(val);\
1466
+ grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1467
+ (offset), sizeof(unsigned char));\
1468
+ } while (0)
1469
+ #define GRN_INT8_SET_AT(ctx,obj,offset,val) do {\
1470
+ signed char _val = (signed char)(val);\
1471
+ grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1472
+ (offset) * sizeof(signed char), sizeof(signed char));\
1473
+ } while (0)
1474
+ #define GRN_UINT8_SET_AT(ctx,obj,offset,val) do { \
1475
+ unsigned char _val = (unsigned char)(val);\
1476
+ grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1477
+ (offset) * sizeof(unsigned char), sizeof(unsigned char));\
1478
+ } while (0)
1479
+ #define GRN_INT16_SET_AT(ctx,obj,offset,val) do {\
1480
+ signed short _val = (signed short)(val);\
1481
+ grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1482
+ (offset) * sizeof(signed short), sizeof(signed short));\
1483
+ } while (0)
1484
+ #define GRN_UINT16_SET_AT(ctx,obj,offset,val) do { \
1485
+ unsigned short _val = (unsigned short)(val);\
1486
+ grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1487
+ (offset) * sizeof(unsigned short), sizeof(unsigned short));\
1488
+ } while (0)
1489
+ #define GRN_INT32_SET_AT(ctx,obj,offset,val) do {\
1490
+ int _val = (int)(val);\
1491
+ grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1492
+ (offset) * sizeof(int), sizeof(int));\
1493
+ } while (0)
1494
+ #define GRN_UINT32_SET_AT(ctx,obj,offset,val) do { \
1495
+ unsigned int _val = (unsigned int)(val);\
1496
+ grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1497
+ (offset) * sizeof(unsigned int), sizeof(unsigned int));\
1498
+ } while (0)
1499
+ #define GRN_INT64_SET_AT(ctx,obj,offset,val) do {\
1500
+ long long int _val = (long long int)(val);\
1501
+ grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1502
+ (offset) * sizeof(long long int), sizeof(long long int));\
1503
+ } while (0)
1504
+ #define GRN_UINT64_SET_AT(ctx,obj,offset,val) do {\
1505
+ long long unsigned int _val = (long long unsigned int)(val);\
1506
+ grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1507
+ (offset) * sizeof(long long unsigned int),\
1508
+ sizeof(long long unsigned int));\
1509
+ } while (0)
1510
+ #define GRN_FLOAT_SET_AT(ctx,obj,offset,val) do {\
1511
+ double _val = (double)(val);\
1512
+ grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1513
+ (offset) * sizeof(double), sizeof(double));\
1514
+ } while (0)
1515
+ #define GRN_TIME_SET_AT GRN_INT64_SET_AT
1516
+ #define GRN_RECORD_SET_AT(ctx,obj,offset,val) do {\
1517
+ grn_id _val = (grn_id)(val);\
1518
+ grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1519
+ (offset) * sizeof(grn_id), sizeof(grn_id));\
1520
+ } while (0)
1521
+ #define GRN_PTR_SET_AT(ctx,obj,offset,val) do {\
1522
+ grn_obj *_val = (grn_obj *)(val);\
1523
+ grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1524
+ (offset) * sizeof(grn_obj *), sizeof(grn_obj *));\
1525
+ } while (0)
1526
+
1527
+ #define GRN_TIME_USEC_PER_SEC 1000000
1528
+ #define GRN_TIME_PACK(sec, usec) ((long long int)(sec) * GRN_TIME_USEC_PER_SEC + (usec))
1529
+ #define GRN_TIME_UNPACK(time_value, sec, usec) do {\
1530
+ sec = (time_value) / GRN_TIME_USEC_PER_SEC;\
1531
+ usec = (time_value) % GRN_TIME_USEC_PER_SEC;\
1532
+ } while (0)
1533
+
1534
+ GRN_API void grn_time_now(grn_ctx *ctx, grn_obj *obj);
1535
+
1536
+ #define GRN_TIME_NOW(ctx,obj) (grn_time_now((ctx), (obj)))
1537
+
1538
+ #define GRN_BOOL_VALUE(obj) (*((unsigned char *)GRN_BULK_HEAD(obj)))
1539
+ #define GRN_INT8_VALUE(obj) (*((signed char *)GRN_BULK_HEAD(obj)))
1540
+ #define GRN_UINT8_VALUE(obj) (*((unsigned char *)GRN_BULK_HEAD(obj)))
1541
+ #define GRN_INT16_VALUE(obj) (*((signed short *)GRN_BULK_HEAD(obj)))
1542
+ #define GRN_UINT16_VALUE(obj) (*((unsigned short *)GRN_BULK_HEAD(obj)))
1543
+ #define GRN_INT32_VALUE(obj) (*((int *)GRN_BULK_HEAD(obj)))
1544
+ #define GRN_UINT32_VALUE(obj) (*((unsigned int *)GRN_BULK_HEAD(obj)))
1545
+ #define GRN_INT64_VALUE(obj) (*((long long int *)GRN_BULK_HEAD(obj)))
1546
+ #define GRN_UINT64_VALUE(obj) (*((long long unsigned int *)GRN_BULK_HEAD(obj)))
1547
+ #define GRN_FLOAT_VALUE(obj) (*((double *)GRN_BULK_HEAD(obj)))
1548
+ #define GRN_TIME_VALUE GRN_INT64_VALUE
1549
+ #define GRN_RECORD_VALUE(obj) (*((grn_id *)GRN_BULK_HEAD(obj)))
1550
+ #define GRN_PTR_VALUE(obj) (*((grn_obj **)GRN_BULK_HEAD(obj)))
1551
+ #define GRN_GEO_POINT_VALUE(obj,_latitude,_longitude) do {\
1552
+ grn_geo_point *_val = (grn_geo_point *)GRN_BULK_HEAD(obj);\
1553
+ _latitude = _val->latitude;\
1554
+ _longitude = _val->longitude;\
1555
+ } while (0)
1556
+
1557
+ #define GRN_BOOL_VALUE_AT(obj,offset) (((unsigned char *)GRN_BULK_HEAD(obj))[offset])
1558
+ #define GRN_INT8_VALUE_AT(obj,offset) (((signed char *)GRN_BULK_HEAD(obj))[offset])
1559
+ #define GRN_UINT8_VALUE_AT(obj,offset) (((unsigned char *)GRN_BULK_HEAD(obj))[offset])
1560
+ #define GRN_INT16_VALUE_AT(obj,offset) (((signed short *)GRN_BULK_HEAD(obj))[offset])
1561
+ #define GRN_UINT16_VALUE_AT(obj,offset) (((unsigned short *)GRN_BULK_HEAD(obj))[offset])
1562
+ #define GRN_INT32_VALUE_AT(obj,offset) (((int *)GRN_BULK_HEAD(obj))[offset])
1563
+ #define GRN_UINT32_VALUE_AT(obj,offset) (((unsigned int *)GRN_BULK_HEAD(obj))[offset])
1564
+ #define GRN_INT64_VALUE_AT(obj,offset) (((long long int *)GRN_BULK_HEAD(obj))[offset])
1565
+ #define GRN_UINT64_VALUE_AT(obj,offset) (((long long unsigned int *)GRN_BULK_HEAD(obj))[offset])
1566
+ #define GRN_FLOAT_VALUE_AT(obj,offset) (((double *)GRN_BULK_HEAD(obj))[offset])
1567
+ #define GRN_TIME_VALUE_AT GRN_INT64_VALUE_AT
1568
+ #define GRN_RECORD_VALUE_AT(obj,offset) (((grn_id *)GRN_BULK_HEAD(obj))[offset])
1569
+ #define GRN_PTR_VALUE_AT(obj,offset) (((grn_obj **)GRN_BULK_HEAD(obj))[offset])
1570
+
1571
+ #define GRN_BOOL_PUT(ctx,obj,val) do {\
1572
+ unsigned char _val = (unsigned char)(val);\
1573
+ grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(unsigned char));\
1574
+ } while (0)
1575
+ #define GRN_INT8_PUT(ctx,obj,val) do {\
1576
+ signed char _val = (signed char)(val); grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(signed char));\
1577
+ } while (0)
1578
+ #define GRN_UINT8_PUT(ctx,obj,val) do {\
1579
+ unsigned char _val = (unsigned char)(val);\
1580
+ grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(unsigned char));\
1581
+ } while (0)
1582
+ #define GRN_INT16_PUT(ctx,obj,val) do {\
1583
+ signed short _val = (signed short)(val); grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(signed short));\
1584
+ } while (0)
1585
+ #define GRN_UINT16_PUT(ctx,obj,val) do {\
1586
+ unsigned short _val = (unsigned short)(val);\
1587
+ grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(unsigned short));\
1588
+ } while (0)
1589
+ #define GRN_INT32_PUT(ctx,obj,val) do {\
1590
+ int _val = (int)(val); grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(int));\
1591
+ } while (0)
1592
+ #define GRN_UINT32_PUT(ctx,obj,val) do {\
1593
+ unsigned int _val = (unsigned int)(val);\
1594
+ grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(unsigned int));\
1595
+ } while (0)
1596
+ #define GRN_INT64_PUT(ctx,obj,val) do {\
1597
+ long long int _val = (long long int)(val);\
1598
+ grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(long long int));\
1599
+ } while (0)
1600
+ #define GRN_UINT64_PUT(ctx,obj,val) do {\
1601
+ long long unsigned int _val = (long long unsigned int)(val);\
1602
+ grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(long long unsigned int));\
1603
+ } while (0)
1604
+ #define GRN_FLOAT_PUT(ctx,obj,val) do {\
1605
+ double _val = (double)(val); grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(double));\
1606
+ } while (0)
1607
+ #define GRN_TIME_PUT GRN_INT64_PUT
1608
+ #define GRN_RECORD_PUT(ctx,obj,val) do {\
1609
+ grn_id _val = (grn_id)(val); grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(grn_id));\
1610
+ } while (0)
1611
+ #define GRN_PTR_PUT(ctx,obj,val) do {\
1612
+ grn_obj *_val = (grn_obj *)(val);\
1613
+ grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(grn_obj *));\
1614
+ } while (0)
1615
+
1616
+ /* grn_str: deprecated. use grn_string instead. */
1617
+
1618
+ typedef struct {
1619
+ const char *orig;
1620
+ char *norm;
1621
+ short *checks;
1622
+ unsigned char *ctypes;
1623
+ int flags;
1624
+ unsigned int orig_blen;
1625
+ unsigned int norm_blen;
1626
+ unsigned int length;
1627
+ grn_encoding encoding;
1628
+ } grn_str;
1629
+
1630
+ #define GRN_STR_REMOVEBLANK (0x01<<0)
1631
+ #define GRN_STR_WITH_CTYPES (0x01<<1)
1632
+ #define GRN_STR_WITH_CHECKS (0x01<<2)
1633
+ #define GRN_STR_NORMALIZE GRN_OBJ_KEY_NORMALIZE
1634
+
1635
+ GRN_API grn_str *grn_str_open(grn_ctx *ctx, const char *str, unsigned int str_len,
1636
+ int flags);
1637
+ GRN_API grn_rc grn_str_close(grn_ctx *ctx, grn_str *nstr);
1638
+
1639
+ /* grn_string */
1640
+
1641
+ #define GRN_STRING_REMOVE_BLANK (0x01<<0)
1642
+ #define GRN_STRING_WITH_TYPES (0x01<<1)
1643
+ #define GRN_STRING_WITH_CHECKS (0x01<<2)
1644
+ #define GRN_STRING_REMOVE_TOKENIZED_DELIMITER (0x01<<3)
1645
+
1646
+ #define GRN_NORMALIZER_AUTO ((grn_obj *)1)
1647
+
1648
+ #define GRN_CHAR_BLANK 0x80
1649
+ #define GRN_CHAR_IS_BLANK(c) ((c) & (GRN_CHAR_BLANK))
1650
+ #define GRN_CHAR_TYPE(c) ((c) & 0x7f)
1651
+
1652
+ typedef enum {
1653
+ GRN_CHAR_NULL = 0,
1654
+ GRN_CHAR_ALPHA,
1655
+ GRN_CHAR_DIGIT,
1656
+ GRN_CHAR_SYMBOL,
1657
+ GRN_CHAR_HIRAGANA,
1658
+ GRN_CHAR_KATAKANA,
1659
+ GRN_CHAR_KANJI,
1660
+ GRN_CHAR_OTHERS
1661
+ } grn_char_type;
1662
+
1663
+ GRN_API grn_obj *grn_string_open(grn_ctx *ctx,
1664
+ const char *string,
1665
+ unsigned int length_in_bytes,
1666
+ grn_obj *normalizer, int flags);
1667
+ GRN_API grn_rc grn_string_get_original(grn_ctx *ctx, grn_obj *string,
1668
+ const char **original,
1669
+ unsigned int *length_in_bytes);
1670
+ GRN_API int grn_string_get_flags(grn_ctx *ctx, grn_obj *string);
1671
+ GRN_API grn_rc grn_string_get_normalized(grn_ctx *ctx, grn_obj *string,
1672
+ const char **normalized,
1673
+ unsigned int *length_in_bytes,
1674
+ unsigned int *n_characters);
1675
+ GRN_API grn_rc grn_string_set_normalized(grn_ctx *ctx, grn_obj *string,
1676
+ char *normalized,
1677
+ unsigned int length_in_bytes,
1678
+ unsigned int n_characters);
1679
+ GRN_API const short *grn_string_get_checks(grn_ctx *ctx, grn_obj *string);
1680
+ GRN_API grn_rc grn_string_set_checks(grn_ctx *ctx,
1681
+ grn_obj *string,
1682
+ short *checks);
1683
+ GRN_API const unsigned char *grn_string_get_types(grn_ctx *ctx, grn_obj *string);
1684
+ GRN_API grn_rc grn_string_set_types(grn_ctx *ctx,
1685
+ grn_obj *string,
1686
+ unsigned char *types);
1687
+ GRN_API grn_encoding grn_string_get_encoding(grn_ctx *ctx, grn_obj *string);
1688
+
1689
+
1690
+ GRN_API int grn_charlen(grn_ctx *ctx, const char *str, const char *end);
1691
+
1692
+ GRN_API grn_rc grn_ctx_push(grn_ctx *ctx, grn_obj *obj);
1693
+ GRN_API grn_obj *grn_ctx_pop(grn_ctx *ctx);
1694
+
1695
+ GRN_API grn_obj *grn_table_select(grn_ctx *ctx, grn_obj *table, grn_obj *expr,
1696
+ grn_obj *res, grn_operator op);
1697
+
1698
+ GRN_API int grn_obj_columns(grn_ctx *ctx, grn_obj *table,
1699
+ const char *str, unsigned int str_size, grn_obj *res);
1700
+
1701
+ GRN_API grn_table_sort_key *grn_table_sort_key_from_str(grn_ctx *ctx,
1702
+ const char *str, unsigned int str_size,
1703
+ grn_obj *table, unsigned int *nkeys);
1704
+ GRN_API grn_rc grn_table_sort_key_close(grn_ctx *ctx,
1705
+ grn_table_sort_key *keys, unsigned int nkeys);
1706
+
1707
+ GRN_API grn_bool grn_table_is_grouped(grn_ctx *ctx, grn_obj *table);
1708
+
1709
+ GRN_API unsigned int grn_table_max_n_subrecs(grn_ctx *ctx, grn_obj *table);
1710
+
1711
+ GRN_API grn_obj *grn_table_create_for_group(grn_ctx *ctx,
1712
+ const char *name,
1713
+ unsigned int name_size,
1714
+ const char *path,
1715
+ grn_obj *group_key,
1716
+ grn_obj *value_type,
1717
+ unsigned int max_n_subrecs);
1718
+
1719
+ GRN_API unsigned int grn_table_get_subrecs(grn_ctx *ctx, grn_obj *table,
1720
+ grn_id id, grn_id *subrecbuf,
1721
+ int *scorebuf, int buf_size);
1722
+
1723
+ GRN_API grn_obj *grn_table_tokenize(grn_ctx *ctx, grn_obj *table,
1724
+ const char *str, unsigned int str_len,
1725
+ grn_obj *buf, grn_bool addp);
1726
+
1727
+ GRN_API grn_rc grn_load(grn_ctx *ctx, grn_content_type input_type,
1728
+ const char *table, unsigned int table_len,
1729
+ const char *columns, unsigned int columns_len,
1730
+ const char *values, unsigned int values_len,
1731
+ const char *ifexists, unsigned int ifexists_len,
1732
+ const char *each, unsigned int each_len);
1733
+
1734
+ #define GRN_CTX_MORE (0x01<<0)
1735
+ #define GRN_CTX_TAIL (0x01<<1)
1736
+ #define GRN_CTX_HEAD (0x01<<2)
1737
+ #define GRN_CTX_QUIET (0x01<<3)
1738
+ #define GRN_CTX_QUIT (0x01<<4)
1739
+
1740
+ GRN_API grn_rc grn_ctx_connect(grn_ctx *ctx, const char *host, int port, int flags);
1741
+ GRN_API unsigned int grn_ctx_send(grn_ctx *ctx, const char *str, unsigned int str_len, int flags);
1742
+ GRN_API unsigned int grn_ctx_recv(grn_ctx *ctx, char **str, unsigned int *str_len, int *flags);
1743
+
1744
+ typedef struct _grn_ctx_info grn_ctx_info;
1745
+
1746
+ struct _grn_ctx_info {
1747
+ int fd;
1748
+ unsigned int com_status;
1749
+ grn_obj *outbuf;
1750
+ unsigned char stat;
1751
+ };
1752
+
1753
+ GRN_API grn_rc grn_ctx_info_get(grn_ctx *ctx, grn_ctx_info *info);
1754
+
1755
+ GRN_API grn_rc grn_set_segv_handler(void);
1756
+ GRN_API grn_rc grn_set_int_handler(void);
1757
+ GRN_API grn_rc grn_set_term_handler(void);
1758
+
1759
+ /* hash */
1760
+
1761
+ typedef struct _grn_hash grn_hash;
1762
+ typedef struct _grn_hash_cursor grn_hash_cursor;
1763
+
1764
+ GRN_API grn_hash *grn_hash_create(grn_ctx *ctx, const char *path, unsigned int key_size,
1765
+ unsigned int value_size, unsigned int flags);
1766
+
1767
+ GRN_API grn_hash *grn_hash_open(grn_ctx *ctx, const char *path);
1768
+
1769
+ GRN_API grn_rc grn_hash_close(grn_ctx *ctx, grn_hash *hash);
1770
+
1771
+ GRN_API grn_id grn_hash_add(grn_ctx *ctx, grn_hash *hash, const void *key,
1772
+ unsigned int key_size, void **value, int *added);
1773
+ GRN_API grn_id grn_hash_get(grn_ctx *ctx, grn_hash *hash, const void *key,
1774
+ unsigned int key_size, void **value);
1775
+
1776
+ GRN_API int grn_hash_get_key(grn_ctx *ctx, grn_hash *hash, grn_id id, void *keybuf, int bufsize);
1777
+ GRN_API int grn_hash_get_key2(grn_ctx *ctx, grn_hash *hash, grn_id id, grn_obj *bulk);
1778
+ GRN_API int grn_hash_get_value(grn_ctx *ctx, grn_hash *hash, grn_id id, void *valuebuf);
1779
+ GRN_API grn_rc grn_hash_set_value(grn_ctx *ctx, grn_hash *hash, grn_id id,
1780
+ const void *value, int flags);
1781
+
1782
+ typedef struct _grn_table_delete_optarg grn_table_delete_optarg;
1783
+
1784
+ struct _grn_table_delete_optarg {
1785
+ int flags;
1786
+ int (*func)(grn_ctx *ctx, grn_obj *, grn_id, void *);
1787
+ void *func_arg;
1788
+ };
1789
+
1790
+ GRN_API grn_rc grn_hash_delete_by_id(grn_ctx *ctx, grn_hash *hash, grn_id id,
1791
+ grn_table_delete_optarg *optarg);
1792
+ GRN_API grn_rc grn_hash_delete(grn_ctx *ctx, grn_hash *hash,
1793
+ const void *key, unsigned int key_size,
1794
+ grn_table_delete_optarg *optarg);
1795
+
1796
+ GRN_API grn_hash_cursor *grn_hash_cursor_open(grn_ctx *ctx, grn_hash *hash,
1797
+ const void *min, unsigned int min_size,
1798
+ const void *max, unsigned int max_size,
1799
+ int offset, int limit, int flags);
1800
+ GRN_API grn_id grn_hash_cursor_next(grn_ctx *ctx, grn_hash_cursor *c);
1801
+ GRN_API void grn_hash_cursor_close(grn_ctx *ctx, grn_hash_cursor *c);
1802
+
1803
+ GRN_API int grn_hash_cursor_get_key(grn_ctx *ctx, grn_hash_cursor *c, void **key);
1804
+ GRN_API int grn_hash_cursor_get_value(grn_ctx *ctx, grn_hash_cursor *c, void **value);
1805
+ GRN_API grn_rc grn_hash_cursor_set_value(grn_ctx *ctx, grn_hash_cursor *c,
1806
+ const void *value, int flags);
1807
+
1808
+ GRN_API int grn_hash_cursor_get_key_value(grn_ctx *ctx, grn_hash_cursor *c,
1809
+ void **key, unsigned int *key_size, void **value);
1810
+
1811
+ GRN_API grn_rc grn_hash_cursor_delete(grn_ctx *ctx, grn_hash_cursor *c,
1812
+ grn_table_delete_optarg *optarg);
1813
+
1814
+ #define GRN_HASH_EACH(ctx,hash,id,key,key_size,value,block) do {\
1815
+ grn_hash_cursor *_sc = grn_hash_cursor_open(ctx, hash, NULL, 0, NULL, 0, 0, -1, 0); \
1816
+ if (_sc) {\
1817
+ grn_id id;\
1818
+ while ((id = grn_hash_cursor_next(ctx, _sc))) {\
1819
+ grn_hash_cursor_get_key_value(ctx, _sc, (void **)(key),\
1820
+ (key_size), (void **)(value));\
1821
+ block\
1822
+ }\
1823
+ grn_hash_cursor_close(ctx, _sc);\
1824
+ }\
1825
+ } while (0)
1826
+
1827
+ /* array */
1828
+
1829
+ typedef struct _grn_array grn_array;
1830
+ typedef struct _grn_array_cursor grn_array_cursor;
1831
+
1832
+ GRN_API grn_array *grn_array_create(grn_ctx *ctx, const char *path,
1833
+ unsigned int value_size, unsigned int flags);
1834
+ GRN_API grn_array *grn_array_open(grn_ctx *ctx, const char *path);
1835
+ GRN_API grn_rc grn_array_close(grn_ctx *ctx, grn_array *array);
1836
+ GRN_API grn_id grn_array_add(grn_ctx *ctx, grn_array *array, void **value);
1837
+ GRN_API grn_id grn_array_push(grn_ctx *ctx, grn_array *array,
1838
+ void (*func)(grn_ctx *ctx, grn_array *array,
1839
+ grn_id id, void *func_arg),
1840
+ void *func_arg);
1841
+ GRN_API grn_id grn_array_pull(grn_ctx *ctx, grn_array *array, grn_bool blockp,
1842
+ void (*func)(grn_ctx *ctx, grn_array *array,
1843
+ grn_id id, void *func_arg),
1844
+ void *func_arg);
1845
+ GRN_API void grn_array_unblock(grn_ctx *ctx, grn_array *array);
1846
+ GRN_API int grn_array_get_value(grn_ctx *ctx, grn_array *array, grn_id id, void *valuebuf);
1847
+ GRN_API grn_rc grn_array_set_value(grn_ctx *ctx, grn_array *array, grn_id id,
1848
+ const void *value, int flags);
1849
+ GRN_API grn_array_cursor *grn_array_cursor_open(grn_ctx *ctx, grn_array *array,
1850
+ grn_id min, grn_id max,
1851
+ int offset, int limit, int flags);
1852
+ GRN_API grn_id grn_array_cursor_next(grn_ctx *ctx, grn_array_cursor *cursor);
1853
+ GRN_API int grn_array_cursor_get_value(grn_ctx *ctx, grn_array_cursor *cursor, void **value);
1854
+ GRN_API grn_rc grn_array_cursor_set_value(grn_ctx *ctx, grn_array_cursor *cursor,
1855
+ const void *value, int flags);
1856
+ GRN_API grn_rc grn_array_cursor_delete(grn_ctx *ctx, grn_array_cursor *cursor,
1857
+ grn_table_delete_optarg *optarg);
1858
+ GRN_API void grn_array_cursor_close(grn_ctx *ctx, grn_array_cursor *cursor);
1859
+ GRN_API grn_rc grn_array_delete_by_id(grn_ctx *ctx, grn_array *array, grn_id id,
1860
+ grn_table_delete_optarg *optarg);
1861
+
1862
+ GRN_API grn_id grn_array_next(grn_ctx *ctx, grn_array *array, grn_id id);
1863
+
1864
+ GRN_API void *_grn_array_get_value(grn_ctx *ctx, grn_array *array, grn_id id);
1865
+
1866
+ #define GRN_ARRAY_EACH(ctx,array,head,tail,id,value,block) do {\
1867
+ grn_array_cursor *_sc = grn_array_cursor_open(ctx, array, head, tail, 0, -1, 0); \
1868
+ if (_sc) {\
1869
+ grn_id id;\
1870
+ while ((id = grn_array_cursor_next(ctx, _sc))) {\
1871
+ grn_array_cursor_get_value(ctx, _sc, (void **)(value));\
1872
+ block\
1873
+ }\
1874
+ grn_array_cursor_close(ctx, _sc); \
1875
+ }\
1876
+ } while (0)
1877
+
1878
+ /* pat */
1879
+
1880
+ typedef struct _grn_pat grn_pat;
1881
+ typedef struct _grn_pat_cursor grn_pat_cursor;
1882
+
1883
+ GRN_API grn_pat *grn_pat_create(grn_ctx *ctx, const char *path, unsigned int key_size,
1884
+ unsigned int value_size, unsigned int flags);
1885
+
1886
+ GRN_API grn_pat *grn_pat_open(grn_ctx *ctx, const char *path);
1887
+
1888
+ GRN_API grn_rc grn_pat_close(grn_ctx *ctx, grn_pat *pat);
1889
+
1890
+ GRN_API grn_rc grn_pat_remove(grn_ctx *ctx, const char *path);
1891
+
1892
+ GRN_API grn_id grn_pat_get(grn_ctx *ctx, grn_pat *pat, const void *key,
1893
+ unsigned int key_size, void **value);
1894
+ GRN_API grn_id grn_pat_add(grn_ctx *ctx, grn_pat *pat, const void *key,
1895
+ unsigned int key_size, void **value, int *added);
1896
+
1897
+ GRN_API int grn_pat_get_key(grn_ctx *ctx, grn_pat *pat, grn_id id, void *keybuf, int bufsize);
1898
+ GRN_API int grn_pat_get_key2(grn_ctx *ctx, grn_pat *pat, grn_id id, grn_obj *bulk);
1899
+ GRN_API int grn_pat_get_value(grn_ctx *ctx, grn_pat *pat, grn_id id, void *valuebuf);
1900
+ GRN_API grn_rc grn_pat_set_value(grn_ctx *ctx, grn_pat *pat, grn_id id,
1901
+ const void *value, int flags);
1902
+
1903
+ GRN_API grn_rc grn_pat_delete_by_id(grn_ctx *ctx, grn_pat *pat, grn_id id,
1904
+ grn_table_delete_optarg *optarg);
1905
+ GRN_API grn_rc grn_pat_delete(grn_ctx *ctx, grn_pat *pat, const void *key, unsigned int key_size,
1906
+ grn_table_delete_optarg *optarg);
1907
+ GRN_API int grn_pat_delete_with_sis(grn_ctx *ctx, grn_pat *pat, grn_id id,
1908
+ grn_table_delete_optarg *optarg);
1909
+
1910
+ typedef struct _grn_pat_scan_hit grn_pat_scan_hit;
1911
+
1912
+ struct _grn_pat_scan_hit {
1913
+ grn_id id;
1914
+ unsigned int offset;
1915
+ unsigned int length;
1916
+ };
1917
+
1918
+ GRN_API int grn_pat_scan(grn_ctx *ctx, grn_pat *pat, const char *str, unsigned int str_len,
1919
+ grn_pat_scan_hit *sh, unsigned int sh_size, const char **rest);
1920
+
1921
+ GRN_API grn_rc grn_pat_prefix_search(grn_ctx *ctx, grn_pat *pat,
1922
+ const void *key, unsigned int key_size, grn_hash *h);
1923
+ GRN_API grn_rc grn_pat_suffix_search(grn_ctx *ctx, grn_pat *pat,
1924
+ const void *key, unsigned int key_size, grn_hash *h);
1925
+ GRN_API grn_id grn_pat_lcp_search(grn_ctx *ctx, grn_pat *pat,
1926
+ const void *key, unsigned int key_size);
1927
+
1928
+ GRN_API unsigned int grn_pat_size(grn_ctx *ctx, grn_pat *pat);
1929
+
1930
+ GRN_API grn_pat_cursor *grn_pat_cursor_open(grn_ctx *ctx, grn_pat *pat,
1931
+ const void *min, unsigned int min_size,
1932
+ const void *max, unsigned int max_size,
1933
+ int offset, int limit, int flags);
1934
+ GRN_API grn_id grn_pat_cursor_next(grn_ctx *ctx, grn_pat_cursor *c);
1935
+ GRN_API void grn_pat_cursor_close(grn_ctx *ctx, grn_pat_cursor *c);
1936
+
1937
+ GRN_API int grn_pat_cursor_get_key(grn_ctx *ctx, grn_pat_cursor *c, void **key);
1938
+ GRN_API int grn_pat_cursor_get_value(grn_ctx *ctx, grn_pat_cursor *c, void **value);
1939
+
1940
+ GRN_API int grn_pat_cursor_get_key_value(grn_ctx *ctx, grn_pat_cursor *c,
1941
+ void **key, unsigned int *key_size, void **value);
1942
+ GRN_API grn_rc grn_pat_cursor_set_value(grn_ctx *ctx, grn_pat_cursor *c,
1943
+ const void *value, int flags);
1944
+ GRN_API grn_rc grn_pat_cursor_delete(grn_ctx *ctx, grn_pat_cursor *c,
1945
+ grn_table_delete_optarg *optarg);
1946
+
1947
+ #define GRN_PAT_EACH(ctx,pat,id,key,key_size,value,block) do { \
1948
+ grn_pat_cursor *_sc = grn_pat_cursor_open(ctx, pat, NULL, 0, NULL, 0, 0, -1, 0); \
1949
+ if (_sc) {\
1950
+ grn_id id;\
1951
+ while ((id = grn_pat_cursor_next(ctx, _sc))) {\
1952
+ grn_pat_cursor_get_key_value(ctx, _sc, (void **)(key),\
1953
+ (key_size), (void **)(value));\
1954
+ block\
1955
+ }\
1956
+ grn_pat_cursor_close(ctx, _sc);\
1957
+ }\
1958
+ } while (0)
1959
+
1960
+ /* dat */
1961
+
1962
+ typedef struct _grn_dat grn_dat;
1963
+ typedef struct _grn_dat_cursor grn_dat_cursor;
1964
+
1965
+ GRN_API grn_dat *grn_dat_create(grn_ctx *ctx, const char *path, unsigned int key_size,
1966
+ unsigned int value_size, unsigned int flags);
1967
+
1968
+ GRN_API grn_dat *grn_dat_open(grn_ctx *ctx, const char *path);
1969
+
1970
+ GRN_API grn_rc grn_dat_close(grn_ctx *ctx, grn_dat *dat);
1971
+
1972
+ GRN_API grn_rc grn_dat_remove(grn_ctx *ctx, const char *path);
1973
+
1974
+ GRN_API grn_id grn_dat_get(grn_ctx *ctx, grn_dat *dat, const void *key,
1975
+ unsigned int key_size, void **value);
1976
+ GRN_API grn_id grn_dat_add(grn_ctx *ctx, grn_dat *dat, const void *key,
1977
+ unsigned int key_size, void **value, int *added);
1978
+
1979
+ GRN_API int grn_dat_get_key(grn_ctx *ctx, grn_dat *dat, grn_id id, void *keybuf, int bufsize);
1980
+ GRN_API int grn_dat_get_key2(grn_ctx *ctx, grn_dat *dat, grn_id id, grn_obj *bulk);
1981
+
1982
+ GRN_API grn_rc grn_dat_delete_by_id(grn_ctx *ctx, grn_dat *dat, grn_id id,
1983
+ grn_table_delete_optarg *optarg);
1984
+ GRN_API grn_rc grn_dat_delete(grn_ctx *ctx, grn_dat *dat, const void *key, unsigned int key_size,
1985
+ grn_table_delete_optarg *optarg);
1986
+
1987
+ GRN_API grn_rc grn_dat_update_by_id(grn_ctx *ctx, grn_dat *dat, grn_id src_key_id,
1988
+ const void *dest_key, unsigned int dest_key_size);
1989
+ GRN_API grn_rc grn_dat_update(grn_ctx *ctx, grn_dat *dat,
1990
+ const void *src_key, unsigned int src_key_size,
1991
+ const void *dest_key, unsigned int dest_key_size);
1992
+
1993
+ GRN_API unsigned int grn_dat_size(grn_ctx *ctx, grn_dat *dat);
1994
+
1995
+ GRN_API grn_dat_cursor *grn_dat_cursor_open(grn_ctx *ctx, grn_dat *dat,
1996
+ const void *min, unsigned int min_size,
1997
+ const void *max, unsigned int max_size,
1998
+ int offset, int limit, int flags);
1999
+ GRN_API grn_id grn_dat_cursor_next(grn_ctx *ctx, grn_dat_cursor *c);
2000
+ GRN_API void grn_dat_cursor_close(grn_ctx *ctx, grn_dat_cursor *c);
2001
+
2002
+ GRN_API int grn_dat_cursor_get_key(grn_ctx *ctx, grn_dat_cursor *c, const void **key);
2003
+ GRN_API grn_rc grn_dat_cursor_delete(grn_ctx *ctx, grn_dat_cursor *c,
2004
+ grn_table_delete_optarg *optarg);
2005
+
2006
+ #define GRN_DAT_EACH(ctx,dat,id,key,key_size,block) do {\
2007
+ grn_dat_cursor *_sc = grn_dat_cursor_open(ctx, dat, NULL, 0, NULL, 0, 0, -1, 0);\
2008
+ if (_sc) {\
2009
+ grn_id id;\
2010
+ unsigned int *_ks = (key_size);\
2011
+ if (_ks) {\
2012
+ while ((id = grn_dat_cursor_next(ctx, _sc))) {\
2013
+ int _ks_raw = grn_dat_cursor_get_key(ctx, _sc, (const void **)(key));\
2014
+ *(_ks) = (unsigned int)_ks_raw;\
2015
+ block\
2016
+ }\
2017
+ } else {\
2018
+ while ((id = grn_dat_cursor_next(ctx, _sc))) {\
2019
+ grn_dat_cursor_get_key(ctx, _sc, (const void **)(key));\
2020
+ block\
2021
+ }\
2022
+ }\
2023
+ grn_dat_cursor_close(ctx, _sc);\
2024
+ }\
2025
+ } while (0)
2026
+
2027
+ #ifdef __cplusplus
2028
+ }
2029
+ #endif
2030
+
2031
+ #endif /* GROONGA_GROONGA_H */