heroku-tokyotyrant 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (340) hide show
  1. data/COPYING +504 -0
  2. data/README.rdoc +231 -0
  3. data/Rakefile +72 -0
  4. data/benchmarks/balancer.rb +101 -0
  5. data/benchmarks/bulk_db.rb +74 -0
  6. data/benchmarks/bulk_table.rb +87 -0
  7. data/benchmarks/db.rb +114 -0
  8. data/benchmarks/table.rb +161 -0
  9. data/ext/extconf.rb +43 -0
  10. data/ext/tokyo/bin/tcamgr +0 -0
  11. data/ext/tokyo/bin/tcamttest +0 -0
  12. data/ext/tokyo/bin/tcatest +0 -0
  13. data/ext/tokyo/bin/tcbmgr +0 -0
  14. data/ext/tokyo/bin/tcbmttest +0 -0
  15. data/ext/tokyo/bin/tcbtest +0 -0
  16. data/ext/tokyo/bin/tcfmgr +0 -0
  17. data/ext/tokyo/bin/tcfmttest +0 -0
  18. data/ext/tokyo/bin/tcftest +0 -0
  19. data/ext/tokyo/bin/tchmgr +0 -0
  20. data/ext/tokyo/bin/tchmttest +0 -0
  21. data/ext/tokyo/bin/tchtest +0 -0
  22. data/ext/tokyo/bin/tcrmgr +0 -0
  23. data/ext/tokyo/bin/tcrmttest +0 -0
  24. data/ext/tokyo/bin/tcrtest +0 -0
  25. data/ext/tokyo/bin/tctmgr +0 -0
  26. data/ext/tokyo/bin/tctmttest +0 -0
  27. data/ext/tokyo/bin/tcttest +0 -0
  28. data/ext/tokyo/bin/tcucodec +0 -0
  29. data/ext/tokyo/bin/tcumttest +0 -0
  30. data/ext/tokyo/bin/tcutest +0 -0
  31. data/ext/tokyo/bin/ttserver +0 -0
  32. data/ext/tokyo/bin/ttulmgr +0 -0
  33. data/ext/tokyo/bin/ttultest +0 -0
  34. data/ext/tokyo/include/tcadb.h +548 -0
  35. data/ext/tokyo/include/tcbdb.h +1101 -0
  36. data/ext/tokyo/include/tcfdb.h +858 -0
  37. data/ext/tokyo/include/tchdb.h +871 -0
  38. data/ext/tokyo/include/tcrdb.h +801 -0
  39. data/ext/tokyo/include/tctdb.h +1086 -0
  40. data/ext/tokyo/include/tculog.h +392 -0
  41. data/ext/tokyo/include/tcutil.h +4184 -0
  42. data/ext/tokyo/include/ttutil.h +494 -0
  43. data/ext/tokyo/lib/libtokyocabinet.9.4.0.dylib +0 -0
  44. data/ext/tokyo/lib/libtokyocabinet.9.dylib +0 -0
  45. data/ext/tokyo/lib/libtokyocabinet.a +0 -0
  46. data/ext/tokyo/lib/libtokyocabinet.dylib +0 -0
  47. data/ext/tokyo/lib/libtokyotyrant.3.22.0.dylib +0 -0
  48. data/ext/tokyo/lib/libtokyotyrant.3.dylib +0 -0
  49. data/ext/tokyo/lib/libtokyotyrant.a +0 -0
  50. data/ext/tokyo/lib/libtokyotyrant.dylib +0 -0
  51. data/ext/tokyo/lib/pkgconfig/tokyocabinet.pc +14 -0
  52. data/ext/tokyo/lib/pkgconfig/tokyotyrant.pc +14 -0
  53. data/ext/tokyo/lib/ttskeldir.bundle +0 -0
  54. data/ext/tokyo/lib/ttskelmock.bundle +0 -0
  55. data/ext/tokyo/lib/ttskelnull.bundle +0 -0
  56. data/ext/tokyo/lib/ttskelproxy.bundle +0 -0
  57. data/ext/tokyo/libexec/tcawmgr.cgi +0 -0
  58. data/ext/tokyo/sbin/ttservctl +163 -0
  59. data/ext/tokyo/share/man/man1/tcamgr.1 +97 -0
  60. data/ext/tokyo/share/man/man1/tcamttest.1 +35 -0
  61. data/ext/tokyo/share/man/man1/tcatest.1 +55 -0
  62. data/ext/tokyo/share/man/man1/tcbmgr.1 +125 -0
  63. data/ext/tokyo/share/man/man1/tcbmttest.1 +81 -0
  64. data/ext/tokyo/share/man/man1/tcbtest.1 +107 -0
  65. data/ext/tokyo/share/man/man1/tcfmgr.1 +98 -0
  66. data/ext/tokyo/share/man/man1/tcfmttest.1 +62 -0
  67. data/ext/tokyo/share/man/man1/tcftest.1 +73 -0
  68. data/ext/tokyo/share/man/man1/tchmgr.1 +110 -0
  69. data/ext/tokyo/share/man/man1/tchmttest.1 +85 -0
  70. data/ext/tokyo/share/man/man1/tchtest.1 +95 -0
  71. data/ext/tokyo/share/man/man1/tcrmgr.1 +164 -0
  72. data/ext/tokyo/share/man/man1/tcrmttest.1 +55 -0
  73. data/ext/tokyo/share/man/man1/tcrtest.1 +89 -0
  74. data/ext/tokyo/share/man/man1/tctmgr.1 +140 -0
  75. data/ext/tokyo/share/man/man1/tctmttest.1 +92 -0
  76. data/ext/tokyo/share/man/man1/tcttest.1 +105 -0
  77. data/ext/tokyo/share/man/man1/tcucodec.1 +162 -0
  78. data/ext/tokyo/share/man/man1/tcumttest.1 +41 -0
  79. data/ext/tokyo/share/man/man1/tcutest.1 +81 -0
  80. data/ext/tokyo/share/man/man1/ttserver.1 +84 -0
  81. data/ext/tokyo/share/man/man1/ttulmgr.1 +40 -0
  82. data/ext/tokyo/share/man/man1/ttultest.1 +16 -0
  83. data/ext/tokyo/share/man/man3/tcadb.3 +676 -0
  84. data/ext/tokyo/share/man/man3/tcbdb.3 +1355 -0
  85. data/ext/tokyo/share/man/man3/tcfdb.3 +975 -0
  86. data/ext/tokyo/share/man/man3/tchdb.3 +898 -0
  87. data/ext/tokyo/share/man/man3/tclist.3 +1 -0
  88. data/ext/tokyo/share/man/man3/tcmap.3 +1 -0
  89. data/ext/tokyo/share/man/man3/tcmdb.3 +1 -0
  90. data/ext/tokyo/share/man/man3/tcmpool.3 +1 -0
  91. data/ext/tokyo/share/man/man3/tcrdb.3 +1309 -0
  92. data/ext/tokyo/share/man/man3/tctdb.3 +1110 -0
  93. data/ext/tokyo/share/man/man3/tctree.3 +1 -0
  94. data/ext/tokyo/share/man/man3/tculog.3 +15 -0
  95. data/ext/tokyo/share/man/man3/tcutil.3 +4518 -0
  96. data/ext/tokyo/share/man/man3/tcxstr.3 +1 -0
  97. data/ext/tokyo/share/man/man3/tokyocabinet.3 +132 -0
  98. data/ext/tokyo/share/man/man3/ttutil.3 +14 -0
  99. data/ext/tokyo/share/man/man8/ttservctl.8 +37 -0
  100. data/ext/tokyo/share/tokyocabinet/COPYING +504 -0
  101. data/ext/tokyo/share/tokyocabinet/ChangeLog +1252 -0
  102. data/ext/tokyo/share/tokyocabinet/THANKS +12 -0
  103. data/ext/tokyo/share/tokyocabinet/doc/benchmark.pdf +0 -0
  104. data/ext/tokyo/share/tokyocabinet/doc/common.css +211 -0
  105. data/ext/tokyo/share/tokyocabinet/doc/icon16.png +0 -0
  106. data/ext/tokyo/share/tokyocabinet/doc/index.html +156 -0
  107. data/ext/tokyo/share/tokyocabinet/doc/index.ja.html +197 -0
  108. data/ext/tokyo/share/tokyocabinet/doc/logo-ja.png +0 -0
  109. data/ext/tokyo/share/tokyocabinet/doc/logo.png +0 -0
  110. data/ext/tokyo/share/tokyocabinet/doc/spex-en.html +7145 -0
  111. data/ext/tokyo/share/tokyocabinet/doc/spex-ja.html +7476 -0
  112. data/ext/tokyo/share/tokyocabinet/doc/tokyoproducts.pdf +0 -0
  113. data/ext/tokyo/share/tokyocabinet/doc/tokyoproducts.ppt +0 -0
  114. data/ext/tokyo/share/tokyotyrant/COPYING +504 -0
  115. data/ext/tokyo/share/tokyotyrant/ChangeLog +578 -0
  116. data/ext/tokyo/share/tokyotyrant/THANKS +15 -0
  117. data/ext/tokyo/share/tokyotyrant/doc/common.css +211 -0
  118. data/ext/tokyo/share/tokyotyrant/doc/index.html +79 -0
  119. data/ext/tokyo/share/tokyotyrant/doc/spex.html +2264 -0
  120. data/ext/tokyo/share/tokyotyrant/ext/mapreduce.lua +57 -0
  121. data/ext/tokyo/share/tokyotyrant/ext/queue.lua +55 -0
  122. data/ext/tokyo/share/tokyotyrant/ext/senatus.lua +532 -0
  123. data/ext/tokyo/share/tokyotyrant/ext/usherette.lua +438 -0
  124. data/ext/tokyo_tyrant.c +147 -0
  125. data/ext/tokyo_tyrant.h +48 -0
  126. data/ext/tokyo_tyrant_db.c +227 -0
  127. data/ext/tokyo_tyrant_db.h +8 -0
  128. data/ext/tokyo_tyrant_module.c +453 -0
  129. data/ext/tokyo_tyrant_module.h +10 -0
  130. data/ext/tokyo_tyrant_query.c +226 -0
  131. data/ext/tokyo_tyrant_query.h +9 -0
  132. data/ext/tokyo_tyrant_table.c +319 -0
  133. data/ext/tokyo_tyrant_table.h +8 -0
  134. data/ext/tokyocabinet-1.4.41/COPYING +504 -0
  135. data/ext/tokyocabinet-1.4.41/ChangeLog +1252 -0
  136. data/ext/tokyocabinet-1.4.41/Makefile.in +825 -0
  137. data/ext/tokyocabinet-1.4.41/README +38 -0
  138. data/ext/tokyocabinet-1.4.41/THANKS +12 -0
  139. data/ext/tokyocabinet-1.4.41/bros/Makefile +133 -0
  140. data/ext/tokyocabinet-1.4.41/bros/bdbtest.c +438 -0
  141. data/ext/tokyocabinet-1.4.41/bros/cdbtest.c +219 -0
  142. data/ext/tokyocabinet-1.4.41/bros/cmpsqltctest.c +186 -0
  143. data/ext/tokyocabinet-1.4.41/bros/gdbmtest.c +216 -0
  144. data/ext/tokyocabinet-1.4.41/bros/mapreporter +72 -0
  145. data/ext/tokyocabinet-1.4.41/bros/maptest.cc +677 -0
  146. data/ext/tokyocabinet-1.4.41/bros/ndbmtest.c +204 -0
  147. data/ext/tokyocabinet-1.4.41/bros/qdbmtest.c +375 -0
  148. data/ext/tokyocabinet-1.4.41/bros/reporter +141 -0
  149. data/ext/tokyocabinet-1.4.41/bros/result.xls +0 -0
  150. data/ext/tokyocabinet-1.4.41/bros/sdbmtest.c +204 -0
  151. data/ext/tokyocabinet-1.4.41/bros/sqltest.c +404 -0
  152. data/ext/tokyocabinet-1.4.41/bros/tctest.c +748 -0
  153. data/ext/tokyocabinet-1.4.41/bros/tdbtest.c +205 -0
  154. data/ext/tokyocabinet-1.4.41/configure +7402 -0
  155. data/ext/tokyocabinet-1.4.41/configure.in +362 -0
  156. data/ext/tokyocabinet-1.4.41/doc/benchmark.pdf +0 -0
  157. data/ext/tokyocabinet-1.4.41/doc/common.css +211 -0
  158. data/ext/tokyocabinet-1.4.41/doc/icon16.png +0 -0
  159. data/ext/tokyocabinet-1.4.41/doc/index.html +156 -0
  160. data/ext/tokyocabinet-1.4.41/doc/index.ja.html +197 -0
  161. data/ext/tokyocabinet-1.4.41/doc/logo-ja.png +0 -0
  162. data/ext/tokyocabinet-1.4.41/doc/logo.png +0 -0
  163. data/ext/tokyocabinet-1.4.41/doc/spex-en.html +7145 -0
  164. data/ext/tokyocabinet-1.4.41/doc/spex-ja.html +7476 -0
  165. data/ext/tokyocabinet-1.4.41/doc/tokyoproducts.pdf +0 -0
  166. data/ext/tokyocabinet-1.4.41/doc/tokyoproducts.ppt +0 -0
  167. data/ext/tokyocabinet-1.4.41/example/Makefile +113 -0
  168. data/ext/tokyocabinet-1.4.41/example/tcadbex.c +55 -0
  169. data/ext/tokyocabinet-1.4.41/example/tcbdbex.c +64 -0
  170. data/ext/tokyocabinet-1.4.41/example/tcfdbex.c +60 -0
  171. data/ext/tokyocabinet-1.4.41/example/tchdbex.c +60 -0
  172. data/ext/tokyocabinet-1.4.41/example/tctchat.c +97 -0
  173. data/ext/tokyocabinet-1.4.41/example/tctchat.tmpl +141 -0
  174. data/ext/tokyocabinet-1.4.41/example/tctdbex.c +85 -0
  175. data/ext/tokyocabinet-1.4.41/example/tctsearch.c +95 -0
  176. data/ext/tokyocabinet-1.4.41/example/tctsearch.tmpl +122 -0
  177. data/ext/tokyocabinet-1.4.41/example/tcutilex.c +77 -0
  178. data/ext/tokyocabinet-1.4.41/f.tsv +2 -0
  179. data/ext/tokyocabinet-1.4.41/lab/calccomp +118 -0
  180. data/ext/tokyocabinet-1.4.41/lab/datechange +56 -0
  181. data/ext/tokyocabinet-1.4.41/lab/diffcheck +45 -0
  182. data/ext/tokyocabinet-1.4.41/lab/htmltotsv +102 -0
  183. data/ext/tokyocabinet-1.4.41/lab/magic +19 -0
  184. data/ext/tokyocabinet-1.4.41/lab/printenv.cgi +27 -0
  185. data/ext/tokyocabinet-1.4.41/lab/stepcount +26 -0
  186. data/ext/tokyocabinet-1.4.41/lab/stopwatch +61 -0
  187. data/ext/tokyocabinet-1.4.41/lab/tabcheck +43 -0
  188. data/ext/tokyocabinet-1.4.41/lab/wgettsv +239 -0
  189. data/ext/tokyocabinet-1.4.41/lab/widthcheck +57 -0
  190. data/ext/tokyocabinet-1.4.41/man/htmltoman +104 -0
  191. data/ext/tokyocabinet-1.4.41/man/tcadb.3 +676 -0
  192. data/ext/tokyocabinet-1.4.41/man/tcamgr.1 +97 -0
  193. data/ext/tokyocabinet-1.4.41/man/tcamttest.1 +35 -0
  194. data/ext/tokyocabinet-1.4.41/man/tcatest.1 +55 -0
  195. data/ext/tokyocabinet-1.4.41/man/tcbdb.3 +1355 -0
  196. data/ext/tokyocabinet-1.4.41/man/tcbmgr.1 +125 -0
  197. data/ext/tokyocabinet-1.4.41/man/tcbmttest.1 +81 -0
  198. data/ext/tokyocabinet-1.4.41/man/tcbtest.1 +107 -0
  199. data/ext/tokyocabinet-1.4.41/man/tcfdb.3 +975 -0
  200. data/ext/tokyocabinet-1.4.41/man/tcfmgr.1 +98 -0
  201. data/ext/tokyocabinet-1.4.41/man/tcfmttest.1 +62 -0
  202. data/ext/tokyocabinet-1.4.41/man/tcftest.1 +73 -0
  203. data/ext/tokyocabinet-1.4.41/man/tchdb.3 +898 -0
  204. data/ext/tokyocabinet-1.4.41/man/tchmgr.1 +110 -0
  205. data/ext/tokyocabinet-1.4.41/man/tchmttest.1 +85 -0
  206. data/ext/tokyocabinet-1.4.41/man/tchtest.1 +95 -0
  207. data/ext/tokyocabinet-1.4.41/man/tclist.3 +1 -0
  208. data/ext/tokyocabinet-1.4.41/man/tcmap.3 +1 -0
  209. data/ext/tokyocabinet-1.4.41/man/tcmdb.3 +1 -0
  210. data/ext/tokyocabinet-1.4.41/man/tcmpool.3 +1 -0
  211. data/ext/tokyocabinet-1.4.41/man/tctdb.3 +1110 -0
  212. data/ext/tokyocabinet-1.4.41/man/tctmgr.1 +140 -0
  213. data/ext/tokyocabinet-1.4.41/man/tctmttest.1 +92 -0
  214. data/ext/tokyocabinet-1.4.41/man/tctree.3 +1 -0
  215. data/ext/tokyocabinet-1.4.41/man/tcttest.1 +105 -0
  216. data/ext/tokyocabinet-1.4.41/man/tcucodec.1 +162 -0
  217. data/ext/tokyocabinet-1.4.41/man/tcumttest.1 +41 -0
  218. data/ext/tokyocabinet-1.4.41/man/tcutest.1 +81 -0
  219. data/ext/tokyocabinet-1.4.41/man/tcutil.3 +4518 -0
  220. data/ext/tokyocabinet-1.4.41/man/tcxstr.3 +1 -0
  221. data/ext/tokyocabinet-1.4.41/man/tokyocabinet.3 +132 -0
  222. data/ext/tokyocabinet-1.4.41/md5.c +381 -0
  223. data/ext/tokyocabinet-1.4.41/md5.h +101 -0
  224. data/ext/tokyocabinet-1.4.41/myconf.c +493 -0
  225. data/ext/tokyocabinet-1.4.41/myconf.h +549 -0
  226. data/ext/tokyocabinet-1.4.41/tcadb.c +4339 -0
  227. data/ext/tokyocabinet-1.4.41/tcadb.h +548 -0
  228. data/ext/tokyocabinet-1.4.41/tcamgr.c +1019 -0
  229. data/ext/tokyocabinet-1.4.41/tcamttest.c +542 -0
  230. data/ext/tokyocabinet-1.4.41/tcatest.c +1845 -0
  231. data/ext/tokyocabinet-1.4.41/tcawmgr.c +482 -0
  232. data/ext/tokyocabinet-1.4.41/tcbdb.c +4180 -0
  233. data/ext/tokyocabinet-1.4.41/tcbdb.h +1101 -0
  234. data/ext/tokyocabinet-1.4.41/tcbmgr.c +1012 -0
  235. data/ext/tokyocabinet-1.4.41/tcbmttest.c +1810 -0
  236. data/ext/tokyocabinet-1.4.41/tcbtest.c +2586 -0
  237. data/ext/tokyocabinet-1.4.41/tcfdb.c +2746 -0
  238. data/ext/tokyocabinet-1.4.41/tcfdb.h +858 -0
  239. data/ext/tokyocabinet-1.4.41/tcfmgr.c +786 -0
  240. data/ext/tokyocabinet-1.4.41/tcfmttest.c +1220 -0
  241. data/ext/tokyocabinet-1.4.41/tcftest.c +1695 -0
  242. data/ext/tokyocabinet-1.4.41/tchdb.c +5153 -0
  243. data/ext/tokyocabinet-1.4.41/tchdb.h +871 -0
  244. data/ext/tokyocabinet-1.4.41/tchmgr.c +842 -0
  245. data/ext/tokyocabinet-1.4.41/tchmttest.c +1757 -0
  246. data/ext/tokyocabinet-1.4.41/tchtest.c +2129 -0
  247. data/ext/tokyocabinet-1.4.41/tctdb.c +6199 -0
  248. data/ext/tokyocabinet-1.4.41/tctdb.h +1086 -0
  249. data/ext/tokyocabinet-1.4.41/tctmgr.c +1241 -0
  250. data/ext/tokyocabinet-1.4.41/tctmttest.c +1563 -0
  251. data/ext/tokyocabinet-1.4.41/tcttest.c +2062 -0
  252. data/ext/tokyocabinet-1.4.41/tcucodec.c +1357 -0
  253. data/ext/tokyocabinet-1.4.41/tcumttest.c +578 -0
  254. data/ext/tokyocabinet-1.4.41/tcutest.c +1875 -0
  255. data/ext/tokyocabinet-1.4.41/tcutil.c +10528 -0
  256. data/ext/tokyocabinet-1.4.41/tcutil.h +4184 -0
  257. data/ext/tokyocabinet-1.4.41/tokyocabinet.idl +336 -0
  258. data/ext/tokyocabinet-1.4.41/tokyocabinet.pc.in +14 -0
  259. data/ext/tokyotyrant-1.1.39/COPYING +504 -0
  260. data/ext/tokyotyrant-1.1.39/ChangeLog +578 -0
  261. data/ext/tokyotyrant-1.1.39/Makefile.in +365 -0
  262. data/ext/tokyotyrant-1.1.39/README +38 -0
  263. data/ext/tokyotyrant-1.1.39/THANKS +15 -0
  264. data/ext/tokyotyrant-1.1.39/configure +6979 -0
  265. data/ext/tokyotyrant-1.1.39/configure.in +300 -0
  266. data/ext/tokyotyrant-1.1.39/doc/common.css +211 -0
  267. data/ext/tokyotyrant-1.1.39/doc/index.html +79 -0
  268. data/ext/tokyotyrant-1.1.39/doc/spex.html +2264 -0
  269. data/ext/tokyotyrant-1.1.39/example/Makefile +68 -0
  270. data/ext/tokyotyrant-1.1.39/example/httptest.pl +88 -0
  271. data/ext/tokyotyrant-1.1.39/example/mcftest.pl +39 -0
  272. data/ext/tokyotyrant-1.1.39/example/mctest.pl +43 -0
  273. data/ext/tokyotyrant-1.1.39/example/tcrdbex +0 -0
  274. data/ext/tokyotyrant-1.1.39/example/tcrdbex.c +49 -0
  275. data/ext/tokyotyrant-1.1.39/example/tcrdbex.o +0 -0
  276. data/ext/tokyotyrant-1.1.39/example/tcrdbtblex +0 -0
  277. data/ext/tokyotyrant-1.1.39/example/tcrdbtblex.c +79 -0
  278. data/ext/tokyotyrant-1.1.39/example/tcrdbtblex.o +0 -0
  279. data/ext/tokyotyrant-1.1.39/ext/mapreduce.lua +57 -0
  280. data/ext/tokyotyrant-1.1.39/ext/queue.lua +55 -0
  281. data/ext/tokyotyrant-1.1.39/ext/senatus.lua +532 -0
  282. data/ext/tokyotyrant-1.1.39/ext/usherette.lua +438 -0
  283. data/ext/tokyotyrant-1.1.39/lab/datechange +56 -0
  284. data/ext/tokyotyrant-1.1.39/lab/diffcheck +45 -0
  285. data/ext/tokyotyrant-1.1.39/lab/fibonacci.lua +20 -0
  286. data/ext/tokyotyrant-1.1.39/lab/footprint.lua +67 -0
  287. data/ext/tokyotyrant-1.1.39/lab/highlow.lua +88 -0
  288. data/ext/tokyotyrant-1.1.39/lab/killdualmaster +12 -0
  289. data/ext/tokyotyrant-1.1.39/lab/rundualmaster +38 -0
  290. data/ext/tokyotyrant-1.1.39/lab/stepcount +26 -0
  291. data/ext/tokyotyrant-1.1.39/lab/tabcheck +43 -0
  292. data/ext/tokyotyrant-1.1.39/lab/ushrtregister.pl +55 -0
  293. data/ext/tokyotyrant-1.1.39/lab/widthcheck +57 -0
  294. data/ext/tokyotyrant-1.1.39/man/htmltoman +100 -0
  295. data/ext/tokyotyrant-1.1.39/man/tcrdb.3 +1309 -0
  296. data/ext/tokyotyrant-1.1.39/man/tcrmgr.1 +164 -0
  297. data/ext/tokyotyrant-1.1.39/man/tcrmttest.1 +55 -0
  298. data/ext/tokyotyrant-1.1.39/man/tcrtest.1 +89 -0
  299. data/ext/tokyotyrant-1.1.39/man/tculog.3 +15 -0
  300. data/ext/tokyotyrant-1.1.39/man/ttservctl.8 +37 -0
  301. data/ext/tokyotyrant-1.1.39/man/ttserver.1 +84 -0
  302. data/ext/tokyotyrant-1.1.39/man/ttulmgr.1 +40 -0
  303. data/ext/tokyotyrant-1.1.39/man/ttultest.1 +16 -0
  304. data/ext/tokyotyrant-1.1.39/man/ttutil.3 +14 -0
  305. data/ext/tokyotyrant-1.1.39/myconf.c +169 -0
  306. data/ext/tokyotyrant-1.1.39/myconf.h +408 -0
  307. data/ext/tokyotyrant-1.1.39/scrext.c +2394 -0
  308. data/ext/tokyotyrant-1.1.39/scrext.h +96 -0
  309. data/ext/tokyotyrant-1.1.39/tcrdb.c +2637 -0
  310. data/ext/tokyotyrant-1.1.39/tcrdb.h +801 -0
  311. data/ext/tokyotyrant-1.1.39/tcrmgr.c +1559 -0
  312. data/ext/tokyotyrant-1.1.39/tcrmttest.c +915 -0
  313. data/ext/tokyotyrant-1.1.39/tcrtest.c +1542 -0
  314. data/ext/tokyotyrant-1.1.39/tculog.c +1211 -0
  315. data/ext/tokyotyrant-1.1.39/tculog.h +392 -0
  316. data/ext/tokyotyrant-1.1.39/tokyotyrant.idl +143 -0
  317. data/ext/tokyotyrant-1.1.39/tokyotyrant.pc.in +14 -0
  318. data/ext/tokyotyrant-1.1.39/ttservctl +163 -0
  319. data/ext/tokyotyrant-1.1.39/ttserver.c +3583 -0
  320. data/ext/tokyotyrant-1.1.39/ttskeldir.c +141 -0
  321. data/ext/tokyotyrant-1.1.39/ttskelmock.c +64 -0
  322. data/ext/tokyotyrant-1.1.39/ttskelnull.c +79 -0
  323. data/ext/tokyotyrant-1.1.39/ttskelproxy.c +74 -0
  324. data/ext/tokyotyrant-1.1.39/ttulmgr.c +266 -0
  325. data/ext/tokyotyrant-1.1.39/ttultest.c +371 -0
  326. data/ext/tokyotyrant-1.1.39/ttutil.c +1510 -0
  327. data/ext/tokyotyrant-1.1.39/ttutil.h +494 -0
  328. data/lib/tokyo_tyrant/balancer.rb +189 -0
  329. data/spec/ext.lua +4 -0
  330. data/spec/plu_db.rb +538 -0
  331. data/spec/spec.rb +1 -0
  332. data/spec/spec_base.rb +17 -0
  333. data/spec/start_tyrants.sh +36 -0
  334. data/spec/stop_tyrants.sh +9 -0
  335. data/spec/tokyo_tyrant_balancer_db_spec.rb +160 -0
  336. data/spec/tokyo_tyrant_balancer_table_spec.rb +177 -0
  337. data/spec/tokyo_tyrant_query_spec.rb +159 -0
  338. data/spec/tokyo_tyrant_spec.rb +254 -0
  339. data/spec/tokyo_tyrant_table_spec.rb +301 -0
  340. metadata +402 -0
