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,494 @@
|
|
1
|
+
/*************************************************************************************************
|
2
|
+
* The utility API of Tokyo Tyrant
|
3
|
+
* Copyright (C) 2006-2009 Mikio Hirabayashi
|
4
|
+
* This file is part of Tokyo Tyrant.
|
5
|
+
* Tokyo Tyrant 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 Tyrant 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
|
+
* Tyrant; 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 _TTUTIL_H /* duplication check */
|
18
|
+
#define _TTUTIL_H
|
19
|
+
|
20
|
+
#if defined(__cplusplus)
|
21
|
+
#define __TTUTIL_CLINKAGEBEGIN extern "C" {
|
22
|
+
#define __TTUTIL_CLINKAGEEND }
|
23
|
+
#else
|
24
|
+
#define __TTUTIL_CLINKAGEBEGIN
|
25
|
+
#define __TTUTIL_CLINKAGEEND
|
26
|
+
#endif
|
27
|
+
__TTUTIL_CLINKAGEBEGIN
|
28
|
+
|
29
|
+
|
30
|
+
#include <tcutil.h>
|
31
|
+
#include <tchdb.h>
|
32
|
+
#include <tcbdb.h>
|
33
|
+
#include <tcfdb.h>
|
34
|
+
#include <tctdb.h>
|
35
|
+
#include <tcadb.h>
|
36
|
+
#include <pthread.h>
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
/*************************************************************************************************
|
41
|
+
* basic utilities
|
42
|
+
*************************************************************************************************/
|
43
|
+
|
44
|
+
|
45
|
+
#define TTIOBUFSIZ 65536 /* size of an I/O buffer */
|
46
|
+
#define TTADDRBUFSIZ 1024 /* size of an address buffer */
|
47
|
+
|
48
|
+
typedef struct { /* type of structure for a socket */
|
49
|
+
int fd; /* file descriptor */
|
50
|
+
char buf[TTIOBUFSIZ]; /* reading buffer */
|
51
|
+
char *rp; /* reading pointer */
|
52
|
+
char *ep; /* end pointer */
|
53
|
+
bool end; /* end flag */
|
54
|
+
double to; /* timeout */
|
55
|
+
double dl; /* deadline time */
|
56
|
+
} TTSOCK;
|
57
|
+
|
58
|
+
|
59
|
+
/* String containing the version information. */
|
60
|
+
extern const char *ttversion;
|
61
|
+
|
62
|
+
|
63
|
+
/* Get the primary name of the local host.
|
64
|
+
`name' specifies the pointer to the region into which the host name is written. The size of
|
65
|
+
the buffer should be equal to or more than `TTADDRBUFSIZ' bytes.
|
66
|
+
If successful, the return value is true, else, it is false. */
|
67
|
+
bool ttgetlocalhostname(char *name);
|
68
|
+
|
69
|
+
|
70
|
+
/* Get the address of a host.
|
71
|
+
`name' specifies the name of the host.
|
72
|
+
`addr' specifies the pointer to the region into which the address is written. The size of the
|
73
|
+
buffer should be equal to or more than `TTADDRBUFSIZ' bytes.
|
74
|
+
If successful, the return value is true, else, it is false. */
|
75
|
+
bool ttgethostaddr(const char *name, char *addr);
|
76
|
+
|
77
|
+
|
78
|
+
/* Open a client socket of TCP/IP stream to a server.
|
79
|
+
`addr' specifies the address of the server.
|
80
|
+
`port' specifies the port number of the server.
|
81
|
+
The return value is the file descriptor of the stream, or -1 on error. */
|
82
|
+
int ttopensock(const char *addr, int port);
|
83
|
+
|
84
|
+
|
85
|
+
/* Open a client socket of UNIX domain stream to a server.
|
86
|
+
`path' specifies the path of the socket file.
|
87
|
+
The return value is the file descriptor of the stream, or -1 on error. */
|
88
|
+
int ttopensockunix(const char *path);
|
89
|
+
|
90
|
+
|
91
|
+
/* Open a server socket of TCP/IP stream to clients.
|
92
|
+
`addr' specifies the address of the server. If it is `NULL', every network address is binded.
|
93
|
+
`port' specifies the port number of the server.
|
94
|
+
The return value is the file descriptor of the stream, or -1 on error. */
|
95
|
+
int ttopenservsock(const char *addr, int port);
|
96
|
+
|
97
|
+
|
98
|
+
/* Open a server socket of UNIX domain stream to clients.
|
99
|
+
`addr' specifies the address of the server. If it is `NULL', every network address is binded.
|
100
|
+
`port' specifies the port number of the server.
|
101
|
+
The return value is the file descriptor of the stream, or -1 on error. */
|
102
|
+
int ttopenservsockunix(const char *path);
|
103
|
+
|
104
|
+
|
105
|
+
/* Accept a TCP/IP connection from a client.
|
106
|
+
`fd' specifies the file descriptor.
|
107
|
+
`addr' specifies the pointer to the region into which the client address is written. The size
|
108
|
+
of the buffer should be equal to or more than `TTADDRBUFSIZ' bytes.
|
109
|
+
`pp' specifies the pointer to a variable to which the client port is assigned. If it is
|
110
|
+
`NULL', it is not used.
|
111
|
+
The return value is the file descriptor of the stream, or -1 on error. */
|
112
|
+
int ttacceptsock(int fd, char *addr, int *pp);
|
113
|
+
|
114
|
+
|
115
|
+
/* Accept a UNIX domain connection from a client.
|
116
|
+
`fd' specifies the file descriptor.
|
117
|
+
The return value is the file descriptor of the stream, or -1 on error. */
|
118
|
+
int ttacceptsockunix(int fd);
|
119
|
+
|
120
|
+
|
121
|
+
/* Shutdown and close a socket.
|
122
|
+
`fd' specifies the file descriptor.
|
123
|
+
If successful, the return value is true, else, it is false. */
|
124
|
+
bool ttclosesock(int fd);
|
125
|
+
|
126
|
+
|
127
|
+
/* Wait an I/O event of a socket.
|
128
|
+
`fd' specifies the file descriptor.
|
129
|
+
`mode' specifies the kind of events; 0 for reading, 1 for writing, 2 for exception.
|
130
|
+
`timeout' specifies the timeout in seconds.
|
131
|
+
If successful, the return value is true, else, it is false. */
|
132
|
+
bool ttwaitsock(int fd, int mode, double timeout);
|
133
|
+
|
134
|
+
|
135
|
+
/* Create a socket object.
|
136
|
+
`fd' specifies the file descriptor.
|
137
|
+
The return value is the socket object. */
|
138
|
+
TTSOCK *ttsocknew(int fd);
|
139
|
+
|
140
|
+
|
141
|
+
/* Delete a socket object.
|
142
|
+
`sock' specifies the socket object. */
|
143
|
+
void ttsockdel(TTSOCK *sock);
|
144
|
+
|
145
|
+
|
146
|
+
/* Set the lifetime of a socket object.
|
147
|
+
`sock' specifies the socket object.
|
148
|
+
`lifetime' specifies the lifetime seconds of each task. By default, there is no limit. */
|
149
|
+
void ttsocksetlife(TTSOCK *sock, double lifetime);
|
150
|
+
|
151
|
+
|
152
|
+
/* Send data by a socket.
|
153
|
+
`sock' specifies the socket object.
|
154
|
+
`buf' specifies the pointer to the region of the data to send.
|
155
|
+
`size' specifies the size of the buffer.
|
156
|
+
If successful, the return value is true, else, it is false. */
|
157
|
+
bool ttsocksend(TTSOCK *sock, const void *buf, int size);
|
158
|
+
|
159
|
+
|
160
|
+
/* Send formatted data by a socket.
|
161
|
+
`sock' specifies the socket object.
|
162
|
+
`format' specifies the printf-like format string.
|
163
|
+
The conversion character `%' can be used with such flag characters as `s', `d', `o', `u',
|
164
|
+
`x', `X', `c', `e', `E', `f', `g', `G', `@', `?', `%'. `@' works as with `s' but escapes meta
|
165
|
+
characters of XML. `?' works as with `s' but escapes meta characters of URL. The other
|
166
|
+
conversion character work as with each original.
|
167
|
+
The other arguments are used according to the format string.
|
168
|
+
If successful, the return value is true, else, it is false. */
|
169
|
+
bool ttsockprintf(TTSOCK *sock, const char *format, ...);
|
170
|
+
|
171
|
+
|
172
|
+
/* Receive data by a socket.
|
173
|
+
`sock' specifies the socket object.
|
174
|
+
`buf' specifies the pointer to the region of the data to be received.
|
175
|
+
`size' specifies the size of the buffer.
|
176
|
+
If successful, the return value is true, else, it is false. False is returned if the socket
|
177
|
+
is closed before receiving the specified size of data. */
|
178
|
+
bool ttsockrecv(TTSOCK *sock, char *buf, int size);
|
179
|
+
|
180
|
+
|
181
|
+
/* Receive one byte by a socket.
|
182
|
+
`sock' specifies the socket object.
|
183
|
+
The return value is the received byte. If some error occurs or the socket is closed by the
|
184
|
+
server, -1 is returned. */
|
185
|
+
int ttsockgetc(TTSOCK *sock);
|
186
|
+
|
187
|
+
|
188
|
+
/* Push a character back to a socket.
|
189
|
+
`sock' specifies the socket object.
|
190
|
+
`c' specifies the character. */
|
191
|
+
void ttsockungetc(TTSOCK *sock, int c);
|
192
|
+
|
193
|
+
|
194
|
+
/* Receive one line by a socket.
|
195
|
+
`sock' specifies the socket object.
|
196
|
+
`buf' specifies the pointer to the region of the data to be received.
|
197
|
+
`size' specifies the size of the buffer.
|
198
|
+
If successful, the return value is true, else, it is false. False is returned if the socket
|
199
|
+
is closed before receiving linefeed. */
|
200
|
+
bool ttsockgets(TTSOCK *sock, char *buf, int size);
|
201
|
+
|
202
|
+
|
203
|
+
/* Receive one line by a socket into allocated buffer.
|
204
|
+
`sock' specifies the socket object.
|
205
|
+
If successful, the return value is the pointer to the result buffer, else, it is `NULL'.
|
206
|
+
`NULL' is returned if the socket is closed before receiving linefeed.
|
207
|
+
Because the region of the return value is allocated with the `malloc' call, it should be
|
208
|
+
released with the `free' call when it is no longer in use. */
|
209
|
+
char *ttsockgets2(TTSOCK *sock);
|
210
|
+
|
211
|
+
|
212
|
+
/* Receive an 32-bit integer by a socket.
|
213
|
+
`sock' specifies the socket object.
|
214
|
+
The return value is the 32-bit integer. */
|
215
|
+
uint32_t ttsockgetint32(TTSOCK *sock);
|
216
|
+
|
217
|
+
|
218
|
+
/* Receive an 64-bit integer by a socket.
|
219
|
+
`sock' specifies the socket object.
|
220
|
+
The return value is the 64-bit integer. */
|
221
|
+
uint64_t ttsockgetint64(TTSOCK *sock);
|
222
|
+
|
223
|
+
|
224
|
+
/* Check whehter a socket is end.
|
225
|
+
`sock' specifies the socket object.
|
226
|
+
The return value is true if the socket is end, else, it is false. */
|
227
|
+
bool ttsockcheckend(TTSOCK *sock);
|
228
|
+
|
229
|
+
|
230
|
+
/* Check the size of prefetched data in a socket.
|
231
|
+
`sock' specifies the socket object.
|
232
|
+
The return value is the size of the prefetched data. */
|
233
|
+
int ttsockcheckpfsiz(TTSOCK *sock);
|
234
|
+
|
235
|
+
|
236
|
+
/* Fetch the resource of a URL by HTTP.
|
237
|
+
`url' specifies the URL.
|
238
|
+
`reqheads' specifies a map object contains request header names and their values. The header
|
239
|
+
"X-TT-Timeout" specifies the timeout in seconds. If it is `NULL', it is not used.
|
240
|
+
`resheads' specifies a map object to store response headers their values. If it is NULL, it
|
241
|
+
is not used. Each key of the map is an uncapitalized header name. The key "STATUS" means the
|
242
|
+
status line.
|
243
|
+
`resbody' specifies a extensible string object to store the entity body of the result. If it
|
244
|
+
is `NULL', it is not used.
|
245
|
+
The return value is the response code or -1 on network error. */
|
246
|
+
int tthttpfetch(const char *url, TCMAP *reqheads, TCMAP *resheads, TCXSTR *resbody);
|
247
|
+
|
248
|
+
|
249
|
+
/* Serialize a real number.
|
250
|
+
`num' specifies a real number.
|
251
|
+
`buf' specifies the pointer to the region into which the result is written. The size of the
|
252
|
+
buffer should be 16 bytes. */
|
253
|
+
void ttpackdouble(double num, char *buf);
|
254
|
+
|
255
|
+
|
256
|
+
/* Redintegrate a serialized real number.
|
257
|
+
`buf' specifies the pointer to the region of the serialized real number. The size of the
|
258
|
+
buffer should be 16 bytes.
|
259
|
+
The return value is the original real number. */
|
260
|
+
double ttunpackdouble(const char *buf);
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
/*************************************************************************************************
|
265
|
+
* server utilities
|
266
|
+
*************************************************************************************************/
|
267
|
+
|
268
|
+
|
269
|
+
#define TTDEFPORT 1978 /* default port of the server */
|
270
|
+
#define TTMAGICNUM 0xc8 /* magic number of each command */
|
271
|
+
#define TTCMDPUT 0x10 /* ID of put command */
|
272
|
+
#define TTCMDPUTKEEP 0x11 /* ID of putkeep command */
|
273
|
+
#define TTCMDPUTCAT 0x12 /* ID of putcat command */
|
274
|
+
#define TTCMDPUTSHL 0x13 /* ID of putshl command */
|
275
|
+
#define TTCMDPUTNR 0x18 /* ID of putnr command */
|
276
|
+
#define TTCMDOUT 0x20 /* ID of out command */
|
277
|
+
#define TTCMDGET 0x30 /* ID of get command */
|
278
|
+
#define TTCMDMGET 0x31 /* ID of mget command */
|
279
|
+
#define TTCMDVSIZ 0x38 /* ID of vsiz command */
|
280
|
+
#define TTCMDITERINIT 0x50 /* ID of iterinit command */
|
281
|
+
#define TTCMDITERNEXT 0x51 /* ID of iternext command */
|
282
|
+
#define TTCMDFWMKEYS 0x58 /* ID of fwmkeys command */
|
283
|
+
#define TTCMDADDINT 0x60 /* ID of addint command */
|
284
|
+
#define TTCMDADDDOUBLE 0x61 /* ID of adddouble command */
|
285
|
+
#define TTCMDEXT 0x68 /* ID of ext command */
|
286
|
+
#define TTCMDSYNC 0x70 /* ID of sync command */
|
287
|
+
#define TTCMDOPTIMIZE 0x71 /* ID of optimize command */
|
288
|
+
#define TTCMDVANISH 0x72 /* ID of vanish command */
|
289
|
+
#define TTCMDCOPY 0x73 /* ID of copy command */
|
290
|
+
#define TTCMDRESTORE 0x74 /* ID of restore command */
|
291
|
+
#define TTCMDSETMST 0x78 /* ID of setmst command */
|
292
|
+
#define TTCMDRNUM 0x80 /* ID of rnum command */
|
293
|
+
#define TTCMDSIZE 0x81 /* ID of size command */
|
294
|
+
#define TTCMDSTAT 0x88 /* ID of stat command */
|
295
|
+
#define TTCMDMISC 0x90 /* ID of misc command */
|
296
|
+
#define TTCMDREPL 0xa0 /* ID of repl command */
|
297
|
+
|
298
|
+
#define TTTIMERMAX 8 /* maximum number of timers */
|
299
|
+
|
300
|
+
typedef struct _TTTIMER { /* type of structure for a timer */
|
301
|
+
pthread_t thid; /* thread ID */
|
302
|
+
bool alive; /* alive flag */
|
303
|
+
struct _TTSERV *serv; /* server object */
|
304
|
+
double freq_timed; /* frequency of timed handler */
|
305
|
+
void (*do_timed)(void *); /* call back function for timed handler */
|
306
|
+
void *opq_timed; /* opaque pointer for timed handler */
|
307
|
+
} TTTIMER;
|
308
|
+
|
309
|
+
typedef struct _TTREQ { /* type of structure for a server */
|
310
|
+
pthread_t thid; /* thread ID */
|
311
|
+
bool alive; /* alive flag */
|
312
|
+
struct _TTSERV *serv; /* server object */
|
313
|
+
int epfd; /* polling file descriptor */
|
314
|
+
double mtime; /* last modified time */
|
315
|
+
bool keep; /* keep-alive flag */
|
316
|
+
int idx; /* ordinal index */
|
317
|
+
} TTREQ;
|
318
|
+
|
319
|
+
typedef struct _TTSERV { /* type of structure for a server */
|
320
|
+
char host[TTADDRBUFSIZ]; /* host name */
|
321
|
+
char addr[TTADDRBUFSIZ]; /* host address */
|
322
|
+
uint16_t port; /* port number */
|
323
|
+
TCLIST *queue; /* queue of requests */
|
324
|
+
pthread_mutex_t qmtx; /* mutex for the queue */
|
325
|
+
pthread_cond_t qcnd; /* condition variable for the queue */
|
326
|
+
pthread_mutex_t tmtx; /* mutex for the timer */
|
327
|
+
pthread_cond_t tcnd; /* condition variable for the timer */
|
328
|
+
int thnum; /* number of threads */
|
329
|
+
double timeout; /* timeout milliseconds of each task */
|
330
|
+
bool term; /* terminate flag */
|
331
|
+
void (*do_log)(int, const char *, void *); /* call back function for logging */
|
332
|
+
void *opq_log; /* opaque pointer for logging */
|
333
|
+
TTTIMER timers[TTTIMERMAX]; /* timer objects */
|
334
|
+
int timernum; /* number of timer objects */
|
335
|
+
void (*do_task)(TTSOCK *, void *, TTREQ *); /* call back function for task */
|
336
|
+
void *opq_task; /* opaque pointer for task */
|
337
|
+
void (*do_term)(void *); /* call back gunction for termination */
|
338
|
+
void *opq_term; /* opaque pointer for termination */
|
339
|
+
} TTSERV;
|
340
|
+
|
341
|
+
enum { /* enumeration for logging levels */
|
342
|
+
TTLOGDEBUG, /* debug */
|
343
|
+
TTLOGINFO, /* information */
|
344
|
+
TTLOGERROR, /* error */
|
345
|
+
TTLOGSYSTEM /* system */
|
346
|
+
};
|
347
|
+
|
348
|
+
|
349
|
+
/* Create a server object.
|
350
|
+
The return value is the server object. */
|
351
|
+
TTSERV *ttservnew(void);
|
352
|
+
|
353
|
+
|
354
|
+
/* Delete a server object.
|
355
|
+
`serv' specifies the server object. */
|
356
|
+
void ttservdel(TTSERV *serv);
|
357
|
+
|
358
|
+
|
359
|
+
/* Configure a server object.
|
360
|
+
`serv' specifies the server object.
|
361
|
+
`host' specifies the name or the address. If it is `NULL', If it is `NULL', every network
|
362
|
+
address is binded.
|
363
|
+
`port' specifies the port number. If it is not less than 0, UNIX domain socket is binded and
|
364
|
+
the host name is treated as the path of the socket file.
|
365
|
+
If successful, the return value is true, else, it is false. */
|
366
|
+
bool ttservconf(TTSERV *serv, const char *host, int port);
|
367
|
+
|
368
|
+
|
369
|
+
/* Set tuning parameters of a server object.
|
370
|
+
`serv' specifies the server object.
|
371
|
+
`thnum' specifies the number of worker threads. By default, the number is 5.
|
372
|
+
`timeout' specifies the timeout seconds of each task. If it is not more than 0, no timeout is
|
373
|
+
specified. By default, there is no timeout. */
|
374
|
+
void ttservtune(TTSERV *serv, int thnum, double timeout);
|
375
|
+
|
376
|
+
|
377
|
+
/* Set the logging handler of a server object.
|
378
|
+
`serv' specifies the server object.
|
379
|
+
`do_log' specifies the pointer to a function to do with a log message. Its first parameter is
|
380
|
+
the log level, one of `TTLOGDEBUG', `TTLOGINFO', `TTLOGERROR'. Its second parameter is the
|
381
|
+
message string. Its third parameter is the opaque pointer.
|
382
|
+
`opq' specifies the opaque pointer to be passed to the handler. It can be `NULL'. */
|
383
|
+
void ttservsetloghandler(TTSERV *serv, void (*do_log)(int, const char *, void *), void *opq);
|
384
|
+
|
385
|
+
|
386
|
+
/* Add a timed handler to a server object.
|
387
|
+
`serv' specifies the server object.
|
388
|
+
`freq' specifies the frequency of execution in seconds.
|
389
|
+
`do_timed' specifies the pointer to a function to do with a event. Its parameter is the
|
390
|
+
opaque pointer.
|
391
|
+
`opq' specifies the opaque pointer to be passed to the handler. It can be `NULL'. */
|
392
|
+
void ttservaddtimedhandler(TTSERV *serv, double freq, void (*do_timed)(void *), void *opq);
|
393
|
+
|
394
|
+
|
395
|
+
/* Set the response handler of a server object.
|
396
|
+
`serv' specifies the server object.
|
397
|
+
`do_task' specifies the pointer to a function to do with a task. Its first parameter is
|
398
|
+
the socket object connected to the client. Its second parameter is the opaque pointer. Its
|
399
|
+
third parameter is the request object.
|
400
|
+
`opq' specifies the opaque pointer to be passed to the handler. It can be `NULL'. */
|
401
|
+
void ttservsettaskhandler(TTSERV *serv, void (*do_task)(TTSOCK *, void *, TTREQ *), void *opq);
|
402
|
+
|
403
|
+
|
404
|
+
/* Set the termination handler of a server object.
|
405
|
+
`serv' specifies the server object.
|
406
|
+
`do_term' specifies the pointer to a function to do with a task. Its parameter is the opaque
|
407
|
+
pointer.
|
408
|
+
`opq' specifies the opaque pointer to be passed to the handler. It can be `NULL'. */
|
409
|
+
void ttservsettermhandler(TTSERV *serv, void (*do_term)(void *), void *opq);
|
410
|
+
|
411
|
+
|
412
|
+
/* Start the service of a server object.
|
413
|
+
`serv' specifies the server object.
|
414
|
+
If successful, the return value is true, else, it is false. */
|
415
|
+
bool ttservstart(TTSERV *serv);
|
416
|
+
|
417
|
+
|
418
|
+
/* Send the terminate signal to a server object.
|
419
|
+
`serv' specifies the server object.
|
420
|
+
If successful, the return value is true, else, it is false. */
|
421
|
+
bool ttservkill(TTSERV *serv);
|
422
|
+
|
423
|
+
|
424
|
+
/* Call the logging function of a server object.
|
425
|
+
`serv' specifies the server object.
|
426
|
+
`level' specifies the logging level.
|
427
|
+
`format' specifies the message format.
|
428
|
+
The other arguments are used according to the format string. */
|
429
|
+
void ttservlog(TTSERV *serv, int level, const char *format, ...);
|
430
|
+
|
431
|
+
|
432
|
+
/* Check whether a server object is killed.
|
433
|
+
`serv' specifies the server object.
|
434
|
+
The return value is true if the server is killed, or false if not. */
|
435
|
+
bool ttserviskilled(TTSERV *serv);
|
436
|
+
|
437
|
+
|
438
|
+
/* Break a simple server expression.
|
439
|
+
`expr' specifies the simple server expression. It is composed of two substrings separated
|
440
|
+
by ":". The former field specifies the name or the address of the server. The latter field
|
441
|
+
specifies the port number. If the latter field is omitted, the default port number is
|
442
|
+
specified.
|
443
|
+
`pp' specifies the pointer to a variable to which the port number is assigned. If it is
|
444
|
+
`NULL', it is not used.
|
445
|
+
The return value is the string of the host name.
|
446
|
+
Because the region of the return value is allocated with the `malloc' call, it should be
|
447
|
+
released with the `free' call when it is no longer in use. */
|
448
|
+
char *ttbreakservexpr(const char *expr, int *pp);
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
/*************************************************************************************************
|
453
|
+
* features for experts
|
454
|
+
*************************************************************************************************/
|
455
|
+
|
456
|
+
|
457
|
+
#define _TT_VERSION "1.1.39"
|
458
|
+
#define _TT_LIBVER 322
|
459
|
+
#define _TT_PROTVER "0.91"
|
460
|
+
|
461
|
+
|
462
|
+
/* Switch the process into the background.
|
463
|
+
If successful, the return value is true, else, it is false. */
|
464
|
+
bool ttdaemonize(void);
|
465
|
+
|
466
|
+
|
467
|
+
/* Get the load average of the system.
|
468
|
+
The return value is the load average of the system. */
|
469
|
+
double ttgetloadavg(void);
|
470
|
+
|
471
|
+
|
472
|
+
/* Convert a string to a time stamp.
|
473
|
+
`str' specifies the string.
|
474
|
+
The return value is the time stamp. */
|
475
|
+
uint64_t ttstrtots(const char *str);
|
476
|
+
|
477
|
+
|
478
|
+
/* Get the command name of a command ID number.
|
479
|
+
`id' specifies the command ID number.
|
480
|
+
The return value is the string of the command name. */
|
481
|
+
const char *ttcmdidtostr(int id);
|
482
|
+
|
483
|
+
|
484
|
+
/* tricks for backward compatibility */
|
485
|
+
#define tcrdbqrysetmax(TC_tdb, TC_max) \
|
486
|
+
tcrdbqrysetlimit((TC_tdb), (TC_max), 0)
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
__TTUTIL_CLINKAGEEND
|
491
|
+
#endif /* duplication check */
|
492
|
+
|
493
|
+
|
494
|
+
/* END OF FILE */
|