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,1355 @@
|
|
1
|
+
.TH "TCBDB" 3 "2009-10-13" "Man Page" "Tokyo Cabinet"
|
2
|
+
|
3
|
+
.SH NAME
|
4
|
+
tcbdb \- the B+ tree database API
|
5
|
+
|
6
|
+
.SH DESCRIPTION
|
7
|
+
.PP
|
8
|
+
B+ tree database is a file containing a B+ tree and is handled with the B+ tree database API.
|
9
|
+
.PP
|
10
|
+
To use the B+ tree database API, include `\fBtcutil.h\fR', `\fBtcbdb.h\fR', and related standard header files. Usually, write the following description near the front of a source file.
|
11
|
+
.PP
|
12
|
+
.RS
|
13
|
+
.br
|
14
|
+
\fB#include <tcutil.h>\fR
|
15
|
+
.br
|
16
|
+
\fB#include <tcbdb.h>\fR
|
17
|
+
.br
|
18
|
+
\fB#include <stdlib.h>\fR
|
19
|
+
.br
|
20
|
+
\fB#include <time.h>\fR
|
21
|
+
.br
|
22
|
+
\fB#include <stdbool.h>\fR
|
23
|
+
.br
|
24
|
+
\fB#include <stdint.h>\fR
|
25
|
+
.RE
|
26
|
+
.PP
|
27
|
+
Objects whose type is pointer to `\fBTCBDB\fR' are used to handle B+ tree databases. A B+ tree database object is created with the function `\fBtcbdbnew\fR' and is deleted with the function `\fBtcbdbdel\fR'. To avoid memory leak, it is important to delete every object when it is no longer in use.
|
28
|
+
.PP
|
29
|
+
Before operations to store or retrieve records, it is necessary to open a database file and connect the B+ tree database object to it. The function `\fBtcbdbopen\fR' is used to open a database file and the function `\fBtcbdbclose\fR' is used to close the database file. To avoid data missing or corruption, it is important to close every database file when it is no longer in use. It is forbidden for multible database objects in a process to open the same database at the same time.
|
30
|
+
|
31
|
+
.SH API
|
32
|
+
.PP
|
33
|
+
The function `tcbdberrmsg' is used in order to get the message string corresponding to an error code.
|
34
|
+
.PP
|
35
|
+
.RS
|
36
|
+
.br
|
37
|
+
\fBconst char *tcbdberrmsg(int \fIecode\fB);\fR
|
38
|
+
.RS
|
39
|
+
`\fIecode\fR' specifies the error code.
|
40
|
+
.RE
|
41
|
+
.RS
|
42
|
+
The return value is the message string of the error code.
|
43
|
+
.RE
|
44
|
+
.RE
|
45
|
+
.PP
|
46
|
+
The function `tcbdbnew' is used in order to create a B+ tree database object.
|
47
|
+
.PP
|
48
|
+
.RS
|
49
|
+
.br
|
50
|
+
\fBTCBDB *tcbdbnew(void);\fR
|
51
|
+
.RS
|
52
|
+
The return value is the new B+ tree database object.
|
53
|
+
.RE
|
54
|
+
.RE
|
55
|
+
.PP
|
56
|
+
The function `tcbdbdel' is used in order to delete a B+ tree database object.
|
57
|
+
.PP
|
58
|
+
.RS
|
59
|
+
.br
|
60
|
+
\fBvoid tcbdbdel(TCBDB *\fIbdb\fB);\fR
|
61
|
+
.RS
|
62
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
63
|
+
.RE
|
64
|
+
.RS
|
65
|
+
If the database is not closed, it is closed implicitly. Note that the deleted object and its derivatives can not be used anymore.
|
66
|
+
.RE
|
67
|
+
.RE
|
68
|
+
.PP
|
69
|
+
The function `tcbdbecode' is used in order to get the last happened error code of a B+ tree database object.
|
70
|
+
.PP
|
71
|
+
.RS
|
72
|
+
.br
|
73
|
+
\fBint tcbdbecode(TCBDB *\fIbdb\fB);\fR
|
74
|
+
.RS
|
75
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
76
|
+
.RE
|
77
|
+
.RS
|
78
|
+
The return value is the last happened error code.
|
79
|
+
.RE
|
80
|
+
.RS
|
81
|
+
The following error codes are defined: `TCESUCCESS' for success, `TCETHREAD' for threading error, `TCEINVALID' for invalid operation, `TCENOFILE' for file not found, `TCENOPERM' for no permission, `TCEMETA' for invalid meta data, `TCERHEAD' for invalid record header, `TCEOPEN' for open error, `TCECLOSE' for close error, `TCETRUNC' for trunc error, `TCESYNC' for sync error, `TCESTAT' for stat error, `TCESEEK' for seek error, `TCEREAD' for read error, `TCEWRITE' for write error, `TCEMMAP' for mmap error, `TCELOCK' for lock error, `TCEUNLINK' for unlink error, `TCERENAME' for rename error, `TCEMKDIR' for mkdir error, `TCERMDIR' for rmdir error, `TCEKEEP' for existing record, `TCENOREC' for no record found, and `TCEMISC' for miscellaneous error.
|
82
|
+
.RE
|
83
|
+
.RE
|
84
|
+
.PP
|
85
|
+
The function `tcbdbsetmutex' is used in order to set mutual exclusion control of a B+ tree database object for threading.
|
86
|
+
.PP
|
87
|
+
.RS
|
88
|
+
.br
|
89
|
+
\fBbool tcbdbsetmutex(TCBDB *\fIbdb\fB);\fR
|
90
|
+
.RS
|
91
|
+
`\fIbdb\fR' specifies the B+ tree database object which is not opened.
|
92
|
+
.RE
|
93
|
+
.RS
|
94
|
+
If successful, the return value is true, else, it is false.
|
95
|
+
.RE
|
96
|
+
.RS
|
97
|
+
Note that the mutual exclusion control of the database should be set before the database is opened.
|
98
|
+
.RE
|
99
|
+
.RE
|
100
|
+
.PP
|
101
|
+
The function `tcbdbsetcmpfunc' is used in order to set the custom comparison function of a B+ tree database object.
|
102
|
+
.PP
|
103
|
+
.RS
|
104
|
+
.br
|
105
|
+
\fBbool tcbdbsetcmpfunc(TCBDB *\fIbdb\fB, TCCMP \fIcmp\fB, void *\fIcmpop\fB);\fR
|
106
|
+
.RS
|
107
|
+
`\fIbdb\fR' specifies the B+ tree database object which is not opened.
|
108
|
+
.RE
|
109
|
+
.RS
|
110
|
+
`\fIcmp\fR' specifies the pointer to the custom comparison function. It receives five parameters. The first parameter is the pointer to the region of one key. The second parameter is the size of the region of one key. The third parameter is the pointer to the region of the other key. The fourth parameter is the size of the region of the other key. The fifth parameter is the pointer to the optional opaque object. It returns positive if the former is big, negative if the latter is big, 0 if both are equivalent.
|
111
|
+
.RE
|
112
|
+
.RS
|
113
|
+
`\fIcmpop\fR' specifies an arbitrary pointer to be given as a parameter of the comparison function. If it is not needed, `NULL' can be specified.
|
114
|
+
.RE
|
115
|
+
.RS
|
116
|
+
If successful, the return value is true, else, it is false.
|
117
|
+
.RE
|
118
|
+
.RS
|
119
|
+
The default comparison function compares keys of two records by lexical order. The functions `tccmplexical' (dafault), `tccmpdecimal', `tccmpint32', and `tccmpint64' are built\-in. Note that the comparison function should be set before the database is opened. Moreover, user\-defined comparison functions should be set every time the database is being opened.
|
120
|
+
.RE
|
121
|
+
.RE
|
122
|
+
.PP
|
123
|
+
The function `tcbdbtune' is used in order to set the tuning parameters of a B+ tree database object.
|
124
|
+
.PP
|
125
|
+
.RS
|
126
|
+
.br
|
127
|
+
\fBbool tcbdbtune(TCBDB *\fIbdb\fB, int32_t \fIlmemb\fB, int32_t \fInmemb\fB, int64_t \fIbnum\fB, int8_t \fIapow\fB, int8_t \fIfpow\fB, uint8_t \fIopts\fB);\fR
|
128
|
+
.RS
|
129
|
+
`\fIbdb\fR' specifies the B+ tree database object which is not opened.
|
130
|
+
.RE
|
131
|
+
.RS
|
132
|
+
`\fIlmemb\fR' specifies the number of members in each leaf page. If it is not more than 0, the default value is specified. The default value is 128.
|
133
|
+
.RE
|
134
|
+
.RS
|
135
|
+
`\fInmemb\fR' specifies the number of members in each non\-leaf page. If it is not more than 0, the default value is specified. The default value is 256.
|
136
|
+
.RE
|
137
|
+
.RS
|
138
|
+
`\fIbnum\fR' specifies the number of elements of the bucket array. If it is not more than 0, the default value is specified. The default value is 16381. Suggested size of the bucket array is about from 1 to 4 times of the number of all pages to be stored.
|
139
|
+
.RE
|
140
|
+
.RS
|
141
|
+
`\fIapow\fR' specifies the size of record alignment by power of 2. If it is negative, the default value is specified. The default value is 8 standing for 2^8=256.
|
142
|
+
.RE
|
143
|
+
.RS
|
144
|
+
`\fIfpow\fR' specifies the maximum number of elements of the free block pool by power of 2. If it is negative, the default value is specified. The default value is 10 standing for 2^10=1024.
|
145
|
+
.RE
|
146
|
+
.RS
|
147
|
+
`\fIopts\fR' specifies options by bitwise-or: `BDBTLARGE' specifies that the size of the database can be larger than 2GB by using 64\-bit bucket array, `BDBTDEFLATE' specifies that each page is compressed with Deflate encoding, `BDBTBZIP' specifies that each page is compressed with BZIP2 encoding, `BDBTTCBS' specifies that each page is compressed with TCBS encoding.
|
148
|
+
.RE
|
149
|
+
.RS
|
150
|
+
If successful, the return value is true, else, it is false.
|
151
|
+
.RE
|
152
|
+
.RS
|
153
|
+
Note that the tuning parameters should be set before the database is opened.
|
154
|
+
.RE
|
155
|
+
.RE
|
156
|
+
.PP
|
157
|
+
The function `tcbdbsetcache' is used in order to set the caching parameters of a B+ tree database object.
|
158
|
+
.PP
|
159
|
+
.RS
|
160
|
+
.br
|
161
|
+
\fBbool tcbdbsetcache(TCBDB *\fIbdb\fB, int32_t \fIlcnum\fB, int32_t \fIncnum\fB);\fR
|
162
|
+
.RS
|
163
|
+
`\fIbdb\fR' specifies the B+ tree database object which is not opened.
|
164
|
+
.RE
|
165
|
+
.RS
|
166
|
+
`\fIlcnum\fR' specifies the maximum number of leaf nodes to be cached. If it is not more than 0, the default value is specified. The default value is 1024.
|
167
|
+
.RE
|
168
|
+
.RS
|
169
|
+
`\fIncnum\fR' specifies the maximum number of non\-leaf nodes to be cached. If it is not more than 0, the default value is specified. The default value is 512.
|
170
|
+
.RE
|
171
|
+
.RS
|
172
|
+
If successful, the return value is true, else, it is false.
|
173
|
+
.RE
|
174
|
+
.RS
|
175
|
+
Note that the caching parameters should be set before the database is opened.
|
176
|
+
.RE
|
177
|
+
.RE
|
178
|
+
.PP
|
179
|
+
The function `tcbdbsetxmsiz' is used in order to set the size of the extra mapped memory of a B+ tree database object.
|
180
|
+
.PP
|
181
|
+
.RS
|
182
|
+
.br
|
183
|
+
\fBbool tcbdbsetxmsiz(TCBDB *\fIbdb\fB, int64_t \fIxmsiz\fB);\fR
|
184
|
+
.RS
|
185
|
+
`\fIbdb\fR' specifies the B+ tree database object which is not opened.
|
186
|
+
.RE
|
187
|
+
.RS
|
188
|
+
`\fIxmsiz\fR' specifies the size of the extra mapped memory. If it is not more than 0, the extra mapped memory is disabled. It is disabled by default.
|
189
|
+
.RE
|
190
|
+
.RS
|
191
|
+
If successful, the return value is true, else, it is false.
|
192
|
+
.RE
|
193
|
+
.RS
|
194
|
+
Note that the mapping parameters should be set before the database is opened.
|
195
|
+
.RE
|
196
|
+
.RE
|
197
|
+
.PP
|
198
|
+
The function `tcbdbsetdfunit' is used in order to set the unit step number of auto defragmentation of a B+ tree database object.
|
199
|
+
.PP
|
200
|
+
.RS
|
201
|
+
.br
|
202
|
+
\fBbool tcbdbsetdfunit(TCBDB *\fIbdb\fB, int32_t \fIdfunit\fB);\fR
|
203
|
+
.RS
|
204
|
+
`\fIbdb\fR' specifies the B+ tree database object which is not opened.
|
205
|
+
.RE
|
206
|
+
.RS
|
207
|
+
`\fIdfunit\fR' specifie the unit step number. If it is not more than 0, the auto defragmentation is disabled. It is disabled by default.
|
208
|
+
.RE
|
209
|
+
.RS
|
210
|
+
If successful, the return value is true, else, it is false.
|
211
|
+
.RE
|
212
|
+
.RS
|
213
|
+
Note that the defragmentation parameter should be set before the database is opened.
|
214
|
+
.RE
|
215
|
+
.RE
|
216
|
+
.PP
|
217
|
+
The function `tcbdbopen' is used in order to open a database file and connect a B+ tree database object.
|
218
|
+
.PP
|
219
|
+
.RS
|
220
|
+
.br
|
221
|
+
\fBbool tcbdbopen(TCBDB *\fIbdb\fB, const char *\fIpath\fB, int \fIomode\fB);\fR
|
222
|
+
.RS
|
223
|
+
`\fIbdb\fR' specifies the B+ tree database object which is not opened.
|
224
|
+
.RE
|
225
|
+
.RS
|
226
|
+
`\fIpath\fR' specifies the path of the database file.
|
227
|
+
.RE
|
228
|
+
.RS
|
229
|
+
`\fIomode\fR' specifies the connection mode: `BDBOWRITER' as a writer, `BDBOREADER' as a reader. If the mode is `BDBOWRITER', the following may be added by bitwise-or: `BDBOCREAT', which means it creates a new database if not exist, `BDBOTRUNC', which means it creates a new database regardless if one exists, `BDBOTSYNC', which means every transaction synchronizes updated contents with the device. Both of `BDBOREADER' and `BDBOWRITER' can be added to by bitwise-or: `BDBONOLCK', which means it opens the database file without file locking, or `BDBOLCKNB', which means locking is performed without blocking.
|
230
|
+
.RE
|
231
|
+
.RS
|
232
|
+
If successful, the return value is true, else, it is false.
|
233
|
+
.RE
|
234
|
+
.RE
|
235
|
+
.PP
|
236
|
+
The function `tcbdbclose' is used in order to close a B+ tree database object.
|
237
|
+
.PP
|
238
|
+
.RS
|
239
|
+
.br
|
240
|
+
\fBbool tcbdbclose(TCBDB *\fIbdb\fB);\fR
|
241
|
+
.RS
|
242
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
243
|
+
.RE
|
244
|
+
.RS
|
245
|
+
If successful, the return value is true, else, it is false.
|
246
|
+
.RE
|
247
|
+
.RS
|
248
|
+
Update of a database is assured to be written when the database is closed. If a writer opens a database but does not close it appropriately, the database will be broken.
|
249
|
+
.RE
|
250
|
+
.RE
|
251
|
+
.PP
|
252
|
+
The function `tcbdbput' is used in order to store a record into a B+ tree database object.
|
253
|
+
.PP
|
254
|
+
.RS
|
255
|
+
.br
|
256
|
+
\fBbool tcbdbput(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, const void *\fIvbuf\fB, int \fIvsiz\fB);\fR
|
257
|
+
.RS
|
258
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
259
|
+
.RE
|
260
|
+
.RS
|
261
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
262
|
+
.RE
|
263
|
+
.RS
|
264
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
265
|
+
.RE
|
266
|
+
.RS
|
267
|
+
`\fIvbuf\fR' specifies the pointer to the region of the value.
|
268
|
+
.RE
|
269
|
+
.RS
|
270
|
+
`\fIvsiz\fR' specifies the size of the region of the value.
|
271
|
+
.RE
|
272
|
+
.RS
|
273
|
+
If successful, the return value is true, else, it is false.
|
274
|
+
.RE
|
275
|
+
.RS
|
276
|
+
If a record with the same key exists in the database, it is overwritten.
|
277
|
+
.RE
|
278
|
+
.RE
|
279
|
+
.PP
|
280
|
+
The function `tcbdbput2' is used in order to store a string record into a B+ tree database object.
|
281
|
+
.PP
|
282
|
+
.RS
|
283
|
+
.br
|
284
|
+
\fBbool tcbdbput2(TCBDB *\fIbdb\fB, const char *\fIkstr\fB, const char *\fIvstr\fB);\fR
|
285
|
+
.RS
|
286
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
287
|
+
.RE
|
288
|
+
.RS
|
289
|
+
`\fIkstr\fR' specifies the string of the key.
|
290
|
+
.RE
|
291
|
+
.RS
|
292
|
+
`\fIvstr\fR' specifies the string of the value.
|
293
|
+
.RE
|
294
|
+
.RS
|
295
|
+
If successful, the return value is true, else, it is false.
|
296
|
+
.RE
|
297
|
+
.RS
|
298
|
+
If a record with the same key exists in the database, it is overwritten.
|
299
|
+
.RE
|
300
|
+
.RE
|
301
|
+
.PP
|
302
|
+
The function `tcbdbputkeep' is used in order to store a new record into a B+ tree database object.
|
303
|
+
.PP
|
304
|
+
.RS
|
305
|
+
.br
|
306
|
+
\fBbool tcbdbputkeep(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, const void *\fIvbuf\fB, int \fIvsiz\fB);\fR
|
307
|
+
.RS
|
308
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
309
|
+
.RE
|
310
|
+
.RS
|
311
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
312
|
+
.RE
|
313
|
+
.RS
|
314
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
315
|
+
.RE
|
316
|
+
.RS
|
317
|
+
`\fIvbuf\fR' specifies the pointer to the region of the value.
|
318
|
+
.RE
|
319
|
+
.RS
|
320
|
+
`\fIvsiz\fR' specifies the size of the region of the value.
|
321
|
+
.RE
|
322
|
+
.RS
|
323
|
+
If successful, the return value is true, else, it is false.
|
324
|
+
.RE
|
325
|
+
.RS
|
326
|
+
If a record with the same key exists in the database, this function has no effect.
|
327
|
+
.RE
|
328
|
+
.RE
|
329
|
+
.PP
|
330
|
+
The function `tcbdbputkeep2' is used in order to store a new string record into a B+ tree database object.
|
331
|
+
.PP
|
332
|
+
.RS
|
333
|
+
.br
|
334
|
+
\fBbool tcbdbputkeep2(TCBDB *\fIbdb\fB, const char *\fIkstr\fB, const char *\fIvstr\fB);\fR
|
335
|
+
.RS
|
336
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
337
|
+
.RE
|
338
|
+
.RS
|
339
|
+
`\fIkstr\fR' specifies the string of the key.
|
340
|
+
.RE
|
341
|
+
.RS
|
342
|
+
`\fIvstr\fR' specifies the string of the value.
|
343
|
+
.RE
|
344
|
+
.RS
|
345
|
+
If successful, the return value is true, else, it is false.
|
346
|
+
.RE
|
347
|
+
.RS
|
348
|
+
If a record with the same key exists in the database, this function has no effect.
|
349
|
+
.RE
|
350
|
+
.RE
|
351
|
+
.PP
|
352
|
+
The function `tcbdbputcat' is used in order to concatenate a value at the end of the existing record in a B+ tree database object.
|
353
|
+
.PP
|
354
|
+
.RS
|
355
|
+
.br
|
356
|
+
\fBbool tcbdbputcat(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, const void *\fIvbuf\fB, int \fIvsiz\fB);\fR
|
357
|
+
.RS
|
358
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
359
|
+
.RE
|
360
|
+
.RS
|
361
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
362
|
+
.RE
|
363
|
+
.RS
|
364
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
365
|
+
.RE
|
366
|
+
.RS
|
367
|
+
`\fIvbuf\fR' specifies the pointer to the region of the value.
|
368
|
+
.RE
|
369
|
+
.RS
|
370
|
+
`\fIvsiz\fR' specifies the size of the region of the value.
|
371
|
+
.RE
|
372
|
+
.RS
|
373
|
+
If successful, the return value is true, else, it is false.
|
374
|
+
.RE
|
375
|
+
.RS
|
376
|
+
If there is no corresponding record, a new record is created.
|
377
|
+
.RE
|
378
|
+
.RE
|
379
|
+
.PP
|
380
|
+
The function `tcbdbputcat2' is used in order to concatenate a string value at the end of the existing record in a B+ tree database object.
|
381
|
+
.PP
|
382
|
+
.RS
|
383
|
+
.br
|
384
|
+
\fBbool tcbdbputcat2(TCBDB *\fIbdb\fB, const char *\fIkstr\fB, const char *\fIvstr\fB);\fR
|
385
|
+
.RS
|
386
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
387
|
+
.RE
|
388
|
+
.RS
|
389
|
+
`\fIkstr\fR' specifies the string of the key.
|
390
|
+
.RE
|
391
|
+
.RS
|
392
|
+
`\fIvstr\fR' specifies the string of the value.
|
393
|
+
.RE
|
394
|
+
.RS
|
395
|
+
If successful, the return value is true, else, it is false.
|
396
|
+
.RE
|
397
|
+
.RS
|
398
|
+
If there is no corresponding record, a new record is created.
|
399
|
+
.RE
|
400
|
+
.RE
|
401
|
+
.PP
|
402
|
+
The function `tcbdbputdup' is used in order to store a record into a B+ tree database object with allowing duplication of keys.
|
403
|
+
.PP
|
404
|
+
.RS
|
405
|
+
.br
|
406
|
+
\fBbool tcbdbputdup(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, const void *\fIvbuf\fB, int \fIvsiz\fB);\fR
|
407
|
+
.RS
|
408
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
409
|
+
.RE
|
410
|
+
.RS
|
411
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
412
|
+
.RE
|
413
|
+
.RS
|
414
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
415
|
+
.RE
|
416
|
+
.RS
|
417
|
+
`\fIvbuf\fR' specifies the pointer to the region of the value.
|
418
|
+
.RE
|
419
|
+
.RS
|
420
|
+
`\fIvsiz\fR' specifies the size of the region of the value.
|
421
|
+
.RE
|
422
|
+
.RS
|
423
|
+
If successful, the return value is true, else, it is false.
|
424
|
+
.RE
|
425
|
+
.RS
|
426
|
+
If a record with the same key exists in the database, the new record is placed after the existing one.
|
427
|
+
.RE
|
428
|
+
.RE
|
429
|
+
.PP
|
430
|
+
The function `tcbdbputdup2' is used in order to store a string record into a B+ tree database object with allowing duplication of keys.
|
431
|
+
.PP
|
432
|
+
.RS
|
433
|
+
.br
|
434
|
+
\fBbool tcbdbputdup2(TCBDB *\fIbdb\fB, const char *\fIkstr\fB, const char *\fIvstr\fB);\fR
|
435
|
+
.RS
|
436
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
437
|
+
.RE
|
438
|
+
.RS
|
439
|
+
`\fIkstr\fR' specifies the string of the key.
|
440
|
+
.RE
|
441
|
+
.RS
|
442
|
+
`\fIvstr\fR' specifies the string of the value.
|
443
|
+
.RE
|
444
|
+
.RS
|
445
|
+
If successful, the return value is true, else, it is false.
|
446
|
+
.RE
|
447
|
+
.RS
|
448
|
+
If a record with the same key exists in the database, the new record is placed after the existing one.
|
449
|
+
.RE
|
450
|
+
.RE
|
451
|
+
.PP
|
452
|
+
The function `tcbdbputdup3' is used in order to store records into a B+ tree database object with allowing duplication of keys.
|
453
|
+
.PP
|
454
|
+
.RS
|
455
|
+
.br
|
456
|
+
\fBbool tcbdbputdup3(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, const TCLIST *\fIvals\fB);\fR
|
457
|
+
.RS
|
458
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
459
|
+
.RE
|
460
|
+
.RS
|
461
|
+
`\fIkbuf\fR' specifies the pointer to the region of the common key.
|
462
|
+
.RE
|
463
|
+
.RS
|
464
|
+
`\fIksiz\fR' specifies the size of the region of the common key.
|
465
|
+
.RE
|
466
|
+
.RS
|
467
|
+
`\fIvals\fR' specifies a list object containing values.
|
468
|
+
.RE
|
469
|
+
.RS
|
470
|
+
If successful, the return value is true, else, it is false.
|
471
|
+
.RE
|
472
|
+
.RS
|
473
|
+
If a record with the same key exists in the database, the new records are placed after the existing one.
|
474
|
+
.RE
|
475
|
+
.RE
|
476
|
+
.PP
|
477
|
+
The function `tcbdbout' is used in order to remove a record of a B+ tree database object.
|
478
|
+
.PP
|
479
|
+
.RS
|
480
|
+
.br
|
481
|
+
\fBbool tcbdbout(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR
|
482
|
+
.RS
|
483
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
484
|
+
.RE
|
485
|
+
.RS
|
486
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
487
|
+
.RE
|
488
|
+
.RS
|
489
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
490
|
+
.RE
|
491
|
+
.RS
|
492
|
+
If successful, the return value is true, else, it is false.
|
493
|
+
.RE
|
494
|
+
.RS
|
495
|
+
If the key of duplicated records is specified, the first one is selected.
|
496
|
+
.RE
|
497
|
+
.RE
|
498
|
+
.PP
|
499
|
+
The function `tcbdbout2' is used in order to remove a string record of a B+ tree database object.
|
500
|
+
.PP
|
501
|
+
.RS
|
502
|
+
.br
|
503
|
+
\fBbool tcbdbout2(TCBDB *\fIbdb\fB, const char *\fIkstr\fB);\fR
|
504
|
+
.RS
|
505
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
506
|
+
.RE
|
507
|
+
.RS
|
508
|
+
`\fIkstr\fR' specifies the string of the key.
|
509
|
+
.RE
|
510
|
+
.RS
|
511
|
+
If successful, the return value is true, else, it is false.
|
512
|
+
.RE
|
513
|
+
.RS
|
514
|
+
If the key of duplicated records is specified, the first one is selected.
|
515
|
+
.RE
|
516
|
+
.RE
|
517
|
+
.PP
|
518
|
+
The function `tcbdbout3' is used in order to remove records of a B+ tree database object.
|
519
|
+
.PP
|
520
|
+
.RS
|
521
|
+
.br
|
522
|
+
\fBbool tcbdbout3(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR
|
523
|
+
.RS
|
524
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
525
|
+
.RE
|
526
|
+
.RS
|
527
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
528
|
+
.RE
|
529
|
+
.RS
|
530
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
531
|
+
.RE
|
532
|
+
.RS
|
533
|
+
If successful, the return value is true, else, it is false.
|
534
|
+
.RE
|
535
|
+
.RS
|
536
|
+
If the key of duplicated records is specified, all of them are removed.
|
537
|
+
.RE
|
538
|
+
.RE
|
539
|
+
.PP
|
540
|
+
The function `tcbdbget' is used in order to retrieve a record in a B+ tree database object.
|
541
|
+
.PP
|
542
|
+
.RS
|
543
|
+
.br
|
544
|
+
\fBvoid *tcbdbget(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, int *\fIsp\fB);\fR
|
545
|
+
.RS
|
546
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
547
|
+
.RE
|
548
|
+
.RS
|
549
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
550
|
+
.RE
|
551
|
+
.RS
|
552
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
553
|
+
.RE
|
554
|
+
.RS
|
555
|
+
`\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return value is assigned.
|
556
|
+
.RE
|
557
|
+
.RS
|
558
|
+
If successful, the return value is the pointer to the region of the value of the corresponding record. `NULL' is returned if no record corresponds.
|
559
|
+
.RE
|
560
|
+
.RS
|
561
|
+
If the key of duplicated records is specified, the first one is selected. Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call when it is no longer in use.
|
562
|
+
.RE
|
563
|
+
.RE
|
564
|
+
.PP
|
565
|
+
The function `tcbdbget2' is used in order to retrieve a string record in a B+ tree database object.
|
566
|
+
.PP
|
567
|
+
.RS
|
568
|
+
.br
|
569
|
+
\fBchar *tcbdbget2(TCBDB *\fIbdb\fB, const char *\fIkstr\fB);\fR
|
570
|
+
.RS
|
571
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
572
|
+
.RE
|
573
|
+
.RS
|
574
|
+
`\fIkstr\fR' specifies the string of the key.
|
575
|
+
.RE
|
576
|
+
.RS
|
577
|
+
If successful, the return value is the string of the value of the corresponding record. `NULL' is returned if no record corresponds.
|
578
|
+
.RE
|
579
|
+
.RS
|
580
|
+
If the key of duplicated records is specified, the first one is selected. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call when it is no longer in use.
|
581
|
+
.RE
|
582
|
+
.RE
|
583
|
+
.PP
|
584
|
+
The function `tcbdbget3' is used in order to retrieve a record in a B+ tree database object as a volatile buffer.
|
585
|
+
.PP
|
586
|
+
.RS
|
587
|
+
.br
|
588
|
+
\fBconst void *tcbdbget3(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, int *\fIsp\fB);\fR
|
589
|
+
.RS
|
590
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
591
|
+
.RE
|
592
|
+
.RS
|
593
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
594
|
+
.RE
|
595
|
+
.RS
|
596
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
597
|
+
.RE
|
598
|
+
.RS
|
599
|
+
`\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return value is assigned.
|
600
|
+
.RE
|
601
|
+
.RS
|
602
|
+
If successful, the return value is the pointer to the region of the value of the corresponding record. `NULL' is returned if no record corresponds.
|
603
|
+
.RE
|
604
|
+
.RS
|
605
|
+
If the key of duplicated records is specified, the first one is selected. Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is volatile and it may be spoiled by another operation of the database, the data should be copied into another involatile buffer immediately.
|
606
|
+
.RE
|
607
|
+
.RE
|
608
|
+
.PP
|
609
|
+
The function `tcbdbget4' is used in order to retrieve records in a B+ tree database object.
|
610
|
+
.PP
|
611
|
+
.RS
|
612
|
+
.br
|
613
|
+
\fBTCLIST *tcbdbget4(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR
|
614
|
+
.RS
|
615
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
616
|
+
.RE
|
617
|
+
.RS
|
618
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
619
|
+
.RE
|
620
|
+
.RS
|
621
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
622
|
+
.RE
|
623
|
+
.RS
|
624
|
+
If successful, the return value is a list object of the values of the corresponding records. `NULL' is returned if no record corresponds.
|
625
|
+
.RE
|
626
|
+
.RS
|
627
|
+
Because the object of the return value is created with the function `tclistnew', it should be deleted with the function `tclistdel' when it is no longer in use.
|
628
|
+
.RE
|
629
|
+
.RE
|
630
|
+
.PP
|
631
|
+
The function `tcbdbvnum' is used in order to get the number of records corresponding a key in a B+ tree database object.
|
632
|
+
.PP
|
633
|
+
.RS
|
634
|
+
.br
|
635
|
+
\fBint tcbdbvnum(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR
|
636
|
+
.RS
|
637
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
638
|
+
.RE
|
639
|
+
.RS
|
640
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
641
|
+
.RE
|
642
|
+
.RS
|
643
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
644
|
+
.RE
|
645
|
+
.RS
|
646
|
+
If successful, the return value is the number of the corresponding records, else, it is 0.
|
647
|
+
.RE
|
648
|
+
.RE
|
649
|
+
.PP
|
650
|
+
The function `tcbdbvnum2' is used in order to get the number of records corresponding a string key in a B+ tree database object.
|
651
|
+
.PP
|
652
|
+
.RS
|
653
|
+
.br
|
654
|
+
\fBint tcbdbvnum2(TCBDB *\fIbdb\fB, const char *\fIkstr\fB);\fR
|
655
|
+
.RS
|
656
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
657
|
+
.RE
|
658
|
+
.RS
|
659
|
+
`\fIkstr\fR' specifies the string of the key.
|
660
|
+
.RE
|
661
|
+
.RS
|
662
|
+
If successful, the return value is the number of the corresponding records, else, it is 0.
|
663
|
+
.RE
|
664
|
+
.RE
|
665
|
+
.PP
|
666
|
+
The function `tcbdbvsiz' is used in order to get the size of the value of a record in a B+ tree database object.
|
667
|
+
.PP
|
668
|
+
.RS
|
669
|
+
.br
|
670
|
+
\fBint tcbdbvsiz(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR
|
671
|
+
.RS
|
672
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
673
|
+
.RE
|
674
|
+
.RS
|
675
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
676
|
+
.RE
|
677
|
+
.RS
|
678
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
679
|
+
.RE
|
680
|
+
.RS
|
681
|
+
If successful, the return value is the size of the value of the corresponding record, else, it is \-1.
|
682
|
+
.RE
|
683
|
+
.RS
|
684
|
+
If the key of duplicated records is specified, the first one is selected.
|
685
|
+
.RE
|
686
|
+
.RE
|
687
|
+
.PP
|
688
|
+
The function `tcbdbvsiz2' is used in order to get the size of the value of a string record in a B+ tree database object.
|
689
|
+
.PP
|
690
|
+
.RS
|
691
|
+
.br
|
692
|
+
\fBint tcbdbvsiz2(TCBDB *\fIbdb\fB, const char *\fIkstr\fB);\fR
|
693
|
+
.RS
|
694
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
695
|
+
.RE
|
696
|
+
.RS
|
697
|
+
`\fIkstr\fR' specifies the string of the key.
|
698
|
+
.RE
|
699
|
+
.RS
|
700
|
+
If successful, the return value is the size of the value of the corresponding record, else, it is \-1.
|
701
|
+
.RE
|
702
|
+
.RS
|
703
|
+
If the key of duplicated records is specified, the first one is selected.
|
704
|
+
.RE
|
705
|
+
.RE
|
706
|
+
.PP
|
707
|
+
The function `tcbdbrange' is used in order to get keys of ranged records in a B+ tree database object.
|
708
|
+
.PP
|
709
|
+
.RS
|
710
|
+
.br
|
711
|
+
\fBTCLIST *tcbdbrange(TCBDB *\fIbdb\fB, const void *\fIbkbuf\fB, int \fIbksiz\fB, bool \fIbinc\fB, const void *\fIekbuf\fB, int \fIeksiz\fB, bool \fIeinc\fB, int \fImax\fB);\fR
|
712
|
+
.RS
|
713
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
714
|
+
.RE
|
715
|
+
.RS
|
716
|
+
`\fIbkbuf\fR' specifies the pointer to the region of the key of the beginning border. If it is `NULL', the first record is specified.
|
717
|
+
.RE
|
718
|
+
.RS
|
719
|
+
`\fIbksiz\fR' specifies the size of the region of the beginning key.
|
720
|
+
.RE
|
721
|
+
.RS
|
722
|
+
`\fIbinc\fR' specifies whether the beginning border is inclusive or not.
|
723
|
+
.RE
|
724
|
+
.RS
|
725
|
+
`\fIekbuf\fR' specifies the pointer to the region of the key of the ending border. If it is `NULL', the last record is specified.
|
726
|
+
.RE
|
727
|
+
.RS
|
728
|
+
`\fIeksiz\fR' specifies the size of the region of the ending key.
|
729
|
+
.RE
|
730
|
+
.RS
|
731
|
+
`\fIeinc\fR' specifies whether the ending border is inclusive or not.
|
732
|
+
.RE
|
733
|
+
.RS
|
734
|
+
`\fImax\fR' specifies the maximum number of keys to be fetched. If it is negative, no limit is specified.
|
735
|
+
.RE
|
736
|
+
.RS
|
737
|
+
The return value is a list object of the keys of the corresponding records. This function does never fail. It returns an empty list even if no record corresponds.
|
738
|
+
.RE
|
739
|
+
.RS
|
740
|
+
Because the object of the return value is created with the function `tclistnew', it should be deleted with the function `tclistdel' when it is no longer in use.
|
741
|
+
.RE
|
742
|
+
.RE
|
743
|
+
.PP
|
744
|
+
The function `tcbdbrange2' is used in order to get string keys of ranged records in a B+ tree database object.
|
745
|
+
.PP
|
746
|
+
.RS
|
747
|
+
.br
|
748
|
+
\fBTCLIST *tcbdbrange2(TCBDB *\fIbdb\fB, const char *\fIbkstr\fB, bool \fIbinc\fB, const char *\fIekstr\fB, bool \fIeinc\fB, int \fImax\fB);\fR
|
749
|
+
.RS
|
750
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
751
|
+
.RE
|
752
|
+
.RS
|
753
|
+
`\fIbkstr\fR' specifies the string of the key of the beginning border. If it is `NULL', the first record is specified.
|
754
|
+
.RE
|
755
|
+
.RS
|
756
|
+
`\fIbinc\fR' specifies whether the beginning border is inclusive or not.
|
757
|
+
.RE
|
758
|
+
.RS
|
759
|
+
`\fIekstr\fR' specifies the string of the key of the ending border. If it is `NULL', the last record is specified.
|
760
|
+
.RE
|
761
|
+
.RS
|
762
|
+
`\fIeinc\fR' specifies whether the ending border is inclusive or not.
|
763
|
+
.RE
|
764
|
+
.RS
|
765
|
+
`\fImax\fR' specifies the maximum number of keys to be fetched. If it is negative, no limit is specified.
|
766
|
+
.RE
|
767
|
+
.RS
|
768
|
+
The return value is a list object of the keys of the corresponding records. This function does never fail. It returns an empty list even if no record corresponds.
|
769
|
+
.RE
|
770
|
+
.RS
|
771
|
+
Because the object of the return value is created with the function `tclistnew', it should be deleted with the function `tclistdel' when it is no longer in use.
|
772
|
+
.RE
|
773
|
+
.RE
|
774
|
+
.PP
|
775
|
+
The function `tcbdbfwmkeys' is used in order to get forward matching keys in a B+ tree database object.
|
776
|
+
.PP
|
777
|
+
.RS
|
778
|
+
.br
|
779
|
+
\fBTCLIST *tcbdbfwmkeys(TCBDB *\fIbdb\fB, const void *\fIpbuf\fB, int \fIpsiz\fB, int \fImax\fB);\fR
|
780
|
+
.RS
|
781
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
782
|
+
.RE
|
783
|
+
.RS
|
784
|
+
`\fIpbuf\fR' specifies the pointer to the region of the prefix.
|
785
|
+
.RE
|
786
|
+
.RS
|
787
|
+
`\fIpsiz\fR' specifies the size of the region of the prefix.
|
788
|
+
.RE
|
789
|
+
.RS
|
790
|
+
`\fImax\fR' specifies the maximum number of keys to be fetched. If it is negative, no limit is specified.
|
791
|
+
.RE
|
792
|
+
.RS
|
793
|
+
The return value is a list object of the corresponding keys. This function does never fail. It returns an empty list even if no key corresponds.
|
794
|
+
.RE
|
795
|
+
.RS
|
796
|
+
Because the object of the return value is created with the function `tclistnew', it should be deleted with the function `tclistdel' when it is no longer in use.
|
797
|
+
.RE
|
798
|
+
.RE
|
799
|
+
.PP
|
800
|
+
The function `tcbdbfwmkeys2' is used in order to get forward matching string keys in a B+ tree database object.
|
801
|
+
.PP
|
802
|
+
.RS
|
803
|
+
.br
|
804
|
+
\fBTCLIST *tcbdbfwmkeys2(TCBDB *\fIbdb\fB, const char *\fIpstr\fB, int \fImax\fB);\fR
|
805
|
+
.RS
|
806
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
807
|
+
.RE
|
808
|
+
.RS
|
809
|
+
`\fIpstr\fR' specifies the string of the prefix.
|
810
|
+
.RE
|
811
|
+
.RS
|
812
|
+
`\fImax\fR' specifies the maximum number of keys to be fetched. If it is negative, no limit is specified.
|
813
|
+
.RE
|
814
|
+
.RS
|
815
|
+
The return value is a list object of the corresponding keys. This function does never fail. It returns an empty list even if no key corresponds.
|
816
|
+
.RE
|
817
|
+
.RS
|
818
|
+
Because the object of the return value is created with the function `tclistnew', it should be deleted with the function `tclistdel' when it is no longer in use.
|
819
|
+
.RE
|
820
|
+
.RE
|
821
|
+
.PP
|
822
|
+
The function `tcbdbaddint' is used in order to add an integer to a record in a B+ tree database object.
|
823
|
+
.PP
|
824
|
+
.RS
|
825
|
+
.br
|
826
|
+
\fBint tcbdbaddint(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, int \fInum\fB);\fR
|
827
|
+
.RS
|
828
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
829
|
+
.RE
|
830
|
+
.RS
|
831
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
832
|
+
.RE
|
833
|
+
.RS
|
834
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
835
|
+
.RE
|
836
|
+
.RS
|
837
|
+
`\fInum\fR' specifies the additional value.
|
838
|
+
.RE
|
839
|
+
.RS
|
840
|
+
If successful, the return value is the summation value, else, it is `INT_MIN'.
|
841
|
+
.RE
|
842
|
+
.RS
|
843
|
+
If the corresponding record exists, the value is treated as an integer and is added to. If no record corresponds, a new record of the additional value is stored.
|
844
|
+
.RE
|
845
|
+
.RE
|
846
|
+
.PP
|
847
|
+
The function `tcbdbadddouble' is used in order to add a real number to a record in a B+ tree database object.
|
848
|
+
.PP
|
849
|
+
.RS
|
850
|
+
.br
|
851
|
+
\fBdouble tcbdbadddouble(TCBDB *\fIbdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, double \fInum\fB);\fR
|
852
|
+
.RS
|
853
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
854
|
+
.RE
|
855
|
+
.RS
|
856
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
857
|
+
.RE
|
858
|
+
.RS
|
859
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
860
|
+
.RE
|
861
|
+
.RS
|
862
|
+
`\fInum\fR' specifies the additional value.
|
863
|
+
.RE
|
864
|
+
.RS
|
865
|
+
If successful, the return value is the summation value, else, it is Not-a-Number.
|
866
|
+
.RE
|
867
|
+
.RS
|
868
|
+
If the corresponding record exists, the value is treated as a real number and is added to. If no record corresponds, a new record of the additional value is stored.
|
869
|
+
.RE
|
870
|
+
.RE
|
871
|
+
.PP
|
872
|
+
The function `tcbdbsync' is used in order to synchronize updated contents of a B+ tree database object with the file and the device.
|
873
|
+
.PP
|
874
|
+
.RS
|
875
|
+
.br
|
876
|
+
\fBbool tcbdbsync(TCBDB *\fIbdb\fB);\fR
|
877
|
+
.RS
|
878
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
879
|
+
.RE
|
880
|
+
.RS
|
881
|
+
If successful, the return value is true, else, it is false.
|
882
|
+
.RE
|
883
|
+
.RS
|
884
|
+
This function is useful when another process connects to the same database file.
|
885
|
+
.RE
|
886
|
+
.RE
|
887
|
+
.PP
|
888
|
+
The function `tcbdboptimize' is used in order to optimize the file of a B+ tree database object.
|
889
|
+
.PP
|
890
|
+
.RS
|
891
|
+
.br
|
892
|
+
\fBbool tcbdboptimize(TCBDB *\fIbdb\fB, int32_t \fIlmemb\fB, int32_t \fInmemb\fB, int64_t \fIbnum\fB, int8_t \fIapow\fB, int8_t \fIfpow\fB, uint8_t \fIopts\fB);\fR
|
893
|
+
.RS
|
894
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
895
|
+
.RE
|
896
|
+
.RS
|
897
|
+
`\fIlmemb\fR' specifies the number of members in each leaf page. If it is not more than 0, the current setting is not changed.
|
898
|
+
.RE
|
899
|
+
.RS
|
900
|
+
`\fInmemb\fR' specifies the number of members in each non\-leaf page. If it is not more than 0, the current setting is not changed.
|
901
|
+
.RE
|
902
|
+
.RS
|
903
|
+
`\fIbnum\fR' specifies the number of elements of the bucket array. If it is not more than 0, the default value is specified. The default value is two times of the number of pages.
|
904
|
+
.RE
|
905
|
+
.RS
|
906
|
+
`\fIapow\fR' specifies the size of record alignment by power of 2. If it is negative, the current setting is not changed.
|
907
|
+
.RE
|
908
|
+
.RS
|
909
|
+
`\fIfpow\fR' specifies the maximum number of elements of the free block pool by power of 2. If it is negative, the current setting is not changed.
|
910
|
+
.RE
|
911
|
+
.RS
|
912
|
+
`\fIopts\fR' specifies options by bitwise-or: `BDBTLARGE' specifies that the size of the database can be larger than 2GB by using 64\-bit bucket array, `BDBTDEFLATE' specifies that each record is compressed with Deflate encoding, `BDBTBZIP' specifies that each page is compressed with BZIP2 encoding, `BDBTTCBS' specifies that each page is compressed with TCBS encoding. If it is `UINT8_MAX', the current setting is not changed.
|
913
|
+
.RE
|
914
|
+
.RS
|
915
|
+
If successful, the return value is true, else, it is false.
|
916
|
+
.RE
|
917
|
+
.RS
|
918
|
+
This function is useful to reduce the size of the database file with data fragmentation by successive updating.
|
919
|
+
.RE
|
920
|
+
.RE
|
921
|
+
.PP
|
922
|
+
The function `tcbdbvanish' is used in order to remove all records of a B+ tree database object.
|
923
|
+
.PP
|
924
|
+
.RS
|
925
|
+
.br
|
926
|
+
\fBbool tcbdbvanish(TCBDB *\fIbdb\fB);\fR
|
927
|
+
.RS
|
928
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
929
|
+
.RE
|
930
|
+
.RS
|
931
|
+
If successful, the return value is true, else, it is false.
|
932
|
+
.RE
|
933
|
+
.RE
|
934
|
+
.PP
|
935
|
+
The function `tcbdbcopy' is used in order to copy the database file of a B+ tree database object.
|
936
|
+
.PP
|
937
|
+
.RS
|
938
|
+
.br
|
939
|
+
\fBbool tcbdbcopy(TCBDB *\fIbdb\fB, const char *\fIpath\fB);\fR
|
940
|
+
.RS
|
941
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
942
|
+
.RE
|
943
|
+
.RS
|
944
|
+
`\fIpath\fR' specifies the path of the destination file. If it begins with `@', the trailing substring is executed as a command line.
|
945
|
+
.RE
|
946
|
+
.RS
|
947
|
+
If successful, the return value is true, else, it is false. False is returned if the executed command returns non\-zero code.
|
948
|
+
.RE
|
949
|
+
.RS
|
950
|
+
The database file is assured to be kept synchronized and not modified while the copying or executing operation is in progress. So, this function is useful to create a backup file of the database file.
|
951
|
+
.RE
|
952
|
+
.RE
|
953
|
+
.PP
|
954
|
+
The function `tcbdbtranbegin' is used in order to begin the transaction of a B+ tree database object.
|
955
|
+
.PP
|
956
|
+
.RS
|
957
|
+
.br
|
958
|
+
\fBbool tcbdbtranbegin(TCBDB *\fIbdb\fB);\fR
|
959
|
+
.RS
|
960
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
961
|
+
.RE
|
962
|
+
.RS
|
963
|
+
If successful, the return value is true, else, it is false.
|
964
|
+
.RE
|
965
|
+
.RS
|
966
|
+
The database is locked by the thread while the transaction so that only one transaction can be activated with a database object at the same time. Thus, the serializable isolation level is assumed if every database operation is performed in the transaction. Because all pages are cached on memory while the transaction, the amount of referred records is limited by the memory capacity. If the database is closed during transaction, the transaction is aborted implicitly.
|
967
|
+
.RE
|
968
|
+
.RE
|
969
|
+
.PP
|
970
|
+
The function `tcbdbtrancommit' is used in order to commit the transaction of a B+ tree database object.
|
971
|
+
.PP
|
972
|
+
.RS
|
973
|
+
.br
|
974
|
+
\fBbool tcbdbtrancommit(TCBDB *\fIbdb\fB);\fR
|
975
|
+
.RS
|
976
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
977
|
+
.RE
|
978
|
+
.RS
|
979
|
+
If successful, the return value is true, else, it is false.
|
980
|
+
.RE
|
981
|
+
.RS
|
982
|
+
Update in the transaction is fixed when it is committed successfully.
|
983
|
+
.RE
|
984
|
+
.RE
|
985
|
+
.PP
|
986
|
+
The function `tcbdbtranabort' is used in order to abort the transaction of a B+ tree database object.
|
987
|
+
.PP
|
988
|
+
.RS
|
989
|
+
.br
|
990
|
+
\fBbool tcbdbtranabort(TCBDB *\fIbdb\fB);\fR
|
991
|
+
.RS
|
992
|
+
`\fIbdb\fR' specifies the B+ tree database object connected as a writer.
|
993
|
+
.RE
|
994
|
+
.RS
|
995
|
+
If successful, the return value is true, else, it is false.
|
996
|
+
.RE
|
997
|
+
.RS
|
998
|
+
Update in the transaction is discarded when it is aborted. The state of the database is rollbacked to before transaction.
|
999
|
+
.RE
|
1000
|
+
.RE
|
1001
|
+
.PP
|
1002
|
+
The function `tcbdbpath' is used in order to get the file path of a B+ tree database object.
|
1003
|
+
.PP
|
1004
|
+
.RS
|
1005
|
+
.br
|
1006
|
+
\fBconst char *tcbdbpath(TCBDB *\fIbdb\fB);\fR
|
1007
|
+
.RS
|
1008
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
1009
|
+
.RE
|
1010
|
+
.RS
|
1011
|
+
The return value is the path of the database file or `NULL' if the object does not connect to any database file.
|
1012
|
+
.RE
|
1013
|
+
.RE
|
1014
|
+
.PP
|
1015
|
+
The function `tcbdbrnum' is used in order to get the number of records of a B+ tree database object.
|
1016
|
+
.PP
|
1017
|
+
.RS
|
1018
|
+
.br
|
1019
|
+
\fBuint64_t tcbdbrnum(TCBDB *\fIbdb\fB);\fR
|
1020
|
+
.RS
|
1021
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
1022
|
+
.RE
|
1023
|
+
.RS
|
1024
|
+
The return value is the number of records or 0 if the object does not connect to any database file.
|
1025
|
+
.RE
|
1026
|
+
.RE
|
1027
|
+
.PP
|
1028
|
+
The function `tcbdbfsiz' is used in order to get the size of the database file of a B+ tree database object.
|
1029
|
+
.PP
|
1030
|
+
.RS
|
1031
|
+
.br
|
1032
|
+
\fBuint64_t tcbdbfsiz(TCBDB *\fIbdb\fB);\fR
|
1033
|
+
.RS
|
1034
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
1035
|
+
.RE
|
1036
|
+
.RS
|
1037
|
+
The return value is the size of the database file or 0 if the object does not connect to any database file.
|
1038
|
+
.RE
|
1039
|
+
.RE
|
1040
|
+
.PP
|
1041
|
+
The function `tcbdbcurnew' is used in order to create a cursor object.
|
1042
|
+
.PP
|
1043
|
+
.RS
|
1044
|
+
.br
|
1045
|
+
\fBBDBCUR *tcbdbcurnew(TCBDB *\fIbdb\fB);\fR
|
1046
|
+
.RS
|
1047
|
+
`\fIbdb\fR' specifies the B+ tree database object.
|
1048
|
+
.RE
|
1049
|
+
.RS
|
1050
|
+
The return value is the new cursor object.
|
1051
|
+
.RE
|
1052
|
+
.RS
|
1053
|
+
Note that the cursor is available only after initialization with the `tcbdbcurfirst' or the `tcbdbcurjump' functions and so on. Moreover, the position of the cursor will be indefinite when the database is updated after the initialization of the cursor.
|
1054
|
+
.RE
|
1055
|
+
.RE
|
1056
|
+
.PP
|
1057
|
+
The function `tcbdbcurdel' is used in order to delete a cursor object.
|
1058
|
+
.PP
|
1059
|
+
.RS
|
1060
|
+
.br
|
1061
|
+
\fBvoid tcbdbcurdel(BDBCUR *\fIcur\fB);\fR
|
1062
|
+
.RS
|
1063
|
+
`\fIcur\fR' specifies the cursor object.
|
1064
|
+
.RE
|
1065
|
+
.RE
|
1066
|
+
.PP
|
1067
|
+
The function `tcbdbcurfirst' is used in order to move a cursor object to the first record.
|
1068
|
+
.PP
|
1069
|
+
.RS
|
1070
|
+
.br
|
1071
|
+
\fBbool tcbdbcurfirst(BDBCUR *\fIcur\fB);\fR
|
1072
|
+
.RS
|
1073
|
+
`\fIcur\fR' specifies the cursor object.
|
1074
|
+
.RE
|
1075
|
+
.RS
|
1076
|
+
If successful, the return value is true, else, it is false. False is returned if there is no record in the database.
|
1077
|
+
.RE
|
1078
|
+
.RE
|
1079
|
+
.PP
|
1080
|
+
The function `tcbdbcurlast' is used in order to move a cursor object to the last record.
|
1081
|
+
.PP
|
1082
|
+
.RS
|
1083
|
+
.br
|
1084
|
+
\fBbool tcbdbcurlast(BDBCUR *\fIcur\fB);\fR
|
1085
|
+
.RS
|
1086
|
+
`\fIcur\fR' specifies the cursor object.
|
1087
|
+
.RE
|
1088
|
+
.RS
|
1089
|
+
If successful, the return value is true, else, it is false. False is returned if there is no record in the database.
|
1090
|
+
.RE
|
1091
|
+
.RE
|
1092
|
+
.PP
|
1093
|
+
The function `tcbdbcurjump' is used in order to move a cursor object to the front of records corresponding a key.
|
1094
|
+
.PP
|
1095
|
+
.RS
|
1096
|
+
.br
|
1097
|
+
\fBbool tcbdbcurjump(BDBCUR *\fIcur\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR
|
1098
|
+
.RS
|
1099
|
+
`\fIcur\fR' specifies the cursor object.
|
1100
|
+
.RE
|
1101
|
+
.RS
|
1102
|
+
`\fIkbuf\fR' specifies the pointer to the region of the key.
|
1103
|
+
.RE
|
1104
|
+
.RS
|
1105
|
+
`\fIksiz\fR' specifies the size of the region of the key.
|
1106
|
+
.RE
|
1107
|
+
.RS
|
1108
|
+
If successful, the return value is true, else, it is false. False is returned if there is no record corresponding the condition.
|
1109
|
+
.RE
|
1110
|
+
.RS
|
1111
|
+
The cursor is set to the first record corresponding the key or the next substitute if completely matching record does not exist.
|
1112
|
+
.RE
|
1113
|
+
.RE
|
1114
|
+
.PP
|
1115
|
+
The function `tcbdbcurjump2' is used in order to move a cursor object to the front of records corresponding a key string.
|
1116
|
+
.PP
|
1117
|
+
.RS
|
1118
|
+
.br
|
1119
|
+
\fBbool tcbdbcurjump2(BDBCUR *\fIcur\fB, const char *\fIkstr\fB);\fR
|
1120
|
+
.RS
|
1121
|
+
`\fIcur\fR' specifies the cursor object.
|
1122
|
+
.RE
|
1123
|
+
.RS
|
1124
|
+
`\fIkstr\fR' specifies the string of the key.
|
1125
|
+
.RE
|
1126
|
+
.RS
|
1127
|
+
If successful, the return value is true, else, it is false. False is returned if there is no record corresponding the condition.
|
1128
|
+
.RE
|
1129
|
+
.RS
|
1130
|
+
The cursor is set to the first record corresponding the key or the next substitute if completely matching record does not exist.
|
1131
|
+
.RE
|
1132
|
+
.RE
|
1133
|
+
.PP
|
1134
|
+
The function `tcbdbcurprev' is used in order to move a cursor object to the previous record.
|
1135
|
+
.PP
|
1136
|
+
.RS
|
1137
|
+
.br
|
1138
|
+
\fBbool tcbdbcurprev(BDBCUR *\fIcur\fB);\fR
|
1139
|
+
.RS
|
1140
|
+
`\fIcur\fR' specifies the cursor object.
|
1141
|
+
.RE
|
1142
|
+
.RS
|
1143
|
+
If successful, the return value is true, else, it is false. False is returned if there is no previous record.
|
1144
|
+
.RE
|
1145
|
+
.RE
|
1146
|
+
.PP
|
1147
|
+
The function `tcbdbcurnext' is used in order to move a cursor object to the next record.
|
1148
|
+
.PP
|
1149
|
+
.RS
|
1150
|
+
.br
|
1151
|
+
\fBbool tcbdbcurnext(BDBCUR *\fIcur\fB);\fR
|
1152
|
+
.RS
|
1153
|
+
`\fIcur\fR' specifies the cursor object.
|
1154
|
+
.RE
|
1155
|
+
.RS
|
1156
|
+
If successful, the return value is true, else, it is false. False is returned if there is no next record.
|
1157
|
+
.RE
|
1158
|
+
.RE
|
1159
|
+
.PP
|
1160
|
+
The function `tcbdbcurput' is used in order to insert a record around a cursor object.
|
1161
|
+
.PP
|
1162
|
+
.RS
|
1163
|
+
.br
|
1164
|
+
\fBbool tcbdbcurput(BDBCUR *\fIcur\fB, const void *\fIvbuf\fB, int \fIvsiz\fB, int \fIcpmode\fB);\fR
|
1165
|
+
.RS
|
1166
|
+
`\fIcur\fR' specifies the cursor object of writer connection.
|
1167
|
+
.RE
|
1168
|
+
.RS
|
1169
|
+
`\fIvbuf\fR' specifies the pointer to the region of the value.
|
1170
|
+
.RE
|
1171
|
+
.RS
|
1172
|
+
`\fIvsiz\fR' specifies the size of the region of the value.
|
1173
|
+
.RE
|
1174
|
+
.RS
|
1175
|
+
`\fIcpmode\fR' specifies detail adjustment: `BDBCPCURRENT', which means that the value of the current record is overwritten, `BDBCPBEFORE', which means that the new record is inserted before the current record, `BDBCPAFTER', which means that the new record is inserted after the current record.
|
1176
|
+
.RE
|
1177
|
+
.RS
|
1178
|
+
If successful, the return value is true, else, it is false. False is returned when the cursor is at invalid position.
|
1179
|
+
.RE
|
1180
|
+
.RS
|
1181
|
+
After insertion, the cursor is moved to the inserted record.
|
1182
|
+
.RE
|
1183
|
+
.RE
|
1184
|
+
.PP
|
1185
|
+
The function `tcbdbcurput2' is used in order to insert a string record around a cursor object.
|
1186
|
+
.PP
|
1187
|
+
.RS
|
1188
|
+
.br
|
1189
|
+
\fBbool tcbdbcurput2(BDBCUR *\fIcur\fB, const char *\fIvstr\fB, int \fIcpmode\fB);\fR
|
1190
|
+
.RS
|
1191
|
+
`\fIcur\fR' specifies the cursor object of writer connection.
|
1192
|
+
.RE
|
1193
|
+
.RS
|
1194
|
+
`\fIvstr\fR' specifies the string of the value.
|
1195
|
+
.RE
|
1196
|
+
.RS
|
1197
|
+
`\fIcpmode\fR' specifies detail adjustment: `BDBCPCURRENT', which means that the value of the current record is overwritten, `BDBCPBEFORE', which means that the new record is inserted before the current record, `BDBCPAFTER', which means that the new record is inserted after the current record.
|
1198
|
+
.RE
|
1199
|
+
.RS
|
1200
|
+
If successful, the return value is true, else, it is false. False is returned when the cursor is at invalid position.
|
1201
|
+
.RE
|
1202
|
+
.RS
|
1203
|
+
After insertion, the cursor is moved to the inserted record.
|
1204
|
+
.RE
|
1205
|
+
.RE
|
1206
|
+
.PP
|
1207
|
+
The function `tcbdbcurout' is used in order to remove the record where a cursor object is.
|
1208
|
+
.PP
|
1209
|
+
.RS
|
1210
|
+
.br
|
1211
|
+
\fBbool tcbdbcurout(BDBCUR *\fIcur\fB);\fR
|
1212
|
+
.RS
|
1213
|
+
`\fIcur\fR' specifies the cursor object of writer connection.
|
1214
|
+
.RE
|
1215
|
+
.RS
|
1216
|
+
If successful, the return value is true, else, it is false. False is returned when the cursor is at invalid position.
|
1217
|
+
.RE
|
1218
|
+
.RS
|
1219
|
+
After deletion, the cursor is moved to the next record if possible.
|
1220
|
+
.RE
|
1221
|
+
.RE
|
1222
|
+
.PP
|
1223
|
+
The function `tcbdbcurkey' is used in order to get the key of the record where the cursor object is.
|
1224
|
+
.PP
|
1225
|
+
.RS
|
1226
|
+
.br
|
1227
|
+
\fBchar *tcbdbcurkey(BDBCUR *\fIcur\fB, int *\fIsp\fB);\fR
|
1228
|
+
.RS
|
1229
|
+
`\fIcur\fR' specifies the cursor object.
|
1230
|
+
.RE
|
1231
|
+
.RS
|
1232
|
+
`\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return value is assigned.
|
1233
|
+
.RE
|
1234
|
+
.RS
|
1235
|
+
If successful, the return value is the pointer to the region of the key, else, it is `NULL'. `NULL' is returned when the cursor is at invalid position.
|
1236
|
+
.RE
|
1237
|
+
.RS
|
1238
|
+
Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call when it is no longer in use.
|
1239
|
+
.RE
|
1240
|
+
.RE
|
1241
|
+
.PP
|
1242
|
+
The function `tcbdbcurkey2' is used in order to get the key string of the record where the cursor object is.
|
1243
|
+
.PP
|
1244
|
+
.RS
|
1245
|
+
.br
|
1246
|
+
\fBchar *tcbdbcurkey2(BDBCUR *\fIcur\fB);\fR
|
1247
|
+
.RS
|
1248
|
+
`\fIcur\fR' specifies the cursor object.
|
1249
|
+
.RE
|
1250
|
+
.RS
|
1251
|
+
If successful, the return value is the string of the key, else, it is `NULL'. `NULL' is returned when the cursor is at invalid position.
|
1252
|
+
.RE
|
1253
|
+
.RS
|
1254
|
+
Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call when it is no longer in use.
|
1255
|
+
.RE
|
1256
|
+
.RE
|
1257
|
+
.PP
|
1258
|
+
The function `tcbdbcurkey3' is used in order to get the key of the record where the cursor object is, as a volatile buffer.
|
1259
|
+
.PP
|
1260
|
+
.RS
|
1261
|
+
.br
|
1262
|
+
\fBconst char *tcbdbcurkey3(BDBCUR *\fIcur\fB, int *\fIsp\fB);\fR
|
1263
|
+
.RS
|
1264
|
+
`\fIcur\fR' specifies the cursor object.
|
1265
|
+
.RE
|
1266
|
+
.RS
|
1267
|
+
`\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return value is assigned.
|
1268
|
+
.RE
|
1269
|
+
.RS
|
1270
|
+
If successful, the return value is the pointer to the region of the key, else, it is `NULL'. `NULL' is returned when the cursor is at invalid position.
|
1271
|
+
.RE
|
1272
|
+
.RS
|
1273
|
+
Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is volatile and it may be spoiled by another operation of the database, the data should be copied into another involatile buffer immediately.
|
1274
|
+
.RE
|
1275
|
+
.RE
|
1276
|
+
.PP
|
1277
|
+
The function `tcbdbcurval' is used in order to get the value of the record where the cursor object is.
|
1278
|
+
.PP
|
1279
|
+
.RS
|
1280
|
+
.br
|
1281
|
+
\fBchar *tcbdbcurval(BDBCUR *\fIcur\fB, int *\fIsp\fB);\fR
|
1282
|
+
.RS
|
1283
|
+
`\fIcur\fR' specifies the cursor object.
|
1284
|
+
.RE
|
1285
|
+
.RS
|
1286
|
+
`\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return value is assigned.
|
1287
|
+
.RE
|
1288
|
+
.RS
|
1289
|
+
If successful, the return value is the pointer to the region of the value, else, it is `NULL'. `NULL' is returned when the cursor is at invalid position.
|
1290
|
+
.RE
|
1291
|
+
.RS
|
1292
|
+
Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call when it is no longer in use.
|
1293
|
+
.RE
|
1294
|
+
.RE
|
1295
|
+
.PP
|
1296
|
+
The function `tcbdbcurval2' is used in order to get the value string of the record where the cursor object is.
|
1297
|
+
.PP
|
1298
|
+
.RS
|
1299
|
+
.br
|
1300
|
+
\fBchar *tcbdbcurval2(BDBCUR *\fIcur\fB);\fR
|
1301
|
+
.RS
|
1302
|
+
`\fIcur\fR' specifies the cursor object.
|
1303
|
+
.RE
|
1304
|
+
.RS
|
1305
|
+
If successful, the return value is the string of the value, else, it is `NULL'. `NULL' is returned when the cursor is at invalid position.
|
1306
|
+
.RE
|
1307
|
+
.RS
|
1308
|
+
Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call when it is no longer in use.
|
1309
|
+
.RE
|
1310
|
+
.RE
|
1311
|
+
.PP
|
1312
|
+
The function `tcbdbcurval3' is used in order to get the value of the record where the cursor object is, as a volatile buffer.
|
1313
|
+
.PP
|
1314
|
+
.RS
|
1315
|
+
.br
|
1316
|
+
\fBconst char *tcbdbcurval3(BDBCUR *\fIcur\fB, int *\fIsp\fB);\fR
|
1317
|
+
.RS
|
1318
|
+
`\fIcur\fR' specifies the cursor object.
|
1319
|
+
.RE
|
1320
|
+
.RS
|
1321
|
+
`\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return value is assigned.
|
1322
|
+
.RE
|
1323
|
+
.RS
|
1324
|
+
If successful, the return value is the pointer to the region of the value, else, it is `NULL'. `NULL' is returned when the cursor is at invalid position.
|
1325
|
+
.RE
|
1326
|
+
.RS
|
1327
|
+
Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is volatile and it may be spoiled by another operation of the database, the data should be copied into another involatile buffer immediately.
|
1328
|
+
.RE
|
1329
|
+
.RE
|
1330
|
+
.PP
|
1331
|
+
The function `tcbdbcurrec' is used in order to get the key and the value of the record where the cursor object is.
|
1332
|
+
.PP
|
1333
|
+
.RS
|
1334
|
+
.br
|
1335
|
+
\fBbool tcbdbcurrec(BDBCUR *\fIcur\fB, TCXSTR *\fIkxstr\fB, TCXSTR *\fIvxstr\fB);\fR
|
1336
|
+
.RS
|
1337
|
+
`\fIcur\fR' specifies the cursor object.
|
1338
|
+
.RE
|
1339
|
+
.RS
|
1340
|
+
`\fIkxstr\fR' specifies the object into which the key is wrote down.
|
1341
|
+
.RE
|
1342
|
+
.RS
|
1343
|
+
`\fIvxstr\fR' specifies the object into which the value is wrote down.
|
1344
|
+
.RE
|
1345
|
+
.RS
|
1346
|
+
If successful, the return value is true, else, it is false. False is returned when the cursor is at invalid position.
|
1347
|
+
.RE
|
1348
|
+
.RE
|
1349
|
+
|
1350
|
+
.SH SEE ALSO
|
1351
|
+
.PP
|
1352
|
+
.BR tcbtest (1),
|
1353
|
+
.BR tcbmttest (1),
|
1354
|
+
.BR tcbmgr (1),
|
1355
|
+
.BR tokyocabinet (3)
|