@@ -0,0 +1,98 @@
1
+ .TH "TCFMGR" 1 "2009-10-13" "Man Page" "Tokyo Cabinet"
2
+
3
+ .SH NAME
4
+ tcfmgr \- the command line utility of the fixed-length database API
5
+
6
+ .SH DESCRIPTION
7
+ .PP
8
+ The command `\fBtcfmgr\fR' is a utility for test and debugging of the fixed\-length database API and its applications. `\fIpath\fR' specifies the path of a database file. `\fIwidth\fR' specifies the width of the value of each record. `\fIlimsiz\fR' specifies the limit size of the database file. `\fIkey\fR' specifies the key of a record. `\fIvalue\fR' specifies the value of a record. `\fIfile\fR' specifies the input file.
9
+ .PP
10
+ .RS
11
+ .br
12
+ \fBtcfmgr create \fIpath\fB \fR[\fB\fIwidth\fB \fR[\fB\fIlimsiz\fB\fR]\fB\fR]\fB\fR
13
+ .RS
14
+ Create a database file.
15
+ .RE
16
+ .br
17
+ \fBtcfmgr inform \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fIpath\fB\fR
18
+ .RS
19
+ Print miscellaneous information to the standard output.
20
+ .RE
21
+ .br
22
+ \fBtcfmgr put \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-sx\fR]\fB \fR[\fB\-dk\fR|\fB\-dc\fR|\fB\-dai\fR|\fB\-dad\fR]\fB \fIpath\fB \fIkey\fB \fIvalue\fB\fR
23
+ .RS
24
+ Store a record.
25
+ .RE
26
+ .br
27
+ \fBtcfmgr out \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-sx\fR]\fB \fIpath\fB \fIkey\fB\fR
28
+ .RS
29
+ Remove a record.
30
+ .RE
31
+ .br
32
+ \fBtcfmgr get \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-sx\fR]\fB \fR[\fB\-px\fR]\fB \fR[\fB\-pz\fR]\fB \fIpath\fB \fIkey\fB\fR
33
+ .RS
34
+ Print the value of a record.
35
+ .RE
36
+ .br
37
+ \fBtcfmgr list \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-m \fInum\fB\fR]\fB \fR[\fB\-pv\fR]\fB \fR[\fB\-px\fR]\fB \fR[\fB\-rb \fIlkey\fB \fIukey\fB\fR]\fB \fR[\fB\-ri \fIstr\fB\fR]\fB \fIpath\fB\fR
38
+ .RS
39
+ Print keys of all records, separated by line feeds.
40
+ .RE
41
+ .br
42
+ \fBtcfmgr optimize \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fIpath\fB \fR[\fB\fIwidth\fB \fR[\fB\fIlimsiz\fB\fR]\fB\fR]\fB\fR
43
+ .RS
44
+ Optimize a database file.
45
+ .RE
46
+ .br
47
+ \fBtcfmgr importtsv \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-sc\fR]\fB \fIpath\fB \fR[\fB\fIfile\fB\fR]\fB\fR
48
+ .RS
49
+ Store records of TSV in each line of a file.
50
+ .RE
51
+ .br
52
+ \fBtcfmgr version\fR
53
+ .RS
54
+ Print the version information of Tokyo Cabinet.
55
+ .RE
56
+ .RE
57
+ .PP
58
+ Options feature the following.
59
+ .PP
60
+ .RS
61
+ \fB\-nl\fR : enable the option `FDBNOLCK'.
62
+ .br
63
+ \fB\-nb\fR : enable the option `FDBLCKNB'.
64
+ .br
65
+ \fB\-sx\fR : the input data is evaluated as a hexadecimal data string.
66
+ .br
67
+ \fB\-dk\fR : use the function `tcfdbputkeep' instead of `tcfdbput'.
68
+ .br
69
+ \fB\-dc\fR : use the function `tcfdbputcat' instead of `tcfdbput'.
70
+ .br
71
+ \fB\-dai\fR : use the function `tcfdbaddint' instead of `tcfdbput'.
72
+ .br
73
+ \fB\-dad\fR : use the function `tcfdbadddouble' instead of `tcfdbput'.
74
+ .br
75
+ \fB\-px\fR : the output data is converted into a hexadecimal data string.
76
+ .br
77
+ \fB\-pz\fR : do not append line feed at the end of the output.
78
+ .br
79
+ \fB\-m \fInum\fR\fR : specify the maximum number of the output.
80
+ .br
81
+ \fB\-pv\fR : print values of records also.
82
+ .br
83
+ \fB\-rb \fIlkey\fR \fIukey\fR\fR : specify the range of keys.
84
+ .br
85
+ \fB\-ri \fIstr\fR\fR : specify the interval notation of keys.
86
+ .br
87
+ \fB\-sc\fR : normalize keys as lower cases.
88
+ .br
89
+ .RE
90
+ .PP
91
+ This command returns 0 on success, another on failure.
92
+
93
+ .SH SEE ALSO
94
+ .PP
95
+ .BR tcftest (1),
96
+ .BR tcfmttest (1),
97
+ .BR tcfdb (3),
98
+ .BR tokyocabinet (3)
@@ -0,0 +1,62 @@
1
+ .TH "TCFMTTEST" 1 "2009-10-13" "Man Page" "Tokyo Cabinet"
2
+
3
+ .SH NAME
4
+ tcfmttest \- test cases of the fixed-length database API
5
+
6
+ .SH DESCRIPTION
7
+ .PP
8
+ The command `\fBtcfmttest\fR' is a utility for facility test under multi\-thread situation. This command is used in the following format. `\fIpath\fR' specifies the path of a database file. `\fItnum\fR' specifies the number of running threads. `\fIrnum\fR' specifies the number of iterations. `\fIwidth\fR' specifies the width of the value of each record. `\fIlimsiz\fR' specifies the limit size of the database file.
9
+ .PP
10
+ .RS
11
+ .br
12
+ \fBtcfmttest write \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-rnd\fR]\fB \fIpath\fB \fItnum\fB \fIrnum\fB \fR[\fB\fIwidth\fB \fR[\fB\fIlimsiz\fB\fR]\fB\fR]\fB\fR
13
+ .RS
14
+ Store records with keys of 8 bytes. They change as `00000001', `00000002'...
15
+ .RE
16
+ .br
17
+ \fBtcfmttest read \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-wb\fR]\fB \fR[\fB\-rnd\fR]\fB \fIpath\fB \fItnum\fB\fR
18
+ .RS
19
+ Retrieve all records of the database above.
20
+ .RE
21
+ .br
22
+ \fBtcfmttest remove \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-rnd\fR]\fB \fIpath\fB \fItnum\fB\fR
23
+ .RS
24
+ Remove all records of the database above.
25
+ .RE
26
+ .br
27
+ \fBtcfmttest wicked \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-nc\fR]\fB \fIpath\fB \fItnum\fB \fIrnum\fB\fR
28
+ .RS
29
+ Perform updating operations selected at random.
30
+ .RE
31
+ .br
32
+ \fBtcfmttest typical \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-nc\fR]\fB \fR[\fB\-rr \fInum\fB\fR]\fB \fIpath\fB \fItnum\fB \fIrnum\fB \fR[\fB\fIwidth\fB \fR[\fB\fIlimsiz\fB\fR]\fB\fR]\fB\fR
33
+ .RS
34
+ Perform typical operations selected at random.
35
+ .RE
36
+ .RE
37
+ .PP
38
+ Options feature the following.
39
+ .PP
40
+ .RS
41
+ \fB\-nl\fR : enable the option `FDBNOLCK'.
42
+ .br
43
+ \fB\-nb\fR : enable the option `FDBLCKNB'.
44
+ .br
45
+ \fB\-rnd\fR : select keys at random.
46
+ .br
47
+ \fB\-wb\fR : use the function `tcfdbget4' instead of `tcfdbget2'.
48
+ .br
49
+ \fB\-nc\fR : omit the comparison test.
50
+ .br
51
+ \fB\-rr\fR \fInum\fR : specifiy the ratio of reading operation by percentage.
52
+ .br
53
+ .RE
54
+ .PP
55
+ This command returns 0 on success, another on failure.
56
+
57
+ .SH SEE ALSO
58
+ .PP
59
+ .BR tcftest (1),
60
+ .BR tcfmgr (1),
61
+ .BR tcfdb (3),
62
+ .BR tokyocabinet (3)
@@ -0,0 +1,73 @@
1
+ .TH "TCFTEST" 1 "2009-10-13" "Man Page" "Tokyo Cabinet"
2
+
3
+ .SH NAME
4
+ tcftest \- test cases of the fixed-length database API
5
+
6
+ .SH DESCRIPTION
7
+ .PP
8
+ The command `\fBtcftest\fR' is a utility for facility test and performance test. This command is used in the following format. `\fIpath\fR' specifies the path of a database file. `\fIrnum\fR' specifies the number of iterations. `\fIwidth\fR' specifies the width of the value of each record. `\fIlimsiz\fR' specifies the limit size of the database file.
9
+ .PP
10
+ .RS
11
+ .br
12
+ \fBtcftest write \fR[\fB\-mt\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-rnd\fR]\fB \fIpath\fB \fIrnum\fB \fR[\fB\fIwidth\fB \fR[\fB\fIlimsiz\fB\fR]\fB\fR]\fB\fR
13
+ .RS
14
+ Store records with keys of 8 bytes. They change as `00000001', `00000002'...
15
+ .RE
16
+ .br
17
+ \fBtcftest read \fR[\fB\-mt\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-wb\fR]\fB \fR[\fB\-rnd\fR]\fB \fIpath\fB\fR
18
+ .RS
19
+ Retrieve all records of the database above.
20
+ .RE
21
+ .br
22
+ \fBtcftest remove \fR[\fB\-mt\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-rnd\fR]\fB \fIpath\fB\fR
23
+ .RS
24
+ Remove all records of the database above.
25
+ .RE
26
+ .br
27
+ \fBtcftest rcat \fR[\fB\-mt\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-pn \fInum\fB\fR]\fB \fR[\fB\-dai\fR|\fB\-dad\fR|\fB\-rl\fR]\fB \fIpath\fB \fIrnum\fB \fR[\fB\fIlimsiz\fB\fR]\fB\fR]\fB\fR
28
+ .RS
29
+ Store records with partway duplicated keys using concatenate mode.
30
+ .RE
31
+ .br
32
+ \fBtcftest misc \fR[\fB\-mt\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fIpath\fB \fIrnum\fB\fR
33
+ .RS
34
+ Perform miscellaneous test of various operations.
35
+ .RE
36
+ .br
37
+ \fBtcftest wicked \fR[\fB\-mt\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fIpath\fB \fIrnum\fB\fR
38
+ .RS
39
+ Perform updating operations selected at random.
40
+ .RE
41
+ .RE
42
+ .PP
43
+ Options feature the following.
44
+ .PP
45
+ .RS
46
+ \fB\-mt\fR : call the function `tcfdbsetmutex'.
47
+ .br
48
+ \fB\-nl\fR : enable the option `FDBNOLCK'.
49
+ .br
50
+ \fB\-nb\fR : enable the option `FDBLCKNB'.
51
+ .br
52
+ \fB\-rnd\fR : select keys at random.
53
+ .br
54
+ \fB\-wb\fR : use the function `tcfdbget4' instead of `tcfdbget2'.
55
+ .br
56
+ \fB\-pn \fInum\fR\fR : specify the number of patterns.
57
+ .br
58
+ \fB\-dai\fR : use the function `tcfdbaddint' instead of `tcfdbputcat'.
59
+ .br
60
+ \fB\-dad\fR : use the function `tcfdbadddouble' instead of `tcfdbputcat'.
61
+ .br
62
+ \fB\-rl\fR : set the length of values at random.
63
+ .br
64
+ .RE
65
+ .PP
66
+ This command returns 0 on success, another on failure.
67
+
68
+ .SH SEE ALSO
69
+ .PP
70
+ .BR tcfmttest (1),
71
+ .BR tcfmgr (1),
72
+ .BR tcfdb (3),
73
+ .BR tokyocabinet (3)
@@ -0,0 +1,898 @@
1
+ .TH "TCHDB" 3 "2009-10-13" "Man Page" "Tokyo Cabinet"
2
+
3
+ .SH NAME
4
+ tchdb \- the hash database API
5
+
6
+ .SH DESCRIPTION
7
+ .PP
8
+ Hash database is a file containing a hash table and is handled with the hash database API.
9
+ .PP
10
+ To use the hash database API, include `\fBtcutil.h\fR', `\fBtchdb.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 <tchdb.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 `\fBTCHDB\fR' are used to handle hash databases. A hash database object is created with the function `\fBtchdbnew\fR' and is deleted with the function `\fBtchdbdel\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 hash database object to it. The function `\fBtchdbopen\fR' is used to open a database file and the function `\fBtchdbclose\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 `tchdberrmsg' is used in order to get the message string corresponding to an error code.
34
+ .PP
35
+ .RS
36
+ .br
37
+ \fBconst char *tchdberrmsg(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 `tchdbnew' is used in order to create a hash database object.
47
+ .PP
48
+ .RS
49
+ .br
50
+ \fBTCHDB *tchdbnew(void);\fR
51
+ .RS
52
+ The return value is the new hash database object.
53
+ .RE
54
+ .RE
55
+ .PP
56
+ The function `tchdbdel' is used in order to delete a hash database object.
57
+ .PP
58
+ .RS
59
+ .br
60
+ \fBvoid tchdbdel(TCHDB *\fIhdb\fB);\fR
61
+ .RS
62
+ `\fIhdb\fR' specifies the hash 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 `tchdbecode' is used in order to get the last happened error code of a hash database object.
70
+ .PP
71
+ .RS
72
+ .br
73
+ \fBint tchdbecode(TCHDB *\fIhdb\fB);\fR
74
+ .RS
75
+ `\fIhdb\fR' specifies the hash 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 `tchdbsetmutex' is used in order to set mutual exclusion control of a hash database object for threading.
86
+ .PP
87
+ .RS
88
+ .br
89
+ \fBbool tchdbsetmutex(TCHDB *\fIhdb\fB);\fR
90
+ .RS
91
+ `\fIhdb\fR' specifies the hash 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 `tchdbtune' is used in order to set the tuning parameters of a hash database object.
102
+ .PP
103
+ .RS
104
+ .br
105
+ \fBbool tchdbtune(TCHDB *\fIhdb\fB, int64_t \fIbnum\fB, int8_t \fIapow\fB, int8_t \fIfpow\fB, uint8_t \fIopts\fB);\fR
106
+ .RS
107
+ `\fIhdb\fR' specifies the hash database object which is not opened.
108
+ .RE
109
+ .RS
110
+ `\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 0.5 to 4 times of the number of all records to be stored.
111
+ .RE
112
+ .RS
113
+ `\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 4 standing for 2^4=16.
114
+ .RE
115
+ .RS
116
+ `\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.
117
+ .RE
118
+ .RS
119
+ `\fIopts\fR' specifies options by bitwise-or: `HDBTLARGE' specifies that the size of the database can be larger than 2GB by using 64\-bit bucket array, `HDBTDEFLATE' specifies that each record is compressed with Deflate encoding, `HDBTBZIP' specifies that each record is compressed with BZIP2 encoding, `HDBTTCBS' specifies that each record is compressed with TCBS encoding.
120
+ .RE
121
+ .RS
122
+ If successful, the return value is true, else, it is false.
123
+ .RE
124
+ .RS
125
+ Note that the tuning parameters should be set before the database is opened.
126
+ .RE
127
+ .RE
128
+ .PP
129
+ The function `tchdbsetcache' is used in order to set the caching parameters of a hash database object.
130
+ .PP
131
+ .RS
132
+ .br
133
+ \fBbool tchdbsetcache(TCHDB *\fIhdb\fB, int32_t \fIrcnum\fB);\fR
134
+ .RS
135
+ `\fIhdb\fR' specifies the hash database object which is not opened.
136
+ .RE
137
+ .RS
138
+ `\fIrcnum\fR' specifies the maximum number of records to be cached. If it is not more than 0, the record cache is disabled. It is disabled by default.
139
+ .RE
140
+ .RS
141
+ If successful, the return value is true, else, it is false.
142
+ .RE
143
+ .RS
144
+ Note that the caching parameters should be set before the database is opened.
145
+ .RE
146
+ .RE
147
+ .PP
148
+ The function `tchdbsetxmsiz' is used in order to set the size of the extra mapped memory of a hash database object.
149
+ .PP
150
+ .RS
151
+ .br
152
+ \fBbool tchdbsetxmsiz(TCHDB *\fIhdb\fB, int64_t \fIxmsiz\fB);\fR
153
+ .RS
154
+ `\fIhdb\fR' specifies the hash database object which is not opened.
155
+ .RE
156
+ .RS
157
+ `\fIxmsiz\fR' specifies the size of the extra mapped memory. If it is not more than 0, the extra mapped memory is disabled. The default size is 67108864.
158
+ .RE
159
+ .RS
160
+ If successful, the return value is true, else, it is false.
161
+ .RE
162
+ .RS
163
+ Note that the mapping parameters should be set before the database is opened.
164
+ .RE
165
+ .RE
166
+ .PP
167
+ The function `tchdbsetdfunit' is used in order to set the unit step number of auto defragmentation of a hash database object.
168
+ .PP
169
+ .RS
170
+ .br
171
+ \fBbool tchdbsetdfunit(TCHDB *\fIhdb\fB, int32_t \fIdfunit\fB);\fR
172
+ .RS
173
+ `\fIhdb\fR' specifies the hash database object which is not opened.
174
+ .RE
175
+ .RS
176
+ `\fIdfunit\fR' specifie the unit step number. If it is not more than 0, the auto defragmentation is disabled. It is disabled by default.
177
+ .RE
178
+ .RS
179
+ If successful, the return value is true, else, it is false.
180
+ .RE
181
+ .RS
182
+ Note that the defragmentation parameters should be set before the database is opened.
183
+ .RE
184
+ .RE
185
+ .PP
186
+ The function `tchdbopen' is used in order to open a database file and connect a hash database object.
187
+ .PP
188
+ .RS
189
+ .br
190
+ \fBbool tchdbopen(TCHDB *\fIhdb\fB, const char *\fIpath\fB, int \fIomode\fB);\fR
191
+ .RS
192
+ `\fIhdb\fR' specifies the hash database object which is not opened.
193
+ .RE
194
+ .RS
195
+ `\fIpath\fR' specifies the path of the database file.
196
+ .RE
197
+ .RS
198
+ `\fIomode\fR' specifies the connection mode: `HDBOWRITER' as a writer, `HDBOREADER' as a reader. If the mode is `HDBOWRITER', the following may be added by bitwise-or: `HDBOCREAT', which means it creates a new database if not exist, `HDBOTRUNC', which means it creates a new database regardless if one exists, `HDBOTSYNC', which means every transaction synchronizes updated contents with the device. Both of `HDBOREADER' and `HDBOWRITER' can be added to by bitwise-or: `HDBONOLCK', which means it opens the database file without file locking, or `HDBOLCKNB', which means locking is performed without blocking.
199
+ .RE
200
+ .RS
201
+ If successful, the return value is true, else, it is false.
202
+ .RE
203
+ .RE
204
+ .PP
205
+ The function `tchdbclose' is used in order to close a hash database object.
206
+ .PP
207
+ .RS
208
+ .br
209
+ \fBbool tchdbclose(TCHDB *\fIhdb\fB);\fR
210
+ .RS
211
+ `\fIhdb\fR' specifies the hash database object.
212
+ .RE
213
+ .RS
214
+ If successful, the return value is true, else, it is false.
215
+ .RE
216
+ .RS
217
+ 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.
218
+ .RE
219
+ .RE
220
+ .PP
221
+ The function `tchdbput' is used in order to store a record into a hash database object.
222
+ .PP
223
+ .RS
224
+ .br
225
+ \fBbool tchdbput(TCHDB *\fIhdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, const void *\fIvbuf\fB, int \fIvsiz\fB);\fR
226
+ .RS
227
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
228
+ .RE
229
+ .RS
230
+ `\fIkbuf\fR' specifies the pointer to the region of the key.
231
+ .RE
232
+ .RS
233
+ `\fIksiz\fR' specifies the size of the region of the key.
234
+ .RE
235
+ .RS
236
+ `\fIvbuf\fR' specifies the pointer to the region of the value.
237
+ .RE
238
+ .RS
239
+ `\fIvsiz\fR' specifies the size of the region of the value.
240
+ .RE
241
+ .RS
242
+ If successful, the return value is true, else, it is false.
243
+ .RE
244
+ .RS
245
+ If a record with the same key exists in the database, it is overwritten.
246
+ .RE
247
+ .RE
248
+ .PP
249
+ The function `tchdbput2' is used in order to store a string record into a hash database object.
250
+ .PP
251
+ .RS
252
+ .br
253
+ \fBbool tchdbput2(TCHDB *\fIhdb\fB, const char *\fIkstr\fB, const char *\fIvstr\fB);\fR
254
+ .RS
255
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
256
+ .RE
257
+ .RS
258
+ `\fIkstr\fR' specifies the string of the key.
259
+ .RE
260
+ .RS
261
+ `\fIvstr\fR' specifies the string of the value.
262
+ .RE
263
+ .RS
264
+ If successful, the return value is true, else, it is false.
265
+ .RE
266
+ .RS
267
+ If a record with the same key exists in the database, it is overwritten.
268
+ .RE
269
+ .RE
270
+ .PP
271
+ The function `tchdbputkeep' is used in order to store a new record into a hash database object.
272
+ .PP
273
+ .RS
274
+ .br
275
+ \fBbool tchdbputkeep(TCHDB *\fIhdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, const void *\fIvbuf\fB, int \fIvsiz\fB);\fR
276
+ .RS
277
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
278
+ .RE
279
+ .RS
280
+ `\fIkbuf\fR' specifies the pointer to the region of the key.
281
+ .RE
282
+ .RS
283
+ `\fIksiz\fR' specifies the size of the region of the key.
284
+ .RE
285
+ .RS
286
+ `\fIvbuf\fR' specifies the pointer to the region of the value.
287
+ .RE
288
+ .RS
289
+ `\fIvsiz\fR' specifies the size of the region of the value.
290
+ .RE
291
+ .RS
292
+ If successful, the return value is true, else, it is false.
293
+ .RE
294
+ .RS
295
+ If a record with the same key exists in the database, this function has no effect.
296
+ .RE
297
+ .RE
298
+ .PP
299
+ The function `tchdbputkeep2' is used in order to store a new string record into a hash database object.
300
+ .PP
301
+ .RS
302
+ .br
303
+ \fBbool tchdbputkeep2(TCHDB *\fIhdb\fB, const char *\fIkstr\fB, const char *\fIvstr\fB);\fR
304
+ .RS
305
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
306
+ .RE
307
+ .RS
308
+ `\fIkstr\fR' specifies the string of the key.
309
+ .RE
310
+ .RS
311
+ `\fIvstr\fR' specifies the string of the value.
312
+ .RE
313
+ .RS
314
+ If successful, the return value is true, else, it is false.
315
+ .RE
316
+ .RS
317
+ If a record with the same key exists in the database, this function has no effect.
318
+ .RE
319
+ .RE
320
+ .PP
321
+ The function `tchdbputcat' is used in order to concatenate a value at the end of the existing record in a hash database object.
322
+ .PP
323
+ .RS
324
+ .br
325
+ \fBbool tchdbputcat(TCHDB *\fIhdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, const void *\fIvbuf\fB, int \fIvsiz\fB);\fR
326
+ .RS
327
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
328
+ .RE
329
+ .RS
330
+ `\fIkbuf\fR' specifies the pointer to the region of the key.
331
+ .RE
332
+ .RS
333
+ `\fIksiz\fR' specifies the size of the region of the key.
334
+ .RE
335
+ .RS
336
+ `\fIvbuf\fR' specifies the pointer to the region of the value.
337
+ .RE
338
+ .RS
339
+ `\fIvsiz\fR' specifies the size of the region of the value.
340
+ .RE
341
+ .RS
342
+ If successful, the return value is true, else, it is false.
343
+ .RE
344
+ .RS
345
+ If there is no corresponding record, a new record is created.
346
+ .RE
347
+ .RE
348
+ .PP
349
+ The function `tchdbputcat2' is used in order to concatenate a string value at the end of the existing record in a hash database object.
350
+ .PP
351
+ .RS
352
+ .br
353
+ \fBbool tchdbputcat2(TCHDB *\fIhdb\fB, const char *\fIkstr\fB, const char *\fIvstr\fB);\fR
354
+ .RS
355
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
356
+ .RE
357
+ .RS
358
+ `\fIkstr\fR' specifies the string of the key.
359
+ .RE
360
+ .RS
361
+ `\fIvstr\fR' specifies the string of the value.
362
+ .RE
363
+ .RS
364
+ If successful, the return value is true, else, it is false.
365
+ .RE
366
+ .RS
367
+ If there is no corresponding record, a new record is created.
368
+ .RE
369
+ .RE
370
+ .PP
371
+ The function `tchdbputasync' is used in order to store a record into a hash database object in asynchronous fashion.
372
+ .PP
373
+ .RS
374
+ .br
375
+ \fBbool tchdbputasync(TCHDB *\fIhdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, const void *\fIvbuf\fB, int \fIvsiz\fB);\fR
376
+ .RS
377
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
378
+ .RE
379
+ .RS
380
+ `\fIkbuf\fR' specifies the pointer to the region of the key.
381
+ .RE
382
+ .RS
383
+ `\fIksiz\fR' specifies the size of the region of the key.
384
+ .RE
385
+ .RS
386
+ `\fIvbuf\fR' specifies the pointer to the region of the value.
387
+ .RE
388
+ .RS
389
+ `\fIvsiz\fR' specifies the size of the region of the value.
390
+ .RE
391
+ .RS
392
+ If successful, the return value is true, else, it is false.
393
+ .RE
394
+ .RS
395
+ If a record with the same key exists in the database, it is overwritten. Records passed to this function are accumulated into the inner buffer and wrote into the file at a blast.
396
+ .RE
397
+ .RE
398
+ .PP
399
+ The function `tchdbputasync2' is used in order to store a string record into a hash database object in asynchronous fashion.
400
+ .PP
401
+ .RS
402
+ .br
403
+ \fBbool tchdbputasync2(TCHDB *\fIhdb\fB, const char *\fIkstr\fB, const char *\fIvstr\fB);\fR
404
+ .RS
405
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
406
+ .RE
407
+ .RS
408
+ `\fIkstr\fR' specifies the string of the key.
409
+ .RE
410
+ .RS
411
+ `\fIvstr\fR' specifies the string of the value.
412
+ .RE
413
+ .RS
414
+ If successful, the return value is true, else, it is false.
415
+ .RE
416
+ .RS
417
+ If a record with the same key exists in the database, it is overwritten. Records passed to this function are accumulated into the inner buffer and wrote into the file at a blast.
418
+ .RE
419
+ .RE
420
+ .PP
421
+ The function `tchdbout' is used in order to remove a record of a hash database object.
422
+ .PP
423
+ .RS
424
+ .br
425
+ \fBbool tchdbout(TCHDB *\fIhdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR
426
+ .RS
427
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
428
+ .RE
429
+ .RS
430
+ `\fIkbuf\fR' specifies the pointer to the region of the key.
431
+ .RE
432
+ .RS
433
+ `\fIksiz\fR' specifies the size of the region of the key.
434
+ .RE
435
+ .RS
436
+ If successful, the return value is true, else, it is false.
437
+ .RE
438
+ .RE
439
+ .PP
440
+ The function `tchdbout2' is used in order to remove a string record of a hash database object.
441
+ .PP
442
+ .RS
443
+ .br
444
+ \fBbool tchdbout2(TCHDB *\fIhdb\fB, const char *\fIkstr\fB);\fR
445
+ .RS
446
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
447
+ .RE
448
+ .RS
449
+ `\fIkstr\fR' specifies the string of the key.
450
+ .RE
451
+ .RS
452
+ If successful, the return value is true, else, it is false.
453
+ .RE
454
+ .RE
455
+ .PP
456
+ The function `tchdbget' is used in order to retrieve a record in a hash database object.
457
+ .PP
458
+ .RS
459
+ .br
460
+ \fBvoid *tchdbget(TCHDB *\fIhdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, int *\fIsp\fB);\fR
461
+ .RS
462
+ `\fIhdb\fR' specifies the hash database object.
463
+ .RE
464
+ .RS
465
+ `\fIkbuf\fR' specifies the pointer to the region of the key.
466
+ .RE
467
+ .RS
468
+ `\fIksiz\fR' specifies the size of the region of the key.
469
+ .RE
470
+ .RS
471
+ `\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return value is assigned.
472
+ .RE
473
+ .RS
474
+ 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.
475
+ .RE
476
+ .RS
477
+ 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.
478
+ .RE
479
+ .RE
480
+ .PP
481
+ The function `tchdbget2' is used in order to retrieve a string record in a hash database object.
482
+ .PP
483
+ .RS
484
+ .br
485
+ \fBchar *tchdbget2(TCHDB *\fIhdb\fB, const char *\fIkstr\fB);\fR
486
+ .RS
487
+ `\fIhdb\fR' specifies the hash database object.
488
+ .RE
489
+ .RS
490
+ `\fIkstr\fR' specifies the string of the key.
491
+ .RE
492
+ .RS
493
+ If successful, the return value is the string of the value of the corresponding record. `NULL' is returned if no record corresponds.
494
+ .RE
495
+ .RS
496
+ 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.
497
+ .RE
498
+ .RE
499
+ .PP
500
+ The function `tchdbget3' is used in order to retrieve a record in a hash database object and write the value into a buffer.
501
+ .PP
502
+ .RS
503
+ .br
504
+ \fBint tchdbget3(TCHDB *\fIhdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, void *\fIvbuf\fB, int \fImax\fB);\fR
505
+ .RS
506
+ `\fIhdb\fR' specifies the hash database object.
507
+ .RE
508
+ .RS
509
+ `\fIkbuf\fR' specifies the pointer to the region of the key.
510
+ .RE
511
+ .RS
512
+ `\fIksiz\fR' specifies the size of the region of the key.
513
+ .RE
514
+ .RS
515
+ `\fIvbuf\fR' specifies the pointer to the buffer into which the value of the corresponding record is written.
516
+ .RE
517
+ .RS
518
+ `\fImax\fR' specifies the size of the buffer.
519
+ .RE
520
+ .RS
521
+ If successful, the return value is the size of the written data, else, it is \-1. \-1 is returned if no record corresponds to the specified key.
522
+ .RE
523
+ .RS
524
+ Note that an additional zero code is not appended at the end of the region of the writing buffer.
525
+ .RE
526
+ .RE
527
+ .PP
528
+ The function `tchdbvsiz' is used in order to get the size of the value of a record in a hash database object.
529
+ .PP
530
+ .RS
531
+ .br
532
+ \fBint tchdbvsiz(TCHDB *\fIhdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR
533
+ .RS
534
+ `\fIhdb\fR' specifies the hash database object.
535
+ .RE
536
+ .RS
537
+ `\fIkbuf\fR' specifies the pointer to the region of the key.
538
+ .RE
539
+ .RS
540
+ `\fIksiz\fR' specifies the size of the region of the key.
541
+ .RE
542
+ .RS
543
+ If successful, the return value is the size of the value of the corresponding record, else, it is \-1.
544
+ .RE
545
+ .RE
546
+ .PP
547
+ The function `tchdbvsiz2' is used in order to get the size of the value of a string record in a hash database object.
548
+ .PP
549
+ .RS
550
+ .br
551
+ \fBint tchdbvsiz2(TCHDB *\fIhdb\fB, const char *\fIkstr\fB);\fR
552
+ .RS
553
+ `\fIhdb\fR' specifies the hash database object.
554
+ .RE
555
+ .RS
556
+ `\fIkstr\fR' specifies the string of the key.
557
+ .RE
558
+ .RS
559
+ If successful, the return value is the size of the value of the corresponding record, else, it is \-1.
560
+ .RE
561
+ .RE
562
+ .PP
563
+ The function `tchdbiterinit' is used in order to initialize the iterator of a hash database object.
564
+ .PP
565
+ .RS
566
+ .br
567
+ \fBbool tchdbiterinit(TCHDB *\fIhdb\fB);\fR
568
+ .RS
569
+ `\fIhdb\fR' specifies the hash database object.
570
+ .RE
571
+ .RS
572
+ If successful, the return value is true, else, it is false.
573
+ .RE
574
+ .RS
575
+ The iterator is used in order to access the key of every record stored in a database.
576
+ .RE
577
+ .RE
578
+ .PP
579
+ The function `tchdbiternext' is used in order to get the next key of the iterator of a hash database object.
580
+ .PP
581
+ .RS
582
+ .br
583
+ \fBvoid *tchdbiternext(TCHDB *\fIhdb\fB, int *\fIsp\fB);\fR
584
+ .RS
585
+ `\fIhdb\fR' specifies the hash database object.
586
+ .RE
587
+ .RS
588
+ `\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return value is assigned.
589
+ .RE
590
+ .RS
591
+ If successful, the return value is the pointer to the region of the next key, else, it is `NULL'. `NULL' is returned when no record is to be get out of the iterator.
592
+ .RE
593
+ .RS
594
+ 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. It is possible to access every record by iteration of calling this function. It is allowed to update or remove records whose keys are fetched while the iteration. However, it is not assured if updating the database is occurred while the iteration. Besides, the order of this traversal access method is arbitrary, so it is not assured that the order of storing matches the one of the traversal access.
595
+ .RE
596
+ .RE
597
+ .PP
598
+ The function `tchdbiternext2' is used in order to get the next key string of the iterator of a hash database object.
599
+ .PP
600
+ .RS
601
+ .br
602
+ \fBchar *tchdbiternext2(TCHDB *\fIhdb\fB);\fR
603
+ .RS
604
+ `\fIhdb\fR' specifies the hash database object.
605
+ .RE
606
+ .RS
607
+ If successful, the return value is the string of the next key, else, it is `NULL'. `NULL' is returned when no record is to be get out of the iterator.
608
+ .RE
609
+ .RS
610
+ 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. It is possible to access every record by iteration of calling this function. However, it is not assured if updating the database is occurred while the iteration. Besides, the order of this traversal access method is arbitrary, so it is not assured that the order of storing matches the one of the traversal access.
611
+ .RE
612
+ .RE
613
+ .PP
614
+ The function `tchdbiternext3' is used in order to get the next extensible objects of the iterator of a hash database object.
615
+ .PP
616
+ .RS
617
+ .br
618
+ \fBbool tchdbiternext3(TCHDB *\fIhdb\fB, TCXSTR *\fIkxstr\fB, TCXSTR *\fIvxstr\fB);\fR
619
+ .RS
620
+ `\fIhdb\fR' specifies the hash database object.
621
+ .RE
622
+ .RS
623
+ `\fIkxstr\fR' specifies the object into which the next key is wrote down.
624
+ .RE
625
+ .RS
626
+ `\fIvxstr\fR' specifies the object into which the next value is wrote down.
627
+ .RE
628
+ .RS
629
+ If successful, the return value is true, else, it is false. False is returned when no record is to be get out of the iterator.
630
+ .RE
631
+ .RE
632
+ .PP
633
+ The function `tchdbfwmkeys' is used in order to get forward matching keys in a hash database object.
634
+ .PP
635
+ .RS
636
+ .br
637
+ \fBTCLIST *tchdbfwmkeys(TCHDB *\fIhdb\fB, const void *\fIpbuf\fB, int \fIpsiz\fB, int \fImax\fB);\fR
638
+ .RS
639
+ `\fIhdb\fR' specifies the hash database object.
640
+ .RE
641
+ .RS
642
+ `\fIpbuf\fR' specifies the pointer to the region of the prefix.
643
+ .RE
644
+ .RS
645
+ `\fIpsiz\fR' specifies the size of the region of the prefix.
646
+ .RE
647
+ .RS
648
+ `\fImax\fR' specifies the maximum number of keys to be fetched. If it is negative, no limit is specified.
649
+ .RE
650
+ .RS
651
+ 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.
652
+ .RE
653
+ .RS
654
+ 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. Note that this function may be very slow because every key in the database is scanned.
655
+ .RE
656
+ .RE
657
+ .PP
658
+ The function `tchdbfwmkeys2' is used in order to get forward matching string keys in a hash database object.
659
+ .PP
660
+ .RS
661
+ .br
662
+ \fBTCLIST *tchdbfwmkeys2(TCHDB *\fIhdb\fB, const char *\fIpstr\fB, int \fImax\fB);\fR
663
+ .RS
664
+ `\fIhdb\fR' specifies the hash database object.
665
+ .RE
666
+ .RS
667
+ `\fIpstr\fR' specifies the string of the prefix.
668
+ .RE
669
+ .RS
670
+ `\fImax\fR' specifies the maximum number of keys to be fetched. If it is negative, no limit is specified.
671
+ .RE
672
+ .RS
673
+ 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.
674
+ .RE
675
+ .RS
676
+ 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. Note that this function may be very slow because every key in the database is scanned.
677
+ .RE
678
+ .RE
679
+ .PP
680
+ The function `tchdbaddint' is used in order to add an integer to a record in a hash database object.
681
+ .PP
682
+ .RS
683
+ .br
684
+ \fBint tchdbaddint(TCHDB *\fIhdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, int \fInum\fB);\fR
685
+ .RS
686
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
687
+ .RE
688
+ .RS
689
+ `\fIkbuf\fR' specifies the pointer to the region of the key.
690
+ .RE
691
+ .RS
692
+ `\fIksiz\fR' specifies the size of the region of the key.
693
+ .RE
694
+ .RS
695
+ `\fInum\fR' specifies the additional value.
696
+ .RE
697
+ .RS
698
+ If successful, the return value is the summation value, else, it is `INT_MIN'.
699
+ .RE
700
+ .RS
701
+ 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.
702
+ .RE
703
+ .RE
704
+ .PP
705
+ The function `tchdbdbadddouble' is used in order to add a real number to a record in a hash database object.
706
+ .PP
707
+ .RS
708
+ .br
709
+ \fBdouble tchdbadddouble(TCHDB *\fIhdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, double \fInum\fB);\fR
710
+ .RS
711
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
712
+ .RE
713
+ .RS
714
+ `\fIkbuf\fR' specifies the pointer to the region of the key.
715
+ .RE
716
+ .RS
717
+ `\fIksiz\fR' specifies the size of the region of the key.
718
+ .RE
719
+ .RS
720
+ `\fInum\fR' specifies the additional value.
721
+ .RE
722
+ .RS
723
+ If successful, the return value is the summation value, else, it is Not-a-Number.
724
+ .RE
725
+ .RS
726
+ 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.
727
+ .RE
728
+ .RE
729
+ .PP
730
+ The function `tchdbsync' is used in order to synchronize updated contents of a hash database object with the file and the device.
731
+ .PP
732
+ .RS
733
+ .br
734
+ \fBbool tchdbsync(TCHDB *\fIhdb\fB);\fR
735
+ .RS
736
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
737
+ .RE
738
+ .RS
739
+ If successful, the return value is true, else, it is false.
740
+ .RE
741
+ .RS
742
+ This function is useful when another process connects to the same database file.
743
+ .RE
744
+ .RE
745
+ .PP
746
+ The function `tchdboptimize' is used in order to optimize the file of a hash database object.
747
+ .PP
748
+ .RS
749
+ .br
750
+ \fBbool tchdboptimize(TCHDB *\fIhdb\fB, int64_t \fIbnum\fB, int8_t \fIapow\fB, int8_t \fIfpow\fB, uint8_t \fIopts\fB);\fR
751
+ .RS
752
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
753
+ .RE
754
+ .RS
755
+ `\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 records.
756
+ .RE
757
+ .RS
758
+ `\fIapow\fR' specifies the size of record alignment by power of 2. If it is negative, the current setting is not changed.
759
+ .RE
760
+ .RS
761
+ `\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.
762
+ .RE
763
+ .RS
764
+ `\fIopts\fR' specifies options by bitwise-or: `HDBTLARGE' specifies that the size of the database can be larger than 2GB by using 64\-bit bucket array, `HDBTDEFLATE' specifies that each record is compressed with Deflate encoding, `HDBTBZIP' specifies that each record is compressed with BZIP2 encoding, `HDBTTCBS' specifies that each record is compressed with TCBS encoding. If it is `UINT8_MAX', the current setting is not changed.
765
+ .RE
766
+ .RS
767
+ If successful, the return value is true, else, it is false.
768
+ .RE
769
+ .RS
770
+ This function is useful to reduce the size of the database file with data fragmentation by successive updating.
771
+ .RE
772
+ .RE
773
+ .PP
774
+ The function `tchdbvanish' is used in order to remove all records of a hash database object.
775
+ .PP
776
+ .RS
777
+ .br
778
+ \fBbool tchdbvanish(TCHDB *\fIhdb\fB);\fR
779
+ .RS
780
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
781
+ .RE
782
+ .RS
783
+ If successful, the return value is true, else, it is false.
784
+ .RE
785
+ .RE
786
+ .PP
787
+ The function `tchdbcopy' is used in order to copy the database file of a hash database object.
788
+ .PP
789
+ .RS
790
+ .br
791
+ \fBbool tchdbcopy(TCHDB *\fIhdb\fB, const char *\fIpath\fB);\fR
792
+ .RS
793
+ `\fIhdb\fR' specifies the hash database object.
794
+ .RE
795
+ .RS
796
+ `\fIpath\fR' specifies the path of the destination file. If it begins with `@', the trailing substring is executed as a command line.
797
+ .RE
798
+ .RS
799
+ If successful, the return value is true, else, it is false. False is returned if the executed command returns non\-zero code.
800
+ .RE
801
+ .RS
802
+ 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.
803
+ .RE
804
+ .RE
805
+ .PP
806
+ The function `tchdbtranbegin' is used in order to begin the transaction of a hash database object.
807
+ .PP
808
+ .RS
809
+ .br
810
+ \fBbool tchdbtranbegin(TCHDB *\fIhdb\fB);\fR
811
+ .RS
812
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
813
+ .RE
814
+ .RS
815
+ If successful, the return value is true, else, it is false.
816
+ .RE
817
+ .RS
818
+ 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. All updated regions are kept track of by write ahead logging while the transaction. If the database is closed during transaction, the transaction is aborted implicitly.
819
+ .RE
820
+ .RE
821
+ .PP
822
+ The function `tchdbtrancommit' is used in order to commit the transaction of a hash database object.
823
+ .PP
824
+ .RS
825
+ .br
826
+ \fBbool tchdbtrancommit(TCHDB *\fIhdb\fB);\fR
827
+ .RS
828
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
829
+ .RE
830
+ .RS
831
+ If successful, the return value is true, else, it is false.
832
+ .RE
833
+ .RS
834
+ Update in the transaction is fixed when it is committed successfully.
835
+ .RE
836
+ .RE
837
+ .PP
838
+ The function `tchdbtranabort' is used in order to abort the transaction of a hash database object.
839
+ .PP
840
+ .RS
841
+ .br
842
+ \fBbool tchdbtranabort(TCHDB *\fIhdb\fB);\fR
843
+ .RS
844
+ `\fIhdb\fR' specifies the hash database object connected as a writer.
845
+ .RE
846
+ .RS
847
+ If successful, the return value is true, else, it is false.
848
+ .RE
849
+ .RS
850
+ Update in the transaction is discarded when it is aborted. The state of the database is rollbacked to before transaction.
851
+ .RE
852
+ .RE
853
+ .PP
854
+ The function `tchdbpath' is used in order to get the file path of a hash database object.
855
+ .PP
856
+ .RS
857
+ .br
858
+ \fBconst char *tchdbpath(TCHDB *\fIhdb\fB);\fR
859
+ .RS
860
+ `\fIhdb\fR' specifies the hash database object.
861
+ .RE
862
+ .RS
863
+ The return value is the path of the database file or `NULL' if the object does not connect to any database file.
864
+ .RE
865
+ .RE
866
+ .PP
867
+ The function `tchdbrnum' is used in order to get the number of records of a hash database object.
868
+ .PP
869
+ .RS
870
+ .br
871
+ \fBuint64_t tchdbrnum(TCHDB *\fIhdb\fB);\fR
872
+ .RS
873
+ `\fIhdb\fR' specifies the hash database object.
874
+ .RE
875
+ .RS
876
+ The return value is the number of records or 0 if the object does not connect to any database file.
877
+ .RE
878
+ .RE
879
+ .PP
880
+ The function `tchdbfsiz' is used in order to get the size of the database file of a hash database object.
881
+ .PP
882
+ .RS
883
+ .br
884
+ \fBuint64_t tchdbfsiz(TCHDB *\fIhdb\fB);\fR
885
+ .RS
886
+ `\fIhdb\fR' specifies the hash database object.
887
+ .RE
888
+ .RS
889
+ The return value is the size of the database file or 0 if the object does not connect to any database file.
890
+ .RE
891
+ .RE
892
+
893
+ .SH SEE ALSO
894
+ .PP
895
+ .BR tchtest (1),
896
+ .BR tchmttest (1),
897
+ .BR tchmgr (1),
898
+ .BR tokyocabinet (3)