📄 spex-en.html
字号:
<dl class="api"><dt><code>void tcmapputcat(TCMAP *<var>map</var>, const void *<var>kbuf</var>, int <var>ksiz</var>, const void *<var>vbuf</var>, int <var>vsiz</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>vbuf</var>' specifies the pointer to the region of the value.</dd><dd>`<var>vsiz</var>' specifies the size of the region of the value.</dd><dd>If there is no corresponding record, a new record is created.</dd></dl><p>The function `tcmapputcat2' is used in order to concatenate a string value at the end of the value of the existing record in a map object.</p><dl class="api"><dt><code>void tcmapputcat2(TCMAP *<var>map</var>, const char *<var>kstr</var>, const char *<var>vstr</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>kstr</var>' specifies the string of the key.</dd><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 `tcmapget3' is used in order to retrieve a semivolatile record in a map object.</p><dl class="api"><dt><code>const void *tcmapget3(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. The internal region of the returned record is moved to the tail so that the record will survive for a time under LRU cache algorithm removing records from the head.</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 head if it is true or 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 head if it is true or 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 `tcmapiterval' is used in order to get the value bound to the key fetched from the iterator of a map object.</p><dl class="api"><dt><code>const void *tcmapiterval(const void *<var>kbuf</var>, int *<var>sp</var>);</code></dt><dd>`<var>kbuf</var>' specifies the pointer to the region of the iteration 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>The return value is the pointer to the region of the value of the corresponding record.</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 `tcmapiterval2' is used in order to get the value string bound to the key fetched from the iterator of a map object.</p><dl class="api"><dt><code>const char *tcmapiterval2(const char *<var>kstr</var>);</code></dt><dd>`<var>kstr</var>' specifies the string of the iteration key.</dd><dd>The return value is the pointer to the region of the value of the corresponding record.</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 `tcmapkeys2' is used in order to create an array of strings of all keys in a map object.</p><dl class="api"><dt><code>const char **tcmapkeys2(const TCMAP *<var>map</var>, int *<var>np</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>np</var>' specifies the pointer to a variable into which the number of elements of the return value is assigned.</dd><dd>The return value is the pointer to the array of all string keys in the map object.</dd><dd>Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if when is no longer in use. Note that elements of the array point to the inner objects, whose life duration is synchronous with the map object.</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 `tcmapvals2' is used in order to create an array of strings of all values in a map object.</p><dl class="api"><dt><code>const char **tcmapvals2(const TCMAP *<var>map</var>, int *<var>np</var>);</code></dt><dd>`<var>map</var>' specifies the map object.</dd><dd>`<var>np</var>' specifies the pointer to a variable into which the number of elements of the return value is assigned.</dd><dd>The return value is the pointer to the array of all string values in the map object.</dd><dd>Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if when is no longer in use. Note that elements of the array point to the inner objects, whose life duration is synchronous with the map object.</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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -