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

📄 tcfdb.3

📁 高性能嵌入式数据库在高并发的环境下使用最好是64位系统比较好
💻 3
📖 第 1 页 / 共 3 页
字号:
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.  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.  The order of this traversal access method is ascending of the ID number..RE.RE.PPThe function `tcfdbiternext3' is used in order to get the next decimay key string of the iterator of a fixed\-length database object..PP.RS.br\fBchar *tcfdbiternext3(TCFDB *\fIfdb\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RSIf successful, the return value is the string of the next decimal 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.  It is allowed to update or remove records whose keys are fetched while the iteration.  The order of this traversal access method is ascending of the ID number..RE.RE.PPThe function `tcfdbrange' is used in order to get range matching ID numbers in a fixed\-length database object..PP.RS.br\fBuint64_t *tcfdbrange(TCFDB *\fIfdb\fB, int64_t \fIlower\fB, int64_t \fIupper\fB, int \fImax\fB, int *\fInp\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RS`\fIlower\fR' specifies the lower limit of the range.  If it is `FDBIDMIN', the minimum ID is specified..RE.RS`\fIupper\fR' specifies the upper limit of the range.  If it is `FDBIDMAX', the maximum ID is specified..RE.RS`\fImax\fR' specifies the maximum number of keys to be fetched.  If it is negative, no limit is specified..RE.RS`\fInp\fR' specifies the pointer to the variable into which the number of elements of the return value is assigned..RE.RSIf successful, the return value is the pointer to an array of ID numbers of the corresponding records.  `NULL' is returned on failure.  This function does never fail and return an empty array even if no key 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 `tcfdbrange2' is used in order to get range matching decimal keys in a fixed\-length database object..PP.RS.br\fBTCLIST *tcfdbrange2(TCFDB *\fIfdb\fB, const void *\fIlbuf\fB, int \fIlsiz\fB, const void *\fIubuf\fB, int \fIusiz\fB, int \fImax\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RS`\fIlbuf\fR' specifies the pointer to the region of the lower key.  If it is "min", the minimum ID number of existing records is specified..RE.RS`\fIlsiz\fR' specifies the size of the region of the lower key..RE.RS`\fIubuf\fR' specifies the pointer to the region of the upper key.  If it is "max", the maximum ID number of existing records is specified..RE.RS`\fIusiz\fR' specifies the size of the region of the upper key..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 decimal 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 `tcfdbrange3' is used in order to get range matching decimal keys with strings in a fixed\-length database object..PP.RS.br\fBTCLIST *tcfdbrange3(TCFDB *\fIfdb\fB, const char *\fIlstr\fB, const char *\fIustr\fB, int \fImax\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RS`\fIlstr\fR' specifies the string of the lower key.  If it is "min", the minimum ID number of existing records is specified..RE.RS`\fIustr\fR' specifies the string of the upper key.  If it is "max", the maximum ID number of existing records is specified..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 decimal 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 `tcfdbrange4' is used in order to get keys with an interval notation in a fixed\-length database object..PP.RS.br\fBTCLIST *tcfdbrange4(TCFDB *\fIfdb\fB, const void *\fIibuf\fB, int \fIisiz\fB, int \fImax\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RS`\fIibuf\fR' specifies the pointer to the region of the interval notation..RE.RS`\fIisiz\fR' specifies the size of the region of the interval notation..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 decimal 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 `tcfdbrange5' is used in order to get keys with an interval notation string in a fixed\-length database object..PP.RS.br\fBTCLIST *tcfdbrange5(TCFDB *\fIfdb\fB, const void *\fIistr\fB, int \fImax\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RS`\fIistr\fR' specifies the pointer to the region of the interval notation string..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 decimal 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 `tcfdbaddint' is used in order to add an integer to a record in a fixed\-length database object..PP.RS.br\fBint tcfdbaddint(TCFDB *\fIfdb\fB, int64_t \fIid\fB, int \fInum\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object connected as a writer..RE.RS`\fIid\fR' specifies the ID number.  It should be more than 0.  If it is `FDBIDMIN', the minimum ID number of existing records is specified.  If it is `FDBIDPREV', the number less by one than the minimum ID number of existing records is specified.  If it is `FDBIDMAX', the maximum ID number of existing records is specified.  If it is `FDBIDNEXT', the number greater by one than the maximum ID number of existing records is specified..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 `tcfdbadddouble' is used in order to add a real number to a record in a fixed\-length database object..PP.RS.br\fBdouble tcfdbadddouble(TCFDB *\fIfdb\fB, int64_t \fIid\fB, double \fInum\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object connected as a writer..RE.RS`\fIid\fR' specifies the ID number.  It should be more than 0.  If it is `FDBIDMIN', the minimum ID number of existing records is specified.  If it is `FDBIDPREV', the number less by one than the minimum ID number of existing records is specified.  If it is `FDBIDMAX', the maximum ID number of existing records is specified.  If it is `FDBIDNEXT', the number greater by one than the maximum ID number of existing records is specified..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 `tcfdbsync' is used in order to synchronize updated contents of a fixed\-length database object with the file and the device..PP.RS.br\fBbool tcfdbsync(TCFDB *\fIfdb\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object connected as a writer..RE.RSIf successful, the return value is true, else, it is false..RE.RSThis function is useful when another process connects to the same database file..RE.RE.PPThe function `tcfdboptimize' is used in order to optimize the file of a fixed\-length database object..PP.RS.br\fBbool tcfdboptimize(TCFDB *\fIfdb\fB, int32_t \fIwidth\fB, int64_t \fIlimsiz\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object connected as a writer..RE.RS`\fIwidth\fR' specifies the width of the value of each record.  If it is not more than 0, the current setting is not changed..RE.RS`\fIlimsiz\fR' specifies the limit size of the database file.  If it is not more than 0, the current setting is not changed..RE.RSIf successful, the return value is true, else, it is false..RE.RE.PPThe function `tcfdbvanish' is used in order to remove all records of a fixed\-length database object..PP.RS.br\fBbool tcfdbvanish(TCFDB *\fIfdb\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object connected as a writer..RE.RSIf successful, the return value is true, else, it is false..RE.RE.PPThe function `tcfdbcopy' is used in order to copy the database file of a fixed\-length database object..PP.RS.br\fBbool tcfdbcopy(TCFDB *\fIfdb\fB, const char *\fIpath\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length 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 `tcfdbpath' is used in order to get the file path of a fixed\-length database object..PP.RS.br\fBconst char *tcfdbpath(TCFDB *\fIfdb\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RSThe return value is the path of the database file or `NULL' if the object does not connect to any database file..RE.RE.PPThe function `tcfdbrnum' is used in order to get the number of records of a fixed\-length database object..PP.RS.br\fBuint64_t tcfdbrnum(TCFDB *\fIfdb\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RSThe return value is the number of records or 0 if the object does not connect to any database file..RE.RE.PPThe function `tcfdbfsiz' is used in order to get the size of the database file of a fixed\-length database object..PP.RS.br\fBuint64_t tcfdbfsiz(TCFDB *\fIfdb\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RSThe return value is the size of the database file or 0 if the object does not connect to any database file..RE.RE.SH SEE ALSO.PP.BR tcftest (1),.BR tcfmttest (1),.BR tcfmgr (1),.BR tokyocabinet (3)

⌨️ 快捷键说明

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