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

📄 tdb_traverse.3

📁 Linux下的一个关系数据库源代码
💻 3
字号:
.TH tdb_traverse "Aug 16, 2000" "Samba" "Linux Programmer's Manual".SH NAMEtdb_traverse - visit every element in a tdb database.SH SYNOPSIS.nf.B #include <tdb.h>.sp.BI "int tdb_traverse(TDB_CONTEXT *" tdb ", ".BI "        int (*" fn ")(TDB_CONTEXT *,TDB_DATA,TDB_DATA,void *),".BI "        void *state);".sp.SH DESCRIPTION.I tdb_traverse is the only sure way to visit all the items within agiven database,.I tdbBecause this function has intimate knowledge of the internals of thedatabase, it is able to cope with writers touching the database at thesame time it is trying to traverse it..spIf .I fn is supplied it will be called with the .I state parameter for each element in the database, as the forth argument. The First argument isthe database.I tdbthe second is the key and the third is the data. If this function call returns anything but 0, the traversal will stop. Unlike in tdb_fetch() the programmeris not required to free either the pointer from either the key or dataparameters that are passed into the function. The.I fnfunction should have the prototype:.nf.in 10int (*tdb_traverse_func)(TDB_CONTEXT *, TDB_DATA, TDB_DATA, void *);.fi.PP.spCalling tdb_traverse with a NULL .I fn parameter is the appropriate way to count the number of elements inthe database..SH "RETURN VALUE"The return value is the number of elements traversed or -1 if therewas an error..SH AUTHORSSoftware: Andrew Tridgell <tridge@linuxcare.com> and Luke Kenneth Casson LeightonMan page: Ben Woodard <ben@valinux.com>.SH "SEE ALSO".BR gdbm (3),.BR tdb(3)

⌨️ 快捷键说明

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