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

📄 tcutil.3

📁 Tokyo Cabinet的Tokyo Cabinet 是一个DBM的实现。这里的数据库由一系列key-value对的记录构成。key和value都可以是任意长度的字节序列,既可以是二进制也可以是字符
💻 3
📖 第 1 页 / 共 5 页
字号:
.PPThe function `tctreeput' is used in order to store a record into a tree object..PP.RS.br\fBvoid tctreeput(TCTREE *\fItree\fB, const void *\fIkbuf\fB, int \fIksiz\fB, const void *\fIvbuf\fB, int \fIvsiz\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the key..RE.RS`\fIksiz\fR' specifies the size of the region of the key..RE.RS`\fIvbuf\fR' specifies the pointer to the region of the value..RE.RS`\fIvsiz\fR' specifies the size of the region of the value..RE.RSIf a record with the same key exists in the tree, it is overwritten..RE.RE.PPThe function `tctreeput2' is used in order to store a string record into a tree object..PP.RS.br\fBvoid tctreeput2(TCTREE *\fItree\fB, const char *\fIkstr\fB, const char *\fIvstr\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkstr\fR' specifies the string of the key..RE.RS`\fIvstr\fR' specifies the string of the value..RE.RSIf a record with the same key exists in the tree, it is overwritten..RE.RE.PPThe function `tctreeputkeep' is used in order to store a new record into a tree object..PP.RS.br\fBbool tctreeputkeep(TCTREE *\fItree\fB, const void *\fIkbuf\fB, int \fIksiz\fB, const void *\fIvbuf\fB, int \fIvsiz\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the key..RE.RS`\fIksiz\fR' specifies the size of the region of the key..RE.RS`\fIvbuf\fR' specifies the pointer to the region of the value..RE.RS`\fIvsiz\fR' specifies the size of the region of the value..RE.RSIf successful, the return value is true, else, it is false..RE.RSIf a record with the same key exists in the tree, this function has no effect..RE.RE.PPThe function `tctreeputkeep2' is used in order to store a new string record into a tree object..PP.RS.br\fBbool tctreeputkeep2(TCTREE *\fItree\fB, const char *\fIkstr\fB, const char *\fIvstr\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkstr\fR' specifies the string of the key..RE.RS`\fIvstr\fR' specifies the string of the value..RE.RSIf successful, the return value is true, else, it is false..RE.RSIf a record with the same key exists in the tree, this function has no effect..RE.RE.PPThe function `tctreeputcat' is used in order to concatenate a value at the end of the value of the existing record in a tree object..PP.RS.br\fBvoid tctreeputcat(TCTREE *\fItree\fB, const void *\fIkbuf\fB, int \fIksiz\fB, const void *\fIvbuf\fB, int \fIvsiz\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the key..RE.RS`\fIksiz\fR' specifies the size of the region of the key..RE.RS`\fIvbuf\fR' specifies the pointer to the region of the value..RE.RS`\fIvsiz\fR' specifies the size of the region of the value..RE.RSIf there is no corresponding record, a new record is created..RE.RE.PPThe function `tctreeputcat2' is used in order to concatenate a string value at the end of the value of the existing record in a tree object..PP.RS.br\fBvoid tctreeputcat2(TCTREE *\fItree\fB, const char *\fIkstr\fB, const char *\fIvstr\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkstr\fR' specifies the string of the key..RE.RS`\fIvstr\fR' specifies the string of the value..RE.RSIf there is no corresponding record, a new record is created..RE.RE.PPThe function `tctreeout' is used in order to remove a record of a tree object..PP.RS.br\fBbool tctreeout(TCTREE *\fItree\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the key..RE.RS`\fIksiz\fR' specifies the size of the region of the key..RE.RSIf successful, the return value is true.  False is returned when no record corresponds to the specified key..RE.RE.PPThe function `tctreeout2' is used in order to remove a string record of a tree object..PP.RS.br\fBbool tctreeout2(TCTREE *\fItree\fB, const char *\fIkstr\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkstr\fR' specifies the string of the key..RE.RSIf successful, the return value is true.  False is returned when no record corresponds to the specified key..RE.RE.PPThe function `tctreeget' is used in order to retrieve a record in a tree object..PP.RS.br\fBconst void *tctreeget(TCTREE *\fItree\fB, const void *\fIkbuf\fB, int \fIksiz\fB, int *\fIsp\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the key..RE.RS`\fIksiz\fR' specifies the size of the region of the key..RE.RS`\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return value is assigned..RE.RSIf successful, the return value is the pointer to the region of the value of the corresponding record.  `NULL' is returned when no record corresponds..RE.RSBecause 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..RE.RE.PPThe function `tctreeget2' is used in order to retrieve a string record in a tree object..PP.RS.br\fBconst char *tctreeget2(TCTREE *\fItree\fB, const char *\fIkstr\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkstr\fR' specifies the string of the key..RE.RSIf successful, the return value is the string of the value of the corresponding record.  `NULL' is returned when no record corresponds..RE.RE.PPThe function `tctreeiterinit' is used in order to initialize the iterator of a tree object..PP.RS.br\fBvoid tctreeiterinit(TCTREE *\fItree\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RSThe iterator is used in order to access the key of every record stored in the tree object..RE.RE.PPThe function `tctreeiterinit2' is used in order to initialize the iterator of a tree object in front of records corresponding a key..PP.RS.br\fBvoid tctreeiterinit2(TCTREE *\fItree\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the key..RE.RS`\fIksiz\fR' specifies the size of the region of the key..RE.RSThe iterator is set to the first record corresponding the key or the next substitute if completely matching record does not exist..RE.RE.PPThe function `tctreeiterinit3' is used in order to initialize the iterator of a tree object in front of records corresponding a key string..PP.RS.br\fBvoid tctreeiterinit3(TCTREE *\fItree\fB, const char *\fIkstr\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkstr\fR' specifies the string of the key..RE.RSThe iterator is set to the first record corresponding the key or the next substitute if completely matching record does not exist..RE.RE.PPThe function `tctreeiternext' is used in order to get the next key of the iterator of a tree object..PP.RS.br\fBconst void *tctreeiternext(TCTREE *\fItree\fB, int *\fIsp\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return value is assigned..RE.RSIf 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..RE.RSBecause 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 ascending of the keys..RE.RE.PPThe function `tctreeiternext2' is used in order to get the next key string of the iterator of a tree object..PP.RS.br\fBconst char *tctreeiternext2(TCTREE *\fItree\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RSIf 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..RE.RSThe order of iteration is assured to be ascending of the keys..RE.RE.PPThe function `tctreernum' is used in order to get the number of records stored in a tree object..PP.RS.br\fBuint64_t tctreernum(const TCTREE *\fItree\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RSThe return value is the number of the records stored in the tree object..RE.RE.PPThe function `tctreemsiz' is used in order to get the total size of memory used in a tree object..PP.RS.br\fBuint64_t tctreemsiz(const TCTREE *\fItree\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RSThe return value is the total size of memory used in a tree object..RE.RE.PPThe function `tctreekeys' is used in order to create a list object containing all keys in a tree object..PP.RS.br\fBTCLIST *tctreekeys(const TCTREE *\fItree\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RSThe return value is the new list object containing all keys in the tree object..RE.RSBecause 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..RE.RE.PPThe function `tctreevals' is used in order to create a list object containing all values in a tree object..PP.RS.br\fBTCLIST *tctreevals(const TCTREE *\fItree\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RSThe return value is the new list object containing all values in the tree object..RE.RSBecause 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..RE.RE.PPThe function `tctreeaddint' is used in order to add an integer to a record in a tree object..PP.RS.br\fBint tctreeaddint(TCTREE *\fItree\fB, const void *\fIkbuf\fB, int \fIksiz\fB, int \fInum\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the key..RE.RS`\fIksiz\fR' specifies the size of the region of the key..RE.RS`\fInum\fR' specifies the additional value..RE.RSThe return value is the summation value..RE.RSIf 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..RE.RE.PPThe function `tctreeadddouble' is used in order to add a real number to a record in a tree object..PP.RS.br\fBdouble tctreeadddouble(TCTREE *\fItree\fB, const void *\fIkbuf\fB, int \fIksiz\fB, double \fInum\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the key..RE.RS`\fIksiz\fR' specifies the size of the region of the key..RE.RS`\fInum\fR' specifies the additional value..RE.RSThe return value is the summation value..RE.RSIf 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..RE.RE.PPThe function `tctreeclear' is used in order to clear a tree object..PP.RS.br\fBvoid tctreeclear(TCTREE *\fItree\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RSAll records are removed..RE.RE.PPThe function `tctreecutfringe' is used in order to remove fringe records of a tree object..PP.RS.br\fBvoid tctreecutfringe(TCTREE *\fItree\fB, int \fInum\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fInum\fR' specifies the number of records to be removed..RE.RE.PPThe function `tctreedump' is used in order to serialize a tree object into a byte array..PP.RS.br\fBvoid *tctreedump(const TCTREE *\fItree\fB, int *\fIsp\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RS`\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return value is assigned..RE.RSThe return value is the pointer to the region of the result serial region..RE.RSBecause 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..RE.RE.PPThe function `tctreeload' is used in order to create a tree object from a serialized byte array..PP.RS.br\fBTCTREE *tctreeload(const void *\fIptr\fB, int \fIsize\fB, TCCMP \fIcmp\fB, void *\fIcmpop\fB);\fR.RS`\fIptr\fR' specifies the pointer to the region of serialized byte array..RE.RS`\fIsize\fR' specifies the size of the region..RE.RS`\fIcmp\fR' specifies the pointer to the custom comparison function..RE.RS

⌨️ 快捷键说明

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