rroonga 1.3.1-x86-mingw32 → 2.0.0-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -1
- data/Rakefile +2 -7
- data/ext/groonga/rb-grn-column.c +34 -37
- data/ext/groonga/rb-grn-context.c +63 -2
- data/ext/groonga/rb-grn-expression.c +21 -13
- data/ext/groonga/rb-grn-object.c +2 -0
- data/ext/groonga/rb-grn-table.c +57 -51
- data/ext/groonga/rb-grn.h +10 -4
- data/lib/1.8/groonga.so +0 -0
- data/lib/1.9/groonga.so +0 -0
- data/lib/groonga/schema.rb +75 -46
- data/lib/groonga.rb +9 -6
- data/rroonga-build.rb +2 -2
- data/test/run-test.rb +1 -2
- data/test/test-table-select.rb +0 -5
- data/test/test-type.rb +2 -2
- data/test/test-version.rb +40 -10
- data/vendor/local/bin/grntest.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/plugin.h +113 -0
- data/vendor/local/include/groonga/groonga/tokenizer.h +146 -0
- data/vendor/local/include/groonga/groonga.h +18 -18
- data/vendor/local/include/msgpack/object.h +98 -0
- data/vendor/local/include/msgpack/object.hpp +412 -0
- data/vendor/local/include/msgpack/pack.h +143 -0
- data/vendor/local/include/msgpack/pack.hpp +318 -0
- data/vendor/local/include/msgpack/pack_define.h +26 -0
- data/vendor/local/include/msgpack/pack_template.h +766 -0
- data/vendor/local/include/msgpack/sbuffer.h +111 -0
- data/vendor/local/include/msgpack/sbuffer.hpp +112 -0
- data/vendor/local/include/msgpack/sysdep.h +195 -0
- data/vendor/local/include/msgpack/type/bool.hpp +55 -0
- data/vendor/local/include/msgpack/type/define.hpp +3279 -0
- data/vendor/local/include/msgpack/type/deque.hpp +77 -0
- data/vendor/local/include/msgpack/type/fixint.hpp +172 -0
- data/vendor/local/include/msgpack/type/float.hpp +82 -0
- data/vendor/local/include/msgpack/type/int.hpp +211 -0
- data/vendor/local/include/msgpack/type/list.hpp +77 -0
- data/vendor/local/include/msgpack/type/map.hpp +205 -0
- data/vendor/local/include/msgpack/type/nil.hpp +65 -0
- data/vendor/local/include/msgpack/type/pair.hpp +61 -0
- data/vendor/local/include/msgpack/type/raw.hpp +94 -0
- data/vendor/local/include/msgpack/type/set.hpp +122 -0
- data/vendor/local/include/msgpack/type/string.hpp +62 -0
- data/vendor/local/include/msgpack/type/tr1/unordered_map.hpp +129 -0
- data/vendor/local/include/msgpack/type/tr1/unordered_set.hpp +122 -0
- data/vendor/local/include/msgpack/type/tuple.hpp +13691 -0
- data/vendor/local/include/msgpack/type/vector.hpp +81 -0
- data/vendor/local/include/msgpack/type.hpp +16 -0
- data/vendor/local/include/msgpack/unpack.h +260 -0
- data/vendor/local/include/msgpack/unpack.hpp +374 -0
- data/vendor/local/include/msgpack/unpack_define.h +93 -0
- data/vendor/local/include/msgpack/unpack_template.h +409 -0
- data/vendor/local/include/msgpack/version.h +40 -0
- data/vendor/local/include/msgpack/vrefbuffer.h +142 -0
- data/vendor/local/include/msgpack/vrefbuffer.hpp +97 -0
- data/vendor/local/include/msgpack/zbuffer.h +207 -0
- data/vendor/local/include/msgpack/zbuffer.hpp +100 -0
- data/vendor/local/include/msgpack/zone.h +147 -0
- data/vendor/local/include/msgpack/zone.hpp +455 -0
- data/vendor/local/include/msgpack.h +30 -0
- data/vendor/local/include/msgpack.hpp +24 -0
- 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 +2 -2
- 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 +2 -2
- data/vendor/local/lib/libgroonga.a +0 -0
- data/vendor/local/lib/libgroonga.dll.a +0 -0
- data/vendor/local/lib/libgroonga.la +2 -2
- 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 +41 -0
- data/vendor/local/lib/libmsgpackc.a +0 -0
- data/vendor/local/lib/libmsgpackc.dll.a +0 -0
- data/vendor/local/lib/libmsgpackc.la +41 -0
- data/vendor/local/lib/pkgconfig/groonga.pc +4 -4
- 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/commands/suggest.txt +1 -1
- data/vendor/local/share/doc/groonga/en/html/_sources/contribution/report.txt +6 -7
- data/vendor/local/share/doc/groonga/en/html/_sources/indexing.txt +108 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/news/1.2.x.txt +386 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/news.txt +51 -385
- data/vendor/local/share/doc/groonga/en/html/_sources/reference.txt +1 -0
- data/vendor/local/share/doc/groonga/en/html/_sources/spec/search.txt +4 -4
- data/vendor/local/share/doc/groonga/en/html/characteristic.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/command_version.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/cache_limit.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/check.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/clearlock.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/column_create.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/column_list.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/column_remove.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/define_selector.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/defrag.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/delete.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/dump.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/load.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/log_level.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/log_put.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/log_reopen.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/quit.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/select.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/shutdown.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/status.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/suggest.html +7 -7
- data/vendor/local/share/doc/groonga/en/html/commands/table_create.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/table_list.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/table_remove.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands/view_add.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/commands.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/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 +5 -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 +9 -9
- data/vendor/local/share/doc/groonga/en/html/contribution.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/executables/grnslap.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/executables/grntest.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/executables/groonga-http.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/executables/groonga-suggest-create-dataset.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/executables/groonga.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/executables.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/expr.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/functions/edit_distance.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/functions/geo_distance.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/functions/geo_in_circle.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/functions/geo_in_rectangle.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/functions/now.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/functions/rand.html +10 -10
- data/vendor/local/share/doc/groonga/en/html/functions.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/genindex.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/geolocation_search.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/index.html +14 -8
- data/vendor/local/share/doc/groonga/en/html/indexing.html +237 -0
- data/vendor/local/share/doc/groonga/en/html/install.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/limitations.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/log.html +20 -20
- 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 +566 -0
- data/vendor/local/share/doc/groonga/en/html/news/senna.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/news.html +65 -464
- data/vendor/local/share/doc/groonga/en/html/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/en/html/output.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/pseudo_column.html +5 -5
- data/vendor/local/share/doc/groonga/en/html/reference.html +14 -8
- 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/spec/search.html +9 -9
- data/vendor/local/share/doc/groonga/en/html/spec.html +9 -9
- 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/en/html/type.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/.buildinfo +1 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/commands/suggest.txt +1 -1
- data/vendor/local/share/doc/groonga/ja/html/_sources/contribution/report.txt +6 -7
- data/vendor/local/share/doc/groonga/ja/html/_sources/indexing.txt +108 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/news/1.2.x.txt +386 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/news.txt +51 -385
- data/vendor/local/share/doc/groonga/ja/html/_sources/reference.txt +1 -0
- data/vendor/local/share/doc/groonga/ja/html/_sources/spec/search.txt +4 -4
- data/vendor/local/share/doc/groonga/ja/html/characteristic.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/command_version.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/cache_limit.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/check.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/clearlock.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/column_create.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/column_list.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/column_remove.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/define_selector.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/defrag.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/delete.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/dump.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/load.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/log_level.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/log_put.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/log_reopen.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/quit.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/select.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/shutdown.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/status.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/suggest.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/table_create.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/table_list.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/table_remove.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands/view_add.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/commands.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/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 +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/documentation.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/contribution/report.html +6 -6
- data/vendor/local/share/doc/groonga/ja/html/contribution.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/executables/grnslap.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/executables/grntest.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/executables/groonga-http.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/executables/groonga-suggest-create-dataset.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/executables/groonga.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/executables.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/expr.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/functions/edit_distance.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/functions/geo_distance.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/functions/geo_in_circle.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/functions/geo_in_rectangle.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/functions/now.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/functions/rand.html +10 -10
- data/vendor/local/share/doc/groonga/ja/html/functions.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/genindex.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/geolocation_search.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/index.html +14 -8
- data/vendor/local/share/doc/groonga/ja/html/indexing.html +215 -0
- data/vendor/local/share/doc/groonga/ja/html/install.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/limitations.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/log.html +20 -20
- 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 +528 -0
- data/vendor/local/share/doc/groonga/ja/html/news/senna.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/news.html +62 -425
- data/vendor/local/share/doc/groonga/ja/html/objects.inv +0 -0
- data/vendor/local/share/doc/groonga/ja/html/output.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/pseudo_column.html +5 -5
- data/vendor/local/share/doc/groonga/ja/html/reference.html +14 -8
- 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/spec/search.html +9 -9
- data/vendor/local/share/doc/groonga/ja/html/spec.html +9 -9
- 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/doc/groonga/ja/html/type.html +5 -5
- data/vendor/local/share/doc/groonga/source/commands/suggest.txt +1 -1
- data/vendor/local/share/doc/groonga/source/contribution/report.txt +6 -7
- data/vendor/local/share/doc/groonga/source/indexing.txt +108 -0
- data/vendor/local/share/doc/groonga/source/news/1.2.x.txt +386 -0
- data/vendor/local/share/doc/groonga/source/news.txt +51 -385
- data/vendor/local/share/doc/groonga/source/reference.txt +1 -0
- data/vendor/local/share/doc/groonga/source/spec/search.txt +4 -4
- data/vendor/local/share/license/groonga/COPYING +10 -12
- data/vendor/local/share/license/msgpack/AUTHORS +1 -0
- data/vendor/local/share/license/msgpack/COPYING +14 -0
- data/vendor/local/share/license/msgpack/LICENSE +202 -0
- data/vendor/local/share/man/ja/man1/groonga.1 +113 -5
- data/vendor/local/share/man/man1/groonga.1 +142 -11
- metadata +66 -3
- data/vendor/local/share/doc/groonga/source/update_execution_example.py +0 -141
@@ -0,0 +1,409 @@
|
|
1
|
+
/*
|
2
|
+
* MessagePack unpacking routine template
|
3
|
+
*
|
4
|
+
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
* you may not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*/
|
18
|
+
|
19
|
+
#ifndef msgpack_unpack_func
|
20
|
+
#error msgpack_unpack_func template is not defined
|
21
|
+
#endif
|
22
|
+
|
23
|
+
#ifndef msgpack_unpack_callback
|
24
|
+
#error msgpack_unpack_callback template is not defined
|
25
|
+
#endif
|
26
|
+
|
27
|
+
#ifndef msgpack_unpack_struct
|
28
|
+
#error msgpack_unpack_struct template is not defined
|
29
|
+
#endif
|
30
|
+
|
31
|
+
#ifndef msgpack_unpack_struct_decl
|
32
|
+
#define msgpack_unpack_struct_decl(name) msgpack_unpack_struct(name)
|
33
|
+
#endif
|
34
|
+
|
35
|
+
#ifndef msgpack_unpack_object
|
36
|
+
#error msgpack_unpack_object type is not defined
|
37
|
+
#endif
|
38
|
+
|
39
|
+
#ifndef msgpack_unpack_user
|
40
|
+
#error msgpack_unpack_user type is not defined
|
41
|
+
#endif
|
42
|
+
|
43
|
+
#ifndef USE_CASE_RANGE
|
44
|
+
#if !defined(_MSC_VER)
|
45
|
+
#define USE_CASE_RANGE
|
46
|
+
#endif
|
47
|
+
#endif
|
48
|
+
|
49
|
+
msgpack_unpack_struct_decl(_stack) {
|
50
|
+
msgpack_unpack_object obj;
|
51
|
+
size_t count;
|
52
|
+
unsigned int ct;
|
53
|
+
msgpack_unpack_object map_key;
|
54
|
+
};
|
55
|
+
|
56
|
+
msgpack_unpack_struct_decl(_context) {
|
57
|
+
msgpack_unpack_user user;
|
58
|
+
unsigned int cs;
|
59
|
+
unsigned int trail;
|
60
|
+
unsigned int top;
|
61
|
+
/*
|
62
|
+
msgpack_unpack_struct(_stack)* stack;
|
63
|
+
unsigned int stack_size;
|
64
|
+
msgpack_unpack_struct(_stack) embed_stack[MSGPACK_EMBED_STACK_SIZE];
|
65
|
+
*/
|
66
|
+
msgpack_unpack_struct(_stack) stack[MSGPACK_EMBED_STACK_SIZE];
|
67
|
+
};
|
68
|
+
|
69
|
+
|
70
|
+
msgpack_unpack_func(void, _init)(msgpack_unpack_struct(_context)* ctx)
|
71
|
+
{
|
72
|
+
ctx->cs = CS_HEADER;
|
73
|
+
ctx->trail = 0;
|
74
|
+
ctx->top = 0;
|
75
|
+
/*
|
76
|
+
ctx->stack = ctx->embed_stack;
|
77
|
+
ctx->stack_size = MSGPACK_EMBED_STACK_SIZE;
|
78
|
+
*/
|
79
|
+
ctx->stack[0].obj = msgpack_unpack_callback(_root)(&ctx->user);
|
80
|
+
}
|
81
|
+
|
82
|
+
/*
|
83
|
+
msgpack_unpack_func(void, _destroy)(msgpack_unpack_struct(_context)* ctx)
|
84
|
+
{
|
85
|
+
if(ctx->stack_size != MSGPACK_EMBED_STACK_SIZE) {
|
86
|
+
free(ctx->stack);
|
87
|
+
}
|
88
|
+
}
|
89
|
+
*/
|
90
|
+
|
91
|
+
msgpack_unpack_func(msgpack_unpack_object, _data)(msgpack_unpack_struct(_context)* ctx)
|
92
|
+
{
|
93
|
+
return (ctx)->stack[0].obj;
|
94
|
+
}
|
95
|
+
|
96
|
+
|
97
|
+
msgpack_unpack_func(int, _execute)(msgpack_unpack_struct(_context)* ctx, const char* data, size_t len, size_t* off)
|
98
|
+
{
|
99
|
+
assert(len >= *off);
|
100
|
+
|
101
|
+
const unsigned char* p = (unsigned char*)data + *off;
|
102
|
+
const unsigned char* const pe = (unsigned char*)data + len;
|
103
|
+
const void* n = NULL;
|
104
|
+
|
105
|
+
unsigned int trail = ctx->trail;
|
106
|
+
unsigned int cs = ctx->cs;
|
107
|
+
unsigned int top = ctx->top;
|
108
|
+
msgpack_unpack_struct(_stack)* stack = ctx->stack;
|
109
|
+
/*
|
110
|
+
unsigned int stack_size = ctx->stack_size;
|
111
|
+
*/
|
112
|
+
msgpack_unpack_user* user = &ctx->user;
|
113
|
+
|
114
|
+
msgpack_unpack_object obj;
|
115
|
+
msgpack_unpack_struct(_stack)* c = NULL;
|
116
|
+
|
117
|
+
int ret;
|
118
|
+
|
119
|
+
#define push_simple_value(func) \
|
120
|
+
if(msgpack_unpack_callback(func)(user, &obj) < 0) { goto _failed; } \
|
121
|
+
goto _push
|
122
|
+
#define push_fixed_value(func, arg) \
|
123
|
+
if(msgpack_unpack_callback(func)(user, arg, &obj) < 0) { goto _failed; } \
|
124
|
+
goto _push
|
125
|
+
#define push_variable_value(func, base, pos, len) \
|
126
|
+
if(msgpack_unpack_callback(func)(user, \
|
127
|
+
(const char*)base, (const char*)pos, len, &obj) < 0) { goto _failed; } \
|
128
|
+
goto _push
|
129
|
+
|
130
|
+
#define again_fixed_trail(_cs, trail_len) \
|
131
|
+
trail = trail_len; \
|
132
|
+
cs = _cs; \
|
133
|
+
goto _fixed_trail_again
|
134
|
+
#define again_fixed_trail_if_zero(_cs, trail_len, ifzero) \
|
135
|
+
trail = trail_len; \
|
136
|
+
if(trail == 0) { goto ifzero; } \
|
137
|
+
cs = _cs; \
|
138
|
+
goto _fixed_trail_again
|
139
|
+
|
140
|
+
#define start_container(func, count_, ct_) \
|
141
|
+
if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */ \
|
142
|
+
if(msgpack_unpack_callback(func)(user, count_, &stack[top].obj) < 0) { goto _failed; } \
|
143
|
+
if((count_) == 0) { obj = stack[top].obj; goto _push; } \
|
144
|
+
stack[top].ct = ct_; \
|
145
|
+
stack[top].count = count_; \
|
146
|
+
++top; \
|
147
|
+
/*printf("container %d count %d stack %d\n",stack[top].obj,count_,top);*/ \
|
148
|
+
/*printf("stack push %d\n", top);*/ \
|
149
|
+
/* FIXME \
|
150
|
+
if(top >= stack_size) { \
|
151
|
+
if(stack_size == MSGPACK_EMBED_STACK_SIZE) { \
|
152
|
+
size_t csize = sizeof(msgpack_unpack_struct(_stack)) * MSGPACK_EMBED_STACK_SIZE; \
|
153
|
+
size_t nsize = csize * 2; \
|
154
|
+
msgpack_unpack_struct(_stack)* tmp = (msgpack_unpack_struct(_stack)*)malloc(nsize); \
|
155
|
+
if(tmp == NULL) { goto _failed; } \
|
156
|
+
memcpy(tmp, ctx->stack, csize); \
|
157
|
+
ctx->stack = stack = tmp; \
|
158
|
+
ctx->stack_size = stack_size = MSGPACK_EMBED_STACK_SIZE * 2; \
|
159
|
+
} else { \
|
160
|
+
size_t nsize = sizeof(msgpack_unpack_struct(_stack)) * ctx->stack_size * 2; \
|
161
|
+
msgpack_unpack_struct(_stack)* tmp = (msgpack_unpack_struct(_stack)*)realloc(ctx->stack, nsize); \
|
162
|
+
if(tmp == NULL) { goto _failed; } \
|
163
|
+
ctx->stack = stack = tmp; \
|
164
|
+
ctx->stack_size = stack_size = stack_size * 2; \
|
165
|
+
} \
|
166
|
+
} \
|
167
|
+
*/ \
|
168
|
+
goto _header_again
|
169
|
+
|
170
|
+
#define NEXT_CS(p) \
|
171
|
+
((unsigned int)*p & 0x1f)
|
172
|
+
|
173
|
+
#ifdef USE_CASE_RANGE
|
174
|
+
#define SWITCH_RANGE_BEGIN switch(*p) {
|
175
|
+
#define SWITCH_RANGE(FROM, TO) case FROM ... TO:
|
176
|
+
#define SWITCH_RANGE_DEFAULT default:
|
177
|
+
#define SWITCH_RANGE_END }
|
178
|
+
#else
|
179
|
+
#define SWITCH_RANGE_BEGIN { if(0) {
|
180
|
+
#define SWITCH_RANGE(FROM, TO) } else if(FROM <= *p && *p <= TO) {
|
181
|
+
#define SWITCH_RANGE_DEFAULT } else {
|
182
|
+
#define SWITCH_RANGE_END } }
|
183
|
+
#endif
|
184
|
+
|
185
|
+
if(p == pe) { goto _out; }
|
186
|
+
do {
|
187
|
+
switch(cs) {
|
188
|
+
case CS_HEADER:
|
189
|
+
SWITCH_RANGE_BEGIN
|
190
|
+
SWITCH_RANGE(0x00, 0x7f) // Positive Fixnum
|
191
|
+
push_fixed_value(_uint8, *(uint8_t*)p);
|
192
|
+
SWITCH_RANGE(0xe0, 0xff) // Negative Fixnum
|
193
|
+
push_fixed_value(_int8, *(int8_t*)p);
|
194
|
+
SWITCH_RANGE(0xc0, 0xdf) // Variable
|
195
|
+
switch(*p) {
|
196
|
+
case 0xc0: // nil
|
197
|
+
push_simple_value(_nil);
|
198
|
+
//case 0xc1: // string
|
199
|
+
// again_terminal_trail(NEXT_CS(p), p+1);
|
200
|
+
case 0xc2: // false
|
201
|
+
push_simple_value(_false);
|
202
|
+
case 0xc3: // true
|
203
|
+
push_simple_value(_true);
|
204
|
+
//case 0xc4:
|
205
|
+
//case 0xc5:
|
206
|
+
//case 0xc6:
|
207
|
+
//case 0xc7:
|
208
|
+
//case 0xc8:
|
209
|
+
//case 0xc9:
|
210
|
+
case 0xca: // float
|
211
|
+
case 0xcb: // double
|
212
|
+
case 0xcc: // unsigned int 8
|
213
|
+
case 0xcd: // unsigned int 16
|
214
|
+
case 0xce: // unsigned int 32
|
215
|
+
case 0xcf: // unsigned int 64
|
216
|
+
case 0xd0: // signed int 8
|
217
|
+
case 0xd1: // signed int 16
|
218
|
+
case 0xd2: // signed int 32
|
219
|
+
case 0xd3: // signed int 64
|
220
|
+
again_fixed_trail(NEXT_CS(p), 1 << (((unsigned int)*p) & 0x03));
|
221
|
+
//case 0xd4:
|
222
|
+
//case 0xd5:
|
223
|
+
//case 0xd6: // big integer 16
|
224
|
+
//case 0xd7: // big integer 32
|
225
|
+
//case 0xd8: // big float 16
|
226
|
+
//case 0xd9: // big float 32
|
227
|
+
case 0xda: // raw 16
|
228
|
+
case 0xdb: // raw 32
|
229
|
+
case 0xdc: // array 16
|
230
|
+
case 0xdd: // array 32
|
231
|
+
case 0xde: // map 16
|
232
|
+
case 0xdf: // map 32
|
233
|
+
again_fixed_trail(NEXT_CS(p), 2 << (((unsigned int)*p) & 0x01));
|
234
|
+
default:
|
235
|
+
goto _failed;
|
236
|
+
}
|
237
|
+
SWITCH_RANGE(0xa0, 0xbf) // FixRaw
|
238
|
+
again_fixed_trail_if_zero(ACS_RAW_VALUE, ((unsigned int)*p & 0x1f), _raw_zero);
|
239
|
+
SWITCH_RANGE(0x90, 0x9f) // FixArray
|
240
|
+
start_container(_array, ((unsigned int)*p) & 0x0f, CT_ARRAY_ITEM);
|
241
|
+
SWITCH_RANGE(0x80, 0x8f) // FixMap
|
242
|
+
start_container(_map, ((unsigned int)*p) & 0x0f, CT_MAP_KEY);
|
243
|
+
|
244
|
+
SWITCH_RANGE_DEFAULT
|
245
|
+
goto _failed;
|
246
|
+
SWITCH_RANGE_END
|
247
|
+
// end CS_HEADER
|
248
|
+
|
249
|
+
|
250
|
+
_fixed_trail_again:
|
251
|
+
++p;
|
252
|
+
|
253
|
+
default:
|
254
|
+
if((size_t)(pe - p) < trail) { goto _out; }
|
255
|
+
n = p; p += trail - 1;
|
256
|
+
switch(cs) {
|
257
|
+
//case CS_
|
258
|
+
//case CS_
|
259
|
+
case CS_FLOAT: {
|
260
|
+
union { uint32_t i; float f; } mem;
|
261
|
+
mem.i = _msgpack_load32(uint32_t,n);
|
262
|
+
push_fixed_value(_float, mem.f); }
|
263
|
+
case CS_DOUBLE: {
|
264
|
+
union { uint64_t i; double f; } mem;
|
265
|
+
mem.i = _msgpack_load64(uint64_t,n);
|
266
|
+
push_fixed_value(_double, mem.f); }
|
267
|
+
case CS_UINT_8:
|
268
|
+
push_fixed_value(_uint8, *(uint8_t*)n);
|
269
|
+
case CS_UINT_16:
|
270
|
+
push_fixed_value(_uint16, _msgpack_load16(uint16_t,n));
|
271
|
+
case CS_UINT_32:
|
272
|
+
push_fixed_value(_uint32, _msgpack_load32(uint32_t,n));
|
273
|
+
case CS_UINT_64:
|
274
|
+
push_fixed_value(_uint64, _msgpack_load64(uint64_t,n));
|
275
|
+
|
276
|
+
case CS_INT_8:
|
277
|
+
push_fixed_value(_int8, *(int8_t*)n);
|
278
|
+
case CS_INT_16:
|
279
|
+
push_fixed_value(_int16, _msgpack_load16(int16_t,n));
|
280
|
+
case CS_INT_32:
|
281
|
+
push_fixed_value(_int32, _msgpack_load32(int32_t,n));
|
282
|
+
case CS_INT_64:
|
283
|
+
push_fixed_value(_int64, _msgpack_load64(int64_t,n));
|
284
|
+
|
285
|
+
//case CS_
|
286
|
+
//case CS_
|
287
|
+
//case CS_BIG_INT_16:
|
288
|
+
// again_fixed_trail_if_zero(ACS_BIG_INT_VALUE, _msgpack_load16(uint16_t,n), _big_int_zero);
|
289
|
+
//case CS_BIG_INT_32:
|
290
|
+
// again_fixed_trail_if_zero(ACS_BIG_INT_VALUE, _msgpack_load32(uint32_t,n), _big_int_zero);
|
291
|
+
//case ACS_BIG_INT_VALUE:
|
292
|
+
//_big_int_zero:
|
293
|
+
// // FIXME
|
294
|
+
// push_variable_value(_big_int, data, n, trail);
|
295
|
+
|
296
|
+
//case CS_BIG_FLOAT_16:
|
297
|
+
// again_fixed_trail_if_zero(ACS_BIG_FLOAT_VALUE, _msgpack_load16(uint16_t,n), _big_float_zero);
|
298
|
+
//case CS_BIG_FLOAT_32:
|
299
|
+
// again_fixed_trail_if_zero(ACS_BIG_FLOAT_VALUE, _msgpack_load32(uint32_t,n), _big_float_zero);
|
300
|
+
//case ACS_BIG_FLOAT_VALUE:
|
301
|
+
//_big_float_zero:
|
302
|
+
// // FIXME
|
303
|
+
// push_variable_value(_big_float, data, n, trail);
|
304
|
+
|
305
|
+
case CS_RAW_16:
|
306
|
+
again_fixed_trail_if_zero(ACS_RAW_VALUE, _msgpack_load16(uint16_t,n), _raw_zero);
|
307
|
+
case CS_RAW_32:
|
308
|
+
again_fixed_trail_if_zero(ACS_RAW_VALUE, _msgpack_load32(uint32_t,n), _raw_zero);
|
309
|
+
case ACS_RAW_VALUE:
|
310
|
+
_raw_zero:
|
311
|
+
push_variable_value(_raw, data, n, trail);
|
312
|
+
|
313
|
+
case CS_ARRAY_16:
|
314
|
+
start_container(_array, _msgpack_load16(uint16_t,n), CT_ARRAY_ITEM);
|
315
|
+
case CS_ARRAY_32:
|
316
|
+
/* FIXME security guard */
|
317
|
+
start_container(_array, _msgpack_load32(uint32_t,n), CT_ARRAY_ITEM);
|
318
|
+
|
319
|
+
case CS_MAP_16:
|
320
|
+
start_container(_map, _msgpack_load16(uint16_t,n), CT_MAP_KEY);
|
321
|
+
case CS_MAP_32:
|
322
|
+
/* FIXME security guard */
|
323
|
+
start_container(_map, _msgpack_load32(uint32_t,n), CT_MAP_KEY);
|
324
|
+
|
325
|
+
default:
|
326
|
+
goto _failed;
|
327
|
+
}
|
328
|
+
}
|
329
|
+
|
330
|
+
_push:
|
331
|
+
if(top == 0) { goto _finish; }
|
332
|
+
c = &stack[top-1];
|
333
|
+
switch(c->ct) {
|
334
|
+
case CT_ARRAY_ITEM:
|
335
|
+
if(msgpack_unpack_callback(_array_item)(user, &c->obj, obj) < 0) { goto _failed; }
|
336
|
+
if(--c->count == 0) {
|
337
|
+
obj = c->obj;
|
338
|
+
--top;
|
339
|
+
/*printf("stack pop %d\n", top);*/
|
340
|
+
goto _push;
|
341
|
+
}
|
342
|
+
goto _header_again;
|
343
|
+
case CT_MAP_KEY:
|
344
|
+
c->map_key = obj;
|
345
|
+
c->ct = CT_MAP_VALUE;
|
346
|
+
goto _header_again;
|
347
|
+
case CT_MAP_VALUE:
|
348
|
+
if(msgpack_unpack_callback(_map_item)(user, &c->obj, c->map_key, obj) < 0) { goto _failed; }
|
349
|
+
if(--c->count == 0) {
|
350
|
+
obj = c->obj;
|
351
|
+
--top;
|
352
|
+
/*printf("stack pop %d\n", top);*/
|
353
|
+
goto _push;
|
354
|
+
}
|
355
|
+
c->ct = CT_MAP_KEY;
|
356
|
+
goto _header_again;
|
357
|
+
|
358
|
+
default:
|
359
|
+
goto _failed;
|
360
|
+
}
|
361
|
+
|
362
|
+
_header_again:
|
363
|
+
cs = CS_HEADER;
|
364
|
+
++p;
|
365
|
+
} while(p != pe);
|
366
|
+
goto _out;
|
367
|
+
|
368
|
+
|
369
|
+
_finish:
|
370
|
+
stack[0].obj = obj;
|
371
|
+
++p;
|
372
|
+
ret = 1;
|
373
|
+
/*printf("-- finish --\n"); */
|
374
|
+
goto _end;
|
375
|
+
|
376
|
+
_failed:
|
377
|
+
/*printf("** FAILED **\n"); */
|
378
|
+
ret = -1;
|
379
|
+
goto _end;
|
380
|
+
|
381
|
+
_out:
|
382
|
+
ret = 0;
|
383
|
+
goto _end;
|
384
|
+
|
385
|
+
_end:
|
386
|
+
ctx->cs = cs;
|
387
|
+
ctx->trail = trail;
|
388
|
+
ctx->top = top;
|
389
|
+
*off = p - (const unsigned char*)data;
|
390
|
+
|
391
|
+
return ret;
|
392
|
+
}
|
393
|
+
|
394
|
+
|
395
|
+
#undef msgpack_unpack_func
|
396
|
+
#undef msgpack_unpack_callback
|
397
|
+
#undef msgpack_unpack_struct
|
398
|
+
#undef msgpack_unpack_object
|
399
|
+
#undef msgpack_unpack_user
|
400
|
+
|
401
|
+
#undef push_simple_value
|
402
|
+
#undef push_fixed_value
|
403
|
+
#undef push_variable_value
|
404
|
+
#undef again_fixed_trail
|
405
|
+
#undef again_fixed_trail_if_zero
|
406
|
+
#undef start_container
|
407
|
+
|
408
|
+
#undef NEXT_CS
|
409
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
/*
|
2
|
+
* MessagePack for C version information
|
3
|
+
*
|
4
|
+
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
* you may not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*/
|
18
|
+
#ifndef MSGPACK_VERSION_H__
|
19
|
+
#define MSGPACK_VERSION_H__
|
20
|
+
|
21
|
+
#ifdef __cplusplus
|
22
|
+
extern "C" {
|
23
|
+
#endif
|
24
|
+
|
25
|
+
|
26
|
+
const char* msgpack_version(void);
|
27
|
+
int msgpack_version_major(void);
|
28
|
+
int msgpack_version_minor(void);
|
29
|
+
|
30
|
+
#define MSGPACK_VERSION "0.5.7"
|
31
|
+
#define MSGPACK_VERSION_MAJOR 0
|
32
|
+
#define MSGPACK_VERSION_MINOR 5
|
33
|
+
|
34
|
+
|
35
|
+
#ifdef __cplusplus
|
36
|
+
}
|
37
|
+
#endif
|
38
|
+
|
39
|
+
#endif /* msgpack/version.h */
|
40
|
+
|
@@ -0,0 +1,142 @@
|
|
1
|
+
/*
|
2
|
+
* MessagePack for C zero-copy buffer implementation
|
3
|
+
*
|
4
|
+
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
* you may not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*/
|
18
|
+
#ifndef MSGPACK_VREFBUFFER_H__
|
19
|
+
#define MSGPACK_VREFBUFFER_H__
|
20
|
+
|
21
|
+
#include "zone.h"
|
22
|
+
#include <stdlib.h>
|
23
|
+
|
24
|
+
#ifndef _WIN32
|
25
|
+
#include <sys/uio.h>
|
26
|
+
#else
|
27
|
+
struct iovec {
|
28
|
+
void *iov_base;
|
29
|
+
size_t iov_len;
|
30
|
+
};
|
31
|
+
#endif
|
32
|
+
|
33
|
+
#ifdef __cplusplus
|
34
|
+
extern "C" {
|
35
|
+
#endif
|
36
|
+
|
37
|
+
|
38
|
+
/**
|
39
|
+
* @defgroup msgpack_vrefbuffer Vectored Referencing buffer
|
40
|
+
* @ingroup msgpack_buffer
|
41
|
+
* @{
|
42
|
+
*/
|
43
|
+
|
44
|
+
struct msgpack_vrefbuffer_chunk;
|
45
|
+
typedef struct msgpack_vrefbuffer_chunk msgpack_vrefbuffer_chunk;
|
46
|
+
|
47
|
+
typedef struct msgpack_vrefbuffer_inner_buffer {
|
48
|
+
size_t free;
|
49
|
+
char* ptr;
|
50
|
+
msgpack_vrefbuffer_chunk* head;
|
51
|
+
} msgpack_vrefbuffer_inner_buffer;
|
52
|
+
|
53
|
+
typedef struct msgpack_vrefbuffer {
|
54
|
+
struct iovec* tail;
|
55
|
+
struct iovec* end;
|
56
|
+
struct iovec* array;
|
57
|
+
|
58
|
+
size_t chunk_size;
|
59
|
+
size_t ref_size;
|
60
|
+
|
61
|
+
msgpack_vrefbuffer_inner_buffer inner_buffer;
|
62
|
+
} msgpack_vrefbuffer;
|
63
|
+
|
64
|
+
|
65
|
+
#ifndef MSGPACK_VREFBUFFER_REF_SIZE
|
66
|
+
#define MSGPACK_VREFBUFFER_REF_SIZE 32
|
67
|
+
#endif
|
68
|
+
|
69
|
+
#ifndef MSGPACK_VREFBUFFER_CHUNK_SIZE
|
70
|
+
#define MSGPACK_VREFBUFFER_CHUNK_SIZE 8192
|
71
|
+
#endif
|
72
|
+
|
73
|
+
bool msgpack_vrefbuffer_init(msgpack_vrefbuffer* vbuf,
|
74
|
+
size_t ref_size, size_t chunk_size);
|
75
|
+
void msgpack_vrefbuffer_destroy(msgpack_vrefbuffer* vbuf);
|
76
|
+
|
77
|
+
static inline msgpack_vrefbuffer* msgpack_vrefbuffer_new(size_t ref_size, size_t chunk_size);
|
78
|
+
static inline void msgpack_vrefbuffer_free(msgpack_vrefbuffer* vbuf);
|
79
|
+
|
80
|
+
static inline int msgpack_vrefbuffer_write(void* data, const char* buf, unsigned int len);
|
81
|
+
|
82
|
+
static inline const struct iovec* msgpack_vrefbuffer_vec(const msgpack_vrefbuffer* vref);
|
83
|
+
static inline size_t msgpack_vrefbuffer_veclen(const msgpack_vrefbuffer* vref);
|
84
|
+
|
85
|
+
int msgpack_vrefbuffer_append_copy(msgpack_vrefbuffer* vbuf,
|
86
|
+
const char* buf, unsigned int len);
|
87
|
+
|
88
|
+
int msgpack_vrefbuffer_append_ref(msgpack_vrefbuffer* vbuf,
|
89
|
+
const char* buf, unsigned int len);
|
90
|
+
|
91
|
+
int msgpack_vrefbuffer_migrate(msgpack_vrefbuffer* vbuf, msgpack_vrefbuffer* to);
|
92
|
+
|
93
|
+
void msgpack_vrefbuffer_clear(msgpack_vrefbuffer* vref);
|
94
|
+
|
95
|
+
/** @} */
|
96
|
+
|
97
|
+
|
98
|
+
msgpack_vrefbuffer* msgpack_vrefbuffer_new(size_t ref_size, size_t chunk_size)
|
99
|
+
{
|
100
|
+
msgpack_vrefbuffer* vbuf = (msgpack_vrefbuffer*)malloc(sizeof(msgpack_vrefbuffer));
|
101
|
+
if(!msgpack_vrefbuffer_init(vbuf, ref_size, chunk_size)) {
|
102
|
+
free(vbuf);
|
103
|
+
return NULL;
|
104
|
+
}
|
105
|
+
return vbuf;
|
106
|
+
}
|
107
|
+
|
108
|
+
void msgpack_vrefbuffer_free(msgpack_vrefbuffer* vbuf)
|
109
|
+
{
|
110
|
+
if(vbuf == NULL) { return; }
|
111
|
+
msgpack_vrefbuffer_destroy(vbuf);
|
112
|
+
free(vbuf);
|
113
|
+
}
|
114
|
+
|
115
|
+
int msgpack_vrefbuffer_write(void* data, const char* buf, unsigned int len)
|
116
|
+
{
|
117
|
+
msgpack_vrefbuffer* vbuf = (msgpack_vrefbuffer*)data;
|
118
|
+
|
119
|
+
if(len < vbuf->ref_size) {
|
120
|
+
return msgpack_vrefbuffer_append_copy(vbuf, buf, len);
|
121
|
+
} else {
|
122
|
+
return msgpack_vrefbuffer_append_ref(vbuf, buf, len);
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
const struct iovec* msgpack_vrefbuffer_vec(const msgpack_vrefbuffer* vref)
|
127
|
+
{
|
128
|
+
return vref->array;
|
129
|
+
}
|
130
|
+
|
131
|
+
size_t msgpack_vrefbuffer_veclen(const msgpack_vrefbuffer* vref)
|
132
|
+
{
|
133
|
+
return vref->tail - vref->array;
|
134
|
+
}
|
135
|
+
|
136
|
+
|
137
|
+
#ifdef __cplusplus
|
138
|
+
}
|
139
|
+
#endif
|
140
|
+
|
141
|
+
#endif /* msgpack/vrefbuffer.h */
|
142
|
+
|
@@ -0,0 +1,97 @@
|
|
1
|
+
//
|
2
|
+
// MessagePack for C++ zero-copy buffer implementation
|
3
|
+
//
|
4
|
+
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
5
|
+
//
|
6
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
// you may not use this file except in compliance with the License.
|
8
|
+
// You may obtain a copy of the License at
|
9
|
+
//
|
10
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
//
|
12
|
+
// Unless required by applicable law or agreed to in writing, software
|
13
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
// See the License for the specific language governing permissions and
|
16
|
+
// limitations under the License.
|
17
|
+
//
|
18
|
+
#ifndef MSGPACK_VREFBUFFER_HPP__
|
19
|
+
#define MSGPACK_VREFBUFFER_HPP__
|
20
|
+
|
21
|
+
#include "vrefbuffer.h"
|
22
|
+
#include <stdexcept>
|
23
|
+
|
24
|
+
namespace msgpack {
|
25
|
+
|
26
|
+
|
27
|
+
class vrefbuffer : public msgpack_vrefbuffer {
|
28
|
+
public:
|
29
|
+
vrefbuffer(size_t ref_size = MSGPACK_VREFBUFFER_REF_SIZE,
|
30
|
+
size_t chunk_size = MSGPACK_VREFBUFFER_CHUNK_SIZE)
|
31
|
+
{
|
32
|
+
msgpack_vrefbuffer_init(this, ref_size, chunk_size);
|
33
|
+
}
|
34
|
+
|
35
|
+
~vrefbuffer()
|
36
|
+
{
|
37
|
+
msgpack_vrefbuffer_destroy(this);
|
38
|
+
}
|
39
|
+
|
40
|
+
public:
|
41
|
+
void write(const char* buf, unsigned int len)
|
42
|
+
{
|
43
|
+
if(len < base::ref_size) {
|
44
|
+
append_copy(buf, len);
|
45
|
+
} else {
|
46
|
+
append_ref(buf, len);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
void append_ref(const char* buf, size_t len)
|
51
|
+
{
|
52
|
+
if(msgpack_vrefbuffer_append_ref(this, buf, len) < 0) {
|
53
|
+
throw std::bad_alloc();
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
void append_copy(const char* buf, size_t len)
|
58
|
+
{
|
59
|
+
if(msgpack_vrefbuffer_append_copy(this, buf, len) < 0) {
|
60
|
+
throw std::bad_alloc();
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
const struct iovec* vector() const
|
65
|
+
{
|
66
|
+
return msgpack_vrefbuffer_vec(this);
|
67
|
+
}
|
68
|
+
|
69
|
+
size_t vector_size() const
|
70
|
+
{
|
71
|
+
return msgpack_vrefbuffer_veclen(this);
|
72
|
+
}
|
73
|
+
|
74
|
+
void migrate(vrefbuffer* to)
|
75
|
+
{
|
76
|
+
if(msgpack_vrefbuffer_migrate(this, to) < 0) {
|
77
|
+
throw std::bad_alloc();
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
void clear()
|
82
|
+
{
|
83
|
+
msgpack_vrefbuffer_clear(this);
|
84
|
+
}
|
85
|
+
|
86
|
+
private:
|
87
|
+
typedef msgpack_vrefbuffer base;
|
88
|
+
|
89
|
+
private:
|
90
|
+
vrefbuffer(const vrefbuffer&);
|
91
|
+
};
|
92
|
+
|
93
|
+
|
94
|
+
} // namespace msgpack
|
95
|
+
|
96
|
+
#endif /* msgpack/vrefbuffer.hpp */
|
97
|
+
|