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,110 @@
1
+ .TH "TCHMGR" 1 "2009-10-13" "Man Page" "Tokyo Cabinet"
2
+
3
+ .SH NAME
4
+ tchmgr \- the command line utility of the hash database API
5
+
6
+ .SH DESCRIPTION
7
+ .PP
8
+ The command `\fBtchmgr\fR' is a utility for test and debugging of the hash database API and its applications. `\fIpath\fR' specifies the path of a database file. `\fIbnum\fR' specifies the number of buckets. `\fIapow\fR' specifies the power of the alignment. `\fIfpow\fR' specifies the power of the free block pool. `\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
+ \fBtchmgr create \fR[\fB\-tl\fR]\fB \fR[\fB\-td\fR|\fB\-tb\fR|\fB\-tt\fR|\fB\-tx\fR]\fB \fIpath\fB \fR[\fB\fIbnum\fB \fR[\fB\fIapow\fB \fR[\fB\fIfpow\fB\fR]\fB\fR]\fB\fR]\fB\fR
13
+ .RS
14
+ Create a database file.
15
+ .RE
16
+ .br
17
+ \fBtchmgr 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
+ \fBtchmgr 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
+ \fBtchmgr 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
+ \fBtchmgr 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
+ \fBtchmgr 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\-fm \fIstr\fB\fR]\fB \fIpath\fB\fR
38
+ .RS
39
+ Print keys of all records, separated by line feeds.
40
+ .RE
41
+ .br
42
+ \fBtchmgr optimize \fR[\fB\-tl\fR]\fB \fR[\fB\-td\fR|\fB\-tb\fR|\fB\-tt\fR|\fB\-tx\fR]\fB \fR[\fB\-tz\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-df\fR]\fB \fIpath\fB \fR[\fB\fIbnum\fB \fR[\fB\fIapow\fB \fR[\fB\fIfpow\fB\fR]\fB\fR]\fB\fR]\fB\fR
43
+ .RS
44
+ Optimize a database file.
45
+ .RE
46
+ .br
47
+ \fBtchmgr 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
+ \fBtchmgr 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\-tl\fR : enable the option `HDBTLARGE'.
62
+ .br
63
+ \fB\-td\fR : enable the option `HDBTDEFLATE'.
64
+ .br
65
+ \fB\-tb\fR : enable the option `HDBTBZIP'.
66
+ .br
67
+ \fB\-tt\fR : enable the option `HDBTTCBS'.
68
+ .br
69
+ \fB\-tx\fR : enable the option `HDBTEXCODEC'.
70
+ .br
71
+ \fB\-nl\fR : enable the option `HDBNOLCK'.
72
+ .br
73
+ \fB\-nb\fR : enable the option `HDBLCKNB'.
74
+ .br
75
+ \fB\-sx\fR : the input data is evaluated as a hexadecimal data string.
76
+ .br
77
+ \fB\-dk\fR : use the function `tchdbputkeep' instead of `tchdbput'.
78
+ .br
79
+ \fB\-dc\fR : use the function `tchdbputcat' instead of `tchdbput'.
80
+ .br
81
+ \fB\-dai\fR : use the function `tchdbaddint' instead of `tchdbput'.
82
+ .br
83
+ \fB\-dad\fR : use the function `tchdbadddouble' instead of `tchdbput'.
84
+ .br
85
+ \fB\-px\fR : the output data is converted into a hexadecimal data string.
86
+ .br
87
+ \fB\-pz\fR : do not append line feed at the end of the output.
88
+ .br
89
+ \fB\-m \fInum\fR\fR : specify the maximum number of the output.
90
+ .br
91
+ \fB\-pv\fR : print values of records also.
92
+ .br
93
+ \fB\-fm \fIstr\fR\fR : specify the prefix of keys.
94
+ .br
95
+ \fB\-tz\fR : enable the option `UINT8_MAX'.
96
+ .br
97
+ \fB\-df\fR : perform defragmentation only.
98
+ .br
99
+ \fB\-sc\fR : normalize keys as lower cases.
100
+ .br
101
+ .RE
102
+ .PP
103
+ This command returns 0 on success, another on failure.
104
+
105
+ .SH SEE ALSO
106
+ .PP
107
+ .BR tchtest (1),
108
+ .BR tchmttest (1),
109
+ .BR tchdb (3),
110
+ .BR tokyocabinet (3)
@@ -0,0 +1,85 @@
1
+ .TH "TCHMTTEST" 1 "2009-10-13" "Man Page" "Tokyo Cabinet"
2
+
3
+ .SH NAME
4
+ tchmttest \- test cases of the hash database API
5
+
6
+ .SH DESCRIPTION
7
+ .PP
8
+ The command `\fBtchmttest\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. `\fIbnum\fR' specifies the number of buckets. `\fIapow\fR' specifies the power of the alignment. `\fIfpow\fR' specifies the power of the free block pool.
9
+ .PP
10
+ .RS
11
+ .br
12
+ \fBtchmttest write \fR[\fB\-tl\fR]\fB \fR[\fB\-td\fR|\fB\-tb\fR|\fB\-tt\fR|\fB\-tx\fR]\fB \fR[\fB\-rc \fInum\fB\fR]\fB \fR[\fB\-xm \fInum\fB\fR]\fB \fR[\fB\-df \fInum\fB\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-as\fR]\fB \fR[\fB\-rnd\fR]\fB \fIpath\fB \fItnum\fB \fIrnum\fB \fR[\fB\fIbnum\fB \fR[\fB\fIapow\fB \fR[\fB\fIfpow\fB\fR]\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
+ \fBtchmttest read \fR[\fB\-rc \fInum\fB\fR]\fB \fR[\fB\-xm \fInum\fB\fR]\fB \fR[\fB\-df \fInum\fB\fR]\fB \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
+ \fBtchmttest remove \fR[\fB\-rc \fInum\fB\fR]\fB \fR[\fB\-xm \fInum\fB\fR]\fB \fR[\fB\-df \fInum\fB\fR]\fB \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
+ \fBtchmttest wicked \fR[\fB\-tl\fR]\fB \fR[\fB\-td\fR|\fB\-tb\fR|\fB\-tt\fR|\fB\-tx\fR]\fB \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
+ \fBtchmttest typical \fR[\fB\-tl\fR]\fB \fR[\fB\-td\fR|\fB\-tb\fR|\fB\-tt\fR|\fB\-tx\fR]\fB \fR[\fB\-rc \fInum\fB\fR]\fB \fR[\fB\-xm \fInum\fB\fR]\fB \fR[\fB\-df \fInum\fB\fR]\fB \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\fIbnum\fB \fR[\fB\fIapow\fB \fR[\fB\fIfpow\fB\fR]\fB\fR]\fB\fR
33
+ .RS
34
+ Perform typical operations selected at random.
35
+ .RE
36
+ .br
37
+ \fBtchmttest race \fR[\fB\-tl\fR]\fB \fR[\fB\-td\fR|\fB\-tb\fR|\fB\-tt\fR|\fB\-tx\fR]\fB \fR[\fB\-xm \fInum\fB\fR]\fB \fR[\fB\-df \fInum\fB\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fIpath\fB \fItnum\fB \fIrnum\fB \fR[\fB\fIbnum\fB \fR[\fB\fIapow\fB \fR[\fB\fIfpow\fB\fR]\fB\fR]\fB\fR
38
+ .RS
39
+ Perform race condition test.
40
+ .RE
41
+ .RE
42
+ .PP
43
+ Options feature the following.
44
+ .PP
45
+ .RS
46
+ \fB\-tl\fR : enable the option `HDBTLARGE'.
47
+ .br
48
+ \fB\-td\fR : enable the option `HDBTDEFLATE'.
49
+ .br
50
+ \fB\-tb\fR : enable the option `HDBTBZIP'.
51
+ .br
52
+ \fB\-tt\fR : enable the option `HDBTTCBS'.
53
+ .br
54
+ \fB\-tx\fR : enable the option `HDBTEXCODEC'.
55
+ .br
56
+ \fB\-rc \fInum\fR\fR : specify the number of cached records.
57
+ .br
58
+ \fB\-xm \fInum\fR\fR : specify the size of the extra mapped memory.
59
+ .br
60
+ \fB\-df \fInum\fR\fR : specify the unit step number of auto defragmentation.
61
+ .br
62
+ \fB\-nl\fR : enable the option `HDBNOLCK'.
63
+ .br
64
+ \fB\-nb\fR : enable the option `HDBLCKNB'.
65
+ .br
66
+ \fB\-as\fR : use the function `tchdbputasync' instead of `tchdbput'.
67
+ .br
68
+ \fB\-rnd\fR : select keys at random.
69
+ .br
70
+ \fB\-wb\fR : use the function `tchdbget3' instead of `tchdbget'.
71
+ .br
72
+ \fB\-nc\fR : omit the comparison test.
73
+ .br
74
+ \fB\-rr \fInum\fR\fR : specify the ratio of reading operation by percentage.
75
+ .br
76
+ .RE
77
+ .PP
78
+ This command returns 0 on success, another on failure.
79
+
80
+ .SH SEE ALSO
81
+ .PP
82
+ .BR tchtest (1),
83
+ .BR tchmgr (1),
84
+ .BR tchdb (3),
85
+ .BR tokyocabinet (3)
@@ -0,0 +1,95 @@
1
+ .TH "TCHTEST" 1 "2009-10-13" "Man Page" "Tokyo Cabinet"
2
+
3
+ .SH NAME
4
+ tchtest \- test cases of the hash database API
5
+
6
+ .SH DESCRIPTION
7
+ .PP
8
+ To use the hash database API easily, the commands `\fBtchtest\fR', `\fBtchmttest\fR', and `\fBtchmgr\fR' are provided.
9
+ .PP
10
+ The command `\fBtchtest\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. `\fIbnum\fR' specifies the number of buckets. `\fIapow\fR' specifies the power of the alignment. `\fIfpow\fR' specifies the power of the free block pool.
11
+ .PP
12
+ .RS
13
+ .br
14
+ \fBtchtest write \fR[\fB\-mt\fR]\fB \fR[\fB\-tl\fR]\fB \fR[\fB\-td\fR|\fB\-tb\fR|\fB\-tt\fR|\fB\-tx\fR]\fB \fR[\fB\-rc \fInum\fB\fR]\fB \fR[\fB\-xm \fInum\fB\fR]\fB \fR[\fB\-df \fInum\fB\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-as\fR]\fB \fR[\fB\-rnd\fR]\fB \fIpath\fB \fIrnum\fB \fR[\fB\fIbnum\fB \fR[\fB\fIapow\fB \fR[\fB\fIfpow\fB\fR]\fB\fR]\fB\fR]\fB\fR
15
+ .RS
16
+ Store records with keys of 8 bytes. They change as `00000001', `00000002'...
17
+ .RE
18
+ .br
19
+ \fBtchtest read \fR[\fB\-mt\fR]\fB \fR[\fB\-rc \fInum\fB\fR]\fB \fR[\fB\-xm \fInum\fB\fR]\fB \fR[\fB\-df \fInum\fB\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-wb\fR]\fB \fR[\fB\-rnd\fR]\fB \fIpath\fB\fR
20
+ .RS
21
+ Retrieve all records of the database above.
22
+ .RE
23
+ .br
24
+ \fBtchtest remove \fR[\fB\-mt\fR]\fB \fR[\fB\-rc \fInum\fB\fR]\fB \fR[\fB\-xm \fInum\fB\fR]\fB \fR[\fB\-df \fInum\fB\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fR[\fB\-rnd\fR]\fB \fIpath\fB\fR
25
+ .RS
26
+ Remove all records of the database above.
27
+ .RE
28
+ .br
29
+ \fBtchtest rcat \fR[\fB\-mt\fR]\fB \fR[\fB\-tl\fR]\fB \fR[\fB\-td\fR|\fB\-tb\fR|\fB\-tt\fR|\fB\-tx\fR]\fB \fR[\fB\-rc \fInum\fB\fR]\fB \fR[\fB\-xm \fInum\fB\fR]\fB \fR[\fB\-df \fInum\fB\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\-ru\fR]\fB \fIpath\fB \fIrnum\fB \fR[\fB\fIbnum\fB \fR[\fB\fIapow\fB \fR[\fB\fIfpow\fB\fR]\fB\fR]\fB\fR]\fB\fR
30
+ .RS
31
+ Store records with partway duplicated keys using concatenate mode.
32
+ .RE
33
+ .br
34
+ \fBtchtest misc \fR[\fB\-mt\fR]\fB \fR[\fB\-tl\fR]\fB \fR[\fB\-td\fR|\fB\-tb\fR|\fB\-tt\fR|\fB\-tx\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fIpath\fB \fIrnum\fB\fR
35
+ .RS
36
+ Perform miscellaneous test of various operations.
37
+ .RE
38
+ .br
39
+ \fBtchtest wicked \fR[\fB\-mt\fR]\fB \fR[\fB\-tl\fR]\fB \fR[\fB\-td\fR|\fB\-tb\fR|\fB\-tt\fR|\fB\-tx\fR]\fB \fR[\fB\-nl\fR|\fB\-nb\fR]\fB \fIpath\fB \fIrnum\fB\fR
40
+ .RS
41
+ Perform updating operations selected at random.
42
+ .RE
43
+ .RE
44
+ .PP
45
+ Options feature the following.
46
+ .PP
47
+ .RS
48
+ \fB\-mt\fR : call the function `tchdbsetmutex'.
49
+ .br
50
+ \fB\-tl\fR : enable the option `HDBTLARGE'.
51
+ .br
52
+ \fB\-td\fR : enable the option `HDBTDEFLATE'.
53
+ .br
54
+ \fB\-tb\fR : enable the option `HDBTBZIP'.
55
+ .br
56
+ \fB\-tt\fR : enable the option `HDBTTCBS'.
57
+ .br
58
+ \fB\-tx\fR : enable the option `HDBTEXCODEC'.
59
+ .br
60
+ \fB\-rc \fInum\fR\fR : specify the number of cached records.
61
+ .br
62
+ \fB\-xm \fInum\fR\fR : specify the size of the extra mapped memory.
63
+ .br
64
+ \fB\-df \fInum\fR\fR : specify the unit step number of auto defragmentation.
65
+ .br
66
+ \fB\-nl\fR : enable the option `HDBNOLCK'.
67
+ .br
68
+ \fB\-nb\fR : enable the option `HDBLCKNB'.
69
+ .br
70
+ \fB\-as\fR : use the function `tchdbputasync' instead of `tchdbput'.
71
+ .br
72
+ \fB\-rnd\fR : select keys at random.
73
+ .br
74
+ \fB\-wb\fR : use the function `tchdbget3' instead of `tchdbget'.
75
+ .br
76
+ \fB\-pn \fInum\fR\fR : specify the number of patterns.
77
+ .br
78
+ \fB\-dai\fR : use the function `tchdbaddint' instead of `tchdbputcat'.
79
+ .br
80
+ \fB\-dad\fR : use the function `tchdbadddouble' instead of `tchdbputcat'.
81
+ .br
82
+ \fB\-rl\fR : set the length of values at random.
83
+ .br
84
+ \fB\-ru\fR : select update operations at random.
85
+ .br
86
+ .RE
87
+ .PP
88
+ This command returns 0 on success, another on failure.
89
+
90
+ .SH SEE ALSO
91
+ .PP
92
+ .BR tchmttest (1),
93
+ .BR tchmgr (1),
94
+ .BR tchdb (3),
95
+ .BR tokyocabinet (3)
@@ -0,0 +1 @@
1
+ .so man3/tcutil.3
@@ -0,0 +1 @@
1
+ .so man3/tcutil.3
@@ -0,0 +1 @@
1
+ .so man3/tcutil.3
@@ -0,0 +1 @@
1
+ .so man3/tcutil.3
@@ -0,0 +1,1110 @@
1
+ .TH "TCTDB" 3 "2009-10-13" "Man Page" "Tokyo Cabinet"
2
+
3
+ .SH NAME
4
+ tctdb \- the table database API
5
+
6
+ .SH DESCRIPTION
7
+ .PP
8
+ Table database is a file containing records composed of the primary keys and arbitrary columns and is handled with the table database API.
9
+ .PP
10
+ To use the table database API, include `\fBtcutil.h\fR', `\fBtctdb.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 <tctdb.h>\fR
17
+ .br
18
+ \fB#include <stdlib.h>\fR
19
+ .br
20
+ \fB#include <stdbool.h>\fR
21
+ .br
22
+ \fB#include <stdint.h>\fR
23
+ .RE
24
+ .PP
25
+ Objects whose type is pointer to `\fBTCTDB\fR' are used to handle table databases. A table database object is created with the function `\fBtctdbnew\fR' and is deleted with the function `\fBtctdbdel\fR'. To avoid memory leak, it is important to delete every object when it is no longer in use.
26
+ .PP
27
+ Before operations to store or retrieve records, it is necessary to open a database file and connect the table database object to it. The function `\fBtctdbopen\fR' is used to open a database file and the function `\fBtctdbclose\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.
28
+
29
+ .SH API
30
+ .PP
31
+ The function `tctdberrmsg' is used in order to get the message string corresponding to an error code.
32
+ .PP
33
+ .RS
34
+ .br
35
+ \fBconst char *tctdberrmsg(int \fIecode\fB);\fR
36
+ .RS
37
+ `\fIecode\fR' specifies the error code.
38
+ .RE
39
+ .RS
40
+ The return value is the message string of the error code.
41
+ .RE
42
+ .RE
43
+ .PP
44
+ The function `tctdbnew' is used in order to create a table database object.
45
+ .PP
46
+ .RS
47
+ .br
48
+ \fBTCTDB *tctdbnew(void);\fR
49
+ .RS
50
+ The return value is the new table database object.
51
+ .RE
52
+ .RE
53
+ .PP
54
+ The function `tctdbdel' is used in order to delete a table database object.
55
+ .PP
56
+ .RS
57
+ .br
58
+ \fBvoid tctdbdel(TCTDB *\fItdb\fB);\fR
59
+ .RS
60
+ `\fItdb\fR' specifies the table database object.
61
+ .RE
62
+ .RS
63
+ If the database is not closed, it is closed implicitly. Note that the deleted object and its derivatives can not be used anymore.
64
+ .RE
65
+ .RE
66
+ .PP
67
+ The function `tctdbecode' is used in order to get the last happened error code of a table database object.
68
+ .PP
69
+ .RS
70
+ .br
71
+ \fBint tctdbecode(TCTDB *\fItdb\fB);\fR
72
+ .RS
73
+ `\fItdb\fR' specifies the table database object.
74
+ .RE
75
+ .RS
76
+ The return value is the last happened error code.
77
+ .RE
78
+ .RS
79
+ 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.
80
+ .RE
81
+ .RE
82
+ .PP
83
+ The function `tctdbsetmutex' is used in order to set mutual exclusion control of a table database object for threading.
84
+ .PP
85
+ .RS
86
+ .br
87
+ \fBbool tctdbsetmutex(TCTDB *\fItdb\fB);\fR
88
+ .RS
89
+ `\fItdb\fR' specifies the table database object which is not opened.
90
+ .RE
91
+ .RS
92
+ If successful, the return value is true, else, it is false.
93
+ .RE
94
+ .RS
95
+ Note that the mutual exclusion control is needed if the object is shared by plural threads and this function should be called before the database is opened.
96
+ .RE
97
+ .RE
98
+ .PP
99
+ The function `tctdbtune' is used in order to set the tuning parameters of a table database object.
100
+ .PP
101
+ .RS
102
+ .br
103
+ \fBbool tctdbtune(TCTDB *\fItdb\fB, int64_t \fIbnum\fB, int8_t \fIapow\fB, int8_t \fIfpow\fB, uint8_t \fIopts\fB);\fR
104
+ .RS
105
+ `\fItdb\fR' specifies the table database object which is not opened.
106
+ .RE
107
+ .RS
108
+ `\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 131071. Suggested size of the bucket array is about from 0.5 to 4 times of the number of all records to be stored.
109
+ .RE
110
+ .RS
111
+ `\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.
112
+ .RE
113
+ .RS
114
+ `\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.
115
+ .RE
116
+ .RS
117
+ `\fIopts\fR' specifies options by bitwise-or: `TDBTLARGE' specifies that the size of the database can be larger than 2GB by using 64\-bit bucket array, `TDBTDEFLATE' specifies that each record is compressed with Deflate encoding, `TDBTBZIP' specifies that each record is compressed with BZIP2 encoding, `TDBTTCBS' specifies that each record is compressed with TCBS encoding.
118
+ .RE
119
+ .RS
120
+ If successful, the return value is true, else, it is false.
121
+ .RE
122
+ .RS
123
+ Note that the tuning parameters should be set before the database is opened.
124
+ .RE
125
+ .RE
126
+ .PP
127
+ The function `tctdbsetcache' is set the caching parameters of a table database object.
128
+ .PP
129
+ .RS
130
+ .br
131
+ \fBbool tctdbsetcache(TCTDB *\fItdb\fB, int32_t \fIrcnum\fB, int32_t \fIlcnum\fB, int32_t \fIncnum\fB);\fR
132
+ .RS
133
+ `\fItdb\fR' specifies the table database object which is not opened.
134
+ .RE
135
+ .RS
136
+ `\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.
137
+ .RE
138
+ .RS
139
+ `\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 4096.
140
+ .RE
141
+ .RS
142
+ `\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.
143
+ .RE
144
+ .RS
145
+ If successful, the return value is true, else, it is false.
146
+ .RE
147
+ .RS
148
+ Note that the caching parameters should be set before the database is opened. Leaf nodes and non\-leaf nodes are used in column indices.
149
+ .RE
150
+ .RE
151
+ .PP
152
+ The function `tctdbsetxmsiz' is used in order to set the size of the extra mapped memory of a table database object.
153
+ .PP
154
+ .RS
155
+ .br
156
+ \fBbool tctdbsetxmsiz(TCTDB *\fItdb\fB, int64_t \fIxmsiz\fB);\fR
157
+ .RS
158
+ `\fItdb\fR' specifies the table database object which is not opened.
159
+ .RE
160
+ .RS
161
+ `\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.
162
+ .RE
163
+ .RS
164
+ If successful, the return value is true, else, it is false.
165
+ .RE
166
+ .RS
167
+ Note that the mapping parameters should be set before the database is opened.
168
+ .RE
169
+ .RE
170
+ .PP
171
+ The function `tctdbsetdfunit' is used in order to set the unit step number of auto defragmentation of a table database object.
172
+ .PP
173
+ .RS
174
+ .br
175
+ \fBbool tctdbsetdfunit(TCTDB *\fItdb\fB, int32_t \fIdfunit\fB);\fR
176
+ .RS
177
+ `\fItdb\fR' specifies the table database object which is not opened.
178
+ .RE
179
+ .RS
180
+ `\fIdfunit\fR' specifie the unit step number. If it is not more than 0, the auto defragmentation is disabled. It is disabled by default.
181
+ .RE
182
+ .RS
183
+ If successful, the return value is true, else, it is false.
184
+ .RE
185
+ .RS
186
+ Note that the defragmentation parameters should be set before the database is opened.
187
+ .RE
188
+ .RE
189
+ .PP
190
+ The function `tctdbopen' is used in order to open a database file and connect a table database object.
191
+ .PP
192
+ .RS
193
+ .br
194
+ \fBbool tctdbopen(TCTDB *\fItdb\fB, const char *\fIpath\fB, int \fIomode\fB);\fR
195
+ .RS
196
+ `\fItdb\fR' specifies the table database object which is not opened.
197
+ .RE
198
+ .RS
199
+ `\fIpath\fR' specifies the path of the database file.
200
+ .RE
201
+ .RS
202
+ `\fIomode\fR' specifies the connection mode: `TDBOWRITER' as a writer, `TDBOREADER' as a reader. If the mode is `TDBOWRITER', the following may be added by bitwise-or: `TDBOCREAT', which means it creates a new database if not exist, `TDBOTRUNC', which means it creates a new database regardless if one exists, `TDBOTSYNC', which means every transaction synchronizes updated contents with the device. Both of `TDBOREADER' and `TDBOWRITER' can be added to by bitwise-or: `TDBONOLCK', which means it opens the database file without file locking, or `TDBOLCKNB', which means locking is performed without blocking.
203
+ .RE
204
+ .RS
205
+ If successful, the return value is true, else, it is false.
206
+ .RE
207
+ .RE
208
+ .PP
209
+ The function `tctdbclose' is used in order to close a table database object.
210
+ .PP
211
+ .RS
212
+ .br
213
+ \fBbool tctdbclose(TCTDB *\fItdb\fB);\fR
214
+ .RS
215
+ `\fItdb\fR' specifies the table database object.
216
+ .RE
217
+ .RS
218
+ If successful, the return value is true, else, it is false.
219
+ .RE
220
+ .RS
221
+ 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.
222
+ .RE
223
+ .RE
224
+ .PP
225
+ The function `tctdbput' is used in order to store a record into a table database object.
226
+ .PP
227
+ .RS
228
+ .br
229
+ \fBbool tctdbput(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, TCMAP *\fIcols\fB);\fR
230
+ .RS
231
+ `\fItdb\fR' specifies the table database object connected as a writer.
232
+ .RE
233
+ .RS
234
+ `\fIpkbuf\fR' specifies the pointer to the region of the primary key.
235
+ .RE
236
+ .RS
237
+ `\fIpksiz\fR' specifies the size of the region of the primary key.
238
+ .RE
239
+ .RS
240
+ `\fIcols\fR' specifies a map object containing columns.
241
+ .RE
242
+ .RS
243
+ If successful, the return value is true, else, it is false.
244
+ .RE
245
+ .RS
246
+ If a record with the same key exists in the database, it is overwritten.
247
+ .RE
248
+ .RE
249
+ .PP
250
+ The function `tctdbput2' is used in order to store a string record into a table database object with a zero separated column string.
251
+ .PP
252
+ .RS
253
+ .br
254
+ \fBbool tctdbput2(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, const void *\fIcbuf\fB, int \fIcsiz\fB);\fR
255
+ .RS
256
+ `\fItdb\fR' specifies the table database object connected as a writer.
257
+ .RE
258
+ .RS
259
+ `\fIpkbuf\fR' specifies the pointer to the region of the primary key.
260
+ .RE
261
+ .RS
262
+ `\fIpksiz\fR' specifies the size of the region of the primary key.
263
+ .RE
264
+ .RS
265
+ `\fIcbuf\fR' specifies the pointer to the region of the zero separated column string where the name and the value of each column are situated one after the other.
266
+ .RE
267
+ .RS
268
+ `\fIcsiz\fR' specifies the size of the region of the column string.
269
+ .RE
270
+ .RS
271
+ If successful, the return value is true, else, it is false.
272
+ .RE
273
+ .RS
274
+ If a record with the same key exists in the database, it is overwritten.
275
+ .RE
276
+ .RE
277
+ .PP
278
+ The function `tctdbput3' is used in order to store a string record into a table database object with a tab separated column string.
279
+ .PP
280
+ .RS
281
+ .br
282
+ \fBbool tctdbput3(TCTDB *\fItdb\fB, const char *\fIpkstr\fB, const char *\fIcstr\fB);\fR
283
+ .RS
284
+ `\fItdb\fR' specifies the table database object connected as a writer.
285
+ .RE
286
+ .RS
287
+ `\fIpkstr\fR' specifies the string of the primary key.
288
+ .RE
289
+ .RS
290
+ `\fIcstr\fR' specifies the string of the the tab separated column string where the name and the value of each column are situated one after the other.
291
+ .RE
292
+ .RS
293
+ If successful, the return value is true, else, it is false.
294
+ .RE
295
+ .RS
296
+ If a record with the same key exists in the database, it is overwritten.
297
+ .RE
298
+ .RE
299
+ .PP
300
+ The function `tctdbputkeep' is used in order to store a new record into a table database object.
301
+ .PP
302
+ .RS
303
+ .br
304
+ \fBbool tctdbputkeep(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, TCMAP *\fIcols\fB);\fR
305
+ .RS
306
+ `\fItdb\fR' specifies the table database object connected as a writer.
307
+ .RE
308
+ .RS
309
+ `\fIpkbuf\fR' specifies the pointer to the region of the primary key.
310
+ .RE
311
+ .RS
312
+ `\fIpksiz\fR' specifies the size of the region of the primary key.
313
+ .RE
314
+ .RS
315
+ `\fIcols\fR' specifies a map object containing columns.
316
+ .RE
317
+ .RS
318
+ If successful, the return value is true, else, it is false.
319
+ .RE
320
+ .RS
321
+ If a record with the same key exists in the database, this function has no effect.
322
+ .RE
323
+ .RE
324
+ .PP
325
+ The function `tctdbputkeep2' is used in order to store a new string record into a table database object with a zero separated column string.
326
+ .PP
327
+ .RS
328
+ .br
329
+ \fBbool tctdbputkeep2(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, const void *\fIcbuf\fB, int \fIcsiz\fB);\fR
330
+ .RS
331
+ `\fItdb\fR' specifies the table database object connected as a writer.
332
+ .RE
333
+ .RS
334
+ `\fIpkbuf\fR' specifies the pointer to the region of the primary key.
335
+ .RE
336
+ .RS
337
+ `\fIpksiz\fR' specifies the size of the region of the primary key.
338
+ .RE
339
+ .RS
340
+ `\fIcbuf\fR' specifies the pointer to the region of the zero separated column string where the name and the value of each column are situated one after the other.
341
+ .RE
342
+ .RS
343
+ `\fIcsiz\fR' specifies the size of the region of the column string.
344
+ .RE
345
+ .RS
346
+ If successful, the return value is true, else, it is false.
347
+ .RE
348
+ .RS
349
+ If a record with the same key exists in the database, this function has no effect.
350
+ .RE
351
+ .RE
352
+ .PP
353
+ The function `tctdbputkeep3' is used in order to store a new string record into a table database object with a tab separated column string.
354
+ .PP
355
+ .RS
356
+ .br
357
+ \fBbool tctdbputkeep3(TCTDB *\fItdb\fB, const char *\fIpkstr\fB, const char *\fIcstr\fB);\fR
358
+ .RS
359
+ `\fItdb\fR' specifies the table database object connected as a writer.
360
+ .RE
361
+ .RS
362
+ `\fIpkstr\fR' specifies the string of the primary key.
363
+ .RE
364
+ .RS
365
+ `\fIcstr\fR' specifies the string of the the tab separated column string where the name and the value of each column are situated one after the other.
366
+ .RE
367
+ .RS
368
+ If successful, the return value is true, else, it is false.
369
+ .RE
370
+ .RS
371
+ If a record with the same key exists in the database, this function has no effect.
372
+ .RE
373
+ .RE
374
+ .PP
375
+ The function `tctdbputcat' is used in order to concatenate columns of the existing record in a table database object.
376
+ .PP
377
+ .RS
378
+ .br
379
+ \fBbool tctdbputcat(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, TCMAP *\fIcols\fB);\fR
380
+ .RS
381
+ `\fItdb\fR' specifies the table database object connected as a writer.
382
+ .RE
383
+ .RS
384
+ `\fIpkbuf\fR' specifies the pointer to the region of the primary key.
385
+ .RE
386
+ .RS
387
+ `\fIpksiz\fR' specifies the size of the region of the primary key.
388
+ .RE
389
+ .RS
390
+ `\fIcols\fR' specifies a map object containing columns.
391
+ .RE
392
+ .RS
393
+ If successful, the return value is true, else, it is false.
394
+ .RE
395
+ .RS
396
+ If there is no corresponding record, a new record is created.
397
+ .RE
398
+ .RE
399
+ .PP
400
+ The function `tctdbputcat2' is used in order to concatenate columns in a table database object with a zero separated column string.
401
+ .PP
402
+ .RS
403
+ .br
404
+ \fBbool tctdbputcat2(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, const void *\fIcbuf\fB, int \fIcsiz\fB);\fR
405
+ .RS
406
+ `\fItdb\fR' specifies the table database object connected as a writer.
407
+ .RE
408
+ .RS
409
+ `\fIpkbuf\fR' specifies the pointer to the region of the primary key.
410
+ .RE
411
+ .RS
412
+ `\fIpksiz\fR' specifies the size of the region of the primary key.
413
+ .RE
414
+ .RS
415
+ `\fIcbuf\fR' specifies the pointer to the region of the zero separated column string where the name and the value of each column are situated one after the other.
416
+ .RE
417
+ .RS
418
+ `\fIcsiz\fR' specifies the size of the region of the column string.
419
+ .RE
420
+ .RS
421
+ If successful, the return value is true, else, it is false.
422
+ .RE
423
+ .RS
424
+ If there is no corresponding record, a new record is created.
425
+ .RE
426
+ .RE
427
+ .PP
428
+ The function `tctdbputcat3' is used in order to concatenate columns in a table database object with with a tab separated column string.
429
+ .PP
430
+ .RS
431
+ .br
432
+ \fBbool tctdbputcat3(TCTDB *\fItdb\fB, const char *\fIpkstr\fB, const char *\fIcstr\fB);\fR
433
+ .RS
434
+ `\fItdb\fR' specifies the table database object connected as a writer.
435
+ .RE
436
+ .RS
437
+ `\fIpkstr\fR' specifies the string of the primary key.
438
+ .RE
439
+ .RS
440
+ `\fIcstr\fR' specifies the string of the the tab separated column string where the name and the value of each column are situated one after the other.
441
+ .RE
442
+ .RS
443
+ If successful, the return value is true, else, it is false.
444
+ .RE
445
+ .RS
446
+ If there is no corresponding record, a new record is created.
447
+ .RE
448
+ .RE
449
+ .PP
450
+ The function `tctdbout' is used in order to remove a record of a table database object.
451
+ .PP
452
+ .RS
453
+ .br
454
+ \fBbool tctdbout(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB);\fR
455
+ .RS
456
+ `\fItdb\fR' specifies the table database object connected as a writer.
457
+ .RE
458
+ .RS
459
+ `\fIpkbuf\fR' specifies the pointer to the region of the primary key.
460
+ .RE
461
+ .RS
462
+ `\fIpksiz\fR' specifies the size of the region of the primary key.
463
+ .RE
464
+ .RS
465
+ If successful, the return value is true, else, it is false.
466
+ .RE
467
+ .RE
468
+ .PP
469
+ The function `tctdbout2' is used in order to remove a string record of a table database object.
470
+ .PP
471
+ .RS
472
+ .br
473
+ \fBbool tctdbout2(TCTDB *\fItdb\fB, const char *\fIpkstr\fB);\fR
474
+ .RS
475
+ `\fItdb\fR' specifies the table database object connected as a writer.
476
+ .RE
477
+ .RS
478
+ `\fIpkstr\fR' specifies the string of the primary key.
479
+ .RE
480
+ .RS
481
+ If successful, the return value is true, else, it is false.
482
+ .RE
483
+ .RE
484
+ .PP
485
+ The function `tctdbget' is used in order to retrieve a record in a table database object.
486
+ .PP
487
+ .RS
488
+ .br
489
+ \fBTCMAP *tctdbget(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB);\fR
490
+ .RS
491
+ `\fItdb\fR' specifies the table database object.
492
+ .RE
493
+ .RS
494
+ `\fIpkbuf\fR' specifies the pointer to the region of the primary key.
495
+ .RE
496
+ .RS
497
+ `\fIpksiz\fR' specifies the size of the region of the primary key.
498
+ .RE
499
+ .RS
500
+ If successful, the return value is a map object of the columns of the corresponding record. `NULL' is returned if no record corresponds.
501
+ .RE
502
+ .RS
503
+ Because the object of the return value is created with the function `tcmapnew', it should be deleted with the function `tcmapdel' when it is no longer in use.
504
+ .RE
505
+ .RE
506
+ .PP
507
+ The function `tctdbget2' is used in order to retrieve a record in a table database object as a zero separated column string.
508
+ .PP
509
+ .RS
510
+ .br
511
+ \fBchar *tctdbget2(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, int *\fIsp\fB);\fR
512
+ .RS
513
+ `\fItdb\fR' specifies the table database object.
514
+ .RE
515
+ .RS
516
+ `\fIpkbuf\fR' specifies the pointer to the region of the primary key.
517
+ .RE
518
+ .RS
519
+ `\fIpksiz\fR' specifies the size of the region of the primary key.
520
+ .RE
521
+ .RS
522
+ `\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return value is assigned.
523
+ .RE
524
+ .RS
525
+ If successful, the return value is the pointer to the region of the column string of the corresponding record. `NULL' is returned if no record corresponds.
526
+ .RE
527
+ .RS
528
+ 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.
529
+ .RE
530
+ .RE
531
+ .PP
532
+ The function `tctdbget3' is used in order to retrieve a string record in a table database object as a tab separated column string.
533
+ .PP
534
+ .RS
535
+ .br
536
+ \fBchar *tctdbget3(TCTDB *\fItdb\fB, const char *\fIpkstr\fB);\fR
537
+ .RS
538
+ `\fItdb\fR' specifies the table database object.
539
+ .RE
540
+ .RS
541
+ `\fIpkstr\fR' specifies the string of the primary key.
542
+ .RE
543
+ .RS
544
+ If successful, the return value is the tab separated column string of the corresponding record. `NULL' is returned if no record corresponds.
545
+ .RE
546
+ .RS
547
+ 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.
548
+ .RE
549
+ .RE
550
+ .PP
551
+ The function `tctdbvsiz' is used in order to get the size of the value of a record in a table database object.
552
+ .PP
553
+ .RS
554
+ .br
555
+ \fBint tctdbvsiz(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB);\fR
556
+ .RS
557
+ `\fItdb\fR' specifies the table database object.
558
+ .RE
559
+ .RS
560
+ `\fIkbuf\fR' specifies the pointer to the region of the primary key.
561
+ .RE
562
+ .RS
563
+ `\fIksiz\fR' specifies the size of the region of the primary key.
564
+ .RE
565
+ .RS
566
+ If successful, the return value is the size of the value of the corresponding record, else, it is \-1.
567
+ .RE
568
+ .RE
569
+ .PP
570
+ The function `tctdbvsiz2' is used in order to get the size of the value of a string record in a table database object.
571
+ .PP
572
+ .RS
573
+ .br
574
+ \fBint tctdbvsiz2(TCTDB *\fItdb\fB, const char *\fIpkstr\fB);\fR
575
+ .RS
576
+ `\fItdb\fR' specifies the table database object.
577
+ .RE
578
+ .RS
579
+ `\fIkstr\fR' specifies the string of the primary key.
580
+ .RE
581
+ .RS
582
+ If successful, the return value is the size of the value of the corresponding record, else, it is \-1.
583
+ .RE
584
+ .RE
585
+ .PP
586
+ The function `tctdbiterinit' is used in order to initialize the iterator of a table database object.
587
+ .PP
588
+ .RS
589
+ .br
590
+ \fBbool tctdbiterinit(TCTDB *\fItdb\fB);\fR
591
+ .RS
592
+ `\fItdb\fR' specifies the table database object.
593
+ .RE
594
+ .RS
595
+ If successful, the return value is true, else, it is false.
596
+ .RE
597
+ .RS
598
+ The iterator is used in order to access the primary key of every record stored in a database.
599
+ .RE
600
+ .RE
601
+ .PP
602
+ The function `tctdbiternext' is used in order to get the next primary key of the iterator of a table database object.
603
+ .PP
604
+ .RS
605
+ .br
606
+ \fBvoid *tctdbiternext(TCTDB *\fItdb\fB, int *\fIsp\fB);\fR
607
+ .RS
608
+ `\fItdb\fR' specifies the table database object.
609
+ .RE
610
+ .RS
611
+ `\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return value is assigned.
612
+ .RE
613
+ .RS
614
+ If successful, the return value is the pointer to the region of the next primary key, else, it is `NULL'. `NULL' is returned when no record is to be get out of the iterator.
615
+ .RE
616
+ .RS
617
+ 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.
618
+ .RE
619
+ .RE
620
+ .PP
621
+ The function `tctdbiternext2' is used in order to get the next primary key string of the iterator of a table database object.
622
+ .PP
623
+ .RS
624
+ .br
625
+ \fBchar *tctdbiternext2(TCTDB *\fItdb\fB);\fR
626
+ .RS
627
+ `\fItdb\fR' specifies the table database object.
628
+ .RE
629
+ .RS
630
+ If successful, the return value is the string of the next primary key, else, it is `NULL'. `NULL' is returned when no record is to be get out of the iterator.
631
+ .RE
632
+ .RS
633
+ 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.
634
+ .RE
635
+ .RE
636
+ .PP
637
+ The function `tctdbiternext3' is used in order to get the columns of the next record of the iterator of a table database object.
638
+ .PP
639
+ .RS
640
+ .br
641
+ \fBTCMAP *tctdbiternext3(TCTDB *\fItdb\fB);\fR
642
+ .RS
643
+ `\fItdb\fR' specifies the table database object.
644
+ .RE
645
+ .RS
646
+ If successful, the return value is a map object of the columns of the next record, else, it is `NULL'. `NULL' is returned when no record is to be get out of the iterator. The primary key is added into the map as a column of an empty string key.
647
+ .RE
648
+ .RS
649
+ Because the object of the return value is created with the function `tcmapnew', it should be deleted with the function `tcmapdel' 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.
650
+ .RE
651
+ .RE
652
+ .PP
653
+ The function `tctdbfwmkeys' is used in order to get forward matching primary keys in a table database object.
654
+ .PP
655
+ .RS
656
+ .br
657
+ \fBTCLIST *tctdbfwmkeys(TCTDB *\fItdb\fB, const void *\fIpbuf\fB, int \fIpsiz\fB, int \fImax\fB);\fR
658
+ .RS
659
+ `\fItdb\fR' specifies the table database object.
660
+ .RE
661
+ .RS
662
+ `\fIpbuf\fR' specifies the pointer to the region of the prefix.
663
+ .RE
664
+ .RS
665
+ `\fIpsiz\fR' specifies the size of the region of the prefix.
666
+ .RE
667
+ .RS
668
+ `\fImax\fR' specifies the maximum number of keys to be fetched. If it is negative, no limit is specified.
669
+ .RE
670
+ .RS
671
+ 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.
672
+ .RE
673
+ .RS
674
+ 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.
675
+ .RE
676
+ .RE
677
+ .PP
678
+ The function `tctdbfwmkeys2' is used in order to get forward matching string primary keys in a table database object.
679
+ .PP
680
+ .RS
681
+ .br
682
+ \fBTCLIST *tctdbfwmkeys2(TCTDB *\fItdb\fB, const char *\fIpstr\fB, int \fImax\fB);\fR
683
+ .RS
684
+ `\fItdb\fR' specifies the table database object.
685
+ .RE
686
+ .RS
687
+ `\fIpstr\fR' specifies the string of the prefix.
688
+ .RE
689
+ .RS
690
+ `\fImax\fR' specifies the maximum number of keys to be fetched. If it is negative, no limit is specified.
691
+ .RE
692
+ .RS
693
+ 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.
694
+ .RE
695
+ .RS
696
+ 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.
697
+ .RE
698
+ .RE
699
+ .PP
700
+ The function `tctdbaddint' is used in order to add an integer to a column of a record in a table database object.
701
+ .PP
702
+ .RS
703
+ .br
704
+ \fBint tctdbaddint(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, int \fInum\fB);\fR
705
+ .RS
706
+ `\fItdb\fR' specifies the table database object connected as a writer.
707
+ .RE
708
+ .RS
709
+ `\fIkbuf\fR' specifies the pointer to the region of the primary key.
710
+ .RE
711
+ .RS
712
+ `\fIksiz\fR' specifies the size of the region of the primary key.
713
+ .RE
714
+ .RS
715
+ `\fInum\fR' specifies the additional value.
716
+ .RE
717
+ .RS
718
+ If successful, the return value is the summation value, else, it is `INT_MIN'.
719
+ .RE
720
+ .RS
721
+ The additional value is stored as a decimal string value of a column whose name is "_num". If no record corresponds, a new record with the additional value is stored.
722
+ .RE
723
+ .RE
724
+ .PP
725
+ The function `tctdbadddouble' is used in order to add a real number to a column of a record in a table database object.
726
+ .PP
727
+ .RS
728
+ .br
729
+ \fBdouble tctdbadddouble(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, double \fInum\fB);\fR
730
+ .RS
731
+ `\fItdb\fR' specifies the table database object connected as a writer.
732
+ .RE
733
+ .RS
734
+ `\fIkbuf\fR' specifies the pointer to the region of the primary key.
735
+ .RE
736
+ .RS
737
+ `\fIksiz\fR' specifies the size of the region of the primary key.
738
+ .RE
739
+ .RS
740
+ `\fInum\fR' specifies the additional value.
741
+ .RE
742
+ .RS
743
+ If successful, the return value is the summation value, else, it is Not\-a\-Number.
744
+ .RE
745
+ .RS
746
+ The additional value is stored as a decimal string value of a column whose name is "_num". If no record corresponds, a new record with the additional value is stored.
747
+ .RE
748
+ .RE
749
+ .PP
750
+ The function `tctdbsync' is used in order to synchronize updated contents of a table database object with the file and the device.
751
+ .PP
752
+ .RS
753
+ .br
754
+ \fBbool tctdbsync(TCTDB *\fItdb\fB);\fR
755
+ .RS
756
+ `\fItdb\fR' specifies the table database object connected as a writer.
757
+ .RE
758
+ .RS
759
+ If successful, the return value is true, else, it is false.
760
+ .RE
761
+ .RS
762
+ This function is useful when another process connects to the same database file.
763
+ .RE
764
+ .RE
765
+ .PP
766
+ The function `tctdboptimize' is used in order to optimize the file of a table database object.
767
+ .PP
768
+ .RS
769
+ .br
770
+ \fBbool tctdboptimize(TCTDB *\fItdb\fB, int64_t \fIbnum\fB, int8_t \fIapow\fB, int8_t \fIfpow\fB, uint8_t \fIopts\fB);\fR
771
+ .RS
772
+ `\fItdb\fR' specifies the table database object connected as a writer.
773
+ .RE
774
+ .RS
775
+ `\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.
776
+ .RE
777
+ .RS
778
+ `\fIapow\fR' specifies the size of record alignment by power of 2. If it is negative, the current setting is not changed.
779
+ .RE
780
+ .RS
781
+ `\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.
782
+ .RE
783
+ .RS
784
+ `\fIopts\fR' specifies options by bitwise-or: `TDBTLARGE' specifies that the size of the database can be larger than 2GB by using 64\-bit bucket array, `TDBTDEFLATE' specifies that each record is compressed with Deflate encoding, `TDBTBZIP' specifies that each record is compressed with BZIP2 encoding, `TDBTTCBS' specifies that each record is compressed with TCBS encoding. If it is `UINT8_MAX', the current setting is not changed.
785
+ .RE
786
+ .RS
787
+ If successful, the return value is true, else, it is false.
788
+ .RE
789
+ .RS
790
+ This function is useful to reduce the size of the database file with data fragmentation by successive updating.
791
+ .RE
792
+ .RE
793
+ .PP
794
+ The function `tctdbvanish' is used in order to remove all records of a table database object.
795
+ .PP
796
+ .RS
797
+ .br
798
+ \fBbool tctdbvanish(TCTDB *\fItdb\fB);\fR
799
+ .RS
800
+ `\fItdb\fR' specifies the table database object connected as a writer.
801
+ .RE
802
+ .RS
803
+ If successful, the return value is true, else, it is false.
804
+ .RE
805
+ .RE
806
+ .PP
807
+ The function `tctdbcopy' is used in order to copy the database file of a table database object.
808
+ .PP
809
+ .RS
810
+ .br
811
+ \fBbool tctdbcopy(TCTDB *\fItdb\fB, const char *\fIpath\fB);\fR
812
+ .RS
813
+ `\fItdb\fR' specifies the table database object.
814
+ .RE
815
+ .RS
816
+ `\fIpath\fR' specifies the path of the destination file. If it begins with `@', the trailing substring is executed as a command line.
817
+ .RE
818
+ .RS
819
+ If successful, the return value is true, else, it is false. False is returned if the executed command returns non\-zero code.
820
+ .RE
821
+ .RS
822
+ 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.
823
+ .RE
824
+ .RE
825
+ .PP
826
+ The function `tctdbtranbegin' is used in order to begin the transaction of a table database object.
827
+ .PP
828
+ .RS
829
+ .br
830
+ \fBbool tctdbtranbegin(TCTDB *\fItdb\fB);\fR
831
+ .RS
832
+ `\fItdb\fR' specifies the table database object connected as a writer.
833
+ .RE
834
+ .RS
835
+ If successful, the return value is true, else, it is false.
836
+ .RE
837
+ .RS
838
+ 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.
839
+ .RE
840
+ .RE
841
+ .PP
842
+ The function `tctdbtrancommit' is used in order to commit the transaction of a table database object.
843
+ .PP
844
+ .RS
845
+ .br
846
+ \fBbool tctdbtrancommit(TCTDB *\fItdb\fB);\fR
847
+ .RS
848
+ `\fItdb\fR' specifies the table database object connected as a writer.
849
+ .RE
850
+ .RS
851
+ If successful, the return value is true, else, it is false.
852
+ .RE
853
+ .RS
854
+ Update in the transaction is fixed when it is committed successfully.
855
+ .RE
856
+ .RE
857
+ .PP
858
+ The function `tctdbtranabort' is used in order to abort the transaction of a table database object.
859
+ .PP
860
+ .RS
861
+ .br
862
+ \fBbool tctdbtranabort(TCTDB *\fItdb\fB);\fR
863
+ .RS
864
+ `\fItdb\fR' specifies the table database object connected as a writer.
865
+ .RE
866
+ .RS
867
+ If successful, the return value is true, else, it is false.
868
+ .RE
869
+ .RS
870
+ Update in the transaction is discarded when it is aborted. The state of the database is rollbacked to before transaction.
871
+ .RE
872
+ .RE
873
+ .PP
874
+ The function `tctdbpath' is used in order to get the file path of a table database object.
875
+ .PP
876
+ .RS
877
+ .br
878
+ \fBconst char *tctdbpath(TCTDB *\fItdb\fB);\fR
879
+ .RS
880
+ `\fItdb\fR' specifies the table database object.
881
+ .RE
882
+ .RS
883
+ The return value is the path of the database file or `NULL' if the object does not connect to any database file.
884
+ .RE
885
+ .RE
886
+ .PP
887
+ The function `tctdbrnum' is used in order to get the number of records ccccof a table database object.
888
+ .PP
889
+ .RS
890
+ .br
891
+ \fBuint64_t tctdbrnum(TCTDB *\fItdb\fB);\fR
892
+ .RS
893
+ `\fItdb\fR' specifies the table database object.
894
+ .RE
895
+ .RS
896
+ The return value is the number of records or 0 if the object does not connect to any database file.
897
+ .RE
898
+ .RE
899
+ .PP
900
+ The function `tctdbfsiz' is used in order to get the size of the database file of a table database object.
901
+ .PP
902
+ .RS
903
+ .br
904
+ \fBuint64_t tctdbfsiz(TCTDB *\fItdb\fB);\fR
905
+ .RS
906
+ `\fItdb\fR' specifies the table database object.
907
+ .RE
908
+ .RS
909
+ The return value is the size of the database file or 0 if the object does not connect to any database file.
910
+ .RE
911
+ .RE
912
+ .PP
913
+ The function `tctdbsetindex' is used in order to set a column index to a table database object.
914
+ .PP
915
+ .RS
916
+ .br
917
+ \fBbool tctdbsetindex(TCTDB *\fItdb\fB, const char *\fIname\fB, int \fItype\fB);\fR
918
+ .RS
919
+ `\fItdb\fR' specifies the table database object connected as a writer.
920
+ .RE
921
+ .RS
922
+ `\fIname\fR' specifies the name of a column. If the name of an existing index is specified, the index is rebuilt. An empty string means the primary key.
923
+ .RE
924
+ .RS
925
+ `\fItype\fR' specifies the index type: `TDBITLEXICAL' for lexical string, `TDBITDECIMAL' for decimal string, `TDBITTOKEN' for token inverted index, `TDBITQGRAM' for q\-gram inverted index. If it is `TDBITOPT', the index is optimized. If it is `TDBITVOID', the index is removed. If `TDBITKEEP' is added by bitwise\-or and the index exists, this function merely returns failure.
926
+ .RE
927
+ .RS
928
+ If successful, the return value is true, else, it is false.
929
+ .RE
930
+ .RS
931
+ Note that the setting indices should be set after the database is opened.
932
+ .RE
933
+ .RE
934
+ .PP
935
+ The function `tctdbgenuid' is used in order to generate a unique ID number of a table database object.
936
+ .PP
937
+ .RS
938
+ .br
939
+ \fBint64_t tctdbgenuid(TCTDB *\fItdb\fB);\fR
940
+ .RS
941
+ `\fItdb\fR' specifies the table database object connected as a writer.
942
+ .RE
943
+ .RS
944
+ The return value is the new unique ID number or \-1 on failure.
945
+ .RE
946
+ .RE
947
+ .PP
948
+ The function `tctdbqrynew' is used in order to create a query object.
949
+ .PP
950
+ .RS
951
+ .br
952
+ \fBTDBQRY *tctdbqrynew(TCTDB *\fItdb\fB);\fR
953
+ .RS
954
+ `\fItdb\fR' specifies the table database object.
955
+ .RE
956
+ .RS
957
+ The return value is the new query object.
958
+ .RE
959
+ .RE
960
+ .PP
961
+ The function `tctdbqrydel' is used in order to delete a query object.
962
+ .PP
963
+ .RS
964
+ .br
965
+ \fBvoid tctdbqrydel(TDBQRY *\fIqry\fB);\fR
966
+ .RS
967
+ `\fIqry\fR' specifies the query object.
968
+ .RE
969
+ .RE
970
+ .PP
971
+ The function `tctdbqryaddcond' is used in order to add a narrowing condition to a query object.
972
+ .PP
973
+ .RS
974
+ .br
975
+ \fBvoid tctdbqryaddcond(TDBQRY *\fIqry\fB, const char *\fIname\fB, int \fIop\fB, const char *\fIexpr\fB);\fR
976
+ .RS
977
+ `\fIqry\fR' specifies the query object.
978
+ .RE
979
+ .RS
980
+ `\fIname\fR' specifies the name of a column. An empty string means the primary key.
981
+ .RE
982
+ .RS
983
+ `\fIop\fR' specifies an operation type: `TDBQCSTREQ' for string which is equal to the expression, `TDBQCSTRINC' for string which is included in the expression, `TDBQCSTRBW' for string which begins with the expression, `TDBQCSTREW' for string which ends with the expression, `TDBQCSTRAND' for string which includes all tokens in the expression, `TDBQCSTROR' for string which includes at least one token in the expression, `TDBQCSTROREQ' for string which is equal to at least one token in the expression, `TDBQCSTRRX' for string which matches regular expressions of the expression, `TDBQCNUMEQ' for number which is equal to the expression, `TDBQCNUMGT' for number which is greater than the expression, `TDBQCNUMGE' for number which is greater than or equal to the expression, `TDBQCNUMLT' for number which is less than the expression, `TDBQCNUMLE' for number which is less than or equal to the expression, `TDBQCNUMBT' for number which is between two tokens of the expression, `TDBQCNUMOREQ' for number which is equal to at least one token in the expression, `TDBQCFTSPH' for full\-text search with the phrase of the expression, `TDBQCFTSAND' for full\-text search with all tokens in the expression, `TDBQCFTSOR' for full\-text search with at least one token in the expression, `TDBQCFTSEX' for full\-text search with the compound expression. All operations can be flagged by bitwise\-or: `TDBQCNEGATE' for negation, `TDBQCNOIDX' for using no index.
984
+ .RE
985
+ .RS
986
+ `\fIexpr\fR' specifies an operand exression.
987
+ .RE
988
+ .RE
989
+ .PP
990
+ The function `tctdbqrysetorder' is used in order to set the order of a query object.
991
+ .PP
992
+ .RS
993
+ .br
994
+ \fBvoid tctdbqrysetorder(TDBQRY *\fIqry\fB, const char *\fIname\fB, int \fItype\fB);\fR
995
+ .RS
996
+ `\fIqry\fR' specifies the query object.
997
+ .RE
998
+ .RS
999
+ `\fIname\fR' specifies the name of a column. An empty string means the primary key.
1000
+ .RE
1001
+ .RS
1002
+ `\fItype\fR' specifies the order type: `TDBQOSTRASC' for string ascending, `TDBQOSTRDESC' for string descending, `TDBQONUMASC' for number ascending, `TDBQONUMDESC' for number descending.
1003
+ .RE
1004
+ .RE
1005
+ .PP
1006
+ The function `tctdbqrysetlimit' is used in order to set the limit number of records of the result of a query object.
1007
+ .PP
1008
+ .RS
1009
+ .br
1010
+ \fBvoid tctdbqrysetlimit(TDBQRY *\fIqry\fB, int \fImax\fB, int \fIskip\fB);\fR
1011
+ .RS
1012
+ `\fIqry\fR' specifies the query object.
1013
+ .RE
1014
+ .RS
1015
+ `\fImax\fR' specifies the maximum number of records of the result. If it is negative, no limit is specified.
1016
+ .RE
1017
+ .RS
1018
+ `\fIskip\fR' specifies the number of skipped records of the result. If it is not more than 0, no record is skipped.
1019
+ .RE
1020
+ .RE
1021
+ .PP
1022
+ The function `tctdbqrysearch' is used in order to execute the search of a query object.
1023
+ .PP
1024
+ .RS
1025
+ .br
1026
+ \fBTCLIST *tctdbqrysearch(TDBQRY *\fIqry\fB);\fR
1027
+ .RS
1028
+ `\fIqry\fR' specifies the query object.
1029
+ .RE
1030
+ .RS
1031
+ The return value is a list object of the primary keys of the corresponding records. This function does never fail. It returns an empty list even if no record corresponds.
1032
+ .RE
1033
+ .RS
1034
+ 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.
1035
+ .RE
1036
+ .RE
1037
+ .PP
1038
+ The function `tctdbqrysearchout' is used in order to remove each record corresponding to a query object.
1039
+ .PP
1040
+ .RS
1041
+ .br
1042
+ \fBbool tctdbqrysearchout(TDBQRY *\fIqry\fB);\fR
1043
+ .RS
1044
+ `\fIqry\fR' specifies the query object of the database connected as a writer.
1045
+ .RE
1046
+ .RS
1047
+ If successful, the return value is true, else, it is false.
1048
+ .RE
1049
+ .RE
1050
+ .PP
1051
+ The function `tctdbqryproc' is used in order to process each record corresponding to a query object.
1052
+ .PP
1053
+ .RS
1054
+ .br
1055
+ \fBbool tctdbqryproc(TDBQRY *\fIqry\fB, TDBQRYPROC \fIproc\fB, void *\fIop\fB);\fR
1056
+ .RS
1057
+ `\fIqry\fR' specifies the query object of the database connected as a writer.
1058
+ .RE
1059
+ .RS
1060
+ `\fIproc\fR' specifies the pointer to the iterator function called for each record. It receives four parameters. The first parameter is the pointer to the region of the primary key. The second parameter is the size of the region of the primary key. The third parameter is a map object containing columns. The fourth parameter is the pointer to the optional opaque object. It returns flags of the post treatment by bitwise-or: `TDBQPPUT' to modify the record, `TDBQPOUT' to remove the record, `TDBQPSTOP' to stop the iteration.
1061
+ .RE
1062
+ .RS
1063
+ `\fIop\fR' specifies an arbitrary pointer to be given as a parameter of the iterator function. If it is not needed, `NULL' can be specified.
1064
+ .RE
1065
+ .RS
1066
+ If successful, the return value is true, else, it is false.
1067
+ .RE
1068
+ .RE
1069
+ .PP
1070
+ The function `tctdbqryhint' is used in order to get the hint string of a query object.
1071
+ .PP
1072
+ .RS
1073
+ .br
1074
+ \fBconst char *tctdbqryhint(TDBQRY *\fIqry\fB);\fR
1075
+ .RS
1076
+ `\fIqry\fR' specifies the query object.
1077
+ .RE
1078
+ .RS
1079
+ The return value is the hint string.
1080
+ .RE
1081
+ .RE
1082
+ .PP
1083
+ The function `tctdbmetasearch' is used in order to retrieve records with multiple query objects and get the set of the result.
1084
+ .PP
1085
+ .RS
1086
+ .br
1087
+ \fBTCLIST *tctdbmetasearch(TDBQRY **\fIqrys\fB, int \fInum\fB, int \fItype\fB);\fR
1088
+ .RS
1089
+ `\fIqrys\fR' specifies an array of the query objects.
1090
+ .RE
1091
+ .RS
1092
+ `\fInum\fR' specifies the number of elements of the array.
1093
+ .RE
1094
+ .RS
1095
+ `\fItype\fR' specifies a set operation type: `TDBMSUNION' for the union set, `TDBMSISECT' for the intersection set, `TDBMSDIFF' for the difference set.
1096
+ .RE
1097
+ .RS
1098
+ The return value is a list object of the primary keys of the corresponding records. This function does never fail. It returns an empty list even if no record corresponds.
1099
+ .RE
1100
+ .RS
1101
+ If the first query object has the order setting, the result array is sorted by the order. 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.
1102
+ .RE
1103
+ .RE
1104
+
1105
+ .SH SEE ALSO
1106
+ .PP
1107
+ .BR tcttest (1),
1108
+ .BR tctmttest (1),
1109
+ .BR tctmgr (1),
1110
+ .BR tokyocabinet (3)