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

📄 tctdb.3

📁 Tokyo Cabinet的Tokyo Cabinet 是一个DBM的实现。这里的数据库由一系列key-value对的记录构成。key和value都可以是任意长度的字节序列,既可以是二进制也可以是字符
💻 3
📖 第 1 页 / 共 3 页
字号:
.RE.RE.PPThe function `tctdbputcat' is used in order to concatenate columns of the existing record in a table database object..PP.RS.br\fBbool tctdbputcat(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, TCMAP *\fIcols\fB);\fR.RS`\fItdb\fR' specifies the table database object connected as a writer..RE.RS`\fIpkbuf\fR' specifies the pointer to the region of the primary key..RE.RS`\fIpksiz\fR' specifies the size of the region of the primary key..RE.RS`\fIcols\fR' specifies a map object containing columns..RE.RSIf successful, the return value is true, else, it is false..RE.RSIf there is no corresponding record, a new record is created..RE.RE.PPThe function `tctdbputcat2' is used in order to concatenate columns in a table database object with a zero separated column string..PP.RS.br\fBbool tctdbputcat2(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, const void *\fIcbuf\fB, int \fIcsiz\fB);\fR.RS`\fItdb\fR' specifies the table database object connected as a writer..RE.RS`\fIpkbuf\fR' specifies the pointer to the region of the primary key..RE.RS`\fIpksiz\fR' specifies the size of the region of the primary key..RE.RS`\fIcbuf\fR' specifies the pointer to the region of the zero separated column string where the name and the value of each column are situated one after the other..RE.RS`\fIcsiz\fR' specifies the size of the region of the column string..RE.RSIf successful, the return value is true, else, it is false..RE.RSIf there is no corresponding record, a new record is created..RE.RE.PPThe function `tctdbputcat3' is used in order to concatenate columns in a table database object with with a tab separated column string..PP.RS.br\fBbool tctdbputcat3(TCTDB *\fItdb\fB, const char *\fIpkstr\fB, const char *\fIcstr\fB);\fR.RS`\fItdb\fR' specifies the table database object connected as a writer..RE.RS`\fIpkstr\fR' specifies the string of the primary key..RE.RS`\fIcstr\fR' specifies the string of the the tab separated column string where the name and the value of each column are situated one after the other..RE.RSIf successful, the return value is true, else, it is false..RE.RSIf there is no corresponding record, a new record is created..RE.RE.PPThe function `tctdbout' is used in order to remove a record of a table database object..PP.RS.br\fBbool tctdbout(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB);\fR.RS`\fItdb\fR' specifies the table database object connected as a writer..RE.RS`\fIpkbuf\fR' specifies the pointer to the region of the primary key..RE.RS`\fIpksiz\fR' specifies the size of the region of the primary key..RE.RSIf successful, the return value is true, else, it is false..RE.RE.PPThe function `tctdbout2' is used in order to remove a string record of a table database object..PP.RS.br\fBbool tctdbout2(TCTDB *\fItdb\fB, const char *\fIpkstr\fB);\fR.RS`\fItdb\fR' specifies the table database object connected as a writer..RE.RS`\fIpkstr\fR' specifies the string of the primary key..RE.RSIf successful, the return value is true, else, it is false..RE.RE.PPThe function `tctdbget' is used in order to retrieve a record in a table database object..PP.RS.br\fBTCMAP *tctdbget(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB);\fR.RS`\fItdb\fR' specifies the table database object..RE.RS`\fIpkbuf\fR' specifies the pointer to the region of the primary key..RE.RS`\fIpksiz\fR' specifies the size of the region of the primary key..RE.RSIf successful, the return value is a map object of the columns of the corresponding record.  `NULL' is returned if no record corresponds..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 `tctdbget2' is used in order to retrieve a record in a table database object as a zero separated column string..PP.RS.br\fBchar *tctdbget2(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, int *\fIsp\fB);\fR.RS`\fItdb\fR' specifies the table database object..RE.RS`\fIpkbuf\fR' specifies the pointer to the region of the primary key..RE.RS`\fIpksiz\fR' specifies the size of the region of the primary 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 column string of the corresponding record.  `NULL' is returned if 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..RE.RE.PPThe function `tctdbget3' is used in order to retrieve a string record in a table database object as a tab separated column string..PP.RS.br\fBchar *tctdbget3(TCTDB *\fItdb\fB, const char *\fIpkstr\fB);\fR.RS`\fItdb\fR' specifies the table database object..RE.RS`\fIpkstr\fR' specifies the string of the primary key..RE.RSIf successful, the return value is the tab separated column string 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 `tctdbvsiz' is used in order to get the size of the value of a record in a table database object..PP.RS.br\fBint tctdbvsiz(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB);\fR.RS`\fItdb\fR' specifies the table database object..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the primary key..RE.RS`\fIksiz\fR' specifies the size of the region of the primary 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 `tctdbvsiz2' is used in order to get the size of the value of a string record in a table database object..PP.RS.br\fBint tctdbvsiz2(TCTDB *\fItdb\fB, const char *\fIpkstr\fB);\fR.RS`\fItdb\fR' specifies the table database object..RE.RS`\fIkstr\fR' specifies the string of the primary 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 `tctdbiterinit' is used in order to initialize the iterator of a table database object..PP.RS.br\fBbool tctdbiterinit(TCTDB *\fItdb\fB);\fR.RS`\fItdb\fR' specifies the table database object..RE.RSIf successful, the return value is true, else, it is false..RE.RSThe iterator is used in order to access the primary key of every record stored in a database..RE.RE.PPThe function `tctdbiternext' is used in order to get the next primary key of the iterator of a table database object..PP.RS.br\fBvoid *tctdbiternext(TCTDB *\fItdb\fB, int *\fIsp\fB);\fR.RS`\fItdb\fR' specifies the table 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 primary 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 `tctdbiternext2' is used in order to get the next primary key string of the iterator of a table database object..PP.RS.br\fBchar *tctdbiternext2(TCTDB *\fItdb\fB);\fR.RS`\fItdb\fR' specifies the table database object..RE.RSIf successful, the return value is the string of the next primary 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 `tctdbfwmkeys' is used in order to get forward matching primary keys in a table database object..PP.RS.br\fBTCLIST *tctdbfwmkeys(TCTDB *\fItdb\fB, const void *\fIpbuf\fB, int \fIpsiz\fB, int \fImax\fB);\fR.RS`\fItdb\fR' specifies the table 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 `tctdbfwmkeys2' is used in order to get forward matching string primary keys in a table database object..PP.RS.br\fBTCLIST *tctdbfwmkeys2(TCTDB *\fItdb\fB, const char *\fIpstr\fB, int \fImax\fB);\fR.RS`\fItdb\fR' specifies the table 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 `tctdbaddint' is used in order to add an integer to a column of a record in a table database object..PP.RS.br\fBint tctdbaddint(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, int \fInum\fB);\fR.RS`\fItdb\fR' specifies the table database object connected as a writer..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the primary key..RE.RS`\fIksiz\fR' specifies the size of the region of the primary 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.RSThe additional value is stored as a decimal string value of a column whose name is "_num".  If no record corresponds, a new record with the additional value is stored..RE.RE.PPThe function `tctdbadddouble' is used in order to add a real number to a column of a record in a table database object..PP.RS.br\fBdouble tctdbadddouble(TCTDB *\fItdb\fB, const void *\fIpkbuf\fB, int \fIpksiz\fB, double \fInum\fB);\fR.RS`\fItdb\fR' specifies the table database object connected as a writer..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the primary key..RE.RS`\fIksiz\fR' specifies the size of the region of the primary key..RE.RS

⌨️ 快捷键说明

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