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

📄 tcfdb.3

📁 Tokyo Cabinet的Tokyo Cabinet 是一个DBM的实现。这里的数据库由一系列key-value对的记录构成。key和value都可以是任意长度的字节序列,既可以是二进制也可以是字符
💻 3
📖 第 1 页 / 共 3 页
字号:
`\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 Not\-a\-Number..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 `tcfdbtranbegin' is used in order to begin the transaction of a fixed\-length database object..PP.RS.br\fBbool tcfdbtranbegin(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.RSThe database is locked by the thread while the transaction so that only one transaction can be activated with a database object at the same time.  Thus, the serializable isolation level is assumed if every database operation is performed in the transaction.  All updated regions are kept track of by write ahead logging while the transaction.  If the database is closed during transaction, the transaction is aborted implicitly..RE.RE.PPThe function `tcfdbtrancommit' is used in order to commit the transaction of a fixed\-length database object..PP.RS.br\fBbool tcfdbtrancommit(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.RSUpdate in the transaction is fixed when it is committed successfully..RE.RE.PPThe function `tcfdbtranabort' is used in order to abort the transaction of a fixed\-length database object..PP.RS.br\fBbool tcfdbtranabort(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.RSUpdate in the transaction is discarded when it is aborted.  The state of the database is rollbacked to before transaction..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 + -