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

📄 villa.3

📁 harvest是一个下载html网页得机器人
💻 3
📖 第 1 页 / 共 2 页
字号:
.PPThe function `vloutlist' is used in order to delete all records corresponding a key..TP.B int vloutlist(VILLA *villa, const char *kbuf, int ksiz);`villa' specifies a database handle connected as a writer.  `kbuf' specifies the pointer to the region of a key.  `ksiz' specifies the size of the region of the key.  If it is negative, the size is assigned with `strlen(kbuf)'.  If successful, the return value is true, else, it is false.  False is returned when no record corresponds to the specified key.  The cursor becomes unavailable due to updating database..PPThe function `vlgetlist' is used in order to retrieve values of all records corresponding a key..TP.B CBLIST *vlgetlist(VILLA *villa, const char *kbuf, int ksiz);`villa' specifies a database handle.  `kbuf' specifies the pointer to the region of a key.  `ksiz' specifies the size of the region of the key.  If it is negative, the size is assigned with `strlen(kbuf)'.  If successful, the return value is a list handle of the values of the corresponding records, else, it is `NULL'.  `NULL' is returned when no record corresponds to the specified key..PPThe function `vlcurfirst' is used in order to move the cursor to the first record..TP.B int vlcurfirst(VILLA *villa);`villa' specifies a database handle.  If successful, the return value is true, else, it is false.  False is returned if there is no record in the database..PPThe function `vlcurlast' is used in order to move the cursor to the last record..TP.B int vlcurlast(VILLA *villa);`villa' specifies a database handle.  If successful, the return value is true, else, it is false.  False is returned if there is no record in the database..PPThe function `vlcurprev' is used in order to move the cursor to the previous record..TP.B int vlcurprev(VILLA *villa);`villa' specifies a database handle.  If successful, the return value is true, else, it is false.  False is returned if there is no previous record..PPThe function `vlcurnext' is used in order to move the cursor to the next record..TP.B int vlcurnext(VILLA *villa);`villa' specifies a database handle.  If successful, the return value is true, else, it is false.  False is returned if there is no next record..PPThe function `vlcurjump' is used in order to move the cursor to positon around a record..TP.B int vlcurjump(VILLA *villa, const char *kbuf, int ksiz, int jmode);`villa' specifies a database handle.  `kbuf' specifies the pointer to the region of a key.  `ksiz' specifies the size of the region of the key.  If it is negative, the size is assigned with `strlen(kbuf)'.  `jmode' specifies detail adjustment: `VL_JFORWARD', which means that the cursor is set to the first record of the same key and that the cursor is set to the next substitute if completely matching record does not exist, `VL_JBACKWARD', which means that the cursor is set to the last record of the same key and that the cursor is set to the previous substitute if completely matching record does not exist.  If successful, the return value is true, else, it is false.  False is returned if there is no record corresponding the condition..PPThe function `vlcurkey' is used in order to get the key of the record where the cursor is..TP.B char *vlcurkey(VILLA *villa, int *sp);`villa' specifies a database handle.  `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned.  If it is `NULL', it is not used.  If successful, the return value is the pointer to the region of the key of the corresponding record, else, it is `NULL'.  `NULL' is returned when no record corresponds to the cursor.  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 if it is no longer in use..PPThe function `vlcurval' is used in order to get the value of the record where the cursor is..TP.B char *vlcurval(VILLA *villa, int *sp);`villa' specifies a database handle.  `sp' specifies the pointer to a variable to which the size of the region of the return value assigned.  If it is `NULL', it is not used.  If successful, the return value is the pointer to the region of the value of the corresponding record, else, it is `NULL'.  `NULL' is returned when no record corresponds to the cursor.  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 if it is no longer in use..PPThe function `vlsettuning' is used in order to set the tuning parameters for performance..TP.B void vlsettuning(VILLA *villa, int lrecmax, int nidxmax, int lcnum, int ncnum);`villa' specifies a database handle.  `lrecmax' specifies the max number of records in a leaf node of B+ tree.  If it is not more than 0, the default value is specified.  `nidxmax' specifies the max number of indexes in a non\-leaf node of B+ tree.  If it is not more than 0, the default value is specified.  `lcnum' specifies the max number of caching leaf nodes.  If it is not more than 0, the default value is specified.  `ncnum' specifies the max number of caching non\-leaf nodes.  If it is not more than 0, the default value is specified.  The default setting is equivalent to `vlsettuning(49, 192, 1024, 512)'.  Because tuning paremeters are not saved in a database, you should specify them every opening a database..PPThe function `vlsync' is used in order to synchronize updating contents with the file and the device..TP.B int vlsync(VILLA *villa);`villa' specifies a database handle connected as a writer.  If successful, the return value is true, else, it is false.  This function is useful when another process uses the connected database file.  This function shuold not be used while the transaction is activated..PPThe function `vloptimize' is used in order to optimize a database..TP.B int vloptimize(VILLA *villa);`villa' specifies a database handle connected as a writer.  If successful, the return value is true, else, it is false.  In an alternating succession of deleting and storing with overwrite or concatenate, dispensable regions accumulate.  This function is useful to do away with them.  This function shuold not be used while the transaction is activated..PPThe function `vlname' is used in order to get the name of a database..TP.B char *vlname(VILLA *villa);`villa' specifies a database handle.  If successful, the return value is the pointer to the region of the name of the database, else, it is `NULL'.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `vlfsiz' is used in order to get the size of a database file..TP.B int vlfsiz(VILLA *villa);`villa' specifies a database handle.  If successful, the return value is the size of the database file, else, it is \-1.  Because of the I/O buffer, the return value may be less than the real size..PPThe function `vllnum' is used in order to get the number of the leaf nodes of B+ tree..TP.B int vllnum(VILLA *villa);`villa' specifies a database handle.  If successful, the return value is the number of the leaf nodes, else, it is \-1..PPThe function `vlnnum' is used in order to get the number of the non\-leaf nodes of B+ tree..TP.B int vlnnum(VILLA *villa);`villa' specifies a database handle.  If successful, the return value is the number of the non\-leaf nodes, else, it is \-1..PPThe function `vlrnum' is used in order to get the number of the records stored in a database..TP.B int vlrnum(VILLA *villa);`villa' specifies a database handle.  If successful, the return value is the number of the records stored in the database, else, it is \-1..PPThe function `vlwritable' is used in order to check whether a database handle is a writer or not..TP.B int vlwritable(VILLA *villa);`villa' specifies a database handle.  The return value is true if the handle is a writer, false if not..PPThe function `vlfatalerror' is used in order to check whether a database has a fatal error or not..TP.B int vlfatalerror(VILLA *villa);`villa' specifies a database handle.  The return value is true if the database has a fatal error, false if not..PPThe function `vlinode' is used in order to get the inode number of a database file..TP.B int vlinode(VILLA *villa);`villa' specifies a database handle.  The return value is the inode number of the database file..PPThe function `vltranbegin' is used in order to begin the transaction..TP.B int vltranbegin(VILLA *villa);`villa' specifies a database handle connected as a writer.  If successful, the return value is true, else, it is false.  Because this function does not perform mutual excrusion control in multi\-thread, the application is responsible for it.  Only one transaction can be activated with a database handle at the same time..PPThe function `vltrancommit' is used in order to commit the transaction..TP.B int vltrancommit(VILLA *villa);`villa' specifies a database handle connected as a writer.  If successful, the return value is true, else, it is false.  Updating a database in the transaction is fixed when it is committed successfully..PPThe function `vltranabort' is used in order to abort the transaction..TP.B int vltranabort(VILLA *villa);`villa' specifies a database handle connected as a writer.  If successful, the return value is true, else, it is false.  Updating a database in the transaction is discarded when it is aborted.  The state of the database is rollbacked to before transaction..PPThe function `vlremove' is used in order to remove a database file..TP.B int vlremove(const char *name);`name' specifies the name of a database file.  If successful, the return value is true, else, it is false..PPAlthough each function of Villa is not reentrant, it does not use any static object internally.  So, it can be used as a thread\-safe function if each calling and reference to the external variable `dpecode' are under exclusion control, on the assumption that `errno', `malloc', and so on are thread\-safe..PPVista is the extended API of Villa.  To compensate for the defect that Villa can not handle a file whose size is more than 2GB, Vista does not use Depot but Curia for handling its internal database.  While Vista provodes data structure and operations of B+ tree as with Villa, its database is realized as a directory..PPIn order to use Vista, you should include `vista.h' instead of `villa.h'.  Because Vista is implemented by overriding symbols of Villa, it can be used as with Villa.  That is, Signatures of Villa and Vista is all the same.  However, as its adverse effect, modules using Vista can not use Depot nor Villa..SH SEE ALSO.PP.BR qdbm (3),.BR depot (3),.BR curia (3),.BR relic (3),.BR hovel (3),.BR cabin (3),.BR odeum (3),.BR ndbm (3),.BR gdbm (3)

⌨️ 快捷键说明

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