rroonga 1.3.1-x86-mingw32 → 2.0.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
You should have received a copy of the GNU Lesser General Public
|
15
15
|
License along with this library; if not, write to the Free Software
|
16
|
-
Foundation, Inc.,
|
16
|
+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
17
17
|
*/
|
18
18
|
#ifndef GROONGA_H
|
19
19
|
#define GROONGA_H
|
@@ -737,8 +737,10 @@ GRN_API grn_id grn_table_at(grn_ctx *ctx, grn_obj *table, grn_id id);
|
|
737
737
|
* @table: 対象table
|
738
738
|
* @key: 検索key
|
739
739
|
*
|
740
|
-
* tableがGRN_TABLE_PAT_KEYを指定して作ったtableなら、
|
740
|
+
* tableがGRN_TABLE_PAT_KEYもしくはGRN_TABLE_DAT_KEYを指定して作ったtableなら、
|
741
741
|
* longest common prefix searchを行い、対応するIDを返す。
|
742
|
+
* tableがGRN_TABLE_HASH_KEYを指定して作ったtableなら、
|
743
|
+
* 完全に一致するキーを検索し、対応するIDを返す。
|
742
744
|
**/
|
743
745
|
GRN_API grn_id grn_table_lcp_search(grn_ctx *ctx, grn_obj *table,
|
744
746
|
const void *key, unsigned int key_size);
|
@@ -1963,31 +1965,15 @@ GRN_API grn_posting *grn_geo_cursor_next(grn_ctx *ctx, grn_obj *cursor);
|
|
1963
1965
|
#endif /* GRN_QUERY_COLUMN */
|
1964
1966
|
|
1965
1967
|
typedef struct _grn_snip grn_snip;
|
1966
|
-
typedef struct _grn_query grn_query;
|
1967
1968
|
typedef struct _grn_snip_mapping grn_snip_mapping;
|
1968
1969
|
|
1969
1970
|
struct _grn_snip_mapping {
|
1970
1971
|
void *dummy;
|
1971
1972
|
};
|
1972
1973
|
|
1973
|
-
GRN_API grn_query *grn_query_open(grn_ctx *ctx, const char *str, unsigned int str_len,
|
1974
|
-
grn_operator default_op, int max_exprs);
|
1975
|
-
GRN_API unsigned int grn_query_rest(grn_ctx *ctx, grn_query *q, const char ** const rest);
|
1976
|
-
GRN_API grn_rc grn_query_close(grn_ctx *ctx, grn_query *q);
|
1977
|
-
|
1978
|
-
GRN_API grn_rc grn_query_scan(grn_ctx *ctx, grn_query *q, const char **strs, unsigned int *str_lens,
|
1979
|
-
unsigned int nstrs, int flags, int *found, int *score);
|
1980
|
-
GRN_API grn_snip *grn_query_snip(grn_ctx *ctx, grn_query *query, int flags,
|
1981
|
-
unsigned int width, unsigned int max_results,
|
1982
|
-
unsigned int n_tags,
|
1983
|
-
const char **opentags, unsigned int *opentag_lens,
|
1984
|
-
const char **closetags, unsigned int *closetag_lens,
|
1985
|
-
grn_snip_mapping *mapping);
|
1986
|
-
|
1987
1974
|
#define GRN_SNIP_NORMALIZE (0x01<<0)
|
1988
1975
|
#define GRN_SNIP_COPY_TAG (0x01<<1)
|
1989
1976
|
#define GRN_SNIP_SKIP_LEADING_SPACES (0x01<<2)
|
1990
|
-
#define GRN_QUERY_SCAN_NORMALIZE GRN_SNIP_NORMALIZE
|
1991
1977
|
|
1992
1978
|
GRN_API grn_snip *grn_snip_open(grn_ctx *ctx, int flags, unsigned int width,
|
1993
1979
|
unsigned int max_results,
|
@@ -2820,6 +2806,20 @@ GRN_API grn_rc grn_dat_cursor_delete(grn_ctx *ctx, grn_dat_cursor *c,
|
|
2820
2806
|
}\
|
2821
2807
|
} while (0)
|
2822
2808
|
|
2809
|
+
/* buffered index builder */
|
2810
|
+
/* 特定のアプリケーション用に準備した内部APIです。 */
|
2811
|
+
|
2812
|
+
typedef struct _grn_ii grn_ii;
|
2813
|
+
typedef struct _grn_ii_buffer grn_ii_buffer;
|
2814
|
+
|
2815
|
+
grn_ii_buffer *grn_ii_buffer_open(grn_ctx *ctx, grn_ii *ii,
|
2816
|
+
long long unsigned int update_buffer_size);
|
2817
|
+
grn_rc grn_ii_buffer_append(grn_ctx *ctx, grn_ii_buffer *ii_buffer,
|
2818
|
+
grn_id rid, unsigned int section, grn_obj *value);
|
2819
|
+
grn_rc grn_ii_buffer_commit(grn_ctx *ctx, grn_ii_buffer *ii_buffer);
|
2820
|
+
grn_rc grn_ii_buffer_close(grn_ctx *ctx, grn_ii_buffer *ii_buffer);
|
2821
|
+
|
2822
|
+
|
2823
2823
|
#ifdef __cplusplus
|
2824
2824
|
}
|
2825
2825
|
#endif
|
@@ -0,0 +1,98 @@
|
|
1
|
+
/*
|
2
|
+
* MessagePack for C dynamic typing routine
|
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_OBJECT_H__
|
19
|
+
#define MSGPACK_OBJECT_H__
|
20
|
+
|
21
|
+
#include "zone.h"
|
22
|
+
#include <stdio.h>
|
23
|
+
|
24
|
+
#ifdef __cplusplus
|
25
|
+
extern "C" {
|
26
|
+
#endif
|
27
|
+
|
28
|
+
|
29
|
+
/**
|
30
|
+
* @defgroup msgpack_object Dynamically typed object
|
31
|
+
* @ingroup msgpack
|
32
|
+
* @{
|
33
|
+
*/
|
34
|
+
|
35
|
+
typedef enum {
|
36
|
+
MSGPACK_OBJECT_NIL = 0x00,
|
37
|
+
MSGPACK_OBJECT_BOOLEAN = 0x01,
|
38
|
+
MSGPACK_OBJECT_POSITIVE_INTEGER = 0x02,
|
39
|
+
MSGPACK_OBJECT_NEGATIVE_INTEGER = 0x03,
|
40
|
+
MSGPACK_OBJECT_DOUBLE = 0x04,
|
41
|
+
MSGPACK_OBJECT_RAW = 0x05,
|
42
|
+
MSGPACK_OBJECT_ARRAY = 0x06,
|
43
|
+
MSGPACK_OBJECT_MAP = 0x07,
|
44
|
+
} msgpack_object_type;
|
45
|
+
|
46
|
+
|
47
|
+
struct msgpack_object;
|
48
|
+
struct msgpack_object_kv;
|
49
|
+
|
50
|
+
typedef struct {
|
51
|
+
uint32_t size;
|
52
|
+
struct msgpack_object* ptr;
|
53
|
+
} msgpack_object_array;
|
54
|
+
|
55
|
+
typedef struct {
|
56
|
+
uint32_t size;
|
57
|
+
struct msgpack_object_kv* ptr;
|
58
|
+
} msgpack_object_map;
|
59
|
+
|
60
|
+
typedef struct {
|
61
|
+
uint32_t size;
|
62
|
+
const char* ptr;
|
63
|
+
} msgpack_object_raw;
|
64
|
+
|
65
|
+
typedef union {
|
66
|
+
bool boolean;
|
67
|
+
uint64_t u64;
|
68
|
+
int64_t i64;
|
69
|
+
double dec;
|
70
|
+
msgpack_object_array array;
|
71
|
+
msgpack_object_map map;
|
72
|
+
msgpack_object_raw raw;
|
73
|
+
} msgpack_object_union;
|
74
|
+
|
75
|
+
typedef struct msgpack_object {
|
76
|
+
msgpack_object_type type;
|
77
|
+
msgpack_object_union via;
|
78
|
+
} msgpack_object;
|
79
|
+
|
80
|
+
typedef struct msgpack_object_kv {
|
81
|
+
msgpack_object key;
|
82
|
+
msgpack_object val;
|
83
|
+
} msgpack_object_kv;
|
84
|
+
|
85
|
+
|
86
|
+
void msgpack_object_print(FILE* out, msgpack_object o);
|
87
|
+
|
88
|
+
bool msgpack_object_equal(const msgpack_object x, const msgpack_object y);
|
89
|
+
|
90
|
+
/** @} */
|
91
|
+
|
92
|
+
|
93
|
+
#ifdef __cplusplus
|
94
|
+
}
|
95
|
+
#endif
|
96
|
+
|
97
|
+
#endif /* msgpack/object.h */
|
98
|
+
|
@@ -0,0 +1,412 @@
|
|
1
|
+
//
|
2
|
+
// MessagePack for C++ static resolution routine
|
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_OBJECT_HPP__
|
19
|
+
#define MSGPACK_OBJECT_HPP__
|
20
|
+
|
21
|
+
#include "object.h"
|
22
|
+
#include "pack.hpp"
|
23
|
+
#include "zone.hpp"
|
24
|
+
#include <string.h>
|
25
|
+
#include <stdexcept>
|
26
|
+
#include <typeinfo>
|
27
|
+
#include <limits>
|
28
|
+
#include <ostream>
|
29
|
+
|
30
|
+
namespace msgpack {
|
31
|
+
|
32
|
+
|
33
|
+
class type_error : public std::bad_cast { };
|
34
|
+
|
35
|
+
|
36
|
+
namespace type {
|
37
|
+
enum object_type {
|
38
|
+
NIL = MSGPACK_OBJECT_NIL,
|
39
|
+
BOOLEAN = MSGPACK_OBJECT_BOOLEAN,
|
40
|
+
POSITIVE_INTEGER = MSGPACK_OBJECT_POSITIVE_INTEGER,
|
41
|
+
NEGATIVE_INTEGER = MSGPACK_OBJECT_NEGATIVE_INTEGER,
|
42
|
+
DOUBLE = MSGPACK_OBJECT_DOUBLE,
|
43
|
+
RAW = MSGPACK_OBJECT_RAW,
|
44
|
+
ARRAY = MSGPACK_OBJECT_ARRAY,
|
45
|
+
MAP = MSGPACK_OBJECT_MAP,
|
46
|
+
};
|
47
|
+
}
|
48
|
+
|
49
|
+
|
50
|
+
struct object;
|
51
|
+
struct object_kv;
|
52
|
+
|
53
|
+
struct object_array {
|
54
|
+
uint32_t size;
|
55
|
+
object* ptr;
|
56
|
+
};
|
57
|
+
|
58
|
+
struct object_map {
|
59
|
+
uint32_t size;
|
60
|
+
object_kv* ptr;
|
61
|
+
};
|
62
|
+
|
63
|
+
struct object_raw {
|
64
|
+
uint32_t size;
|
65
|
+
const char* ptr;
|
66
|
+
};
|
67
|
+
|
68
|
+
struct object {
|
69
|
+
union union_type {
|
70
|
+
bool boolean;
|
71
|
+
uint64_t u64;
|
72
|
+
int64_t i64;
|
73
|
+
double dec;
|
74
|
+
object_array array;
|
75
|
+
object_map map;
|
76
|
+
object_raw raw;
|
77
|
+
object_raw ref; // obsolete
|
78
|
+
};
|
79
|
+
|
80
|
+
type::object_type type;
|
81
|
+
union_type via;
|
82
|
+
|
83
|
+
bool is_nil() const { return type == type::NIL; }
|
84
|
+
|
85
|
+
template <typename T>
|
86
|
+
T as() const;
|
87
|
+
|
88
|
+
template <typename T>
|
89
|
+
void convert(T* v) const;
|
90
|
+
|
91
|
+
object();
|
92
|
+
|
93
|
+
object(msgpack_object o);
|
94
|
+
|
95
|
+
template <typename T>
|
96
|
+
explicit object(const T& v);
|
97
|
+
|
98
|
+
template <typename T>
|
99
|
+
object(const T& v, zone* z);
|
100
|
+
|
101
|
+
template <typename T>
|
102
|
+
object& operator=(const T& v);
|
103
|
+
|
104
|
+
operator msgpack_object() const;
|
105
|
+
|
106
|
+
struct with_zone;
|
107
|
+
|
108
|
+
private:
|
109
|
+
struct implicit_type;
|
110
|
+
|
111
|
+
public:
|
112
|
+
implicit_type convert() const;
|
113
|
+
};
|
114
|
+
|
115
|
+
struct object_kv {
|
116
|
+
object key;
|
117
|
+
object val;
|
118
|
+
};
|
119
|
+
|
120
|
+
struct object::with_zone : object {
|
121
|
+
with_zone(msgpack::zone* zone) : zone(zone) { }
|
122
|
+
msgpack::zone* zone;
|
123
|
+
private:
|
124
|
+
with_zone();
|
125
|
+
};
|
126
|
+
|
127
|
+
|
128
|
+
bool operator==(const object x, const object y);
|
129
|
+
bool operator!=(const object x, const object y);
|
130
|
+
|
131
|
+
template <typename T>
|
132
|
+
bool operator==(const object x, const T& y);
|
133
|
+
|
134
|
+
template <typename T>
|
135
|
+
bool operator==(const T& y, const object x);
|
136
|
+
|
137
|
+
template <typename T>
|
138
|
+
bool operator!=(const object x, const T& y);
|
139
|
+
|
140
|
+
template <typename T>
|
141
|
+
bool operator!=(const T& y, const object x);
|
142
|
+
|
143
|
+
std::ostream& operator<< (std::ostream& s, const object o);
|
144
|
+
|
145
|
+
|
146
|
+
// serialize operator
|
147
|
+
template <typename Stream, typename T>
|
148
|
+
packer<Stream>& operator<< (packer<Stream>& o, const T& v);
|
149
|
+
|
150
|
+
// convert operator
|
151
|
+
template <typename T>
|
152
|
+
T& operator>> (object o, T& v);
|
153
|
+
|
154
|
+
// deconvert operator
|
155
|
+
template <typename T>
|
156
|
+
void operator<< (object::with_zone& o, const T& v);
|
157
|
+
|
158
|
+
|
159
|
+
struct object::implicit_type {
|
160
|
+
implicit_type(object o) : obj(o) { }
|
161
|
+
~implicit_type() { }
|
162
|
+
|
163
|
+
template <typename T>
|
164
|
+
operator T() { return obj.as<T>(); }
|
165
|
+
|
166
|
+
private:
|
167
|
+
object obj;
|
168
|
+
};
|
169
|
+
|
170
|
+
|
171
|
+
// obsolete
|
172
|
+
template <typename Type>
|
173
|
+
class define : public Type {
|
174
|
+
public:
|
175
|
+
typedef Type msgpack_type;
|
176
|
+
typedef define<Type> define_type;
|
177
|
+
|
178
|
+
define() {}
|
179
|
+
define(const msgpack_type& v) : msgpack_type(v) {}
|
180
|
+
|
181
|
+
template <typename Packer>
|
182
|
+
void msgpack_pack(Packer& o) const
|
183
|
+
{
|
184
|
+
o << static_cast<const msgpack_type&>(*this);
|
185
|
+
}
|
186
|
+
|
187
|
+
void msgpack_unpack(object o)
|
188
|
+
{
|
189
|
+
o >> static_cast<msgpack_type&>(*this);
|
190
|
+
}
|
191
|
+
};
|
192
|
+
|
193
|
+
|
194
|
+
template <typename Stream>
|
195
|
+
template <typename T>
|
196
|
+
inline packer<Stream>& packer<Stream>::pack(const T& v)
|
197
|
+
{
|
198
|
+
*this << v;
|
199
|
+
return *this;
|
200
|
+
}
|
201
|
+
|
202
|
+
inline object& operator>> (object o, object& v)
|
203
|
+
{
|
204
|
+
v = o;
|
205
|
+
return v;
|
206
|
+
}
|
207
|
+
|
208
|
+
template <typename T>
|
209
|
+
inline T& operator>> (object o, T& v)
|
210
|
+
{
|
211
|
+
v.msgpack_unpack(o.convert());
|
212
|
+
return v;
|
213
|
+
}
|
214
|
+
|
215
|
+
template <typename Stream, typename T>
|
216
|
+
inline packer<Stream>& operator<< (packer<Stream>& o, const T& v)
|
217
|
+
{
|
218
|
+
v.msgpack_pack(o);
|
219
|
+
return o;
|
220
|
+
}
|
221
|
+
|
222
|
+
template <typename T>
|
223
|
+
void operator<< (object::with_zone& o, const T& v)
|
224
|
+
{
|
225
|
+
v.msgpack_object(static_cast<object*>(&o), o.zone);
|
226
|
+
}
|
227
|
+
|
228
|
+
|
229
|
+
inline bool operator==(const object x, const object y)
|
230
|
+
{
|
231
|
+
return msgpack_object_equal(x, y);
|
232
|
+
}
|
233
|
+
|
234
|
+
template <typename T>
|
235
|
+
inline bool operator==(const object x, const T& y)
|
236
|
+
try {
|
237
|
+
return x == object(y);
|
238
|
+
} catch (msgpack::type_error&) {
|
239
|
+
return false;
|
240
|
+
}
|
241
|
+
|
242
|
+
inline bool operator!=(const object x, const object y)
|
243
|
+
{ return !(x == y); }
|
244
|
+
|
245
|
+
template <typename T>
|
246
|
+
inline bool operator==(const T& y, const object x)
|
247
|
+
{ return x == y; }
|
248
|
+
|
249
|
+
template <typename T>
|
250
|
+
inline bool operator!=(const object x, const T& y)
|
251
|
+
{ return !(x == y); }
|
252
|
+
|
253
|
+
template <typename T>
|
254
|
+
inline bool operator!=(const T& y, const object x)
|
255
|
+
{ return x != y; }
|
256
|
+
|
257
|
+
|
258
|
+
inline object::implicit_type object::convert() const
|
259
|
+
{
|
260
|
+
return implicit_type(*this);
|
261
|
+
}
|
262
|
+
|
263
|
+
template <typename T>
|
264
|
+
inline void object::convert(T* v) const
|
265
|
+
{
|
266
|
+
*this >> *v;
|
267
|
+
}
|
268
|
+
|
269
|
+
template <typename T>
|
270
|
+
inline T object::as() const
|
271
|
+
{
|
272
|
+
T v;
|
273
|
+
convert(&v);
|
274
|
+
return v;
|
275
|
+
}
|
276
|
+
|
277
|
+
|
278
|
+
inline object::object()
|
279
|
+
{
|
280
|
+
type = type::NIL;
|
281
|
+
}
|
282
|
+
|
283
|
+
template <typename T>
|
284
|
+
inline object::object(const T& v)
|
285
|
+
{
|
286
|
+
*this << v;
|
287
|
+
}
|
288
|
+
|
289
|
+
template <typename T>
|
290
|
+
inline object& object::operator=(const T& v)
|
291
|
+
{
|
292
|
+
*this = object(v);
|
293
|
+
return *this;
|
294
|
+
}
|
295
|
+
|
296
|
+
template <typename T>
|
297
|
+
object::object(const T& v, zone* z)
|
298
|
+
{
|
299
|
+
with_zone oz(z);
|
300
|
+
oz << v;
|
301
|
+
type = oz.type;
|
302
|
+
via = oz.via;
|
303
|
+
}
|
304
|
+
|
305
|
+
|
306
|
+
inline object::object(msgpack_object o)
|
307
|
+
{
|
308
|
+
// FIXME beter way?
|
309
|
+
::memcpy(this, &o, sizeof(o));
|
310
|
+
}
|
311
|
+
|
312
|
+
inline void operator<< (object& o, msgpack_object v)
|
313
|
+
{
|
314
|
+
// FIXME beter way?
|
315
|
+
::memcpy(&o, &v, sizeof(v));
|
316
|
+
}
|
317
|
+
|
318
|
+
inline object::operator msgpack_object() const
|
319
|
+
{
|
320
|
+
// FIXME beter way?
|
321
|
+
msgpack_object obj;
|
322
|
+
::memcpy(&obj, this, sizeof(obj));
|
323
|
+
return obj;
|
324
|
+
}
|
325
|
+
|
326
|
+
|
327
|
+
// obsolete
|
328
|
+
template <typename T>
|
329
|
+
inline void convert(T& v, object o)
|
330
|
+
{
|
331
|
+
o.convert(&v);
|
332
|
+
}
|
333
|
+
|
334
|
+
// obsolete
|
335
|
+
template <typename Stream, typename T>
|
336
|
+
inline void pack(packer<Stream>& o, const T& v)
|
337
|
+
{
|
338
|
+
o.pack(v);
|
339
|
+
}
|
340
|
+
|
341
|
+
// obsolete
|
342
|
+
template <typename Stream, typename T>
|
343
|
+
inline void pack_copy(packer<Stream>& o, T v)
|
344
|
+
{
|
345
|
+
pack(o, v);
|
346
|
+
}
|
347
|
+
|
348
|
+
|
349
|
+
template <typename Stream>
|
350
|
+
packer<Stream>& operator<< (packer<Stream>& o, const object& v)
|
351
|
+
{
|
352
|
+
switch(v.type) {
|
353
|
+
case type::NIL:
|
354
|
+
o.pack_nil();
|
355
|
+
return o;
|
356
|
+
|
357
|
+
case type::BOOLEAN:
|
358
|
+
if(v.via.boolean) {
|
359
|
+
o.pack_true();
|
360
|
+
} else {
|
361
|
+
o.pack_false();
|
362
|
+
}
|
363
|
+
return o;
|
364
|
+
|
365
|
+
case type::POSITIVE_INTEGER:
|
366
|
+
o.pack_uint64(v.via.u64);
|
367
|
+
return o;
|
368
|
+
|
369
|
+
case type::NEGATIVE_INTEGER:
|
370
|
+
o.pack_int64(v.via.i64);
|
371
|
+
return o;
|
372
|
+
|
373
|
+
case type::DOUBLE:
|
374
|
+
o.pack_double(v.via.dec);
|
375
|
+
return o;
|
376
|
+
|
377
|
+
case type::RAW:
|
378
|
+
o.pack_raw(v.via.raw.size);
|
379
|
+
o.pack_raw_body(v.via.raw.ptr, v.via.raw.size);
|
380
|
+
return o;
|
381
|
+
|
382
|
+
case type::ARRAY:
|
383
|
+
o.pack_array(v.via.array.size);
|
384
|
+
for(object* p(v.via.array.ptr),
|
385
|
+
* const pend(v.via.array.ptr + v.via.array.size);
|
386
|
+
p < pend; ++p) {
|
387
|
+
o << *p;
|
388
|
+
}
|
389
|
+
return o;
|
390
|
+
|
391
|
+
case type::MAP:
|
392
|
+
o.pack_map(v.via.map.size);
|
393
|
+
for(object_kv* p(v.via.map.ptr),
|
394
|
+
* const pend(v.via.map.ptr + v.via.map.size);
|
395
|
+
p < pend; ++p) {
|
396
|
+
o << p->key;
|
397
|
+
o << p->val;
|
398
|
+
}
|
399
|
+
return o;
|
400
|
+
|
401
|
+
default:
|
402
|
+
throw type_error();
|
403
|
+
}
|
404
|
+
}
|
405
|
+
|
406
|
+
|
407
|
+
} // namespace msgpack
|
408
|
+
|
409
|
+
#include "msgpack/type.hpp"
|
410
|
+
|
411
|
+
#endif /* msgpack/object.hpp */
|
412
|
+
|
@@ -0,0 +1,143 @@
|
|
1
|
+
/*
|
2
|
+
* MessagePack for C packing routine
|
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_PACK_H__
|
19
|
+
#define MSGPACK_PACK_H__
|
20
|
+
|
21
|
+
#include "pack_define.h"
|
22
|
+
#include "object.h"
|
23
|
+
#include <stdlib.h>
|
24
|
+
|
25
|
+
#ifdef __cplusplus
|
26
|
+
extern "C" {
|
27
|
+
#endif
|
28
|
+
|
29
|
+
|
30
|
+
/**
|
31
|
+
* @defgroup msgpack_buffer Buffers
|
32
|
+
* @ingroup msgpack
|
33
|
+
* @{
|
34
|
+
* @}
|
35
|
+
*/
|
36
|
+
|
37
|
+
/**
|
38
|
+
* @defgroup msgpack_pack Serializer
|
39
|
+
* @ingroup msgpack
|
40
|
+
* @{
|
41
|
+
*/
|
42
|
+
|
43
|
+
typedef int (*msgpack_packer_write)(void* data, const char* buf, unsigned int len);
|
44
|
+
|
45
|
+
typedef struct msgpack_packer {
|
46
|
+
void* data;
|
47
|
+
msgpack_packer_write callback;
|
48
|
+
} msgpack_packer;
|
49
|
+
|
50
|
+
static void msgpack_packer_init(msgpack_packer* pk, void* data, msgpack_packer_write callback);
|
51
|
+
|
52
|
+
static msgpack_packer* msgpack_packer_new(void* data, msgpack_packer_write callback);
|
53
|
+
static void msgpack_packer_free(msgpack_packer* pk);
|
54
|
+
|
55
|
+
static int msgpack_pack_short(msgpack_packer* pk, short d);
|
56
|
+
static int msgpack_pack_int(msgpack_packer* pk, int d);
|
57
|
+
static int msgpack_pack_long(msgpack_packer* pk, long d);
|
58
|
+
static int msgpack_pack_long_long(msgpack_packer* pk, long long d);
|
59
|
+
static int msgpack_pack_unsigned_short(msgpack_packer* pk, unsigned short d);
|
60
|
+
static int msgpack_pack_unsigned_int(msgpack_packer* pk, unsigned int d);
|
61
|
+
static int msgpack_pack_unsigned_long(msgpack_packer* pk, unsigned long d);
|
62
|
+
static int msgpack_pack_unsigned_long_long(msgpack_packer* pk, unsigned long long d);
|
63
|
+
|
64
|
+
static int msgpack_pack_uint8(msgpack_packer* pk, uint8_t d);
|
65
|
+
static int msgpack_pack_uint16(msgpack_packer* pk, uint16_t d);
|
66
|
+
static int msgpack_pack_uint32(msgpack_packer* pk, uint32_t d);
|
67
|
+
static int msgpack_pack_uint64(msgpack_packer* pk, uint64_t d);
|
68
|
+
static int msgpack_pack_int8(msgpack_packer* pk, int8_t d);
|
69
|
+
static int msgpack_pack_int16(msgpack_packer* pk, int16_t d);
|
70
|
+
static int msgpack_pack_int32(msgpack_packer* pk, int32_t d);
|
71
|
+
static int msgpack_pack_int64(msgpack_packer* pk, int64_t d);
|
72
|
+
|
73
|
+
static int msgpack_pack_fix_uint8(msgpack_packer* pk, uint8_t d);
|
74
|
+
static int msgpack_pack_fix_uint16(msgpack_packer* pk, uint16_t d);
|
75
|
+
static int msgpack_pack_fix_uint32(msgpack_packer* pk, uint32_t d);
|
76
|
+
static int msgpack_pack_fix_uint64(msgpack_packer* pk, uint64_t d);
|
77
|
+
static int msgpack_pack_fix_int8(msgpack_packer* pk, int8_t d);
|
78
|
+
static int msgpack_pack_fix_int16(msgpack_packer* pk, int16_t d);
|
79
|
+
static int msgpack_pack_fix_int32(msgpack_packer* pk, int32_t d);
|
80
|
+
static int msgpack_pack_fix_int64(msgpack_packer* pk, int64_t d);
|
81
|
+
|
82
|
+
static int msgpack_pack_float(msgpack_packer* pk, float d);
|
83
|
+
static int msgpack_pack_double(msgpack_packer* pk, double d);
|
84
|
+
|
85
|
+
static int msgpack_pack_nil(msgpack_packer* pk);
|
86
|
+
static int msgpack_pack_true(msgpack_packer* pk);
|
87
|
+
static int msgpack_pack_false(msgpack_packer* pk);
|
88
|
+
|
89
|
+
static int msgpack_pack_array(msgpack_packer* pk, unsigned int n);
|
90
|
+
|
91
|
+
static int msgpack_pack_map(msgpack_packer* pk, unsigned int n);
|
92
|
+
|
93
|
+
static int msgpack_pack_raw(msgpack_packer* pk, size_t l);
|
94
|
+
static int msgpack_pack_raw_body(msgpack_packer* pk, const void* b, size_t l);
|
95
|
+
|
96
|
+
int msgpack_pack_object(msgpack_packer* pk, msgpack_object d);
|
97
|
+
|
98
|
+
|
99
|
+
/** @} */
|
100
|
+
|
101
|
+
|
102
|
+
#define msgpack_pack_inline_func(name) \
|
103
|
+
inline int msgpack_pack ## name
|
104
|
+
|
105
|
+
#define msgpack_pack_inline_func_cint(name) \
|
106
|
+
inline int msgpack_pack ## name
|
107
|
+
|
108
|
+
#define msgpack_pack_inline_func_fixint(name) \
|
109
|
+
inline int msgpack_pack_fix ## name
|
110
|
+
|
111
|
+
#define msgpack_pack_user msgpack_packer*
|
112
|
+
|
113
|
+
#define msgpack_pack_append_buffer(user, buf, len) \
|
114
|
+
return (*(user)->callback)((user)->data, (const char*)buf, len)
|
115
|
+
|
116
|
+
#include "pack_template.h"
|
117
|
+
|
118
|
+
inline void msgpack_packer_init(msgpack_packer* pk, void* data, msgpack_packer_write callback)
|
119
|
+
{
|
120
|
+
pk->data = data;
|
121
|
+
pk->callback = callback;
|
122
|
+
}
|
123
|
+
|
124
|
+
inline msgpack_packer* msgpack_packer_new(void* data, msgpack_packer_write callback)
|
125
|
+
{
|
126
|
+
msgpack_packer* pk = (msgpack_packer*)calloc(1, sizeof(msgpack_packer));
|
127
|
+
if(!pk) { return NULL; }
|
128
|
+
msgpack_packer_init(pk, data, callback);
|
129
|
+
return pk;
|
130
|
+
}
|
131
|
+
|
132
|
+
inline void msgpack_packer_free(msgpack_packer* pk)
|
133
|
+
{
|
134
|
+
free(pk);
|
135
|
+
}
|
136
|
+
|
137
|
+
|
138
|
+
#ifdef __cplusplus
|
139
|
+
}
|
140
|
+
#endif
|
141
|
+
|
142
|
+
#endif /* msgpack/pack.h */
|
143
|
+
|