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

📄 tcadb.3

📁 高性能嵌入式数据库在高并发的环境下使用最好是64位系统比较好
💻 3
📖 第 1 页 / 共 2 页
字号:
.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..RE.RE.PPThe function `tcadbget2' is used in order to retrieve a string record in an abstract database object..PP.RS.br\fBchar *tcadbget2(TCADB *\fIadb\fB, const char *\fIkstr\fB);\fR.RS`\fIadb\fR' specifies the abstract database 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 if no record corresponds..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 `tcadbvsiz' is used in order to get the size of the value of a record in an abstract database object..PP.RS.br\fBint tcadbvsiz(TCADB *\fIadb\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR.RS`\fIadb\fR' specifies the abstract 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 `tcadbvsiz2' is used in order to get the size of the value of a string record in an abstract database object..PP.RS.br\fBint tcadbvsiz2(TCADB *\fIadb\fB, const char *\fIkstr\fB);\fR.RS`\fIadb\fR' specifies the abstract 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 `tcadbiterinit' is used in order to initialize the iterator of an abstract database object..PP.RS.br\fBbool tcadbiterinit(TCADB *\fIadb\fB);\fR.RS`\fIadb\fR' specifies the abstract database object..RE.RSIf successful, the return value is true, else, it is false..RE.RSThe iterator is used in order to access the key of every record stored in a database..RE.RE.PPThe function `tcadbiternext' is used in order to get the next key of the iterator of an abstract database object..PP.RS.br\fBvoid *tcadbiternext(TCADB *\fIadb\fB, int *\fIsp\fB);\fR.RS`\fIadb\fR' specifies the abstract database 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 is to be get out of 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.  It is possible to access every record by iteration of calling this function.  It is allowed to update or remove records whose keys are fetched while the iteration.  However, it is not assured if updating the database is occurred while the iteration.  Besides, the order of this traversal access method is arbitrary, so it is not assured that the order of storing matches the one of the traversal access..RE.RE.PPThe function `tcadbiternext2' is used in order to get the next key string of the iterator of an abstract database object..PP.RS.br\fBchar *tcadbiternext2(TCADB *\fIadb\fB);\fR.RS`\fIadb\fR' specifies the abstract database object..RE.RSIf successful, the return value is the string of the next key, else, it is `NULL'.  `NULL' is returned when no record is to be get out of 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.  It is possible to access every record by iteration of calling this function.  However, it is not assured if updating the database is occurred while the iteration.  Besides, the order of this traversal access method is arbitrary, so it is not assured that the order of storing matches the one of the traversal access..RE.RE.PPThe function `tcadbfwmkeys' is used in order to get forward matching keys in an abstract database object..PP.RS.br\fBTCLIST *tcadbfwmkeys(TCADB *\fIadb\fB, const void *\fIpbuf\fB, int \fIpsiz\fB, int \fImax\fB);\fR.RS`\fIadb\fR' specifies the abstract 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 `tcadbfwmkeys2' is used in order to get forward matching string keys in an abstract database object..PP.RS.br\fBTCLIST *tcadbfwmkeys2(TCADB *\fIadb\fB, const char *\fIpstr\fB, int \fImax\fB);\fR.RS`\fIadb\fR' specifies the abstract 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 `tcadbaddint' is used in order to add an integer to a record in an abstract database object..PP.RS.br\fBint tcadbaddint(TCADB *\fIadb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, int \fInum\fB);\fR.RS`\fIadb\fR' specifies the abstract database object connected as a writer..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.RSIf successful, the return value is the summation value, else, it is `INT_MIN'..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 `tcadbadddouble' is used in order to add a real number to a record in an abstract database object..PP.RS.br\fBdouble tcadbadddouble(TCADB *\fIadb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, double \fInum\fB);\fR.RS`\fIadb\fR' specifies the abstract database object connected as a writer..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.RSIf successful, the return value is the summation value, else, it is `NAN'..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 `tcadbsync' is used in order to synchronize updated contents of an abstract database object with the file and the device..PP.RS.br\fBbool tcadbsync(TCADB *\fIadb\fB);\fR.RS`\fIadb\fR' specifies the abstract database object..RE.RSIf successful, the return value is true, else, it is false..RE.RE.PPThe function `tcadbvanish' is used in order to remove all records of an abstract database object..PP.RS.br\fBbool tcadbvanish(TCADB *\fIadb\fB);\fR.RS`\fIadb\fR' specifies the abstract database object..RE.RSIf successful, the return value is true, else, it is false..RE.RE.PPThe function `tcadbcopy' is used in order to copy the database file of an abstract database object..PP.RS.br\fBbool tcadbcopy(TCADB *\fIadb\fB, const char *\fIpath\fB);\fR.RS`\fIadb\fR' specifies the abstract database object..RE.RS`\fIpath\fR' specifies the path of the destination file.  If it begins with `@', the trailing substring is executed as a command line..RE.RSIf successful, the return value is true, else, it is false.  False is returned if the executed command returns non\-zero code..RE.RSThe database file is assured to be kept synchronized and not modified while the copying or executing operation is in progress.  So, this function is useful to create a backup file of the database file..RE.RE.PPThe function `tcadbrnum' is used in order to get the number of records of an abstract database object..PP.RS.br\fBuint64_t tcadbrnum(TCADB *\fIadb\fB);\fR.RS`\fIadb\fR' specifies the abstract database object..RE.RSThe return value is the number of records or 0 if the object does not connect to any database instance..RE.RE.PPThe function `tcadbsize' is used in order to get the size of the database of an abstract database object..PP.RS.br\fBuint64_t tcadbsize(TCADB *\fIadb\fB);\fR.RS`\fIadb\fR' specifies the abstract database object..RE.RSThe return value is the size of the database or 0 if the object does not connect to any database instance..RE.RE.SH SEE ALSO.PP.BR tcatest (1),.BR tcamgr (1),.BR tokyocabinet (3)

⌨️ 快捷键说明

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