heroku-tokyotyrant 0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +504 -0
- data/README.rdoc +231 -0
- data/Rakefile +72 -0
- data/benchmarks/balancer.rb +101 -0
- data/benchmarks/bulk_db.rb +74 -0
- data/benchmarks/bulk_table.rb +87 -0
- data/benchmarks/db.rb +114 -0
- data/benchmarks/table.rb +161 -0
- data/ext/extconf.rb +43 -0
- data/ext/tokyo/bin/tcamgr +0 -0
- data/ext/tokyo/bin/tcamttest +0 -0
- data/ext/tokyo/bin/tcatest +0 -0
- data/ext/tokyo/bin/tcbmgr +0 -0
- data/ext/tokyo/bin/tcbmttest +0 -0
- data/ext/tokyo/bin/tcbtest +0 -0
- data/ext/tokyo/bin/tcfmgr +0 -0
- data/ext/tokyo/bin/tcfmttest +0 -0
- data/ext/tokyo/bin/tcftest +0 -0
- data/ext/tokyo/bin/tchmgr +0 -0
- data/ext/tokyo/bin/tchmttest +0 -0
- data/ext/tokyo/bin/tchtest +0 -0
- data/ext/tokyo/bin/tcrmgr +0 -0
- data/ext/tokyo/bin/tcrmttest +0 -0
- data/ext/tokyo/bin/tcrtest +0 -0
- data/ext/tokyo/bin/tctmgr +0 -0
- data/ext/tokyo/bin/tctmttest +0 -0
- data/ext/tokyo/bin/tcttest +0 -0
- data/ext/tokyo/bin/tcucodec +0 -0
- data/ext/tokyo/bin/tcumttest +0 -0
- data/ext/tokyo/bin/tcutest +0 -0
- data/ext/tokyo/bin/ttserver +0 -0
- data/ext/tokyo/bin/ttulmgr +0 -0
- data/ext/tokyo/bin/ttultest +0 -0
- data/ext/tokyo/include/tcadb.h +548 -0
- data/ext/tokyo/include/tcbdb.h +1101 -0
- data/ext/tokyo/include/tcfdb.h +858 -0
- data/ext/tokyo/include/tchdb.h +871 -0
- data/ext/tokyo/include/tcrdb.h +801 -0
- data/ext/tokyo/include/tctdb.h +1086 -0
- data/ext/tokyo/include/tculog.h +392 -0
- data/ext/tokyo/include/tcutil.h +4184 -0
- data/ext/tokyo/include/ttutil.h +494 -0
- data/ext/tokyo/lib/libtokyocabinet.9.4.0.dylib +0 -0
- data/ext/tokyo/lib/libtokyocabinet.9.dylib +0 -0
- data/ext/tokyo/lib/libtokyocabinet.a +0 -0
- data/ext/tokyo/lib/libtokyocabinet.dylib +0 -0
- data/ext/tokyo/lib/libtokyotyrant.3.22.0.dylib +0 -0
- data/ext/tokyo/lib/libtokyotyrant.3.dylib +0 -0
- data/ext/tokyo/lib/libtokyotyrant.a +0 -0
- data/ext/tokyo/lib/libtokyotyrant.dylib +0 -0
- data/ext/tokyo/lib/pkgconfig/tokyocabinet.pc +14 -0
- data/ext/tokyo/lib/pkgconfig/tokyotyrant.pc +14 -0
- data/ext/tokyo/lib/ttskeldir.bundle +0 -0
- data/ext/tokyo/lib/ttskelmock.bundle +0 -0
- data/ext/tokyo/lib/ttskelnull.bundle +0 -0
- data/ext/tokyo/lib/ttskelproxy.bundle +0 -0
- data/ext/tokyo/libexec/tcawmgr.cgi +0 -0
- data/ext/tokyo/sbin/ttservctl +163 -0
- data/ext/tokyo/share/man/man1/tcamgr.1 +97 -0
- data/ext/tokyo/share/man/man1/tcamttest.1 +35 -0
- data/ext/tokyo/share/man/man1/tcatest.1 +55 -0
- data/ext/tokyo/share/man/man1/tcbmgr.1 +125 -0
- data/ext/tokyo/share/man/man1/tcbmttest.1 +81 -0
- data/ext/tokyo/share/man/man1/tcbtest.1 +107 -0
- data/ext/tokyo/share/man/man1/tcfmgr.1 +98 -0
- data/ext/tokyo/share/man/man1/tcfmttest.1 +62 -0
- data/ext/tokyo/share/man/man1/tcftest.1 +73 -0
- data/ext/tokyo/share/man/man1/tchmgr.1 +110 -0
- data/ext/tokyo/share/man/man1/tchmttest.1 +85 -0
- data/ext/tokyo/share/man/man1/tchtest.1 +95 -0
- data/ext/tokyo/share/man/man1/tcrmgr.1 +164 -0
- data/ext/tokyo/share/man/man1/tcrmttest.1 +55 -0
- data/ext/tokyo/share/man/man1/tcrtest.1 +89 -0
- data/ext/tokyo/share/man/man1/tctmgr.1 +140 -0
- data/ext/tokyo/share/man/man1/tctmttest.1 +92 -0
- data/ext/tokyo/share/man/man1/tcttest.1 +105 -0
- data/ext/tokyo/share/man/man1/tcucodec.1 +162 -0
- data/ext/tokyo/share/man/man1/tcumttest.1 +41 -0
- data/ext/tokyo/share/man/man1/tcutest.1 +81 -0
- data/ext/tokyo/share/man/man1/ttserver.1 +84 -0
- data/ext/tokyo/share/man/man1/ttulmgr.1 +40 -0
- data/ext/tokyo/share/man/man1/ttultest.1 +16 -0
- data/ext/tokyo/share/man/man3/tcadb.3 +676 -0
- data/ext/tokyo/share/man/man3/tcbdb.3 +1355 -0
- data/ext/tokyo/share/man/man3/tcfdb.3 +975 -0
- data/ext/tokyo/share/man/man3/tchdb.3 +898 -0
- data/ext/tokyo/share/man/man3/tclist.3 +1 -0
- data/ext/tokyo/share/man/man3/tcmap.3 +1 -0
- data/ext/tokyo/share/man/man3/tcmdb.3 +1 -0
- data/ext/tokyo/share/man/man3/tcmpool.3 +1 -0
- data/ext/tokyo/share/man/man3/tcrdb.3 +1309 -0
- data/ext/tokyo/share/man/man3/tctdb.3 +1110 -0
- data/ext/tokyo/share/man/man3/tctree.3 +1 -0
- data/ext/tokyo/share/man/man3/tculog.3 +15 -0
- data/ext/tokyo/share/man/man3/tcutil.3 +4518 -0
- data/ext/tokyo/share/man/man3/tcxstr.3 +1 -0
- data/ext/tokyo/share/man/man3/tokyocabinet.3 +132 -0
- data/ext/tokyo/share/man/man3/ttutil.3 +14 -0
- data/ext/tokyo/share/man/man8/ttservctl.8 +37 -0
- data/ext/tokyo/share/tokyocabinet/COPYING +504 -0
- data/ext/tokyo/share/tokyocabinet/ChangeLog +1252 -0
- data/ext/tokyo/share/tokyocabinet/THANKS +12 -0
- data/ext/tokyo/share/tokyocabinet/doc/benchmark.pdf +0 -0
- data/ext/tokyo/share/tokyocabinet/doc/common.css +211 -0
- data/ext/tokyo/share/tokyocabinet/doc/icon16.png +0 -0
- data/ext/tokyo/share/tokyocabinet/doc/index.html +156 -0
- data/ext/tokyo/share/tokyocabinet/doc/index.ja.html +197 -0
- data/ext/tokyo/share/tokyocabinet/doc/logo-ja.png +0 -0
- data/ext/tokyo/share/tokyocabinet/doc/logo.png +0 -0
- data/ext/tokyo/share/tokyocabinet/doc/spex-en.html +7145 -0
- data/ext/tokyo/share/tokyocabinet/doc/spex-ja.html +7476 -0
- data/ext/tokyo/share/tokyocabinet/doc/tokyoproducts.pdf +0 -0
- data/ext/tokyo/share/tokyocabinet/doc/tokyoproducts.ppt +0 -0
- data/ext/tokyo/share/tokyotyrant/COPYING +504 -0
- data/ext/tokyo/share/tokyotyrant/ChangeLog +578 -0
- data/ext/tokyo/share/tokyotyrant/THANKS +15 -0
- data/ext/tokyo/share/tokyotyrant/doc/common.css +211 -0
- data/ext/tokyo/share/tokyotyrant/doc/index.html +79 -0
- data/ext/tokyo/share/tokyotyrant/doc/spex.html +2264 -0
- data/ext/tokyo/share/tokyotyrant/ext/mapreduce.lua +57 -0
- data/ext/tokyo/share/tokyotyrant/ext/queue.lua +55 -0
- data/ext/tokyo/share/tokyotyrant/ext/senatus.lua +532 -0
- data/ext/tokyo/share/tokyotyrant/ext/usherette.lua +438 -0
- data/ext/tokyo_tyrant.c +147 -0
- data/ext/tokyo_tyrant.h +48 -0
- data/ext/tokyo_tyrant_db.c +227 -0
- data/ext/tokyo_tyrant_db.h +8 -0
- data/ext/tokyo_tyrant_module.c +453 -0
- data/ext/tokyo_tyrant_module.h +10 -0
- data/ext/tokyo_tyrant_query.c +226 -0
- data/ext/tokyo_tyrant_query.h +9 -0
- data/ext/tokyo_tyrant_table.c +319 -0
- data/ext/tokyo_tyrant_table.h +8 -0
- data/ext/tokyocabinet-1.4.41/COPYING +504 -0
- data/ext/tokyocabinet-1.4.41/ChangeLog +1252 -0
- data/ext/tokyocabinet-1.4.41/Makefile.in +825 -0
- data/ext/tokyocabinet-1.4.41/README +38 -0
- data/ext/tokyocabinet-1.4.41/THANKS +12 -0
- data/ext/tokyocabinet-1.4.41/bros/Makefile +133 -0
- data/ext/tokyocabinet-1.4.41/bros/bdbtest.c +438 -0
- data/ext/tokyocabinet-1.4.41/bros/cdbtest.c +219 -0
- data/ext/tokyocabinet-1.4.41/bros/cmpsqltctest.c +186 -0
- data/ext/tokyocabinet-1.4.41/bros/gdbmtest.c +216 -0
- data/ext/tokyocabinet-1.4.41/bros/mapreporter +72 -0
- data/ext/tokyocabinet-1.4.41/bros/maptest.cc +677 -0
- data/ext/tokyocabinet-1.4.41/bros/ndbmtest.c +204 -0
- data/ext/tokyocabinet-1.4.41/bros/qdbmtest.c +375 -0
- data/ext/tokyocabinet-1.4.41/bros/reporter +141 -0
- data/ext/tokyocabinet-1.4.41/bros/result.xls +0 -0
- data/ext/tokyocabinet-1.4.41/bros/sdbmtest.c +204 -0
- data/ext/tokyocabinet-1.4.41/bros/sqltest.c +404 -0
- data/ext/tokyocabinet-1.4.41/bros/tctest.c +748 -0
- data/ext/tokyocabinet-1.4.41/bros/tdbtest.c +205 -0
- data/ext/tokyocabinet-1.4.41/configure +7402 -0
- data/ext/tokyocabinet-1.4.41/configure.in +362 -0
- data/ext/tokyocabinet-1.4.41/doc/benchmark.pdf +0 -0
- data/ext/tokyocabinet-1.4.41/doc/common.css +211 -0
- data/ext/tokyocabinet-1.4.41/doc/icon16.png +0 -0
- data/ext/tokyocabinet-1.4.41/doc/index.html +156 -0
- data/ext/tokyocabinet-1.4.41/doc/index.ja.html +197 -0
- data/ext/tokyocabinet-1.4.41/doc/logo-ja.png +0 -0
- data/ext/tokyocabinet-1.4.41/doc/logo.png +0 -0
- data/ext/tokyocabinet-1.4.41/doc/spex-en.html +7145 -0
- data/ext/tokyocabinet-1.4.41/doc/spex-ja.html +7476 -0
- data/ext/tokyocabinet-1.4.41/doc/tokyoproducts.pdf +0 -0
- data/ext/tokyocabinet-1.4.41/doc/tokyoproducts.ppt +0 -0
- data/ext/tokyocabinet-1.4.41/example/Makefile +113 -0
- data/ext/tokyocabinet-1.4.41/example/tcadbex.c +55 -0
- data/ext/tokyocabinet-1.4.41/example/tcbdbex.c +64 -0
- data/ext/tokyocabinet-1.4.41/example/tcfdbex.c +60 -0
- data/ext/tokyocabinet-1.4.41/example/tchdbex.c +60 -0
- data/ext/tokyocabinet-1.4.41/example/tctchat.c +97 -0
- data/ext/tokyocabinet-1.4.41/example/tctchat.tmpl +141 -0
- data/ext/tokyocabinet-1.4.41/example/tctdbex.c +85 -0
- data/ext/tokyocabinet-1.4.41/example/tctsearch.c +95 -0
- data/ext/tokyocabinet-1.4.41/example/tctsearch.tmpl +122 -0
- data/ext/tokyocabinet-1.4.41/example/tcutilex.c +77 -0
- data/ext/tokyocabinet-1.4.41/f.tsv +2 -0
- data/ext/tokyocabinet-1.4.41/lab/calccomp +118 -0
- data/ext/tokyocabinet-1.4.41/lab/datechange +56 -0
- data/ext/tokyocabinet-1.4.41/lab/diffcheck +45 -0
- data/ext/tokyocabinet-1.4.41/lab/htmltotsv +102 -0
- data/ext/tokyocabinet-1.4.41/lab/magic +19 -0
- data/ext/tokyocabinet-1.4.41/lab/printenv.cgi +27 -0
- data/ext/tokyocabinet-1.4.41/lab/stepcount +26 -0
- data/ext/tokyocabinet-1.4.41/lab/stopwatch +61 -0
- data/ext/tokyocabinet-1.4.41/lab/tabcheck +43 -0
- data/ext/tokyocabinet-1.4.41/lab/wgettsv +239 -0
- data/ext/tokyocabinet-1.4.41/lab/widthcheck +57 -0
- data/ext/tokyocabinet-1.4.41/man/htmltoman +104 -0
- data/ext/tokyocabinet-1.4.41/man/tcadb.3 +676 -0
- data/ext/tokyocabinet-1.4.41/man/tcamgr.1 +97 -0
- data/ext/tokyocabinet-1.4.41/man/tcamttest.1 +35 -0
- data/ext/tokyocabinet-1.4.41/man/tcatest.1 +55 -0
- data/ext/tokyocabinet-1.4.41/man/tcbdb.3 +1355 -0
- data/ext/tokyocabinet-1.4.41/man/tcbmgr.1 +125 -0
- data/ext/tokyocabinet-1.4.41/man/tcbmttest.1 +81 -0
- data/ext/tokyocabinet-1.4.41/man/tcbtest.1 +107 -0
- data/ext/tokyocabinet-1.4.41/man/tcfdb.3 +975 -0
- data/ext/tokyocabinet-1.4.41/man/tcfmgr.1 +98 -0
- data/ext/tokyocabinet-1.4.41/man/tcfmttest.1 +62 -0
- data/ext/tokyocabinet-1.4.41/man/tcftest.1 +73 -0
- data/ext/tokyocabinet-1.4.41/man/tchdb.3 +898 -0
- data/ext/tokyocabinet-1.4.41/man/tchmgr.1 +110 -0
- data/ext/tokyocabinet-1.4.41/man/tchmttest.1 +85 -0
- data/ext/tokyocabinet-1.4.41/man/tchtest.1 +95 -0
- data/ext/tokyocabinet-1.4.41/man/tclist.3 +1 -0
- data/ext/tokyocabinet-1.4.41/man/tcmap.3 +1 -0
- data/ext/tokyocabinet-1.4.41/man/tcmdb.3 +1 -0
- data/ext/tokyocabinet-1.4.41/man/tcmpool.3 +1 -0
- data/ext/tokyocabinet-1.4.41/man/tctdb.3 +1110 -0
- data/ext/tokyocabinet-1.4.41/man/tctmgr.1 +140 -0
- data/ext/tokyocabinet-1.4.41/man/tctmttest.1 +92 -0
- data/ext/tokyocabinet-1.4.41/man/tctree.3 +1 -0
- data/ext/tokyocabinet-1.4.41/man/tcttest.1 +105 -0
- data/ext/tokyocabinet-1.4.41/man/tcucodec.1 +162 -0
- data/ext/tokyocabinet-1.4.41/man/tcumttest.1 +41 -0
- data/ext/tokyocabinet-1.4.41/man/tcutest.1 +81 -0
- data/ext/tokyocabinet-1.4.41/man/tcutil.3 +4518 -0
- data/ext/tokyocabinet-1.4.41/man/tcxstr.3 +1 -0
- data/ext/tokyocabinet-1.4.41/man/tokyocabinet.3 +132 -0
- data/ext/tokyocabinet-1.4.41/md5.c +381 -0
- data/ext/tokyocabinet-1.4.41/md5.h +101 -0
- data/ext/tokyocabinet-1.4.41/myconf.c +493 -0
- data/ext/tokyocabinet-1.4.41/myconf.h +549 -0
- data/ext/tokyocabinet-1.4.41/tcadb.c +4339 -0
- data/ext/tokyocabinet-1.4.41/tcadb.h +548 -0
- data/ext/tokyocabinet-1.4.41/tcamgr.c +1019 -0
- data/ext/tokyocabinet-1.4.41/tcamttest.c +542 -0
- data/ext/tokyocabinet-1.4.41/tcatest.c +1845 -0
- data/ext/tokyocabinet-1.4.41/tcawmgr.c +482 -0
- data/ext/tokyocabinet-1.4.41/tcbdb.c +4180 -0
- data/ext/tokyocabinet-1.4.41/tcbdb.h +1101 -0
- data/ext/tokyocabinet-1.4.41/tcbmgr.c +1012 -0
- data/ext/tokyocabinet-1.4.41/tcbmttest.c +1810 -0
- data/ext/tokyocabinet-1.4.41/tcbtest.c +2586 -0
- data/ext/tokyocabinet-1.4.41/tcfdb.c +2746 -0
- data/ext/tokyocabinet-1.4.41/tcfdb.h +858 -0
- data/ext/tokyocabinet-1.4.41/tcfmgr.c +786 -0
- data/ext/tokyocabinet-1.4.41/tcfmttest.c +1220 -0
- data/ext/tokyocabinet-1.4.41/tcftest.c +1695 -0
- data/ext/tokyocabinet-1.4.41/tchdb.c +5153 -0
- data/ext/tokyocabinet-1.4.41/tchdb.h +871 -0
- data/ext/tokyocabinet-1.4.41/tchmgr.c +842 -0
- data/ext/tokyocabinet-1.4.41/tchmttest.c +1757 -0
- data/ext/tokyocabinet-1.4.41/tchtest.c +2129 -0
- data/ext/tokyocabinet-1.4.41/tctdb.c +6199 -0
- data/ext/tokyocabinet-1.4.41/tctdb.h +1086 -0
- data/ext/tokyocabinet-1.4.41/tctmgr.c +1241 -0
- data/ext/tokyocabinet-1.4.41/tctmttest.c +1563 -0
- data/ext/tokyocabinet-1.4.41/tcttest.c +2062 -0
- data/ext/tokyocabinet-1.4.41/tcucodec.c +1357 -0
- data/ext/tokyocabinet-1.4.41/tcumttest.c +578 -0
- data/ext/tokyocabinet-1.4.41/tcutest.c +1875 -0
- data/ext/tokyocabinet-1.4.41/tcutil.c +10528 -0
- data/ext/tokyocabinet-1.4.41/tcutil.h +4184 -0
- data/ext/tokyocabinet-1.4.41/tokyocabinet.idl +336 -0
- data/ext/tokyocabinet-1.4.41/tokyocabinet.pc.in +14 -0
- data/ext/tokyotyrant-1.1.39/COPYING +504 -0
- data/ext/tokyotyrant-1.1.39/ChangeLog +578 -0
- data/ext/tokyotyrant-1.1.39/Makefile.in +365 -0
- data/ext/tokyotyrant-1.1.39/README +38 -0
- data/ext/tokyotyrant-1.1.39/THANKS +15 -0
- data/ext/tokyotyrant-1.1.39/configure +6979 -0
- data/ext/tokyotyrant-1.1.39/configure.in +300 -0
- data/ext/tokyotyrant-1.1.39/doc/common.css +211 -0
- data/ext/tokyotyrant-1.1.39/doc/index.html +79 -0
- data/ext/tokyotyrant-1.1.39/doc/spex.html +2264 -0
- data/ext/tokyotyrant-1.1.39/example/Makefile +68 -0
- data/ext/tokyotyrant-1.1.39/example/httptest.pl +88 -0
- data/ext/tokyotyrant-1.1.39/example/mcftest.pl +39 -0
- data/ext/tokyotyrant-1.1.39/example/mctest.pl +43 -0
- data/ext/tokyotyrant-1.1.39/example/tcrdbex +0 -0
- data/ext/tokyotyrant-1.1.39/example/tcrdbex.c +49 -0
- data/ext/tokyotyrant-1.1.39/example/tcrdbex.o +0 -0
- data/ext/tokyotyrant-1.1.39/example/tcrdbtblex +0 -0
- data/ext/tokyotyrant-1.1.39/example/tcrdbtblex.c +79 -0
- data/ext/tokyotyrant-1.1.39/example/tcrdbtblex.o +0 -0
- data/ext/tokyotyrant-1.1.39/ext/mapreduce.lua +57 -0
- data/ext/tokyotyrant-1.1.39/ext/queue.lua +55 -0
- data/ext/tokyotyrant-1.1.39/ext/senatus.lua +532 -0
- data/ext/tokyotyrant-1.1.39/ext/usherette.lua +438 -0
- data/ext/tokyotyrant-1.1.39/lab/datechange +56 -0
- data/ext/tokyotyrant-1.1.39/lab/diffcheck +45 -0
- data/ext/tokyotyrant-1.1.39/lab/fibonacci.lua +20 -0
- data/ext/tokyotyrant-1.1.39/lab/footprint.lua +67 -0
- data/ext/tokyotyrant-1.1.39/lab/highlow.lua +88 -0
- data/ext/tokyotyrant-1.1.39/lab/killdualmaster +12 -0
- data/ext/tokyotyrant-1.1.39/lab/rundualmaster +38 -0
- data/ext/tokyotyrant-1.1.39/lab/stepcount +26 -0
- data/ext/tokyotyrant-1.1.39/lab/tabcheck +43 -0
- data/ext/tokyotyrant-1.1.39/lab/ushrtregister.pl +55 -0
- data/ext/tokyotyrant-1.1.39/lab/widthcheck +57 -0
- data/ext/tokyotyrant-1.1.39/man/htmltoman +100 -0
- data/ext/tokyotyrant-1.1.39/man/tcrdb.3 +1309 -0
- data/ext/tokyotyrant-1.1.39/man/tcrmgr.1 +164 -0
- data/ext/tokyotyrant-1.1.39/man/tcrmttest.1 +55 -0
- data/ext/tokyotyrant-1.1.39/man/tcrtest.1 +89 -0
- data/ext/tokyotyrant-1.1.39/man/tculog.3 +15 -0
- data/ext/tokyotyrant-1.1.39/man/ttservctl.8 +37 -0
- data/ext/tokyotyrant-1.1.39/man/ttserver.1 +84 -0
- data/ext/tokyotyrant-1.1.39/man/ttulmgr.1 +40 -0
- data/ext/tokyotyrant-1.1.39/man/ttultest.1 +16 -0
- data/ext/tokyotyrant-1.1.39/man/ttutil.3 +14 -0
- data/ext/tokyotyrant-1.1.39/myconf.c +169 -0
- data/ext/tokyotyrant-1.1.39/myconf.h +408 -0
- data/ext/tokyotyrant-1.1.39/scrext.c +2394 -0
- data/ext/tokyotyrant-1.1.39/scrext.h +96 -0
- data/ext/tokyotyrant-1.1.39/tcrdb.c +2637 -0
- data/ext/tokyotyrant-1.1.39/tcrdb.h +801 -0
- data/ext/tokyotyrant-1.1.39/tcrmgr.c +1559 -0
- data/ext/tokyotyrant-1.1.39/tcrmttest.c +915 -0
- data/ext/tokyotyrant-1.1.39/tcrtest.c +1542 -0
- data/ext/tokyotyrant-1.1.39/tculog.c +1211 -0
- data/ext/tokyotyrant-1.1.39/tculog.h +392 -0
- data/ext/tokyotyrant-1.1.39/tokyotyrant.idl +143 -0
- data/ext/tokyotyrant-1.1.39/tokyotyrant.pc.in +14 -0
- data/ext/tokyotyrant-1.1.39/ttservctl +163 -0
- data/ext/tokyotyrant-1.1.39/ttserver.c +3583 -0
- data/ext/tokyotyrant-1.1.39/ttskeldir.c +141 -0
- data/ext/tokyotyrant-1.1.39/ttskelmock.c +64 -0
- data/ext/tokyotyrant-1.1.39/ttskelnull.c +79 -0
- data/ext/tokyotyrant-1.1.39/ttskelproxy.c +74 -0
- data/ext/tokyotyrant-1.1.39/ttulmgr.c +266 -0
- data/ext/tokyotyrant-1.1.39/ttultest.c +371 -0
- data/ext/tokyotyrant-1.1.39/ttutil.c +1510 -0
- data/ext/tokyotyrant-1.1.39/ttutil.h +494 -0
- data/lib/tokyo_tyrant/balancer.rb +189 -0
- data/spec/ext.lua +4 -0
- data/spec/plu_db.rb +538 -0
- data/spec/spec.rb +1 -0
- data/spec/spec_base.rb +17 -0
- data/spec/start_tyrants.sh +36 -0
- data/spec/stop_tyrants.sh +9 -0
- data/spec/tokyo_tyrant_balancer_db_spec.rb +160 -0
- data/spec/tokyo_tyrant_balancer_table_spec.rb +177 -0
- data/spec/tokyo_tyrant_query_spec.rb +159 -0
- data/spec/tokyo_tyrant_spec.rb +254 -0
- data/spec/tokyo_tyrant_table_spec.rb +301 -0
- metadata +402 -0
@@ -0,0 +1,549 @@
|
|
1
|
+
/*************************************************************************************************
|
2
|
+
* System-dependent configurations of Tokyo Cabinet
|
3
|
+
* Copyright (C) 2006-2009 Mikio Hirabayashi
|
4
|
+
* This file is part of Tokyo Cabinet.
|
5
|
+
* Tokyo Cabinet is free software; you can redistribute it and/or modify it under the terms of
|
6
|
+
* the GNU Lesser General Public License as published by the Free Software Foundation; either
|
7
|
+
* version 2.1 of the License or any later version. Tokyo Cabinet is distributed in the hope
|
8
|
+
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
10
|
+
* License for more details.
|
11
|
+
* You should have received a copy of the GNU Lesser General Public License along with Tokyo
|
12
|
+
* Cabinet; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
13
|
+
* Boston, MA 02111-1307 USA.
|
14
|
+
*************************************************************************************************/
|
15
|
+
|
16
|
+
|
17
|
+
#ifndef _MYCONF_H // duplication check
|
18
|
+
#define _MYCONF_H
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
/*************************************************************************************************
|
23
|
+
* system discrimination
|
24
|
+
*************************************************************************************************/
|
25
|
+
|
26
|
+
|
27
|
+
#if defined(__linux__)
|
28
|
+
|
29
|
+
#define _SYS_LINUX_
|
30
|
+
#define TCSYSNAME "Linux"
|
31
|
+
|
32
|
+
#elif defined(__FreeBSD__)
|
33
|
+
|
34
|
+
#define _SYS_FREEBSD_
|
35
|
+
#define TCSYSNAME "FreeBSD"
|
36
|
+
|
37
|
+
#elif defined(__NetBSD__)
|
38
|
+
|
39
|
+
#define _SYS_NETBSD_
|
40
|
+
#define TCSYSNAME "NetBSD"
|
41
|
+
|
42
|
+
#elif defined(__OpenBSD__)
|
43
|
+
|
44
|
+
#define _SYS_OPENBSD_
|
45
|
+
#define TCSYSNAME "OpenBSD"
|
46
|
+
|
47
|
+
#elif defined(__sun__) || defined(__sun)
|
48
|
+
|
49
|
+
#define _SYS_SUNOS_
|
50
|
+
#define TCSYSNAME "SunOS"
|
51
|
+
|
52
|
+
#elif defined(__hpux)
|
53
|
+
|
54
|
+
#define _SYS_HPUX_
|
55
|
+
#define TCSYSNAME "HP-UX"
|
56
|
+
|
57
|
+
#elif defined(__osf)
|
58
|
+
|
59
|
+
#define _SYS_TRU64_
|
60
|
+
#define TCSYSNAME "Tru64"
|
61
|
+
|
62
|
+
#elif defined(_AIX)
|
63
|
+
|
64
|
+
#define _SYS_AIX_
|
65
|
+
#define TCSYSNAME "AIX"
|
66
|
+
|
67
|
+
#elif defined(__APPLE__) && defined(__MACH__)
|
68
|
+
|
69
|
+
#define _SYS_MACOSX_
|
70
|
+
#define TCSYSNAME "Mac OS X"
|
71
|
+
|
72
|
+
#elif defined(_MSC_VER)
|
73
|
+
|
74
|
+
#define _SYS_MSVC_
|
75
|
+
#define TCSYSNAME "Windows (VC++)"
|
76
|
+
|
77
|
+
#elif defined(_WIN32)
|
78
|
+
|
79
|
+
#define _SYS_MINGW_
|
80
|
+
#define TCSYSNAME "Windows (MinGW)"
|
81
|
+
|
82
|
+
#elif defined(__CYGWIN__)
|
83
|
+
|
84
|
+
#define _SYS_CYGWIN_
|
85
|
+
#define TCSYSNAME "Windows (Cygwin)"
|
86
|
+
|
87
|
+
#else
|
88
|
+
|
89
|
+
#define _SYS_GENERIC_
|
90
|
+
#define TCSYSNAME "Generic"
|
91
|
+
|
92
|
+
#endif
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
/*************************************************************************************************
|
97
|
+
* common settings
|
98
|
+
*************************************************************************************************/
|
99
|
+
|
100
|
+
|
101
|
+
#if defined(NDEBUG)
|
102
|
+
#define TCDODEBUG(TC_expr) \
|
103
|
+
do { \
|
104
|
+
} while(false)
|
105
|
+
#else
|
106
|
+
#define TCDODEBUG(TC_expr) \
|
107
|
+
do { \
|
108
|
+
TC_expr; \
|
109
|
+
} while(false)
|
110
|
+
#endif
|
111
|
+
|
112
|
+
#define TCSWAB16(TC_num) \
|
113
|
+
( \
|
114
|
+
((TC_num & 0x00ffU) << 8) | \
|
115
|
+
((TC_num & 0xff00U) >> 8) \
|
116
|
+
)
|
117
|
+
|
118
|
+
#define TCSWAB32(TC_num) \
|
119
|
+
( \
|
120
|
+
((TC_num & 0x000000ffUL) << 24) | \
|
121
|
+
((TC_num & 0x0000ff00UL) << 8) | \
|
122
|
+
((TC_num & 0x00ff0000UL) >> 8) | \
|
123
|
+
((TC_num & 0xff000000UL) >> 24) \
|
124
|
+
)
|
125
|
+
|
126
|
+
#define TCSWAB64(TC_num) \
|
127
|
+
( \
|
128
|
+
((TC_num & 0x00000000000000ffULL) << 56) | \
|
129
|
+
((TC_num & 0x000000000000ff00ULL) << 40) | \
|
130
|
+
((TC_num & 0x0000000000ff0000ULL) << 24) | \
|
131
|
+
((TC_num & 0x00000000ff000000ULL) << 8) | \
|
132
|
+
((TC_num & 0x000000ff00000000ULL) >> 8) | \
|
133
|
+
((TC_num & 0x0000ff0000000000ULL) >> 24) | \
|
134
|
+
((TC_num & 0x00ff000000000000ULL) >> 40) | \
|
135
|
+
((TC_num & 0xff00000000000000ULL) >> 56) \
|
136
|
+
)
|
137
|
+
|
138
|
+
#if defined(_MYBIGEND) || defined(_MYSWAB)
|
139
|
+
#define TCBIGEND 1
|
140
|
+
#define TCHTOIS(TC_num) TCSWAB16(TC_num)
|
141
|
+
#define TCHTOIL(TC_num) TCSWAB32(TC_num)
|
142
|
+
#define TCHTOILL(TC_num) TCSWAB64(TC_num)
|
143
|
+
#define TCITOHS(TC_num) TCSWAB16(TC_num)
|
144
|
+
#define TCITOHL(TC_num) TCSWAB32(TC_num)
|
145
|
+
#define TCITOHLL(TC_num) TCSWAB64(TC_num)
|
146
|
+
#else
|
147
|
+
#define TCBIGEND 0
|
148
|
+
#define TCHTOIS(TC_num) (TC_num)
|
149
|
+
#define TCHTOIL(TC_num) (TC_num)
|
150
|
+
#define TCHTOILL(TC_num) (TC_num)
|
151
|
+
#define TCITOHS(TC_num) (TC_num)
|
152
|
+
#define TCITOHL(TC_num) (TC_num)
|
153
|
+
#define TCITOHLL(TC_num) (TC_num)
|
154
|
+
#endif
|
155
|
+
|
156
|
+
#if defined(_MYNOUBC)
|
157
|
+
#define TCUBCACHE 0
|
158
|
+
#elif defined(_SYS_LINUX_) || defined(_SYS_FREEBSD_) || defined(_SYS_NETBSD_) || \
|
159
|
+
defined(_SYS_MACOSX_) || defined(_SYS_SUNOS_)
|
160
|
+
#define TCUBCACHE 1
|
161
|
+
#else
|
162
|
+
#define TCUBCACHE 0
|
163
|
+
#endif
|
164
|
+
|
165
|
+
#if defined(_MYNOZLIB)
|
166
|
+
#define TCUSEZLIB 0
|
167
|
+
#else
|
168
|
+
#define TCUSEZLIB 1
|
169
|
+
#endif
|
170
|
+
|
171
|
+
#if defined(_MYNOBZIP)
|
172
|
+
#define TCUSEBZIP 0
|
173
|
+
#else
|
174
|
+
#define TCUSEBZIP 1
|
175
|
+
#endif
|
176
|
+
|
177
|
+
#if defined(_MYEXLZMA)
|
178
|
+
#define TCUSEEXLZMA 1
|
179
|
+
#else
|
180
|
+
#define TCUSEEXLZMA 0
|
181
|
+
#endif
|
182
|
+
|
183
|
+
#if defined(_MYEXLZO)
|
184
|
+
#define TCUSEEXLZO 1
|
185
|
+
#else
|
186
|
+
#define TCUSEEXLZO 0
|
187
|
+
#endif
|
188
|
+
|
189
|
+
#if defined(_MYNOPTHREAD)
|
190
|
+
#define TCUSEPTHREAD 0
|
191
|
+
#else
|
192
|
+
#define TCUSEPTHREAD 1
|
193
|
+
#endif
|
194
|
+
|
195
|
+
#if defined(_MYMICROYIELD)
|
196
|
+
#define TCMICROYIELD 1
|
197
|
+
#else
|
198
|
+
#define TCMICROYIELD 0
|
199
|
+
#endif
|
200
|
+
|
201
|
+
#define MYMALLOC malloc
|
202
|
+
#define MYCALLOC calloc
|
203
|
+
#define MYREALLOC realloc
|
204
|
+
#define MYFREE free
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
/*************************************************************************************************
|
209
|
+
* general headers
|
210
|
+
*************************************************************************************************/
|
211
|
+
|
212
|
+
|
213
|
+
#include <assert.h>
|
214
|
+
#include <ctype.h>
|
215
|
+
#include <errno.h>
|
216
|
+
#include <float.h>
|
217
|
+
#include <limits.h>
|
218
|
+
#include <locale.h>
|
219
|
+
#include <math.h>
|
220
|
+
#include <setjmp.h>
|
221
|
+
#include <stdarg.h>
|
222
|
+
#include <stddef.h>
|
223
|
+
#include <stdio.h>
|
224
|
+
#include <stdlib.h>
|
225
|
+
#include <signal.h>
|
226
|
+
#include <string.h>
|
227
|
+
#include <time.h>
|
228
|
+
|
229
|
+
#include <inttypes.h>
|
230
|
+
#include <stdbool.h>
|
231
|
+
#include <stdint.h>
|
232
|
+
|
233
|
+
#include <unistd.h>
|
234
|
+
#include <sys/param.h>
|
235
|
+
#include <sys/types.h>
|
236
|
+
#include <sys/stat.h>
|
237
|
+
#include <sys/mman.h>
|
238
|
+
#include <sys/time.h>
|
239
|
+
#include <sys/times.h>
|
240
|
+
#include <sys/wait.h>
|
241
|
+
#include <sys/resource.h>
|
242
|
+
#include <fcntl.h>
|
243
|
+
#include <dirent.h>
|
244
|
+
#include <regex.h>
|
245
|
+
#include <glob.h>
|
246
|
+
|
247
|
+
#if TCUSEPTHREAD
|
248
|
+
#include <pthread.h>
|
249
|
+
#if defined(_POSIX_PRIORITY_SCHEDULING)
|
250
|
+
#include <sched.h>
|
251
|
+
#endif
|
252
|
+
#endif
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
/*************************************************************************************************
|
257
|
+
* miscellaneous hacks
|
258
|
+
*************************************************************************************************/
|
259
|
+
|
260
|
+
|
261
|
+
#if defined(__GNUC__)
|
262
|
+
#define _alignof(TC_a) ((size_t)__alignof__(TC_a))
|
263
|
+
#else
|
264
|
+
#define _alignof(TC_a) sizeof(TC_a)
|
265
|
+
#endif
|
266
|
+
#define _issigned(TC_a) ((TC_a)-1 < 1 ? true : false)
|
267
|
+
#define _maxof(TC_a) \
|
268
|
+
((TC_a)(sizeof(TC_a) == sizeof(int64_t) ? _issigned(TC_a) ? INT64_MAX : UINT64_MAX : \
|
269
|
+
sizeof(TC_a) == sizeof(int32_t) ? _issigned(TC_a) ? INT32_MAX : UINT32_MAX : \
|
270
|
+
sizeof(TC_a) == sizeof(int16_t) ? _issigned(TC_a) ? INT16_MAX : UINT16_MAX : \
|
271
|
+
_issigned(TC_a) ? INT8_MAX : UINT8_MAX))
|
272
|
+
|
273
|
+
#if defined(_SYS_FREEBSD_) || defined(_SYS_NETBSD_) || defined(_SYS_OPENBSD_)
|
274
|
+
#define nan(TC_a) strtod("nan", NULL)
|
275
|
+
#define nanl(TC_a) ((long double)strtod("nan", NULL))
|
276
|
+
#endif
|
277
|
+
|
278
|
+
#if ! defined(PATH_MAX)
|
279
|
+
#if defined(MAXPATHLEN)
|
280
|
+
#define PATH_MAX MAXPATHLEN
|
281
|
+
#else
|
282
|
+
#define PATH_MAX 4096
|
283
|
+
#endif
|
284
|
+
#endif
|
285
|
+
#if ! defined(NAME_MAX)
|
286
|
+
#define NAME_MAX 255
|
287
|
+
#endif
|
288
|
+
|
289
|
+
extern int _tc_dummy_cnt;
|
290
|
+
|
291
|
+
int _tc_dummyfunc(void);
|
292
|
+
|
293
|
+
int _tc_dummyfuncv(int a, ...);
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
/*************************************************************************************************
|
298
|
+
* notation of filesystems
|
299
|
+
*************************************************************************************************/
|
300
|
+
|
301
|
+
|
302
|
+
#define MYPATHCHR '/'
|
303
|
+
#define MYPATHSTR "/"
|
304
|
+
#define MYEXTCHR '.'
|
305
|
+
#define MYEXTSTR "."
|
306
|
+
#define MYCDIRSTR "."
|
307
|
+
#define MYPDIRSTR ".."
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
/*************************************************************************************************
|
312
|
+
* for ZLIB
|
313
|
+
*************************************************************************************************/
|
314
|
+
|
315
|
+
|
316
|
+
enum {
|
317
|
+
_TCZMZLIB,
|
318
|
+
_TCZMRAW,
|
319
|
+
_TCZMGZIP
|
320
|
+
};
|
321
|
+
|
322
|
+
|
323
|
+
extern char *(*_tc_deflate)(const char *, int, int *, int);
|
324
|
+
|
325
|
+
extern char *(*_tc_inflate)(const char *, int, int *, int);
|
326
|
+
|
327
|
+
extern unsigned int (*_tc_getcrc)(const char *, int);
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
/*************************************************************************************************
|
332
|
+
* for BZIP2
|
333
|
+
*************************************************************************************************/
|
334
|
+
|
335
|
+
|
336
|
+
extern char *(*_tc_bzcompress)(const char *, int, int *);
|
337
|
+
|
338
|
+
extern char *(*_tc_bzdecompress)(const char *, int, int *);
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
/*************************************************************************************************
|
343
|
+
* for test of custom codec functions
|
344
|
+
*************************************************************************************************/
|
345
|
+
|
346
|
+
|
347
|
+
void *_tc_recencode(const void *ptr, int size, int *sp, void *op);
|
348
|
+
|
349
|
+
void *_tc_recdecode(const void *ptr, int size, int *sp, void *op);
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
/*************************************************************************************************
|
354
|
+
* for POSIX thread disability
|
355
|
+
*************************************************************************************************/
|
356
|
+
|
357
|
+
|
358
|
+
#if ! TCUSEPTHREAD
|
359
|
+
|
360
|
+
#define pthread_t intptr_t
|
361
|
+
|
362
|
+
#define pthread_once_t intptr_t
|
363
|
+
#undef PTHREAD_ONCE_INIT
|
364
|
+
#define PTHREAD_ONCE_INIT 0
|
365
|
+
#define pthread_once(TC_a, TC_b) _tc_dummyfuncv((intptr_t)(TC_a), (TC_b))
|
366
|
+
|
367
|
+
#define pthread_mutexattr_t intptr_t
|
368
|
+
#undef PTHREAD_MUTEX_RECURSIVE
|
369
|
+
#define PTHREAD_MUTEX_RECURSIVE 0
|
370
|
+
#define pthread_mutexattr_init(TC_a) _tc_dummyfuncv((intptr_t)(TC_a))
|
371
|
+
#define pthread_mutexattr_destroy(TC_a) _tc_dummyfuncv((intptr_t)(TC_a))
|
372
|
+
#define pthread_mutexattr_settype(TC_a, TC_b) _tc_dummyfuncv((intptr_t)(TC_a), (TC_b))
|
373
|
+
|
374
|
+
#define pthread_mutex_t intptr_t
|
375
|
+
#undef PTHREAD_MUTEX_INITIALIZER
|
376
|
+
#define PTHREAD_MUTEX_INITIALIZER 0
|
377
|
+
#define pthread_mutex_init(TC_a, TC_b) _tc_dummyfuncv((intptr_t)(TC_a), (TC_b))
|
378
|
+
#define pthread_mutex_destroy(TC_a) _tc_dummyfuncv((intptr_t)(TC_a))
|
379
|
+
#define pthread_mutex_lock(TC_a) _tc_dummyfuncv((intptr_t)(TC_a))
|
380
|
+
#define pthread_mutex_unlock(TC_a) _tc_dummyfuncv((intptr_t)(TC_a))
|
381
|
+
|
382
|
+
#define pthread_rwlock_t intptr_t
|
383
|
+
#undef PTHREAD_RWLOCK_INITIALIZER
|
384
|
+
#define PTHREAD_RWLOCK_INITIALIZER 0
|
385
|
+
#define pthread_rwlock_init(TC_a, TC_b) _tc_dummyfuncv((intptr_t)(TC_a), (TC_b))
|
386
|
+
#define pthread_rwlock_destroy(TC_a) _tc_dummyfuncv((intptr_t)(TC_a))
|
387
|
+
#define pthread_rwlock_rdlock(TC_a) _tc_dummyfuncv((intptr_t)(TC_a))
|
388
|
+
#define pthread_rwlock_wrlock(TC_a) _tc_dummyfuncv((intptr_t)(TC_a))
|
389
|
+
#define pthread_rwlock_unlock(TC_a) _tc_dummyfuncv((intptr_t)(TC_a))
|
390
|
+
|
391
|
+
#define pthread_key_t intptr_t
|
392
|
+
#define pthread_key_create(TC_a, TC_b) _tc_dummyfuncv((intptr_t)(TC_a), (TC_b))
|
393
|
+
#define pthread_key_delete(TC_a) _tc_dummyfuncv((intptr_t)(TC_a))
|
394
|
+
#define pthread_setspecific(TC_a, TC_b) _tc_dummyfuncv((intptr_t)(TC_a))
|
395
|
+
#define pthread_getspecific(TC_a) _tc_dummyfuncv((intptr_t)(TC_a))
|
396
|
+
|
397
|
+
#define pthread_create(TC_th, TC_attr, TC_func, TC_arg) \
|
398
|
+
(*(TC_th) = 0, (TC_func)(TC_arg), 0)
|
399
|
+
#define pthread_join(TC_th, TC_rv) (*(TC_rv) = NULL, 0)
|
400
|
+
#define pthread_detach(TC_th) 0
|
401
|
+
#define sched_yield() _tc_dummyfunc()
|
402
|
+
|
403
|
+
#endif
|
404
|
+
|
405
|
+
#if TCUSEPTHREAD && TCMICROYIELD
|
406
|
+
#define TCTESTYIELD() \
|
407
|
+
do { \
|
408
|
+
if(((++_tc_dummy_cnt) & (0x20 - 1)) == 0){ \
|
409
|
+
sched_yield(); \
|
410
|
+
if(_tc_dummy_cnt > 0x1000) _tc_dummy_cnt = (uint32_t)time(NULL) % 0x1000; \
|
411
|
+
} \
|
412
|
+
} while(false)
|
413
|
+
#undef assert
|
414
|
+
#define assert(TC_expr) \
|
415
|
+
do { \
|
416
|
+
if(!(TC_expr)){ \
|
417
|
+
fprintf(stderr, "assertion failed: %s\n", #TC_expr); \
|
418
|
+
abort(); \
|
419
|
+
} \
|
420
|
+
TCTESTYIELD(); \
|
421
|
+
} while(false)
|
422
|
+
#define if(TC_cond) \
|
423
|
+
if((((++_tc_dummy_cnt) & (0x100 - 1)) != 0 || (sched_yield() * 0) == 0) && (TC_cond))
|
424
|
+
#define while(TC_cond) \
|
425
|
+
while((((++_tc_dummy_cnt) & (0x100 - 1)) != 0 || (sched_yield() * 0) == 0) && (TC_cond))
|
426
|
+
#else
|
427
|
+
#define TCTESTYIELD() \
|
428
|
+
do { \
|
429
|
+
} while(false)
|
430
|
+
#endif
|
431
|
+
|
432
|
+
#if !defined(_POSIX_PRIORITY_SCHEDULING) && TCUSEPTHREAD
|
433
|
+
#define sched_yield() usleep(1000 * 20)
|
434
|
+
#endif
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
/*************************************************************************************************
|
439
|
+
* utilities for implementation
|
440
|
+
*************************************************************************************************/
|
441
|
+
|
442
|
+
|
443
|
+
#define TCNUMBUFSIZ 32 // size of a buffer for a number
|
444
|
+
|
445
|
+
/* set a buffer for a variable length number */
|
446
|
+
#define TCSETVNUMBUF(TC_len, TC_buf, TC_num) \
|
447
|
+
do { \
|
448
|
+
int _TC_num = (TC_num); \
|
449
|
+
if(_TC_num == 0){ \
|
450
|
+
((signed char *)(TC_buf))[0] = 0; \
|
451
|
+
(TC_len) = 1; \
|
452
|
+
} else { \
|
453
|
+
(TC_len) = 0; \
|
454
|
+
while(_TC_num > 0){ \
|
455
|
+
int _TC_rem = _TC_num & 0x7f; \
|
456
|
+
_TC_num >>= 7; \
|
457
|
+
if(_TC_num > 0){ \
|
458
|
+
((signed char *)(TC_buf))[(TC_len)] = -_TC_rem - 1; \
|
459
|
+
} else { \
|
460
|
+
((signed char *)(TC_buf))[(TC_len)] = _TC_rem; \
|
461
|
+
} \
|
462
|
+
(TC_len)++; \
|
463
|
+
} \
|
464
|
+
} \
|
465
|
+
} while(false)
|
466
|
+
|
467
|
+
/* set a buffer for a variable length number of 64-bit */
|
468
|
+
#define TCSETVNUMBUF64(TC_len, TC_buf, TC_num) \
|
469
|
+
do { \
|
470
|
+
long long int _TC_num = (TC_num); \
|
471
|
+
if(_TC_num == 0){ \
|
472
|
+
((signed char *)(TC_buf))[0] = 0; \
|
473
|
+
(TC_len) = 1; \
|
474
|
+
} else { \
|
475
|
+
(TC_len) = 0; \
|
476
|
+
while(_TC_num > 0){ \
|
477
|
+
int _TC_rem = _TC_num & 0x7f; \
|
478
|
+
_TC_num >>= 7; \
|
479
|
+
if(_TC_num > 0){ \
|
480
|
+
((signed char *)(TC_buf))[(TC_len)] = -_TC_rem - 1; \
|
481
|
+
} else { \
|
482
|
+
((signed char *)(TC_buf))[(TC_len)] = _TC_rem; \
|
483
|
+
} \
|
484
|
+
(TC_len)++; \
|
485
|
+
} \
|
486
|
+
} \
|
487
|
+
} while(false)
|
488
|
+
|
489
|
+
/* read a variable length buffer */
|
490
|
+
#define TCREADVNUMBUF(TC_buf, TC_num, TC_step) \
|
491
|
+
do { \
|
492
|
+
TC_num = 0; \
|
493
|
+
int _TC_base = 1; \
|
494
|
+
int _TC_i = 0; \
|
495
|
+
while(true){ \
|
496
|
+
if(((signed char *)(TC_buf))[_TC_i] >= 0){ \
|
497
|
+
TC_num += ((signed char *)(TC_buf))[_TC_i] * _TC_base; \
|
498
|
+
break; \
|
499
|
+
} \
|
500
|
+
TC_num += _TC_base * (((signed char *)(TC_buf))[_TC_i] + 1) * -1; \
|
501
|
+
_TC_base <<= 7; \
|
502
|
+
_TC_i++; \
|
503
|
+
} \
|
504
|
+
(TC_step) = _TC_i + 1; \
|
505
|
+
} while(false)
|
506
|
+
|
507
|
+
/* read a variable length buffer */
|
508
|
+
#define TCREADVNUMBUF64(TC_buf, TC_num, TC_step) \
|
509
|
+
do { \
|
510
|
+
TC_num = 0; \
|
511
|
+
long long int _TC_base = 1; \
|
512
|
+
int _TC_i = 0; \
|
513
|
+
while(true){ \
|
514
|
+
if(((signed char *)(TC_buf))[_TC_i] >= 0){ \
|
515
|
+
TC_num += ((signed char *)(TC_buf))[_TC_i] * _TC_base; \
|
516
|
+
break; \
|
517
|
+
} \
|
518
|
+
TC_num += _TC_base * (((signed char *)(TC_buf))[_TC_i] + 1) * -1; \
|
519
|
+
_TC_base <<= 7; \
|
520
|
+
_TC_i++; \
|
521
|
+
} \
|
522
|
+
(TC_step) = _TC_i + 1; \
|
523
|
+
} while(false)
|
524
|
+
|
525
|
+
/* calculate the size of a buffer for a variable length number */
|
526
|
+
#define TCCALCVNUMSIZE(TC_num) \
|
527
|
+
((TC_num) < 0x80 ? 1 : (TC_num) < 0x4000 ? 2 : (TC_num) < 0x200000 ? 3 : \
|
528
|
+
(TC_num) < 0x10000000 ? 4 : 5)
|
529
|
+
|
530
|
+
/* compare keys of two records by lexical order */
|
531
|
+
#define TCCMPLEXICAL(TC_rv, TC_aptr, TC_asiz, TC_bptr, TC_bsiz) \
|
532
|
+
do { \
|
533
|
+
(TC_rv) = 0; \
|
534
|
+
int _TC_min = (TC_asiz) < (TC_bsiz) ? (TC_asiz) : (TC_bsiz); \
|
535
|
+
for(int _TC_i = 0; _TC_i < _TC_min; _TC_i++){ \
|
536
|
+
if(((unsigned char *)(TC_aptr))[_TC_i] != ((unsigned char *)(TC_bptr))[_TC_i]){ \
|
537
|
+
(TC_rv) = ((unsigned char *)(TC_aptr))[_TC_i] - ((unsigned char *)(TC_bptr))[_TC_i]; \
|
538
|
+
break; \
|
539
|
+
} \
|
540
|
+
} \
|
541
|
+
if((TC_rv) == 0) (TC_rv) = (TC_asiz) - (TC_bsiz); \
|
542
|
+
} while(false)
|
543
|
+
|
544
|
+
|
545
|
+
|
546
|
+
#endif // duplication check
|
547
|
+
|
548
|
+
|
549
|
+
// END OF FILE
|