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

📄 tcutil.3

📁 高性能嵌入式数据库在高并发的环境下使用最好是64位系统比较好
💻 3
📖 第 1 页 / 共 5 页
字号:
.RE.RE.PPThe function `tcmdbget3' is used in order to retrieve a record and move it astern in an on\-memory hash database object..PP.RS.br\fBvoid *tcmdbget3(TCMDB *\fImdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, int *\fIsp\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database 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.  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.  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..RE.RE.PPThe function `tcmdbvsiz' is used in order to get the size of the value of a record in an on\-memory hash database object..PP.RS.br\fBint tcmdbvsiz(TCMDB *\fImdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database 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 the size of the value of the corresponding record, else, it is \-1..RE.RE.PPThe function `tcmdbvsiz2' is used in order to get the size of the value of a string record in an on\-memory hash database object..PP.RS.br\fBint tcmdbvsiz2(TCMDB *\fImdb\fB, const char *\fIkstr\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database object..RE.RS`\fIkstr\fR' specifies the string of the key..RE.RSIf successful, the return value is the size of the value of the corresponding record, else, it is \-1..RE.RE.PPThe function `tcmdbiterinit' is used in order to initialize the iterator of an on\-memory hash database object..PP.RS.br\fBvoid tcmdbiterinit(TCMDB *\fImdb\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database object..RE.RSThe iterator is used in order to access the key of every record stored in the on\-memory hash database..RE.RE.PPThe function `tcmdbiternext' is used in order to get the next key of the iterator of an on\-memory hash database object..PP.RS.br\fBvoid *tcmdbiternext(TCMDB *\fImdb\fB, int *\fIsp\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database object..RE.RS`\fIsp\fR' specifies the pointer to the variable into which the size of the region of the return.RE.RSvalue 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.  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.  The order of iteration is assured to be the same as the stored order..RE.RE.PPThe function `tcmdbiternext2' is used in order to get the next key string of the iterator of an on\-memory hash database object..PP.RS.br\fBchar *tcmdbiternext2(TCMDB *\fImdb\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database 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.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.  The order of iteration is assured to be the same as the stored order..RE.RE.PPThe function `tcmdbfwmkeys' is used in order to get forward matching keys in an on\-memory hash database object..PP.RS.br\fBTCLIST *tcmdbfwmkeys(TCMDB *\fImdb\fB, const void *\fIpbuf\fB, int \fIpsiz\fB, int \fImax\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database object..RE.RS`\fIpbuf\fR' specifies the pointer to the region of the prefix..RE.RS`\fIpsiz\fR' specifies the size of the region of the prefix..RE.RS`\fImax\fR' specifies the maximum number of keys to be fetched.  If it is negative, no limit is specified..RE.RSThe return value is a list object of the corresponding keys.  This function does never fail and return an empty list even if no key corresponds..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.  Note that this function may be very slow because every key in the database is scanned..RE.RE.PPThe function `tcmdbfwmkeys2' is used in order to get forward matching string keys in an on\-memory hash database object..PP.RS.br\fBTCLIST *tcmdbfwmkeys2(TCMDB *\fImdb\fB, const char *\fIpstr\fB, int \fImax\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database object..RE.RS`\fIpstr\fR' specifies the string of the prefix..RE.RS`\fImax\fR' specifies the maximum number of keys to be fetched.  If it is negative, no limit is specified..RE.RSThe return value is a list object of the corresponding keys.  This function does never fail and return an empty list even if no key corresponds..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.  Note that this function may be very slow because every key in the database is scanned..RE.RE.PPThe function `tcmdbrnum' is used in order to get the number of records stored in an on\-memory hash database object..PP.RS.br\fBuint64_t tcmdbrnum(TCMDB *\fImdb\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database object..RE.RSThe return value is the number of the records stored in the database..RE.RE.PPThe function `tcmdbmsiz' is used in order to get the total size of memory used in an on\-memory hash database object..PP.RS.br\fBuint64_t tcmdbmsiz(TCMDB *\fImdb\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database object..RE.RSThe return value is the total size of memory used in the database..RE.RE.PPThe function `tcmdbaddint' is used in order to add an integer to a record in an on\-memory hash database object..PP.RS.br\fBint tcmdbaddint(TCMDB *\fImdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, int \fInum\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database 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 `tcmdbadddouble' is used in order to add a real number to a record in an on\-memory hash database object..PP.RS.br\fBdouble tcmdbadddouble(TCMDB *\fImdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, double \fInum\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database 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 `tcmdbvanish' is used in order to clear an on\-memory hash database object..PP.RS.br\fBvoid tcmdbvanish(TCMDB *\fImdb\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database object..RE.RSAll records are removed..RE.RE.PPThe function `tcmdbcutfront' is used in order to remove front records of an on\-memory hash database object..PP.RS.br\fBvoid tcmdbcutfront(TCMDB *\fImdb\fB, int \fInum\fB);\fR.RS`\fImdb\fR' specifies the on\-memory hash database object..RE.RS`\fInum\fR' specifies the number of records to be removed..RE.RE.SH API OF MEMORY POOL.PPThe function `tcmpoolnew' is used in order to create a memory pool object..PP.RS.br\fBTCMPOOL *tcmpoolnew(void);\fR.RSThe return value is the new memory pool object..RE.RE.PPThe function `tcmpooldel' is used in order to delete a memory pool object..PP.RS.br\fBvoid tcmpooldel(TCMPOOL *\fImpool\fB);\fR.RS`\fImpool\fR' specifies the memory pool object..RE.RSNote that the deleted object and its derivatives can not be used anymore..RE.RE.PPThe function `tcmpoolput' is used in order to relegate an arbitrary object to a memory pool object..PP.RS.br\fBvoid tcmpoolput(TCMPOOL *\fImpool\fB, void *\fIptr\fB, void (*\fIdel\fB)(void *));\fR.RS`\fImpool\fR' specifies the memory pool object..RE.RS`\fIptr\fR' specifies the pointer to the object to be relegated..RE.RS`\fIdel\fR' specifies the pointer to the function to delete the object..RE.RSThis function assures that the specified object is deleted when the memory pool object is deleted..RE.RE.PPThe function `tcmpoolputptr' is used in order to relegate an allocated region to a memory pool object..PP.RS.br\fBvoid tcmpoolputptr(TCMPOOL *\fImpool\fB, void *\fIptr\fB);\fR.RS`\fIptr\fR' specifies the pointer to the region to be relegated..RE.RSThis function assures that the specified region is released when the memory pool object is deleted..RE.RE.PPThe function `tcmpoolputxstr' is used in order to relegate an extensible string object to a memory pool object..PP.RS.br\fBvoid tcmpoolputxstr(TCMPOOL *\fImpool\fB, TCXSTR *\fIxstr\fB);\fR.RS`\fImpool\fR' specifies the memory pool object..RE.RS`\fIxstr\fR' specifies the extensible string object..RE.RSThis function assures that the specified object is deleted when the memory pool object is deleted..RE.RE.PPThe function `tcmpoolputlist' is used in order to relegate a list object to a memory pool object..PP.RS.br\fBvoid tcmpoolputlist(TCMPOOL *\fImpool\fB, TCLIST *\fIlist\fB);\fR.RS`\fImpool\fR' specifies the memory pool object..RE.RS`\fIlist\fR' specifies the list object..RE.RSThis function assures that the specified object is deleted when the memory pool object is deleted..RE.RE.PPThe function `tcmpoolputmap' is used in order to relegate a map object to a memory pool object..PP.RS.br\fBvoid tcmpoolputmap(TCMPOOL *\fImpool\fB, TCMAP *\fImap\fB);\fR.RS`\fImpool\fR' specifies the memory pool object..RE.RS`\fImap\fR' specifies the map object..RE.RSThis function assures that the specified object is deleted when the memory pool object is deleted..RE.RE.PPThe function `tcmpoolputtree' is used in order to relegate a tree object to a memory pool object..PP.RS.br\fBvoid tcmpoolputtree(TCMPOOL *\fImpool\fB, TCTREE *\fItree\fB);\fR.RS`\fImpool\fR' specifies the memory pool object..RE.RS`\fItree\fR' specifies the tree object..RE.RSThis function assures that the specified object is deleted when the memory pool object is deleted..RE.RE.PPThe function `tcmpoolmalloc' is used in order to allocate a region relegated to a memory pool object..PP.RS.br\fBvoid *tcmpoolmalloc(TCMPOOL *\fImpool\fB, size_t \fIsize\fB);\fR.RS`\fImpool\fR' specifies the memory pool object..RE.RSThe return value is the pointer to the allocated region under the memory pool..RE.RE.PPThe function `tcmpoolxstrnew' is used in order to create an extensible string object relegated to a memory pool object..PP.RS.br\fBTCXSTR *tcmpoolxstrnew(TCMPOOL *\fImpool\fB);\fR.RSThe return value is the new extensible string object under the memory pool..RE.RE.PPThe function `tcmpoollistnew' is used in order to create a list object relegated to a memory pool object..PP.RS.br\fBTCLIST *tcmpoollistnew(TCMPOOL *\fImpool\fB);\fR.RSThe return value is the new list object under the memory pool..RE.RE.PPThe function `tcmpoolmapnew' is used in order to create a map object relegated to a memory pool object..PP.RS.br\fBTCMAP *tcmpoolmapnew(TCMPOOL *\fImpool\fB);\fR.RSThe return value is the new map object under the memory pool..RE.RE.PPThe function `tcmpooltreenew' is used in order to create a tree object relegated to a memory pool object..PP.RS.br\fBTCTREE *tcmpooltreenew(TCMPOOL *\fImpool\fB);\fR.RSThe return value is the new tree object under the memory pool..RE.RE.PPThe function `tcmpoolglobal' is used in order to get the global memory pool object..PP.RS.br\fBTCMPOOL *tcmpoolglobal(void);\fR.RSThe return value is the global memory pool object..RE.RSThe global memory pool object is a singleton and assured to be deleted when the process is terminating normally..RE.RE.SH API OF MISCELLANEOUS UTILITIES.PPThe function `tclmax' is used in order to get the larger value of tw

⌨️ 快捷键说明

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