⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spex-en.html

📁 Tokyo Cabinet的Tokyo Cabinet 是一个DBM的实现。这里的数据库由一系列key-value对的记录构成。key和value都可以是任意长度的字节序列,既可以是二进制也可以是字符
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<dd>`<var>vstr</var>' specifies the string of the value.</dd><dd>If there is no corresponding record, a new record is created.</dd></dl><p>The function `tcmapout' is used in order to remove a record of a map object.</p><dl class="api"><dt><code>bool tcmapout(TCMAP *<var>map</var>, const void *<var>kbuf</var>, int <var>ksiz</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>kbuf</var>' specifies the pointer to the region of the key.</dd><dd>`<var>ksiz</var>' specifies the size of the region of the key.</dd><dd>If successful, the return value is true.  False is returned when no record corresponds to the specified key.</dd></dl><p>The function `tcmapout2' is used in order to remove a string record of a map object.</p><dl class="api"><dt><code>bool tcmapout2(TCMAP *<var>map</var>, const char *<var>kstr</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>kstr</var>' specifies the string of the key.</dd><dd>If successful, the return value is true.  False is returned when no record corresponds to the specified key.</dd></dl><p>The function `tcmapget' is used in order to retrieve a record in a map object.</p><dl class="api"><dt><code>const void *tcmapget(const TCMAP *<var>map</var>, const void *<var>kbuf</var>, int <var>ksiz</var>, int *<var>sp</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>kbuf</var>' specifies the pointer to the region of the key.</dd><dd>`<var>ksiz</var>' specifies the size of the region of the key.</dd><dd>`<var>sp</var>' specifies the pointer to the variable into which the size of the region of the return value is assigned.</dd><dd>If successful, the return value is the pointer to the region of the value of the corresponding record.  `NULL' is returned when no record corresponds.</dd><dd>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.</dd></dl><p>The function `tcmapget2' is used in order to retrieve a string record in a map object.</p><dl class="api"><dt><code>const char *tcmapget2(const TCMAP *<var>map</var>, const char *<var>kstr</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>kstr</var>' specifies the string of the key.</dd><dd>If successful, the return value is the string of the value of the corresponding record.  `NULL' is returned when no record corresponds.</dd></dl><p>The function `tcmapmove' is used in order to move a record to the edge of a map object.</p><dl class="api"><dt><code>bool tcmapmove(TCMAP *<var>map</var>, const void *<var>kbuf</var>, int <var>ksiz</var>, bool <var>head</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>kbuf</var>' specifies the pointer to the region of a key.</dd><dd>`<var>ksiz</var>' specifies the size of the region of the key.</dd><dd>`<var>head</var>' specifies the destination which is the head if it is true or the tail if else.</dd><dd>If successful, the return value is true.  False is returned when no record corresponds to the specified key.</dd></dl><p>The function `tcmapmove2' is used in order to move a string record to the edge of a map object.</p><dl class="api"><dt><code>bool tcmapmove2(TCMAP *<var>map</var>, const char *<var>kstr</var>, bool <var>head</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>kstr</var>' specifies the string of a key.</dd><dd>`<var>head</var>' specifies the destination which is the head if it is true or the tail if else.</dd><dd>If successful, the return value is true.  False is returned when no record corresponds to the specified key.</dd></dl><p>The function `tcmapiterinit' is used in order to initialize the iterator of a map object.</p><dl class="api"><dt><code>void tcmapiterinit(TCMAP *<var>map</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>The iterator is used in order to access the key of every record stored in the map object.</dd></dl><p>The function `tcmapiternext' is used in order to get the next key of the iterator of a map object.</p><dl class="api"><dt><code>const void *tcmapiternext(TCMAP *<var>map</var>, int *<var>sp</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>sp</var>' specifies the pointer to the variable into which the size of the region of the return value is assigned.</dd><dd>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 can be fetched from the iterator.</dd><dd>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.  The order of iteration is assured to be the same as the stored order.</dd></dl><p>The function `tcmapiternext2' is used in order to get the next key string of the iterator of a map object.</p><dl class="api"><dt><code>const char *tcmapiternext2(TCMAP *<var>map</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>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 can be fetched from the iterator.</dd><dd>The order of iteration is assured to be the same as the stored order.</dd></dl><p>The function `tcmaprnum' is used in order to get the number of records stored in a map object.</p><dl class="api"><dt><code>uint64_t tcmaprnum(const TCMAP *<var>map</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>The return value is the number of the records stored in the map object.</dd></dl><p>The function `tcmapmsiz' is used in order to get the total size of memory used in a map object.</p><dl class="api"><dt><code>uint64_t tcmapmsiz(const TCMAP *<var>map</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>The return value is the total size of memory used in a map object.</dd></dl><p>The function `tcmapkeys' is used in order to create a list object containing all keys in a map object.</p><dl class="api"><dt><code>TCLIST *tcmapkeys(const TCMAP *<var>map</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>The return value is the new list object containing all keys in the map object.</dd><dd>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.</dd></dl><p>The function `tcmapvals' is used in order to create a list object containing all values in a map object.</p><dl class="api"><dt><code>TCLIST *tcmapvals(const TCMAP *<var>map</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>The return value is the new list object containing all values in the map object.</dd><dd>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.</dd></dl><p>The function `tcmapaddint' is used in order to add an integer to a record in a map object.</p><dl class="api"><dt><code>int tcmapaddint(TCMAP *<var>map</var>, const void *<var>kbuf</var>, int <var>ksiz</var>, int <var>num</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>kbuf</var>' specifies the pointer to the region of the key.</dd><dd>`<var>ksiz</var>' specifies the size of the region of the key.</dd><dd>`<var>num</var>' specifies the additional value.</dd><dd>The return value is the summation value.</dd><dd>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.</dd></dl><p>The function `tcmapadddouble' is used in order to add a real number to a record in a map object.</p><dl class="api"><dt><code>double tcmapadddouble(TCMAP *<var>map</var>, const void *<var>kbuf</var>, int <var>ksiz</var>, double <var>num</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>kbuf</var>' specifies the pointer to the region of the key.</dd><dd>`<var>ksiz</var>' specifies the size of the region of the key.</dd><dd>`<var>num</var>' specifies the additional value.</dd><dd>The return value is the summation value.</dd><dd>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.</dd></dl><p>The function `tcmapclear' is used in order to clear a map object.</p><dl class="api"><dt><code>void tcmapclear(TCMAP *<var>map</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>All records are removed.</dd></dl><p>The function `tcmapcutfront' is used in order to remove front records of a map object.</p><dl class="api"><dt><code>void tcmapcutfront(TCMAP *<var>map</var>, int <var>num</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>num</var>' specifies the number of records to be removed.</dd></dl><p>The function `tcmapdump' is used in order to serialize a map object into a byte array.</p><dl class="api"><dt><code>void *tcmapdump(const TCMAP *<var>map</var>, int *<var>sp</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>sp</var>' specifies the pointer to the variable into which the size of the region of the return value is assigned.</dd><dd>The return value is the pointer to the region of the result serial region.</dd><dd>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.</dd></dl><p>The function `tcmapload' is used in order to create a map object from a serialized byte array.</p><dl class="api"><dt><code>TCMAP *tcmapload(const void *<var>ptr</var>, int <var>size</var>);</code></dt><dd>`<var>ptr</var>' specifies the pointer to the region of serialized byte array.</dd><dd>`<var>size</var>' specifies the size of the region.</dd><dd>The return value is a new map object.</dd><dd>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.</dd></dl><h3 id="tcutilapi_treeapi">API of Ordered Tree</h3><p>The function `tctreenew' is used in order to create a tree object.</p><dl class="api"><dt><code>TCTREE *tctreenew(void);</code></dt><dd>The return value is the new tree object.</dd></dl><p>The function `tctreenew2' is used in order to create a tree object with specifying the custom comparison function.</p><dl class="api"><dt><code>TCTREE *tctreenew2(TCCMP <var>cmp</var>, void *<var>cmpop</var>);</code></dt><dd>`<var>cmp</var>' specifies the pointer to the custom comparison function.  It receives five parameters.  The first parameter is the pointer to the region of one key.  The second parameter is the size of the region of one key.  The third parameter is the pointer to the region of the other key.  The fourth parameter is the size of the region of the other key.  The fifth parameter is the pointer to the optional opaque object.  It returns positive if the former is big, negative if the latter is big, 0 if both are equivalent.</dd><dd>`<var>cmpop</var>' specifies an arbitrary pointer to be given as a parameter of the comparison function.  If it is not needed, `NULL' can be specified.</dd><dd>The return value is the new tree object.</dd><dd>The default comparison function compares keys of two records by lexical order.  The functions `tccmplexical' (dafault), `tccmpdecimal', `tccmpint32', and `tccmpint64' are built

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -