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
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright(C) 2009-2014 Brazil
2
+ Copyright(C) 2014 Brazil
3
3
 
4
4
  This library is free software; you can redistribute it and/or
5
5
  modify it under the terms of the GNU Lesser General Public
@@ -18,2099 +18,9 @@
18
18
  #ifndef GROONGA_H
19
19
  #define GROONGA_H
20
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
- struct _grn_table_group_result {
711
- grn_obj *table;
712
- unsigned char key_begin;
713
- unsigned char key_end;
714
- int limit;
715
- grn_table_group_flags flags;
716
- grn_operator op;
717
- };
718
-
719
- GRN_API grn_rc grn_table_group(grn_ctx *ctx, grn_obj *table,
720
- grn_table_sort_key *keys, int n_keys,
721
- grn_table_group_result *results, int n_results);
722
- GRN_API grn_rc grn_table_setoperation(grn_ctx *ctx, grn_obj *table1, grn_obj *table2,
723
- grn_obj *res, grn_operator op);
724
- GRN_API grn_rc grn_table_difference(grn_ctx *ctx, grn_obj *table1, grn_obj *table2,
725
- grn_obj *res1, grn_obj *res2);
726
- GRN_API int grn_table_columns(grn_ctx *ctx, grn_obj *table,
727
- const char *name, unsigned int name_size,
728
- grn_obj *res);
729
-
730
- GRN_API grn_obj *grn_obj_column(grn_ctx *ctx, grn_obj *table,
731
- const char *name, unsigned int name_size);
732
-
733
- GRN_API unsigned int grn_table_size(grn_ctx *ctx, grn_obj *table);
734
-
735
- /*-------------------------------------------------------------
736
- * API for column
737
- */
738
-
739
- #define GRN_COLUMN_NAME_ID "_id"
740
- #define GRN_COLUMN_NAME_ID_LEN (sizeof(GRN_COLUMN_NAME_ID) - 1)
741
- #define GRN_COLUMN_NAME_KEY "_key"
742
- #define GRN_COLUMN_NAME_KEY_LEN (sizeof(GRN_COLUMN_NAME_KEY) - 1)
743
- #define GRN_COLUMN_NAME_VALUE "_value"
744
- #define GRN_COLUMN_NAME_VALUE_LEN (sizeof(GRN_COLUMN_NAME_VALUE) - 1)
745
- #define GRN_COLUMN_NAME_SCORE "_score"
746
- #define GRN_COLUMN_NAME_SCORE_LEN (sizeof(GRN_COLUMN_NAME_SCORE) - 1)
747
- #define GRN_COLUMN_NAME_NSUBRECS "_nsubrecs"
748
- #define GRN_COLUMN_NAME_NSUBRECS_LEN (sizeof(GRN_COLUMN_NAME_NSUBRECS) - 1)
749
-
750
- GRN_API grn_obj *grn_column_create(grn_ctx *ctx, grn_obj *table,
751
- const char *name, unsigned int name_size,
752
- const char *path, grn_obj_flags flags, grn_obj *type);
753
-
754
- #define GRN_COLUMN_OPEN_OR_CREATE(ctx,table,name,name_size,path,flags,type,column) \
755
- (((column) = grn_obj_column((ctx), (table), (name), (name_size))) ||\
756
- ((column) = grn_column_create((ctx), (table), (name), (name_size), (path), (flags), (type))))
757
-
758
- GRN_API grn_rc grn_column_index_update(grn_ctx *ctx, grn_obj *column,
759
- grn_id id, unsigned int section,
760
- grn_obj *oldvalue, grn_obj *newvalue);
761
- GRN_API grn_obj *grn_column_table(grn_ctx *ctx, grn_obj *column);
762
-
763
- /*-------------------------------------------------------------
764
- * API for db, table and/or column
765
- */
766
-
767
- typedef enum {
768
- GRN_INFO_ENCODING = 0,
769
- GRN_INFO_SOURCE,
770
- GRN_INFO_DEFAULT_TOKENIZER,
771
- GRN_INFO_ELEMENT_SIZE,
772
- GRN_INFO_CURR_MAX,
773
- GRN_INFO_MAX_ELEMENT_SIZE,
774
- GRN_INFO_SEG_SIZE,
775
- GRN_INFO_CHUNK_SIZE,
776
- GRN_INFO_MAX_SECTION,
777
- GRN_INFO_HOOK_LOCAL_DATA,
778
- GRN_INFO_ELEMENT_A,
779
- GRN_INFO_ELEMENT_CHUNK,
780
- GRN_INFO_ELEMENT_CHUNK_SIZE,
781
- GRN_INFO_ELEMENT_BUFFER_FREE,
782
- GRN_INFO_ELEMENT_NTERMS,
783
- GRN_INFO_ELEMENT_NTERMS_VOID,
784
- GRN_INFO_ELEMENT_SIZE_IN_CHUNK,
785
- GRN_INFO_ELEMENT_POS_IN_CHUNK,
786
- GRN_INFO_ELEMENT_SIZE_IN_BUFFER,
787
- GRN_INFO_ELEMENT_POS_IN_BUFFER,
788
- GRN_INFO_ELEMENT_ESTIMATE_SIZE,
789
- GRN_INFO_NGRAM_UNIT_SIZE,
790
- /*
791
- GRN_INFO_VERSION,
792
- GRN_INFO_CONFIGURE_OPTIONS,
793
- GRN_INFO_CONFIG_PATH,
794
- */
795
- GRN_INFO_PARTIAL_MATCH_THRESHOLD,
796
- GRN_INFO_II_SPLIT_THRESHOLD,
797
- GRN_INFO_SUPPORT_ZLIB,
798
- GRN_INFO_SUPPORT_LZ4,
799
- /* Just for backward compatibility. We'll remove it at 5.0.0. */
800
- #define GRN_INFO_SUPPORT_LZO GRN_INFO_SUPPORT_LZ4
801
- GRN_INFO_NORMALIZER,
802
- GRN_INFO_TOKEN_FILTERS
803
- } grn_info_type;
804
-
805
- GRN_API grn_obj *grn_obj_get_info(grn_ctx *ctx, grn_obj *obj, grn_info_type type, grn_obj *valuebuf);
806
- GRN_API grn_rc grn_obj_set_info(grn_ctx *ctx, grn_obj *obj, grn_info_type type, grn_obj *value);
807
- GRN_API grn_obj *grn_obj_get_element_info(grn_ctx *ctx, grn_obj *obj, grn_id id,
808
- grn_info_type type, grn_obj *value);
809
- GRN_API grn_rc grn_obj_set_element_info(grn_ctx *ctx, grn_obj *obj, grn_id id,
810
- grn_info_type type, grn_obj *value);
811
-
812
- GRN_API grn_bool grn_obj_is_builtin(grn_ctx *ctx, grn_obj *obj);
813
-
814
- GRN_API grn_obj *grn_obj_get_value(grn_ctx *ctx, grn_obj *obj, grn_id id, grn_obj *value);
815
- GRN_API int grn_obj_get_values(grn_ctx *ctx, grn_obj *obj, grn_id offset, void **values);
816
-
817
- #define GRN_COLUMN_EACH(ctx,column,id,value,block) do {\
818
- int _n;\
819
- grn_id id = 1;\
820
- while ((_n = grn_obj_get_values(ctx, column, id, (void **)&value)) > 0) {\
821
- for (; _n; _n--, id++, value++) {\
822
- block\
823
- }\
824
- }\
825
- } while (0)
826
-
827
- #define GRN_OBJ_SET_MASK (0x07)
828
- #define GRN_OBJ_SET (0x01)
829
- #define GRN_OBJ_INCR (0x02)
830
- #define GRN_OBJ_DECR (0x03)
831
- #define GRN_OBJ_APPEND (0x04)
832
- #define GRN_OBJ_PREPEND (0x05)
833
- #define GRN_OBJ_GET (0x01<<4)
834
- #define GRN_OBJ_COMPARE (0x01<<5)
835
- #define GRN_OBJ_LOCK (0x01<<6)
836
- #define GRN_OBJ_UNLOCK (0x01<<7)
837
-
838
- GRN_API grn_rc grn_obj_set_value(grn_ctx *ctx, grn_obj *obj, grn_id id, grn_obj *value, int flags);
839
- GRN_API grn_rc grn_obj_remove(grn_ctx *ctx, grn_obj *obj);
840
- GRN_API grn_rc grn_obj_rename(grn_ctx *ctx, grn_obj *obj,
841
- const char *name, unsigned int name_size);
842
- GRN_API grn_rc grn_table_rename(grn_ctx *ctx, grn_obj *table,
843
- const char *name, unsigned int name_size);
844
-
845
- GRN_API grn_rc grn_column_rename(grn_ctx *ctx, grn_obj *column,
846
- const char *name, unsigned int name_size);
847
-
848
- GRN_API grn_rc grn_obj_close(grn_ctx *ctx, grn_obj *obj);
849
- GRN_API grn_rc grn_obj_reinit(grn_ctx *ctx, grn_obj *obj, grn_id domain, unsigned char flags);
850
- GRN_API void grn_obj_unlink(grn_ctx *ctx, grn_obj *obj);
851
-
852
- GRN_API grn_user_data *grn_obj_user_data(grn_ctx *ctx, grn_obj *obj);
853
-
854
- GRN_API grn_rc grn_obj_set_finalizer(grn_ctx *ctx, grn_obj *obj, grn_proc_func *func);
855
-
856
- GRN_API const char *grn_obj_path(grn_ctx *ctx, grn_obj *obj);
857
- GRN_API int grn_obj_name(grn_ctx *ctx, grn_obj *obj, char *namebuf, int buf_size);
858
-
859
- GRN_API int grn_column_name(grn_ctx *ctx, grn_obj *obj, char *namebuf, int buf_size);
860
-
861
- GRN_API grn_id grn_obj_get_range(grn_ctx *ctx, grn_obj *obj);
862
-
863
- #define GRN_OBJ_GET_DOMAIN(obj) \
864
- ((obj)->header.type == GRN_TABLE_NO_KEY ? GRN_ID_NIL : (obj)->header.domain)
865
-
866
- GRN_API int grn_obj_expire(grn_ctx *ctx, grn_obj *obj, int threshold);
867
- GRN_API int grn_obj_check(grn_ctx *ctx, grn_obj *obj);
868
- GRN_API grn_rc grn_obj_lock(grn_ctx *ctx, grn_obj *obj, grn_id id, int timeout);
869
- GRN_API grn_rc grn_obj_unlock(grn_ctx *ctx, grn_obj *obj, grn_id id);
870
- GRN_API grn_rc grn_obj_clear_lock(grn_ctx *ctx, grn_obj *obj);
871
- GRN_API unsigned int grn_obj_is_locked(grn_ctx *ctx, grn_obj *obj);
872
- GRN_API int grn_obj_defrag(grn_ctx *ctx, grn_obj *obj, int threshold);
873
-
874
- GRN_API grn_obj *grn_obj_db(grn_ctx *ctx, grn_obj *obj);
875
-
876
- GRN_API grn_id grn_obj_id(grn_ctx *ctx, grn_obj *obj);
877
-
878
- typedef struct _grn_search_optarg grn_search_optarg;
879
-
880
- struct _grn_search_optarg {
881
- grn_operator mode;
882
- int similarity_threshold;
883
- int max_interval;
884
- int *weight_vector;
885
- int vector_size;
886
- grn_obj *proc;
887
- int max_size;
888
- };
889
-
890
- GRN_API grn_rc grn_obj_search(grn_ctx *ctx, grn_obj *obj, grn_obj *query,
891
- grn_obj *res, grn_operator op, grn_search_optarg *optarg);
892
-
893
- typedef grn_rc grn_selector_func(grn_ctx *ctx, grn_obj *table, grn_obj *index,
894
- int nargs, grn_obj **args,
895
- grn_obj *res, grn_operator op);
896
-
897
- GRN_API grn_rc grn_proc_set_selector(grn_ctx *ctx, grn_obj *proc,
898
- grn_selector_func selector);
899
-
900
- /*-------------------------------------------------------------
901
- * grn_vector
902
- */
903
-
904
- GRN_API unsigned int grn_vector_size(grn_ctx *ctx, grn_obj *vector);
905
-
906
- GRN_API grn_rc grn_vector_add_element(grn_ctx *ctx, grn_obj *vector,
907
- const char *str, unsigned int str_len,
908
- unsigned int weight, grn_id domain);
909
-
910
- GRN_API unsigned int grn_vector_get_element(grn_ctx *ctx, grn_obj *vector,
911
- unsigned int offset, const char **str,
912
- unsigned int *weight, grn_id *domain);
913
-
914
- /*-------------------------------------------------------------
915
- * grn_uvector
916
- */
917
-
918
- GRN_API unsigned int grn_uvector_size(grn_ctx *ctx, grn_obj *uvector);
919
-
920
- GRN_API grn_rc grn_uvector_add_element(grn_ctx *ctx, grn_obj *vector,
921
- grn_id id, unsigned int weight);
922
-
923
- GRN_API grn_id grn_uvector_get_element(grn_ctx *ctx, grn_obj *uvector,
924
- unsigned int offset,
925
- unsigned int *weight);
926
-
927
- /*-------------------------------------------------------------
928
- * API for hook
929
- */
930
-
931
- GRN_API int grn_proc_call_next(grn_ctx *ctx, grn_obj *exec_info, grn_obj *in, grn_obj *out);
932
- GRN_API void *grn_proc_get_ctx_local_data(grn_ctx *ctx, grn_obj *exec_info);
933
- GRN_API void *grn_proc_get_hook_local_data(grn_ctx *ctx, grn_obj *exec_info);
934
-
935
- typedef enum {
936
- GRN_HOOK_SET = 0,
937
- GRN_HOOK_GET,
938
- GRN_HOOK_INSERT,
939
- GRN_HOOK_DELETE,
940
- GRN_HOOK_SELECT
941
- } grn_hook_entry;
942
-
943
- GRN_API grn_rc grn_obj_add_hook(grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry,
944
- int offset, grn_obj *proc, grn_obj *data);
945
- GRN_API int grn_obj_get_nhooks(grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry);
946
- GRN_API grn_obj *grn_obj_get_hook(grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry,
947
- int offset, grn_obj *data);
948
- GRN_API grn_rc grn_obj_delete_hook(grn_ctx *ctx, grn_obj *obj, grn_hook_entry entry, int offset);
949
-
950
- GRN_API grn_obj *grn_obj_open(grn_ctx *ctx, unsigned char type, grn_obj_flags flags, grn_id domain);
951
-
952
- GRN_API int grn_column_index(grn_ctx *ctx, grn_obj *column, grn_operator op,
953
- grn_obj **indexbuf, int buf_size, int *section);
954
-
955
- GRN_API grn_rc grn_obj_delete_by_id(grn_ctx *ctx, grn_obj *db, grn_id id, grn_bool removep);
956
- GRN_API grn_rc grn_obj_path_by_id(grn_ctx *ctx, grn_obj *db, grn_id id, char *buffer);
957
-
958
- /* geo */
959
-
960
- typedef struct {
961
- int latitude;
962
- int longitude;
963
- } grn_geo_point;
964
-
965
- GRN_API grn_rc grn_geo_select_in_rectangle(grn_ctx *ctx,
966
- grn_obj *index,
967
- grn_obj *top_left_point,
968
- grn_obj *bottom_right_point,
969
- grn_obj *res,
970
- grn_operator op);
971
- GRN_API int grn_geo_estimate_in_rectangle(grn_ctx *ctx,
972
- grn_obj *index,
973
- grn_obj *top_left_point,
974
- grn_obj *bottom_right_point);
975
- GRN_API grn_obj *grn_geo_cursor_open_in_rectangle(grn_ctx *ctx,
976
- grn_obj *index,
977
- grn_obj *top_left_point,
978
- grn_obj *bottom_right_point,
979
- int offset,
980
- int limit);
981
- GRN_API grn_posting *grn_geo_cursor_next(grn_ctx *ctx, grn_obj *cursor);
982
-
983
-
984
- /* query & snippet */
985
-
986
- #ifndef GRN_QUERY_AND
987
- #define GRN_QUERY_AND '+'
988
- #endif /* GRN_QUERY_AND */
989
- #ifndef GRN_QUERY_AND_NOT
990
- # ifdef GRN_QUERY_BUT
991
- /* Deprecated. Just for backward compatibility. */
992
- # define GRN_QUERY_AND_NOT GRN_QUERY_BUT
993
- # else
994
- # define GRN_QUERY_AND_NOT '-'
995
- # endif /* GRN_QUERY_BUT */
996
- #endif /* GRN_QUERY_AND_NOT */
997
- #ifndef GRN_QUERY_ADJ_INC
998
- #define GRN_QUERY_ADJ_INC '>'
999
- #endif /* GRN_QUERY_ADJ_POS2 */
1000
- #ifndef GRN_QUERY_ADJ_DEC
1001
- #define GRN_QUERY_ADJ_DEC '<'
1002
- #endif /* GRN_QUERY_ADJ_POS1 */
1003
- #ifndef GRN_QUERY_ADJ_NEG
1004
- #define GRN_QUERY_ADJ_NEG '~'
1005
- #endif /* GRN_QUERY_ADJ_NEG */
1006
- #ifndef GRN_QUERY_PREFIX
1007
- #define GRN_QUERY_PREFIX '*'
1008
- #endif /* GRN_QUERY_PREFIX */
1009
- #ifndef GRN_QUERY_PARENL
1010
- #define GRN_QUERY_PARENL '('
1011
- #endif /* GRN_QUERY_PARENL */
1012
- #ifndef GRN_QUERY_PARENR
1013
- #define GRN_QUERY_PARENR ')'
1014
- #endif /* GRN_QUERY_PARENR */
1015
- #ifndef GRN_QUERY_QUOTEL
1016
- #define GRN_QUERY_QUOTEL '"'
1017
- #endif /* GRN_QUERY_QUOTEL */
1018
- #ifndef GRN_QUERY_QUOTER
1019
- #define GRN_QUERY_QUOTER '"'
1020
- #endif /* GRN_QUERY_QUOTER */
1021
- #ifndef GRN_QUERY_ESCAPE
1022
- #define GRN_QUERY_ESCAPE '\\'
1023
- #endif /* GRN_QUERY_ESCAPE */
1024
- #ifndef GRN_QUERY_COLUMN
1025
- #define GRN_QUERY_COLUMN ':'
1026
- #endif /* GRN_QUERY_COLUMN */
1027
-
1028
- typedef struct _grn_snip_mapping grn_snip_mapping;
1029
-
1030
- struct _grn_snip_mapping {
1031
- void *dummy;
1032
- };
1033
-
1034
- #define GRN_SNIP_NORMALIZE (0x01<<0)
1035
- #define GRN_SNIP_COPY_TAG (0x01<<1)
1036
- #define GRN_SNIP_SKIP_LEADING_SPACES (0x01<<2)
1037
-
1038
- #define GRN_SNIP_MAPPING_HTML_ESCAPE ((grn_snip_mapping *)-1)
1039
-
1040
- GRN_API grn_obj *grn_snip_open(grn_ctx *ctx, int flags, unsigned int width,
1041
- unsigned int max_results,
1042
- const char *defaultopentag, unsigned int defaultopentag_len,
1043
- const char *defaultclosetag, unsigned int defaultclosetag_len,
1044
- grn_snip_mapping *mapping);
1045
- GRN_API grn_rc grn_snip_add_cond(grn_ctx *ctx, grn_obj *snip,
1046
- const char *keyword, unsigned int keyword_len,
1047
- const char *opentag, unsigned int opentag_len,
1048
- const char *closetag, unsigned int closetag_len);
1049
- GRN_API grn_rc grn_snip_set_normalizer(grn_ctx *ctx, grn_obj *snip,
1050
- grn_obj *normalizer);
1051
- GRN_API grn_obj *grn_snip_get_normalizer(grn_ctx *ctx, grn_obj *snip);
1052
- GRN_API grn_rc grn_snip_exec(grn_ctx *ctx, grn_obj *snip,
1053
- const char *string, unsigned int string_len,
1054
- unsigned int *nresults, unsigned int *max_tagged_len);
1055
- GRN_API grn_rc grn_snip_get_result(grn_ctx *ctx, grn_obj *snip, const unsigned int index,
1056
- char *result, unsigned int *result_len);
1057
-
1058
- /* log */
1059
-
1060
- #define GRN_LOG_TIME (0x01<<0)
1061
- #define GRN_LOG_TITLE (0x01<<1)
1062
- #define GRN_LOG_MESSAGE (0x01<<2)
1063
- #define GRN_LOG_LOCATION (0x01<<3)
1064
-
1065
- /* Deprecated since 2.1.2. Use grn_logger instead. */
1066
- typedef struct _grn_logger_info grn_logger_info;
1067
-
1068
- /* Deprecated since 2.1.2. Use grn_logger instead. */
1069
- struct _grn_logger_info {
1070
- grn_log_level max_level;
1071
- int flags;
1072
- void (*func)(int, const char *, const char *, const char *, const char *, void *);
1073
- void *func_arg;
1074
- };
1075
-
1076
- /* Deprecated since 2.1.2. Use grn_logger_set() instead. */
1077
- GRN_API grn_rc grn_logger_info_set(grn_ctx *ctx, const grn_logger_info *info);
1078
-
1079
- typedef struct _grn_logger grn_logger;
1080
-
1081
- struct _grn_logger {
1082
- grn_log_level max_level;
1083
- int flags;
1084
- void *user_data;
1085
- void (*log)(grn_ctx *ctx, grn_log_level level,
1086
- const char *timestamp, const char *title, const char *message,
1087
- const char *location, void *user_data);
1088
- void (*reopen)(grn_ctx *ctx, void *user_data);
1089
- void (*fin)(grn_ctx *ctx, void *user_data);
1090
- };
1091
-
1092
- GRN_API grn_rc grn_logger_set(grn_ctx *ctx, const grn_logger *logger);
1093
-
1094
- GRN_API void grn_logger_set_max_level(grn_ctx *ctx, grn_log_level max_level);
1095
- GRN_API grn_log_level grn_logger_get_max_level(grn_ctx *ctx);
1096
-
1097
- #ifdef __GNUC__
1098
- #define GRN_ATTRIBUTE_PRINTF(fmt_pos) \
1099
- __attribute__ ((format(printf, fmt_pos, fmt_pos + 1)))
1100
- #else
1101
- #define GRN_ATTRIBUTE_PRINTF(fmt_pos)
1102
- #endif /* __GNUC__ */
1103
-
1104
- GRN_API void grn_logger_put(grn_ctx *ctx, grn_log_level level,
1105
- const char *file, int line, const char *func, const char *fmt, ...) GRN_ATTRIBUTE_PRINTF(6);
1106
- GRN_API void grn_logger_reopen(grn_ctx *ctx);
1107
-
1108
- GRN_API grn_bool grn_logger_pass(grn_ctx *ctx, grn_log_level level);
1109
-
1110
- #ifndef GRN_LOG_DEFAULT_LEVEL
1111
- #define GRN_LOG_DEFAULT_LEVEL GRN_LOG_NOTICE
1112
- #endif /* GRN_LOG_DEFAULT_LEVEL */
1113
-
1114
- GRN_API void grn_default_logger_set_max_level(grn_log_level level);
1115
- GRN_API grn_log_level grn_default_logger_get_max_level(void);
1116
- GRN_API void grn_default_logger_set_path(const char *path);
1117
- GRN_API const char *grn_default_logger_get_path(void);
1118
-
1119
- #define GRN_LOG(ctx,level,...) do {\
1120
- if (grn_logger_pass(ctx, level)) {\
1121
- grn_logger_put(ctx, (level), __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__); \
1122
- }\
1123
- } while (0)
1124
-
1125
- typedef struct _grn_query_logger grn_query_logger;
1126
-
1127
- struct _grn_query_logger {
1128
- unsigned int flags;
1129
- void *user_data;
1130
- void (*log)(grn_ctx *ctx, unsigned int flag,
1131
- const char *timestamp, const char *info, const char *message,
1132
- void *user_data);
1133
- void (*reopen)(grn_ctx *ctx, void *user_data);
1134
- void (*fin)(grn_ctx *ctx, void *user_data);
1135
- };
1136
-
1137
- GRN_API grn_rc grn_query_logger_set(grn_ctx *ctx, const grn_query_logger *logger);
1138
-
1139
- GRN_API void grn_query_logger_put(grn_ctx *ctx, unsigned int flag,
1140
- const char *mark,
1141
- const char *format, ...) GRN_ATTRIBUTE_PRINTF(4);
1142
- GRN_API void grn_query_logger_reopen(grn_ctx *ctx);
1143
-
1144
- GRN_API grn_bool grn_query_logger_pass(grn_ctx *ctx, unsigned int flag);
1145
-
1146
- GRN_API void grn_default_query_logger_set_flags(unsigned int flags);
1147
- GRN_API unsigned int grn_default_query_logger_get_flags(void);
1148
- GRN_API void grn_default_query_logger_set_path(const char *path);
1149
- GRN_API const char *grn_default_query_logger_get_path(void);
1150
-
1151
- #define GRN_QUERY_LOG(ctx, flag, mark, format, ...) do {\
1152
- if (grn_query_logger_pass(ctx, flag)) {\
1153
- grn_query_logger_put(ctx, (flag), (mark), format, __VA_ARGS__);\
1154
- }\
1155
- } while (0)
1156
-
1157
- /* grn_bulk */
1158
-
1159
- #define GRN_BULK_BUFSIZE (sizeof(grn_obj) - sizeof(grn_obj_header))
1160
- /* This assumes that GRN_BULK_BUFSIZE is less than 32 (= 0x20). */
1161
- #define GRN_BULK_BUFSIZE_MAX 0x1f
1162
- #define GRN_BULK_SIZE_IN_FLAGS(flags) ((flags) & GRN_BULK_BUFSIZE_MAX)
1163
- #define GRN_BULK_OUTP(bulk) ((bulk)->header.impl_flags & GRN_OBJ_OUTPLACE)
1164
- #define GRN_BULK_REWIND(bulk) do {\
1165
- if ((bulk)->header.type == GRN_VECTOR) {\
1166
- grn_obj *_body = (bulk)->u.v.body;\
1167
- if (_body) {\
1168
- if (GRN_BULK_OUTP(_body)) {\
1169
- (_body)->u.b.curr = (_body)->u.b.head;\
1170
- } else {\
1171
- (_body)->header.flags &= ~GRN_BULK_BUFSIZE_MAX;\
1172
- }\
1173
- }\
1174
- (bulk)->u.v.n_sections = 0;\
1175
- } else {\
1176
- if (GRN_BULK_OUTP(bulk)) {\
1177
- (bulk)->u.b.curr = (bulk)->u.b.head;\
1178
- } else {\
1179
- (bulk)->header.flags &= ~GRN_BULK_BUFSIZE_MAX;\
1180
- }\
1181
- }\
1182
- } while (0)
1183
- #define GRN_BULK_WSIZE(bulk) \
1184
- (GRN_BULK_OUTP(bulk)\
1185
- ? ((bulk)->u.b.tail - (bulk)->u.b.head)\
1186
- : GRN_BULK_BUFSIZE)
1187
- #define GRN_BULK_REST(bulk) \
1188
- (GRN_BULK_OUTP(bulk)\
1189
- ? ((bulk)->u.b.tail - (bulk)->u.b.curr)\
1190
- : GRN_BULK_BUFSIZE - GRN_BULK_SIZE_IN_FLAGS((bulk)->header.flags))
1191
- #define GRN_BULK_VSIZE(bulk) \
1192
- (GRN_BULK_OUTP(bulk)\
1193
- ? ((bulk)->u.b.curr - (bulk)->u.b.head)\
1194
- : GRN_BULK_SIZE_IN_FLAGS((bulk)->header.flags))
1195
- #define GRN_BULK_EMPTYP(bulk) \
1196
- (GRN_BULK_OUTP(bulk)\
1197
- ? ((bulk)->u.b.curr == (bulk)->u.b.head)\
1198
- : !(GRN_BULK_SIZE_IN_FLAGS((bulk)->header.flags)))
1199
- #define GRN_BULK_HEAD(bulk) \
1200
- (GRN_BULK_OUTP(bulk)\
1201
- ? ((bulk)->u.b.head)\
1202
- : (char *)&((bulk)->u.b.head))
1203
- #define GRN_BULK_CURR(bulk) \
1204
- (GRN_BULK_OUTP(bulk)\
1205
- ? ((bulk)->u.b.curr)\
1206
- : (char *)&((bulk)->u.b.head) + GRN_BULK_SIZE_IN_FLAGS((bulk)->header.flags))
1207
- #define GRN_BULK_TAIL(bulk) \
1208
- (GRN_BULK_OUTP(bulk)\
1209
- ? ((bulk)->u.b.tail)\
1210
- : (char *)&((bulk)[1]))
1211
-
1212
- GRN_API grn_rc grn_bulk_reinit(grn_ctx *ctx, grn_obj *bulk, unsigned int size);
1213
- GRN_API grn_rc grn_bulk_resize(grn_ctx *ctx, grn_obj *bulk, unsigned int newsize);
1214
- GRN_API grn_rc grn_bulk_write(grn_ctx *ctx, grn_obj *bulk,
1215
- const char *str, unsigned int len);
1216
- GRN_API grn_rc grn_bulk_write_from(grn_ctx *ctx, grn_obj *bulk,
1217
- const char *str, unsigned int from, unsigned int len);
1218
- GRN_API grn_rc grn_bulk_reserve(grn_ctx *ctx, grn_obj *bulk, unsigned int len);
1219
- GRN_API grn_rc grn_bulk_space(grn_ctx *ctx, grn_obj *bulk, unsigned int len);
1220
- GRN_API grn_rc grn_bulk_truncate(grn_ctx *ctx, grn_obj *bulk, unsigned int len);
1221
- GRN_API grn_rc grn_bulk_fin(grn_ctx *ctx, grn_obj *bulk);
1222
-
1223
- /* grn_text */
1224
-
1225
- GRN_API grn_rc grn_text_itoa(grn_ctx *ctx, grn_obj *bulk, int i);
1226
- GRN_API grn_rc grn_text_itoa_padded(grn_ctx *ctx, grn_obj *bulk, int i, char ch, unsigned int len);
1227
- GRN_API grn_rc grn_text_lltoa(grn_ctx *ctx, grn_obj *bulk, long long int i);
1228
- GRN_API grn_rc grn_text_ftoa(grn_ctx *ctx, grn_obj *bulk, double d);
1229
- GRN_API grn_rc grn_text_itoh(grn_ctx *ctx, grn_obj *bulk, int i, unsigned int len);
1230
- GRN_API grn_rc grn_text_itob(grn_ctx *ctx, grn_obj *bulk, grn_id id);
1231
- GRN_API grn_rc grn_text_lltob32h(grn_ctx *ctx, grn_obj *bulk, long long int i);
1232
- GRN_API grn_rc grn_text_benc(grn_ctx *ctx, grn_obj *bulk, unsigned int v);
1233
- GRN_API grn_rc grn_text_esc(grn_ctx *ctx, grn_obj *bulk, const char *s, unsigned int len);
1234
- GRN_API grn_rc grn_text_urlenc(grn_ctx *ctx, grn_obj *buf,
1235
- const char *str, unsigned int len);
1236
- GRN_API const char *grn_text_urldec(grn_ctx *ctx, grn_obj *buf,
1237
- const char *s, const char *e, char d);
1238
- GRN_API grn_rc grn_text_escape_xml(grn_ctx *ctx, grn_obj *buf,
1239
- const char *s, unsigned int len);
1240
- GRN_API grn_rc grn_text_time2rfc1123(grn_ctx *ctx, grn_obj *bulk, int sec);
1241
- GRN_API grn_rc grn_text_printf(grn_ctx *ctx, grn_obj *bulk,
1242
- const char *format, ...) GRN_ATTRIBUTE_PRINTF(3);
1243
- GRN_API grn_rc grn_text_vprintf(grn_ctx *ctx, grn_obj *bulk,
1244
- const char *format, va_list args);
1245
-
1246
- typedef struct _grn_obj_format grn_obj_format;
1247
-
1248
- #define GRN_OBJ_FORMAT_WITH_COLUMN_NAMES (0x01<<0)
1249
- #define GRN_OBJ_FORMAT_AS_ARRAY (0x01<<3)
1250
- /* Deprecated since 4.0.1. It will be removed at 5.0.0.
1251
- Use GRN_OBJ_FORMAT_AS_ARRAY instead.*/
1252
- #define GRN_OBJ_FORMAT_ASARRAY GRN_OBJ_FORMAT_AS_ARRAY
1253
- #define GRN_OBJ_FORMAT_WITH_WEIGHT (0x01<<4)
1254
-
1255
- struct _grn_obj_format {
1256
- grn_obj columns;
1257
- const void *min;
1258
- const void *max;
1259
- unsigned int min_size;
1260
- unsigned int max_size;
1261
- int nhits;
1262
- int offset;
1263
- int limit;
1264
- int hits_offset;
1265
- int flags;
1266
- grn_obj *expression;
1267
- };
1268
-
1269
- #define GRN_OBJ_FORMAT_INIT(format,format_nhits,format_offset,format_limit,format_hits_offset) do { \
1270
- GRN_PTR_INIT(&(format)->columns, GRN_OBJ_VECTOR, GRN_ID_NIL);\
1271
- (format)->nhits = (format_nhits);\
1272
- (format)->offset = (format_offset);\
1273
- (format)->limit = (format_limit);\
1274
- (format)->hits_offset = (format_hits_offset);\
1275
- (format)->flags = 0;\
1276
- (format)->expression = NULL;\
1277
- } while (0)
1278
-
1279
- #define GRN_OBJ_FORMAT_FIN(ctx,format) do {\
1280
- int ncolumns = GRN_BULK_VSIZE(&(format)->columns) / sizeof(grn_obj *);\
1281
- grn_obj **columns = (grn_obj **)GRN_BULK_HEAD(&(format)->columns);\
1282
- while (ncolumns--) { grn_obj_unlink((ctx), *columns++); }\
1283
- GRN_OBJ_FIN((ctx), &(format)->columns);\
1284
- if ((format)->expression) { GRN_OBJ_FIN((ctx), (format)->expression); } \
1285
- } while (0)
1286
-
1287
- GRN_API void grn_output_obj(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type,
1288
- grn_obj *obj, grn_obj_format *format);
1289
- GRN_API void grn_output_envelope(grn_ctx *ctx, grn_rc rc,
1290
- grn_obj *head, grn_obj *body, grn_obj *foot,
1291
- const char *file, int line);
1292
-
1293
- GRN_API void grn_ctx_output_array_open(grn_ctx *ctx,
1294
- const char *name, int nelements);
1295
- GRN_API void grn_ctx_output_array_close(grn_ctx *ctx);
1296
- GRN_API void grn_ctx_output_map_open(grn_ctx *ctx,
1297
- const char *name, int nelements);
1298
- GRN_API void grn_ctx_output_map_close(grn_ctx *ctx);
1299
- GRN_API void grn_ctx_output_int32(grn_ctx *ctx, int value);
1300
- GRN_API void grn_ctx_output_int64(grn_ctx *ctx, long long int value);
1301
- GRN_API void grn_ctx_output_float(grn_ctx *ctx, double value);
1302
- GRN_API void grn_ctx_output_cstr(grn_ctx *ctx, const char *value);
1303
- GRN_API void grn_ctx_output_str(grn_ctx *ctx,
1304
- const char *value, unsigned int value_len);
1305
- GRN_API void grn_ctx_output_bool(grn_ctx *ctx, grn_bool value);
1306
- GRN_API void grn_ctx_output_obj(grn_ctx *ctx,
1307
- grn_obj *value, grn_obj_format *format);
1308
-
1309
-
1310
- GRN_API grn_content_type grn_ctx_get_output_type(grn_ctx *ctx);
1311
- GRN_API grn_rc grn_ctx_set_output_type(grn_ctx *ctx, grn_content_type type);
1312
- GRN_API const char *grn_ctx_get_mime_type(grn_ctx *ctx);
1313
- GRN_API void grn_ctx_recv_handler_set(grn_ctx *,
1314
- void (*func)(grn_ctx *, int, void *),
1315
- void *func_arg);
1316
-
1317
- /* obsolete */
1318
- GRN_API grn_rc grn_text_otoj(grn_ctx *ctx, grn_obj *bulk, grn_obj *obj,
1319
- grn_obj_format *format);
1320
-
1321
- /* various values exchanged via grn_obj */
1322
-
1323
- #define GRN_OBJ_DO_SHALLOW_COPY (GRN_OBJ_REFER|GRN_OBJ_OUTPLACE)
1324
- #define GRN_OBJ_VECTOR (0x01<<7)
1325
-
1326
- #define GRN_OBJ_MUTABLE(obj) ((obj) && (obj)->header.type <= GRN_VECTOR)
1327
-
1328
- #define GRN_VALUE_FIX_SIZE_INIT(obj,flags,domain)\
1329
- GRN_OBJ_INIT((obj), ((flags) & GRN_OBJ_VECTOR) ? GRN_UVECTOR : GRN_BULK,\
1330
- ((flags) & GRN_OBJ_DO_SHALLOW_COPY), (domain))
1331
- #define GRN_VALUE_VAR_SIZE_INIT(obj,flags,domain)\
1332
- GRN_OBJ_INIT((obj), ((flags) & GRN_OBJ_VECTOR) ? GRN_VECTOR : GRN_BULK,\
1333
- ((flags) & GRN_OBJ_DO_SHALLOW_COPY), (domain))
1334
-
1335
- #define GRN_VOID_INIT(obj) GRN_OBJ_INIT((obj), GRN_VOID, 0, GRN_DB_VOID)
1336
- #define GRN_TEXT_INIT(obj,flags) \
1337
- GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_TEXT)
1338
- #define GRN_SHORT_TEXT_INIT(obj,flags) \
1339
- GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_SHORT_TEXT)
1340
- #define GRN_LONG_TEXT_INIT(obj,flags) \
1341
- GRN_VALUE_VAR_SIZE_INIT(obj, flags, GRN_DB_LONG_TEXT)
1342
- #define GRN_TEXT_SET_REF(obj,str,len) do {\
1343
- (obj)->u.b.head = (char *)(str);\
1344
- (obj)->u.b.curr = (char *)(str) + (len);\
1345
- } while (0)
1346
- #define GRN_TEXT_SET(ctx,obj,str,len) do {\
1347
- if ((obj)->header.impl_flags & GRN_OBJ_REFER) {\
1348
- GRN_TEXT_SET_REF((obj), (str), (len));\
1349
- } else {\
1350
- grn_bulk_write_from((ctx), (obj), (const char *)(str), 0, (unsigned int)(len));\
1351
- }\
1352
- } while (0)
1353
- #define GRN_TEXT_PUT(ctx,obj,str,len) \
1354
- grn_bulk_write((ctx), (obj), (const char *)(str), (unsigned int)(len))
1355
- #define GRN_TEXT_PUTC(ctx,obj,c) do {\
1356
- char _c = (c); grn_bulk_write((ctx), (obj), &_c, 1);\
1357
- } while (0)
1358
-
1359
- #define GRN_TEXT_PUTS(ctx,obj,str) GRN_TEXT_PUT((ctx), (obj), (str), strlen(str))
1360
- #define GRN_TEXT_SETS(ctx,obj,str) GRN_TEXT_SET((ctx), (obj), (str), strlen(str))
1361
- #define GRN_TEXT_VALUE(obj) GRN_BULK_HEAD(obj)
1362
- #define GRN_TEXT_LEN(obj) GRN_BULK_VSIZE(obj)
1363
-
1364
- #define GRN_BOOL_INIT(obj,flags) \
1365
- GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_BOOL)
1366
- #define GRN_INT8_INIT(obj,flags) \
1367
- GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT8)
1368
- #define GRN_UINT8_INIT(obj,flags) \
1369
- GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT8)
1370
- #define GRN_INT16_INIT(obj,flags) \
1371
- GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT16)
1372
- #define GRN_UINT16_INIT(obj,flags) \
1373
- GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT16)
1374
- #define GRN_INT32_INIT(obj,flags) \
1375
- GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT32)
1376
- #define GRN_UINT32_INIT(obj,flags) \
1377
- GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT32)
1378
- #define GRN_INT64_INIT(obj,flags) \
1379
- GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_INT64)
1380
- #define GRN_UINT64_INIT(obj,flags) \
1381
- GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_UINT64)
1382
- #define GRN_FLOAT_INIT(obj,flags) \
1383
- GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_FLOAT)
1384
- #define GRN_TIME_INIT(obj,flags) \
1385
- GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_TIME)
1386
- #define GRN_RECORD_INIT GRN_VALUE_FIX_SIZE_INIT
1387
- #define GRN_PTR_INIT(obj,flags,domain)\
1388
- GRN_OBJ_INIT((obj), ((flags) & GRN_OBJ_VECTOR) ? GRN_PVECTOR : GRN_PTR,\
1389
- ((flags) & GRN_OBJ_DO_SHALLOW_COPY), (domain))
1390
- #define GRN_TOKYO_GEO_POINT_INIT(obj,flags) \
1391
- GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_TOKYO_GEO_POINT)
1392
- #define GRN_WGS84_GEO_POINT_INIT(obj,flags) \
1393
- GRN_VALUE_FIX_SIZE_INIT(obj, flags, GRN_DB_WGS84_GEO_POINT)
1394
-
1395
- #define GRN_BOOL_SET(ctx,obj,val) do {\
1396
- unsigned char _val = (unsigned char)(val);\
1397
- grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(unsigned char));\
1398
- } while (0)
1399
- #define GRN_INT8_SET(ctx,obj,val) do {\
1400
- signed char _val = (signed char)(val);\
1401
- grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(signed char));\
1402
- } while (0)
1403
- #define GRN_UINT8_SET(ctx,obj,val) do {\
1404
- unsigned char _val = (unsigned char)(val);\
1405
- grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(unsigned char));\
1406
- } while (0)
1407
- #define GRN_INT16_SET(ctx,obj,val) do {\
1408
- signed short _val = (signed short)(val);\
1409
- grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(signed short));\
1410
- } while (0)
1411
- #define GRN_UINT16_SET(ctx,obj,val) do {\
1412
- unsigned short _val = (unsigned short)(val);\
1413
- grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(unsigned short));\
1414
- } while (0)
1415
- #define GRN_INT32_SET(ctx,obj,val) do {\
1416
- int _val = (int)(val);\
1417
- grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(int));\
1418
- } while (0)
1419
- #define GRN_UINT32_SET(ctx,obj,val) do {\
1420
- unsigned int _val = (unsigned int)(val);\
1421
- grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(unsigned int));\
1422
- } while (0)
1423
- #define GRN_INT64_SET(ctx,obj,val) do {\
1424
- long long int _val = (long long int)(val);\
1425
- grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(long long int));\
1426
- } while (0)
1427
- #define GRN_UINT64_SET(ctx,obj,val) do {\
1428
- long long unsigned int _val = (long long unsigned int)(val);\
1429
- grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(long long unsigned int));\
1430
- } while (0)
1431
- #define GRN_FLOAT_SET(ctx,obj,val) do {\
1432
- double _val = (double)(val);\
1433
- grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(double));\
1434
- } while (0)
1435
- #define GRN_TIME_SET GRN_INT64_SET
1436
- #define GRN_RECORD_SET(ctx,obj,val) do {\
1437
- grn_id _val = (grn_id)(val);\
1438
- grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(grn_id));\
1439
- } while (0)
1440
- #define GRN_PTR_SET(ctx,obj,val) do {\
1441
- grn_obj *_val = (grn_obj *)(val);\
1442
- grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(grn_obj *));\
1443
- } while (0)
1444
-
1445
- #define GRN_GEO_DEGREE2MSEC(degree)\
1446
- ((int)((degree) * 3600 * 1000 + ((degree) > 0 ? 0.5 : -0.5)))
1447
- #define GRN_GEO_MSEC2DEGREE(msec)\
1448
- ((((int)(msec)) / 3600.0) * 0.001)
1449
-
1450
- #define GRN_GEO_POINT_SET(ctx,obj,_latitude,_longitude) do {\
1451
- grn_geo_point _val;\
1452
- _val.latitude = (int)(_latitude);\
1453
- _val.longitude = (int)(_longitude);\
1454
- grn_bulk_write_from((ctx), (obj), (char *)&_val, 0, sizeof(grn_geo_point));\
1455
- } while (0)
1456
-
1457
- #define GRN_BOOL_SET_AT(ctx,obj,offset,val) do {\
1458
- unsigned char _val = (unsigned char)(val);\
1459
- grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1460
- (offset), sizeof(unsigned char));\
1461
- } while (0)
1462
- #define GRN_INT8_SET_AT(ctx,obj,offset,val) do {\
1463
- signed char _val = (signed char)(val);\
1464
- grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1465
- (offset) * sizeof(signed char), sizeof(signed char));\
1466
- } while (0)
1467
- #define GRN_UINT8_SET_AT(ctx,obj,offset,val) do { \
1468
- unsigned char _val = (unsigned char)(val);\
1469
- grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1470
- (offset) * sizeof(unsigned char), sizeof(unsigned char));\
1471
- } while (0)
1472
- #define GRN_INT16_SET_AT(ctx,obj,offset,val) do {\
1473
- signed short _val = (signed short)(val);\
1474
- grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1475
- (offset) * sizeof(signed short), sizeof(signed short));\
1476
- } while (0)
1477
- #define GRN_UINT16_SET_AT(ctx,obj,offset,val) do { \
1478
- unsigned short _val = (unsigned short)(val);\
1479
- grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1480
- (offset) * sizeof(unsigned short), sizeof(unsigned short));\
1481
- } while (0)
1482
- #define GRN_INT32_SET_AT(ctx,obj,offset,val) do {\
1483
- int _val = (int)(val);\
1484
- grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1485
- (offset) * sizeof(int), sizeof(int));\
1486
- } while (0)
1487
- #define GRN_UINT32_SET_AT(ctx,obj,offset,val) do { \
1488
- unsigned int _val = (unsigned int)(val);\
1489
- grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1490
- (offset) * sizeof(unsigned int), sizeof(unsigned int));\
1491
- } while (0)
1492
- #define GRN_INT64_SET_AT(ctx,obj,offset,val) do {\
1493
- long long int _val = (long long int)(val);\
1494
- grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1495
- (offset) * sizeof(long long int), sizeof(long long int));\
1496
- } while (0)
1497
- #define GRN_UINT64_SET_AT(ctx,obj,offset,val) do {\
1498
- long long unsigned int _val = (long long unsigned int)(val);\
1499
- grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1500
- (offset) * sizeof(long long unsigned int),\
1501
- sizeof(long long unsigned int));\
1502
- } while (0)
1503
- #define GRN_FLOAT_SET_AT(ctx,obj,offset,val) do {\
1504
- double _val = (double)(val);\
1505
- grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1506
- (offset) * sizeof(double), sizeof(double));\
1507
- } while (0)
1508
- #define GRN_TIME_SET_AT GRN_INT64_SET_AT
1509
- #define GRN_RECORD_SET_AT(ctx,obj,offset,val) do {\
1510
- grn_id _val = (grn_id)(val);\
1511
- grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1512
- (offset) * sizeof(grn_id), sizeof(grn_id));\
1513
- } while (0)
1514
- #define GRN_PTR_SET_AT(ctx,obj,offset,val) do {\
1515
- grn_obj *_val = (grn_obj *)(val);\
1516
- grn_bulk_write_from((ctx), (obj), (char *)&_val,\
1517
- (offset) * sizeof(grn_obj *), sizeof(grn_obj *));\
1518
- } while (0)
1519
-
1520
- #define GRN_TIME_USEC_PER_SEC 1000000
1521
- #define GRN_TIME_PACK(sec, usec) ((long long int)(sec) * GRN_TIME_USEC_PER_SEC + (usec))
1522
- #define GRN_TIME_UNPACK(time_value, sec, usec) do {\
1523
- sec = (time_value) / GRN_TIME_USEC_PER_SEC;\
1524
- usec = (time_value) % GRN_TIME_USEC_PER_SEC;\
1525
- } while (0)
1526
-
1527
- GRN_API void grn_time_now(grn_ctx *ctx, grn_obj *obj);
1528
-
1529
- #define GRN_TIME_NOW(ctx,obj) (grn_time_now((ctx), (obj)))
1530
-
1531
- #define GRN_BOOL_VALUE(obj) (*((unsigned char *)GRN_BULK_HEAD(obj)))
1532
- #define GRN_INT8_VALUE(obj) (*((signed char *)GRN_BULK_HEAD(obj)))
1533
- #define GRN_UINT8_VALUE(obj) (*((unsigned char *)GRN_BULK_HEAD(obj)))
1534
- #define GRN_INT16_VALUE(obj) (*((signed short *)GRN_BULK_HEAD(obj)))
1535
- #define GRN_UINT16_VALUE(obj) (*((unsigned short *)GRN_BULK_HEAD(obj)))
1536
- #define GRN_INT32_VALUE(obj) (*((int *)GRN_BULK_HEAD(obj)))
1537
- #define GRN_UINT32_VALUE(obj) (*((unsigned int *)GRN_BULK_HEAD(obj)))
1538
- #define GRN_INT64_VALUE(obj) (*((long long int *)GRN_BULK_HEAD(obj)))
1539
- #define GRN_UINT64_VALUE(obj) (*((long long unsigned int *)GRN_BULK_HEAD(obj)))
1540
- #define GRN_FLOAT_VALUE(obj) (*((double *)GRN_BULK_HEAD(obj)))
1541
- #define GRN_TIME_VALUE GRN_INT64_VALUE
1542
- #define GRN_RECORD_VALUE(obj) (*((grn_id *)GRN_BULK_HEAD(obj)))
1543
- #define GRN_PTR_VALUE(obj) (*((grn_obj **)GRN_BULK_HEAD(obj)))
1544
- #define GRN_GEO_POINT_VALUE(obj,_latitude,_longitude) do {\
1545
- grn_geo_point *_val = (grn_geo_point *)GRN_BULK_HEAD(obj);\
1546
- _latitude = _val->latitude;\
1547
- _longitude = _val->longitude;\
1548
- } while (0)
1549
-
1550
- #define GRN_BOOL_VALUE_AT(obj,offset) (((unsigned char *)GRN_BULK_HEAD(obj))[offset])
1551
- #define GRN_INT8_VALUE_AT(obj,offset) (((signed char *)GRN_BULK_HEAD(obj))[offset])
1552
- #define GRN_UINT8_VALUE_AT(obj,offset) (((unsigned char *)GRN_BULK_HEAD(obj))[offset])
1553
- #define GRN_INT16_VALUE_AT(obj,offset) (((signed short *)GRN_BULK_HEAD(obj))[offset])
1554
- #define GRN_UINT16_VALUE_AT(obj,offset) (((unsigned short *)GRN_BULK_HEAD(obj))[offset])
1555
- #define GRN_INT32_VALUE_AT(obj,offset) (((int *)GRN_BULK_HEAD(obj))[offset])
1556
- #define GRN_UINT32_VALUE_AT(obj,offset) (((unsigned int *)GRN_BULK_HEAD(obj))[offset])
1557
- #define GRN_INT64_VALUE_AT(obj,offset) (((long long int *)GRN_BULK_HEAD(obj))[offset])
1558
- #define GRN_UINT64_VALUE_AT(obj,offset) (((long long unsigned int *)GRN_BULK_HEAD(obj))[offset])
1559
- #define GRN_FLOAT_VALUE_AT(obj,offset) (((double *)GRN_BULK_HEAD(obj))[offset])
1560
- #define GRN_TIME_VALUE_AT GRN_INT64_VALUE_AT
1561
- #define GRN_RECORD_VALUE_AT(obj,offset) (((grn_id *)GRN_BULK_HEAD(obj))[offset])
1562
- #define GRN_PTR_VALUE_AT(obj,offset) (((grn_obj **)GRN_BULK_HEAD(obj))[offset])
1563
-
1564
- #define GRN_BOOL_PUT(ctx,obj,val) do {\
1565
- unsigned char _val = (unsigned char)(val);\
1566
- grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(unsigned char));\
1567
- } while (0)
1568
- #define GRN_INT8_PUT(ctx,obj,val) do {\
1569
- signed char _val = (signed char)(val); grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(signed char));\
1570
- } while (0)
1571
- #define GRN_UINT8_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_INT16_PUT(ctx,obj,val) do {\
1576
- signed short _val = (signed short)(val); grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(signed short));\
1577
- } while (0)
1578
- #define GRN_UINT16_PUT(ctx,obj,val) do {\
1579
- unsigned short _val = (unsigned short)(val);\
1580
- grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(unsigned short));\
1581
- } while (0)
1582
- #define GRN_INT32_PUT(ctx,obj,val) do {\
1583
- int _val = (int)(val); grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(int));\
1584
- } while (0)
1585
- #define GRN_UINT32_PUT(ctx,obj,val) do {\
1586
- unsigned int _val = (unsigned int)(val);\
1587
- grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(unsigned int));\
1588
- } while (0)
1589
- #define GRN_INT64_PUT(ctx,obj,val) do {\
1590
- long long int _val = (long long int)(val);\
1591
- grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(long long int));\
1592
- } while (0)
1593
- #define GRN_UINT64_PUT(ctx,obj,val) do {\
1594
- long long unsigned int _val = (long long unsigned int)(val);\
1595
- grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(long long unsigned int));\
1596
- } while (0)
1597
- #define GRN_FLOAT_PUT(ctx,obj,val) do {\
1598
- double _val = (double)(val); grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(double));\
1599
- } while (0)
1600
- #define GRN_TIME_PUT GRN_INT64_PUT
1601
- #define GRN_RECORD_PUT(ctx,obj,val) do {\
1602
- grn_id _val = (grn_id)(val); grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(grn_id));\
1603
- } while (0)
1604
- #define GRN_PTR_PUT(ctx,obj,val) do {\
1605
- grn_obj *_val = (grn_obj *)(val);\
1606
- grn_bulk_write((ctx), (obj), (char *)&_val, sizeof(grn_obj *));\
1607
- } while (0)
1608
-
1609
- /* grn_str: deprecated. use grn_string instead. */
1610
-
1611
- typedef struct {
1612
- const char *orig;
1613
- char *norm;
1614
- short *checks;
1615
- unsigned char *ctypes;
1616
- int flags;
1617
- unsigned int orig_blen;
1618
- unsigned int norm_blen;
1619
- unsigned int length;
1620
- grn_encoding encoding;
1621
- } grn_str;
1622
-
1623
- #define GRN_STR_REMOVEBLANK (0x01<<0)
1624
- #define GRN_STR_WITH_CTYPES (0x01<<1)
1625
- #define GRN_STR_WITH_CHECKS (0x01<<2)
1626
- #define GRN_STR_NORMALIZE GRN_OBJ_KEY_NORMALIZE
1627
-
1628
- GRN_API grn_str *grn_str_open(grn_ctx *ctx, const char *str, unsigned int str_len,
1629
- int flags);
1630
- GRN_API grn_rc grn_str_close(grn_ctx *ctx, grn_str *nstr);
1631
-
1632
- /* grn_string */
1633
-
1634
- #define GRN_STRING_REMOVE_BLANK (0x01<<0)
1635
- #define GRN_STRING_WITH_TYPES (0x01<<1)
1636
- #define GRN_STRING_WITH_CHECKS (0x01<<2)
1637
- #define GRN_STRING_REMOVE_TOKENIZED_DELIMITER (0x01<<3)
1638
-
1639
- #define GRN_NORMALIZER_AUTO ((grn_obj *)1)
1640
-
1641
- #define GRN_CHAR_BLANK 0x80
1642
- #define GRN_CHAR_IS_BLANK(c) ((c) & (GRN_CHAR_BLANK))
1643
- #define GRN_CHAR_TYPE(c) ((c) & 0x7f)
1644
-
1645
- typedef enum {
1646
- GRN_CHAR_NULL = 0,
1647
- GRN_CHAR_ALPHA,
1648
- GRN_CHAR_DIGIT,
1649
- GRN_CHAR_SYMBOL,
1650
- GRN_CHAR_HIRAGANA,
1651
- GRN_CHAR_KATAKANA,
1652
- GRN_CHAR_KANJI,
1653
- GRN_CHAR_OTHERS
1654
- } grn_char_type;
1655
-
1656
- GRN_API grn_obj *grn_string_open(grn_ctx *ctx,
1657
- const char *string,
1658
- unsigned int length_in_bytes,
1659
- grn_obj *normalizer, int flags);
1660
- GRN_API grn_rc grn_string_get_original(grn_ctx *ctx, grn_obj *string,
1661
- const char **original,
1662
- unsigned int *length_in_bytes);
1663
- GRN_API int grn_string_get_flags(grn_ctx *ctx, grn_obj *string);
1664
- GRN_API grn_rc grn_string_get_normalized(grn_ctx *ctx, grn_obj *string,
1665
- const char **normalized,
1666
- unsigned int *length_in_bytes,
1667
- unsigned int *n_characters);
1668
- GRN_API grn_rc grn_string_set_normalized(grn_ctx *ctx, grn_obj *string,
1669
- char *normalized,
1670
- unsigned int length_in_bytes,
1671
- unsigned int n_characters);
1672
- GRN_API const short *grn_string_get_checks(grn_ctx *ctx, grn_obj *string);
1673
- GRN_API grn_rc grn_string_set_checks(grn_ctx *ctx,
1674
- grn_obj *string,
1675
- short *checks);
1676
- GRN_API const unsigned char *grn_string_get_types(grn_ctx *ctx, grn_obj *string);
1677
- GRN_API grn_rc grn_string_set_types(grn_ctx *ctx,
1678
- grn_obj *string,
1679
- unsigned char *types);
1680
- GRN_API grn_encoding grn_string_get_encoding(grn_ctx *ctx, grn_obj *string);
1681
-
1682
-
1683
- GRN_API int grn_charlen(grn_ctx *ctx, const char *str, const char *end);
1684
-
1685
- /* expr */
1686
-
1687
- GRN_API grn_obj *grn_expr_create(grn_ctx *ctx, const char *name, unsigned int name_size);
1688
- GRN_API grn_rc grn_expr_close(grn_ctx *ctx, grn_obj *expr);
1689
- GRN_API grn_obj *grn_expr_add_var(grn_ctx *ctx, grn_obj *expr,
1690
- const char *name, unsigned int name_size);
1691
- GRN_API grn_obj *grn_expr_get_var(grn_ctx *ctx, grn_obj *expr,
1692
- const char *name, unsigned int name_size);
1693
- GRN_API grn_obj *grn_expr_get_var_by_offset(grn_ctx *ctx, grn_obj *expr, unsigned int offset);
1694
- GRN_API grn_rc grn_expr_clear_vars(grn_ctx *ctx, grn_obj *expr);
1695
-
1696
-
1697
- GRN_API grn_obj *grn_expr_append_obj(grn_ctx *ctx, grn_obj *expr, grn_obj *obj,
1698
- grn_operator op, int nargs);
1699
- GRN_API grn_obj *grn_expr_append_const(grn_ctx *ctx, grn_obj *expr, grn_obj *obj,
1700
- grn_operator op, int nargs);
1701
- GRN_API grn_obj *grn_expr_append_const_str(grn_ctx *ctx, grn_obj *expr,
1702
- const char *str, unsigned int str_size,
1703
- grn_operator op, int nargs);
1704
- GRN_API grn_obj *grn_expr_append_const_int(grn_ctx *ctx, grn_obj *expr, int i,
1705
- grn_operator op, int nargs);
1706
- GRN_API grn_rc grn_expr_append_op(grn_ctx *ctx, grn_obj *expr, grn_operator op, int nargs);
1707
-
1708
- GRN_API grn_rc grn_expr_get_keywords(grn_ctx *ctx, grn_obj *expr, grn_obj *keywords);
1709
-
1710
- GRN_API grn_rc grn_expr_syntax_escape(grn_ctx *ctx,
1711
- const char *query, int query_size,
1712
- const char *target_characters,
1713
- char escape_character,
1714
- grn_obj *escaped_query);
1715
- GRN_API grn_rc grn_expr_syntax_escape_query(grn_ctx *ctx,
1716
- const char *query, int query_size,
1717
- grn_obj *escaped_query);
1718
-
1719
- GRN_API grn_rc grn_expr_compile(grn_ctx *ctx, grn_obj *expr);
1720
- GRN_API grn_obj *grn_expr_exec(grn_ctx *ctx, grn_obj *expr, int nargs);
1721
- GRN_API grn_rc grn_ctx_push(grn_ctx *ctx, grn_obj *obj);
1722
- GRN_API grn_obj *grn_ctx_pop(grn_ctx *ctx);
1723
-
1724
- GRN_API grn_obj *grn_expr_alloc(grn_ctx *ctx, grn_obj *expr,
1725
- grn_id domain, grn_obj_flags flags);
1726
-
1727
- GRN_API grn_obj *grn_table_select(grn_ctx *ctx, grn_obj *table, grn_obj *expr,
1728
- grn_obj *res, grn_operator op);
1729
-
1730
- GRN_API int grn_obj_columns(grn_ctx *ctx, grn_obj *table,
1731
- const char *str, unsigned int str_size, grn_obj *res);
1732
-
1733
- #define GRN_EXPR_CREATE_FOR_QUERY(ctx,table,expr,var) do {\
1734
- if (((expr) = grn_expr_create((ctx), NULL, 0)) &&\
1735
- ((var) = grn_expr_add_var((ctx), (expr), NULL, 0))) {\
1736
- GRN_RECORD_INIT((var), 0, grn_obj_id((ctx), (table)));\
1737
- } else {\
1738
- (var) = NULL;\
1739
- }\
1740
- } while (0)
1741
-
1742
- typedef unsigned int grn_expr_flags;
1743
-
1744
- #define GRN_EXPR_SYNTAX_QUERY (0x00)
1745
- #define GRN_EXPR_SYNTAX_SCRIPT (0x01)
1746
- #define GRN_EXPR_SYNTAX_OUTPUT_COLUMNS (0x20)
1747
- #define GRN_EXPR_SYNTAX_ADJUSTER (0x40)
1748
- #define GRN_EXPR_ALLOW_PRAGMA (0x02)
1749
- #define GRN_EXPR_ALLOW_COLUMN (0x04)
1750
- #define GRN_EXPR_ALLOW_UPDATE (0x08)
1751
- #define GRN_EXPR_ALLOW_LEADING_NOT (0x10)
1752
-
1753
- GRN_API grn_rc grn_expr_parse(grn_ctx *ctx, grn_obj *expr,
1754
- const char *str, unsigned int str_size,
1755
- grn_obj *default_column, grn_operator default_mode,
1756
- grn_operator default_op, grn_expr_flags flags);
1757
-
1758
- GRN_API grn_obj *grn_expr_snip(grn_ctx *ctx, grn_obj *expr, int flags,
1759
- unsigned int width, unsigned int max_results,
1760
- unsigned int n_tags,
1761
- const char **opentags, unsigned int *opentag_lens,
1762
- const char **closetags, unsigned int *closetag_lens,
1763
- grn_snip_mapping *mapping);
1764
- GRN_API grn_rc grn_expr_snip_add_conditions(grn_ctx *ctx,
1765
- grn_obj *expr,
1766
- grn_obj *snip,
1767
- unsigned int n_tags,
1768
- const char **opentags,
1769
- unsigned int *opentag_lens,
1770
- const char **closetags,
1771
- unsigned int *closetag_lens);
1772
-
1773
- GRN_API grn_table_sort_key *grn_table_sort_key_from_str(grn_ctx *ctx,
1774
- const char *str, unsigned int str_size,
1775
- grn_obj *table, unsigned int *nkeys);
1776
- GRN_API grn_rc grn_table_sort_key_close(grn_ctx *ctx,
1777
- grn_table_sort_key *keys, unsigned int nkeys);
1778
-
1779
- GRN_API grn_bool grn_table_is_grouped(grn_ctx *ctx, grn_obj *table);
1780
-
1781
- GRN_API unsigned int grn_table_max_n_subrecs(grn_ctx *ctx, grn_obj *table);
1782
-
1783
- GRN_API grn_obj *grn_table_create_for_group(grn_ctx *ctx,
1784
- const char *name,
1785
- unsigned int name_size,
1786
- const char *path,
1787
- grn_obj *group_key,
1788
- grn_obj *value_type,
1789
- unsigned int max_n_subrecs);
1790
-
1791
- GRN_API unsigned int grn_table_get_subrecs(grn_ctx *ctx, grn_obj *table,
1792
- grn_id id, grn_id *subrecbuf,
1793
- int *scorebuf, int buf_size);
1794
-
1795
- GRN_API grn_obj *grn_table_tokenize(grn_ctx *ctx, grn_obj *table,
1796
- const char *str, unsigned int str_len,
1797
- grn_obj *buf, grn_bool addp);
1798
-
1799
- GRN_API grn_rc grn_load(grn_ctx *ctx, grn_content_type input_type,
1800
- const char *table, unsigned int table_len,
1801
- const char *columns, unsigned int columns_len,
1802
- const char *values, unsigned int values_len,
1803
- const char *ifexists, unsigned int ifexists_len,
1804
- const char *each, unsigned int each_len);
1805
-
1806
- #define GRN_CTX_MORE (0x01<<0)
1807
- #define GRN_CTX_TAIL (0x01<<1)
1808
- #define GRN_CTX_HEAD (0x01<<2)
1809
- #define GRN_CTX_QUIET (0x01<<3)
1810
- #define GRN_CTX_QUIT (0x01<<4)
1811
-
1812
- GRN_API grn_rc grn_ctx_connect(grn_ctx *ctx, const char *host, int port, int flags);
1813
- GRN_API unsigned int grn_ctx_send(grn_ctx *ctx, const char *str, unsigned int str_len, int flags);
1814
- GRN_API unsigned int grn_ctx_recv(grn_ctx *ctx, char **str, unsigned int *str_len, int *flags);
1815
-
1816
- typedef struct _grn_ctx_info grn_ctx_info;
1817
-
1818
- struct _grn_ctx_info {
1819
- int fd;
1820
- unsigned int com_status;
1821
- grn_obj *outbuf;
1822
- unsigned char stat;
1823
- };
1824
-
1825
- GRN_API grn_rc grn_ctx_info_get(grn_ctx *ctx, grn_ctx_info *info);
1826
-
1827
- GRN_API grn_rc grn_set_segv_handler(void);
1828
- GRN_API grn_rc grn_set_int_handler(void);
1829
- GRN_API grn_rc grn_set_term_handler(void);
1830
-
1831
- /* hash */
1832
-
1833
- typedef struct _grn_hash grn_hash;
1834
- typedef struct _grn_hash_cursor grn_hash_cursor;
1835
-
1836
- GRN_API grn_hash *grn_hash_create(grn_ctx *ctx, const char *path, unsigned int key_size,
1837
- unsigned int value_size, unsigned int flags);
1838
-
1839
- GRN_API grn_hash *grn_hash_open(grn_ctx *ctx, const char *path);
1840
-
1841
- GRN_API grn_rc grn_hash_close(grn_ctx *ctx, grn_hash *hash);
1842
-
1843
- GRN_API grn_id grn_hash_add(grn_ctx *ctx, grn_hash *hash, const void *key,
1844
- unsigned int key_size, void **value, int *added);
1845
- GRN_API grn_id grn_hash_get(grn_ctx *ctx, grn_hash *hash, const void *key,
1846
- unsigned int key_size, void **value);
1847
-
1848
- GRN_API int grn_hash_get_key(grn_ctx *ctx, grn_hash *hash, grn_id id, void *keybuf, int bufsize);
1849
- GRN_API int grn_hash_get_key2(grn_ctx *ctx, grn_hash *hash, grn_id id, grn_obj *bulk);
1850
- GRN_API int grn_hash_get_value(grn_ctx *ctx, grn_hash *hash, grn_id id, void *valuebuf);
1851
- GRN_API grn_rc grn_hash_set_value(grn_ctx *ctx, grn_hash *hash, grn_id id,
1852
- const void *value, int flags);
1853
-
1854
- typedef struct _grn_table_delete_optarg grn_table_delete_optarg;
1855
-
1856
- struct _grn_table_delete_optarg {
1857
- int flags;
1858
- int (*func)(grn_ctx *ctx, grn_obj *, grn_id, void *);
1859
- void *func_arg;
1860
- };
1861
-
1862
- GRN_API grn_rc grn_hash_delete_by_id(grn_ctx *ctx, grn_hash *hash, grn_id id,
1863
- grn_table_delete_optarg *optarg);
1864
- GRN_API grn_rc grn_hash_delete(grn_ctx *ctx, grn_hash *hash,
1865
- const void *key, unsigned int key_size,
1866
- grn_table_delete_optarg *optarg);
1867
-
1868
- GRN_API grn_hash_cursor *grn_hash_cursor_open(grn_ctx *ctx, grn_hash *hash,
1869
- const void *min, unsigned int min_size,
1870
- const void *max, unsigned int max_size,
1871
- int offset, int limit, int flags);
1872
- GRN_API grn_id grn_hash_cursor_next(grn_ctx *ctx, grn_hash_cursor *c);
1873
- GRN_API void grn_hash_cursor_close(grn_ctx *ctx, grn_hash_cursor *c);
1874
-
1875
- GRN_API int grn_hash_cursor_get_key(grn_ctx *ctx, grn_hash_cursor *c, void **key);
1876
- GRN_API int grn_hash_cursor_get_value(grn_ctx *ctx, grn_hash_cursor *c, void **value);
1877
- GRN_API grn_rc grn_hash_cursor_set_value(grn_ctx *ctx, grn_hash_cursor *c,
1878
- const void *value, int flags);
1879
-
1880
- GRN_API int grn_hash_cursor_get_key_value(grn_ctx *ctx, grn_hash_cursor *c,
1881
- void **key, unsigned int *key_size, void **value);
1882
-
1883
- GRN_API grn_rc grn_hash_cursor_delete(grn_ctx *ctx, grn_hash_cursor *c,
1884
- grn_table_delete_optarg *optarg);
1885
-
1886
- #define GRN_HASH_EACH(ctx,hash,id,key,key_size,value,block) do {\
1887
- grn_hash_cursor *_sc = grn_hash_cursor_open(ctx, hash, NULL, 0, NULL, 0, 0, -1, 0); \
1888
- if (_sc) {\
1889
- grn_id id;\
1890
- while ((id = grn_hash_cursor_next(ctx, _sc))) {\
1891
- grn_hash_cursor_get_key_value(ctx, _sc, (void **)(key),\
1892
- (key_size), (void **)(value));\
1893
- block\
1894
- }\
1895
- grn_hash_cursor_close(ctx, _sc);\
1896
- }\
1897
- } while (0)
1898
-
1899
- /* array */
1900
-
1901
- typedef struct _grn_array grn_array;
1902
- typedef struct _grn_array_cursor grn_array_cursor;
1903
-
1904
- GRN_API grn_array *grn_array_create(grn_ctx *ctx, const char *path,
1905
- unsigned int value_size, unsigned int flags);
1906
- GRN_API grn_array *grn_array_open(grn_ctx *ctx, const char *path);
1907
- GRN_API grn_rc grn_array_close(grn_ctx *ctx, grn_array *array);
1908
- GRN_API grn_id grn_array_add(grn_ctx *ctx, grn_array *array, void **value);
1909
- GRN_API grn_id grn_array_push(grn_ctx *ctx, grn_array *array,
1910
- void (*func)(grn_ctx *ctx, grn_array *array,
1911
- grn_id id, void *func_arg),
1912
- void *func_arg);
1913
- GRN_API grn_id grn_array_pull(grn_ctx *ctx, grn_array *array, grn_bool blockp,
1914
- void (*func)(grn_ctx *ctx, grn_array *array,
1915
- grn_id id, void *func_arg),
1916
- void *func_arg);
1917
- GRN_API void grn_array_unblock(grn_ctx *ctx, grn_array *array);
1918
- GRN_API int grn_array_get_value(grn_ctx *ctx, grn_array *array, grn_id id, void *valuebuf);
1919
- GRN_API grn_rc grn_array_set_value(grn_ctx *ctx, grn_array *array, grn_id id,
1920
- const void *value, int flags);
1921
- GRN_API grn_array_cursor *grn_array_cursor_open(grn_ctx *ctx, grn_array *array,
1922
- grn_id min, grn_id max,
1923
- int offset, int limit, int flags);
1924
- GRN_API grn_id grn_array_cursor_next(grn_ctx *ctx, grn_array_cursor *cursor);
1925
- GRN_API int grn_array_cursor_get_value(grn_ctx *ctx, grn_array_cursor *cursor, void **value);
1926
- GRN_API grn_rc grn_array_cursor_set_value(grn_ctx *ctx, grn_array_cursor *cursor,
1927
- const void *value, int flags);
1928
- GRN_API grn_rc grn_array_cursor_delete(grn_ctx *ctx, grn_array_cursor *cursor,
1929
- grn_table_delete_optarg *optarg);
1930
- GRN_API void grn_array_cursor_close(grn_ctx *ctx, grn_array_cursor *cursor);
1931
- GRN_API grn_rc grn_array_delete_by_id(grn_ctx *ctx, grn_array *array, grn_id id,
1932
- grn_table_delete_optarg *optarg);
1933
-
1934
- GRN_API grn_id grn_array_next(grn_ctx *ctx, grn_array *array, grn_id id);
1935
-
1936
- GRN_API void *_grn_array_get_value(grn_ctx *ctx, grn_array *array, grn_id id);
1937
-
1938
- #define GRN_ARRAY_EACH(ctx,array,head,tail,id,value,block) do {\
1939
- grn_array_cursor *_sc = grn_array_cursor_open(ctx, array, head, tail, 0, -1, 0); \
1940
- if (_sc) {\
1941
- grn_id id;\
1942
- while ((id = grn_array_cursor_next(ctx, _sc))) {\
1943
- grn_array_cursor_get_value(ctx, _sc, (void **)(value));\
1944
- block\
1945
- }\
1946
- grn_array_cursor_close(ctx, _sc); \
1947
- }\
1948
- } while (0)
1949
-
1950
- /* pat */
1951
-
1952
- typedef struct _grn_pat grn_pat;
1953
- typedef struct _grn_pat_cursor grn_pat_cursor;
1954
-
1955
- GRN_API grn_pat *grn_pat_create(grn_ctx *ctx, const char *path, unsigned int key_size,
1956
- unsigned int value_size, unsigned int flags);
1957
-
1958
- GRN_API grn_pat *grn_pat_open(grn_ctx *ctx, const char *path);
1959
-
1960
- GRN_API grn_rc grn_pat_close(grn_ctx *ctx, grn_pat *pat);
1961
-
1962
- GRN_API grn_rc grn_pat_remove(grn_ctx *ctx, const char *path);
1963
-
1964
- GRN_API grn_id grn_pat_get(grn_ctx *ctx, grn_pat *pat, const void *key,
1965
- unsigned int key_size, void **value);
1966
- GRN_API grn_id grn_pat_add(grn_ctx *ctx, grn_pat *pat, const void *key,
1967
- unsigned int key_size, void **value, int *added);
1968
-
1969
- GRN_API int grn_pat_get_key(grn_ctx *ctx, grn_pat *pat, grn_id id, void *keybuf, int bufsize);
1970
- GRN_API int grn_pat_get_key2(grn_ctx *ctx, grn_pat *pat, grn_id id, grn_obj *bulk);
1971
- GRN_API int grn_pat_get_value(grn_ctx *ctx, grn_pat *pat, grn_id id, void *valuebuf);
1972
- GRN_API grn_rc grn_pat_set_value(grn_ctx *ctx, grn_pat *pat, grn_id id,
1973
- const void *value, int flags);
1974
-
1975
- GRN_API grn_rc grn_pat_delete_by_id(grn_ctx *ctx, grn_pat *pat, grn_id id,
1976
- grn_table_delete_optarg *optarg);
1977
- GRN_API grn_rc grn_pat_delete(grn_ctx *ctx, grn_pat *pat, const void *key, unsigned int key_size,
1978
- grn_table_delete_optarg *optarg);
1979
- GRN_API int grn_pat_delete_with_sis(grn_ctx *ctx, grn_pat *pat, grn_id id,
1980
- grn_table_delete_optarg *optarg);
1981
-
1982
- typedef struct _grn_pat_scan_hit grn_pat_scan_hit;
1983
-
1984
- struct _grn_pat_scan_hit {
1985
- grn_id id;
1986
- unsigned int offset;
1987
- unsigned int length;
1988
- };
1989
-
1990
- GRN_API int grn_pat_scan(grn_ctx *ctx, grn_pat *pat, const char *str, unsigned int str_len,
1991
- grn_pat_scan_hit *sh, unsigned int sh_size, const char **rest);
1992
-
1993
- GRN_API grn_rc grn_pat_prefix_search(grn_ctx *ctx, grn_pat *pat,
1994
- const void *key, unsigned int key_size, grn_hash *h);
1995
- GRN_API grn_rc grn_pat_suffix_search(grn_ctx *ctx, grn_pat *pat,
1996
- const void *key, unsigned int key_size, grn_hash *h);
1997
- GRN_API grn_id grn_pat_lcp_search(grn_ctx *ctx, grn_pat *pat,
1998
- const void *key, unsigned int key_size);
1999
-
2000
- GRN_API unsigned int grn_pat_size(grn_ctx *ctx, grn_pat *pat);
2001
-
2002
- GRN_API grn_pat_cursor *grn_pat_cursor_open(grn_ctx *ctx, grn_pat *pat,
2003
- const void *min, unsigned int min_size,
2004
- const void *max, unsigned int max_size,
2005
- int offset, int limit, int flags);
2006
- GRN_API grn_id grn_pat_cursor_next(grn_ctx *ctx, grn_pat_cursor *c);
2007
- GRN_API void grn_pat_cursor_close(grn_ctx *ctx, grn_pat_cursor *c);
2008
-
2009
- GRN_API int grn_pat_cursor_get_key(grn_ctx *ctx, grn_pat_cursor *c, void **key);
2010
- GRN_API int grn_pat_cursor_get_value(grn_ctx *ctx, grn_pat_cursor *c, void **value);
2011
-
2012
- GRN_API int grn_pat_cursor_get_key_value(grn_ctx *ctx, grn_pat_cursor *c,
2013
- void **key, unsigned int *key_size, void **value);
2014
- GRN_API grn_rc grn_pat_cursor_set_value(grn_ctx *ctx, grn_pat_cursor *c,
2015
- const void *value, int flags);
2016
- GRN_API grn_rc grn_pat_cursor_delete(grn_ctx *ctx, grn_pat_cursor *c,
2017
- grn_table_delete_optarg *optarg);
2018
-
2019
- #define GRN_PAT_EACH(ctx,pat,id,key,key_size,value,block) do { \
2020
- grn_pat_cursor *_sc = grn_pat_cursor_open(ctx, pat, NULL, 0, NULL, 0, 0, -1, 0); \
2021
- if (_sc) {\
2022
- grn_id id;\
2023
- while ((id = grn_pat_cursor_next(ctx, _sc))) {\
2024
- grn_pat_cursor_get_key_value(ctx, _sc, (void **)(key),\
2025
- (key_size), (void **)(value));\
2026
- block\
2027
- }\
2028
- grn_pat_cursor_close(ctx, _sc);\
2029
- }\
2030
- } while (0)
2031
-
2032
- /* dat */
2033
-
2034
- typedef struct _grn_dat grn_dat;
2035
- typedef struct _grn_dat_cursor grn_dat_cursor;
2036
-
2037
- GRN_API grn_dat *grn_dat_create(grn_ctx *ctx, const char *path, unsigned int key_size,
2038
- unsigned int value_size, unsigned int flags);
2039
-
2040
- GRN_API grn_dat *grn_dat_open(grn_ctx *ctx, const char *path);
2041
-
2042
- GRN_API grn_rc grn_dat_close(grn_ctx *ctx, grn_dat *dat);
2043
-
2044
- GRN_API grn_rc grn_dat_remove(grn_ctx *ctx, const char *path);
2045
-
2046
- GRN_API grn_id grn_dat_get(grn_ctx *ctx, grn_dat *dat, const void *key,
2047
- unsigned int key_size, void **value);
2048
- GRN_API grn_id grn_dat_add(grn_ctx *ctx, grn_dat *dat, const void *key,
2049
- unsigned int key_size, void **value, int *added);
2050
-
2051
- GRN_API int grn_dat_get_key(grn_ctx *ctx, grn_dat *dat, grn_id id, void *keybuf, int bufsize);
2052
- GRN_API int grn_dat_get_key2(grn_ctx *ctx, grn_dat *dat, grn_id id, grn_obj *bulk);
2053
-
2054
- GRN_API grn_rc grn_dat_delete_by_id(grn_ctx *ctx, grn_dat *dat, grn_id id,
2055
- grn_table_delete_optarg *optarg);
2056
- GRN_API grn_rc grn_dat_delete(grn_ctx *ctx, grn_dat *dat, const void *key, unsigned int key_size,
2057
- grn_table_delete_optarg *optarg);
2058
-
2059
- GRN_API grn_rc grn_dat_update_by_id(grn_ctx *ctx, grn_dat *dat, grn_id src_key_id,
2060
- const void *dest_key, unsigned int dest_key_size);
2061
- GRN_API grn_rc grn_dat_update(grn_ctx *ctx, grn_dat *dat,
2062
- const void *src_key, unsigned int src_key_size,
2063
- const void *dest_key, unsigned int dest_key_size);
2064
-
2065
- GRN_API unsigned int grn_dat_size(grn_ctx *ctx, grn_dat *dat);
2066
-
2067
- GRN_API grn_dat_cursor *grn_dat_cursor_open(grn_ctx *ctx, grn_dat *dat,
2068
- const void *min, unsigned int min_size,
2069
- const void *max, unsigned int max_size,
2070
- int offset, int limit, int flags);
2071
- GRN_API grn_id grn_dat_cursor_next(grn_ctx *ctx, grn_dat_cursor *c);
2072
- GRN_API void grn_dat_cursor_close(grn_ctx *ctx, grn_dat_cursor *c);
2073
-
2074
- GRN_API int grn_dat_cursor_get_key(grn_ctx *ctx, grn_dat_cursor *c, const void **key);
2075
- GRN_API grn_rc grn_dat_cursor_delete(grn_ctx *ctx, grn_dat_cursor *c,
2076
- grn_table_delete_optarg *optarg);
2077
-
2078
- #define GRN_DAT_EACH(ctx,dat,id,key,key_size,block) do {\
2079
- grn_dat_cursor *_sc = grn_dat_cursor_open(ctx, dat, NULL, 0, NULL, 0, 0, -1, 0);\
2080
- if (_sc) {\
2081
- grn_id id;\
2082
- unsigned int *_ks = (key_size);\
2083
- if (_ks) {\
2084
- while ((id = grn_dat_cursor_next(ctx, _sc))) {\
2085
- int _ks_raw = grn_dat_cursor_get_key(ctx, _sc, (const void **)(key));\
2086
- *(_ks) = (unsigned int)_ks_raw;\
2087
- block\
2088
- }\
2089
- } else {\
2090
- while ((id = grn_dat_cursor_next(ctx, _sc))) {\
2091
- grn_dat_cursor_get_key(ctx, _sc, (const void **)(key));\
2092
- block\
2093
- }\
2094
- }\
2095
- grn_dat_cursor_close(ctx, _sc);\
2096
- }\
2097
- } while (0)
2098
-
2099
- /* buffered index builder */
2100
-
2101
- typedef struct _grn_ii grn_ii;
2102
- typedef struct _grn_ii_buffer grn_ii_buffer;
2103
-
2104
- grn_ii_buffer *grn_ii_buffer_open(grn_ctx *ctx, grn_ii *ii,
2105
- long long unsigned int update_buffer_size);
2106
- grn_rc grn_ii_buffer_append(grn_ctx *ctx, grn_ii_buffer *ii_buffer,
2107
- grn_id rid, unsigned int section, grn_obj *value);
2108
- grn_rc grn_ii_buffer_commit(grn_ctx *ctx, grn_ii_buffer *ii_buffer);
2109
- grn_rc grn_ii_buffer_close(grn_ctx *ctx, grn_ii_buffer *ii_buffer);
2110
-
2111
-
2112
- #ifdef __cplusplus
2113
- }
2114
- #endif
21
+ #include "groonga/groonga.h"
22
+ #include "groonga/ii.h"
23
+ #include "groonga/expr.h"
24
+ #include "groonga/util.h"
2115
25
 
2116
26
  #endif /* GROONGA_H */