|
| static int | dbif_stamp (DBD *dbd, void *buffer, int size) |
| | Get the db stamp which is the st_ctime of the file "cnid2.db" and store it in buffer.
|
| static int | dbif_init_rootinfo (DBD *dbd, int version) |
| | Inititialize rootinfo key (which has CNID 0 as key).
|
| static int | dbif_getversion (DBD *dbd, uint32_t *version) |
| | Return CNID database version number.
|
| static int | dbif_setversion (DBD *dbd, uint32_t version) |
| | Set CNID database version number.
|
| static int | dbif_upgrade (DBD *dbd) |
| static int | dbif_openlog (DBD *dbd) |
| static int | dbif_logautorem (DBD *dbd) |
| DBD * | dbif_init (const char *envhome, const char *filename) |
| int | dbif_env_open (DBD *dbd, struct db_param *dbp, uint32_t dbenv_oflags) |
| int | dbif_open (DBD *dbd, struct db_param *dbp, int reindex) |
| static int | dbif_closedb (DBD *dbd) |
| int | dbif_close (DBD *dbd) |
| int | dbif_env_remove (const char *path) |
| int | dbif_get (DBD *dbd, const int dbi, DBT *key, DBT *val, uint32_t flags) |
| int | dbif_put (DBD *dbd, const int dbi, DBT *key, DBT *val, uint32_t flags) |
| int | dbif_del (DBD *dbd, const int dbi, DBT *key, uint32_t flags) |
| static bool | dbif_name_contains (const void *name, size_t namelen, const void *term, size_t termlen) |
| int | dbif_search (DBD *dbd, DBT *key, char *resbuf, uint32_t offset, bool *more) |
| | Paginated substring cursor scan over the name index.
|
| int | dbif_txn_begin (DBD *dbd) |
| int | dbif_txn_commit (DBD *dbd) |
| int | dbif_txn_abort (DBD *dbd) |
| int | dbif_txn_close (DBD *dbd, int ret) |
| | Close a transaction based on ret code.
|
| int | dbif_txn_checkpoint (DBD *dbd, uint32_t kbyte, uint32_t min, uint32_t flags) |
| int | dbif_count (DBD *dbd, const int dbi, uint32_t *count) |
| int | dbif_copy_rootinfokey (DBD *srcdbd, DBD *destdbd) |
| int | dbif_dump (DBD *dbd, int dumpindexes) |
| int | dbif_idwalk (DBD *dbd, cnid_t *cnid, int close) |
| | Iterates over dbd, returning cnids.
|
| int dbif_search |
( |
DBD * | dbd, |
|
|
DBT * | key, |
|
|
char * | resbuf, |
|
|
uint32_t | offset, |
|
|
bool * | more ) |
Paginated substring cursor scan over the name index.
Skips offset matching entries before emitting up to DBD_MAX_SRCH_RSLTS results into resbuf. After the buffer fills, continues until the next matching entry to decide whether further matches exist; reports the result via more.
The caller MUST keep a separate backup of the original name bytes because BDB takes ownership of key->data after each pget() call.
- Parameters
-
| [in] | dbd | database handle |
| [in] | key | initialised with the search name (key->data, key->size) |
| [out] | resbuf | buffer for matching CNIDs in network byte order, must have capacity for DBD_MAX_SRCH_RSLTS * sizeof(cnid_t) bytes |
| [in] | offset | number of leading matches to skip, range 0..DBD_SEARCH_MAX_OFFSET |
| [out] | more | set to true iff a (offset + DBD_MAX_SRCH_RSLTS + 1)-th matching entry exists in the index, false otherwise. MUST be non-NULL. |
- Returns
- -1 on BDB engine error, else the number of matches written to
resbuf (0..DBD_MAX_SRCH_RSLTS)