📄 hoge
字号:
`\fImap\fR' specifies the map object..RE.RSThe return value is the new list object containing all keys in the map 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 `tcmapkeys2' is used in order to create an array of strings of all keys in a map object..PP.RS.br\fBconst char **tcmapkeys2(const TCMAP *\fImap\fB, int *\fInp\fB);\fR.RS`\fImap\fR' specifies the map object..RE.RS`\fInp\fR' specifies the pointer to a variable into which the number of elements of the return value is assigned..RE.RSThe return value is the pointer to the array of all string keys in the map object..RE.RSBecause 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..RE.RE.PPThe function `tcmapvals' is used in order to create a list object containing all values in a map object..PP.RS.br\fBTCLIST *tcmapvals(const TCMAP *\fImap\fB);\fR.RS`\fImap\fR' specifies the map object..RE.RSThe return value is the new list object containing all values in the map 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 `tcmapvals2' is used in order to create an array of strings of all values in a map object..PP.RS.br\fBconst char **tcmapvals2(const TCMAP *\fImap\fB, int *\fInp\fB);\fR.RS`\fImap\fR' specifies the map object..RE.RS`\fInp\fR' specifies the pointer to a variable into which the number of elements of the return value is assigned..RE.RSThe return value is the pointer to the array of all string values in the map object..RE.RSBecause 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..RE.RE.PPThe function `tcmapaddint' is used in order to add an integer to a record in a map object..PP.RS.br\fBint tcmapaddint(TCMAP *\fImap\fB, const void *\fIkbuf\fB, int \fIksiz\fB, int \fInum\fB);\fR.RS`\fImap\fR' specifies the map 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 `tcmapadddouble' is used in order to add a real number to a record in a map object..PP.RS.br\fBdouble tcmapadddouble(TCMAP *\fImap\fB, const void *\fIkbuf\fB, int \fIksiz\fB, double \fInum\fB);\fR.RS`\fImap\fR' specifies the map 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 `tcmapclear' is used in order to clear a map object..PP.RS.br\fBvoid tcmapclear(TCMAP *\fImap\fB);\fR.RS`\fImap\fR' specifies the map object..RE.RSAll records are removed..RE.RE.PPThe function `tcmapcutfront' is used in order to remove front records of a map object..PP.RS.br\fBvoid tcmapcutfront(TCMAP *\fImap\fB, int \fInum\fB);\fR.RS`\fImap\fR' specifies the map object..RE.RS`\fInum\fR' specifies the number of records to be removed..RE.RE.PPThe function `tcmapdump' is used in order to serialize a map object into a byte array..PP.RS.br\fBvoid *tcmapdump(const TCMAP *\fImap\fB, int *\fIsp\fB);\fR.RS`\fImap\fR' specifies the map 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 `tcmapload' is used in order to create a map object from a serialized byte array..PP.RS.br\fBTCMAP *tcmapload(const void *\fIptr\fB, int \fIsize\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.RSThe return value is a new map object..RE.RSBecause 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..RE.RE.PPThe function `tcmaploadone' is used in order to extract a map record from a serialized byte array..PP.RS.br\fBvoid *tcmaploadone(const void *\fIptr\fB, int \fIsize\fB, const void *\fIkbuf\fB, int \fIksiz\fB, int *\fIsp\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`\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.SH API OF ORDERED TREE.PPThe function `tctreenew' is used in order to create a tree object..PP.RS.br\fBTCTREE *tctreenew(void);\fR.RSThe return value is the new tree object..RE.RE.PPThe function `tctreenew2' is used in order to create a tree object with specifying the custom comparison function..PP.RS.br\fBTCTREE *tctreenew2(TREECMP \fIcmp\fB, void *\fIcmpop\fB);\fR.RS`\fIcmp\fR' specifies the pointer to the custom comparison function..RE.RS`\fIcmpop\fR' specifies an arbitrary pointer to be given as a parameter of the comparison function. If it is not needed, `NULL' can be specified..RE.RSThe return value is the new tree object..RE.RSThe default comparison function compares keys of two records by lexical order. The functions `tctreecmplexical' (dafault), `tctreecmpdecimal', `tctreecmpint32', and `tctreecmpint64' are built\-in..RE.RE.PPThe function `tctreedup' is used in order to copy a tree object..PP.RS.br\fBTCTREE *tctreedup(const TCTREE *\fItree\fB);\fR.RS`\fItree\fR' specifies the tree object..RE.RSThe return value is the new tree object equivalent to the specified object..RE.RE.PPThe function `tctreedel' is used in order to delete a tree object..PP.RS.br\fBvoid tctreedel(TCTREE *\fItree\fB);\fR.RS`tree' specifies the tree object..RE.RSNote that the deleted object and its derivatives can not be used anymore..RE.RE.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 th
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -