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

📄 tcfdb.3

📁 高性能嵌入式数据库在高并发的环境下使用最好是64位系统比较好
💻 3
📖 第 1 页 / 共 3 页
字号:
.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`\fIvbuf\fR' specifies the pointer to the region of the value..RE.RS`\fIvsiz\fR' specifies the size of the region of the value.  If the size of the value is greater than the width tuning parameter of the database, the size is cut down to the width..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 `tcfdbputcat2' is used in order to concatenate a value with a decimal key in a fixed\-length database object..PP.RS.br\fBbool tcfdbputcat2(TCFDB *\fIfdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, const void *\fIvbuf\fB, int \fIvsiz\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object connected as a writer..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the decimal key.  It should be more than 0.  If it is "min", the minimum ID number of existing records is specified.  If it is "prev", the number less by one than the minimum ID number of existing records is specified.  If it is "max", the maximum ID number of existing records is specified.  If it is "next", the number greater by one than the maximum ID number of existing records is specified..RE.RS`\fIksiz\fR' specifies the size of the region of the key..RE.RS`\fIvbuf\fR' specifies the pointer to the region of the value..RE.RS`\fIvsiz\fR' specifies the size of the region of the value.  If the size of the value is greater than the width tuning parameter of the database, the size is cut down to the width..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 `tcfdbputcat3' is used in order to concatenate a string value with a decimal key in a fixed\-length database object..PP.RS.br\fBbool tcfdbputcat3(TCFDB *\fIfdb\fB, const char *\fIkstr\fB, const void *\fIvstr\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object connected as a writer..RE.RS`\fIkstr\fR' specifies the string of the decimal key.  It should be more than 0.  If it is "min", the minimum ID number of existing records is specified.  If it is "prev", the number less by one than the minimum ID number of existing records is specified.  If it is "max", the maximum ID number of existing records is specified.  If it is "next", the number greater by one than the maximum ID number of existing records is specified..RE.RS`\fIvstr\fR' specifies the string of the value..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 `tcfdbout' is used in order to remove a record of a fixed\-length database object..PP.RS.br\fBbool tcfdbout(TCFDB *\fIfdb\fB, int64_t \fIid\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 `FDBIDMAX', the maximum ID number of existing records is specified..RE.RSIf successful, the return value is true, else, it is false..RE.RE.PPThe function `tcfdbout2' is used in order to remove a record with a decimal key of a fixed\-length database object..PP.RS.br\fBbool tcfdbout2(TCFDB *\fIfdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object connected as a writer..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the decimal key.  It should be more than 0.  If it is "min", the minimum ID number of existing records is specified.  If it is "max", the maximum ID number of existing records is specified..RE.RS`\fIksiz\fR' specifies the size of the region of the key..RE.RSIf successful, the return value is true, else, it is false..RE.RE.PPThe function `tcfdbout3' is used in order to remove a string record with a decimal key of a fixed\-length database object..PP.RS.br\fBbool tcfdbout3(TCFDB *\fIfdb\fB, const char *\fIkstr\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object connected as a writer..RE.RS`\fIkstr\fR' specifies the string of the decimal key.  It should be more than 0.  If it is "min", the minimum ID number of existing records is specified.  If it is "max", the maximum ID number of existing records is specified..RE.RSIf successful, the return value is true, else, it is false..RE.RE.PPThe function `tcfdbget' is used in order to retrieve a record in a fixed\-length database object..PP.RS.br\fBvoid *tcfdbget(TCFDB *\fIfdb\fB, int64_t \fIid\fB, int *\fIsp\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..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 `FDBIDMAX', the maximum ID number of existing records is specified..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 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 `tcfdbget2' is used in order to retrieve a record with a decimal key in a fixed\-length database object..PP.RS.br\fBvoid *tcfdbget2(TCFDB *\fIfdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB, int *\fIsp\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the decimal key.  It should be more than 0.  If it is "min", the minimum ID number of existing records is specified.  If it is "max", the maximum ID number of existing records is specified..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 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 `tcfdbget3' is used in order to retrieve a string record with a decimal key in a fixed\-length database object..PP.RS.br\fBchar *tcfdbget3(TCFDB *\fIfdb\fB, const char *\fIkstr\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RS`\fIkstr\fR' specifies the string of the decimal key.  It should be more than 0.  If it is "min", the minimum ID number of existing records is specified.  If it is "max", the maximum ID number of existing records is specified..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 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 `tcfdbget4' is used in order to retrieve a record in a fixed\-length database object and write the value into a buffer..PP.RS.br\fBint tcfdbget4(TCFDB *\fIfdb\fB, int64_t \fIid\fB, void *\fIvbuf\fB, int \fImax\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..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 `FDBIDMAX', the maximum ID number of existing records is specified..RE.RS`\fIvbuf\fR' specifies the pointer to the buffer into which the value of the corresponding record is written..RE.RS`\fImax\fR' specifies the size of the buffer..RE.RSIf successful, the return value is the size of the written data, else, it is \-1.  \-1 is returned if no record corresponds to the specified key..RE.RSNote that an additional zero code is not appended at the end of the region of the writing buffer..RE.RE.PPThe function `tcfdbvsiz' is used in order to get the size of the value of a record in a fixed\-length database object..PP.RS.br\fBint tcfdbvsiz(TCFDB *\fIfdb\fB, int64_t \fIid\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..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 `FDBIDMAX', the maximum ID number of existing records is specified..RE.RSIf successful, the return value is the size of the value of the corresponding record, else, it is \-1..RE.RE.PPThe function `tcfdbvsiz2' is used in order to get the size of the value with a decimal key in a fixed\-length database object..PP.RS.br\fBint tcfdbvsiz2(TCFDB *\fIfdb\fB, const void *\fIkbuf\fB, int \fIksiz\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RS`\fIkbuf\fR' specifies the pointer to the region of the decimal key.  It should be more than 0.  If it is "min", the minimum ID number of existing records is specified.  If it is "max", the maximum ID number of existing records is specified..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 `tcfdbvsiz3' is used in order to get the size of the string value with a decimal key in a fixed\-length database object..PP.RS.br\fBint tcfdbvsiz3(TCFDB *\fIfdb\fB, const char *\fIkstr\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RS`\fIkstr\fR' specifies the string of the decimal key.  It should be more than 0.  If it is "min", the minimum ID number of existing records is specified.  If it is "max", the maximum ID number of existing records is specified..RE.RSIf successful, the return value is the size of the value of the corresponding record, else, it is \-1..RE.RE.PPThe function `tcfdbiterinit' is used in order to initialize the iterator of a fixed\-length database object..PP.RS.br\fBbool tcfdbiterinit(TCFDB *\fIfdb\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length 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 `tcfdbiternext' is used in order to get the next ID number of the iterator of a fixed\-length database object..PP.RS.br\fBuint64_t tcfdbiternext(TCFDB *\fIfdb\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length database object..RE.RSIf successful, the return value is the next ID number of the iterator, else, it is 0.  0 is returned when no record is to be get out of the iterator..RE.RSIt 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 `tcfdbiternext2' is used in order to get the next decimay key of the iterator of a fixed\-length database object..PP.RS.br\fBvoid *tcfdbiternext2(TCFDB *\fIfdb\fB, int *\fIsp\fB);\fR.RS`\fIfdb\fR' specifies the fixed\-length 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 decimal key, else, it is `NULL'.  `NULL' is returned when no record is to be get out of the iterator..RE.RS

⌨️ 快捷键说明

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