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