Manual Reference Pages - DBH_EXIT_SWEEP (3)
dbh_sweep, dbh_fanout, dbh_foreach_sweep, dbh_foreach_fanout, dbh_exit_sweep, dbh_exit_fanout - apply a function to all or part of the DBHashtable
int dbh_foreach_sweep (DBHashTable *dbh, DBHashFunc operate);
int dbh_foreach_fanout (DBHashTable *dbh, DBHashFunc operate);
int dbh_sweep (DBHashTable *dbh, DBHashFunc operate, unsigned char *key1, unsigned char *key2, unsigned char ignore_portion);
int dbh_fanout (DBHashTable *dbh, DBHashFunc operate, unsigned char *key1, unsigned char *key2, unsigned char ignore_portion);
void dbh_exit_sweep (DBHashTable *dbh);
void dbh_exit_fanout (DBHashTable *dbh);
dbh_foreach_sweep applies function
operate to each member of the hash, following a sweep trajectory.
Sweep is done by traversing
DBHashTable in a vertical direction through all branches.
dbh_foreach_fanout applies a function
operate to each member of the hash, following a fanout trajectory. Fanout
is done by traversing the
DBHashTable in a horizontal direction through all records.
dbh_fanout apply a function to subtree members of the hash, where
dbh_sweep follows a sweep trajectory (vertically through branches)
dbh_fanout follows a fanout trajectory (horizontally through branches).
key1 is the key from which to start the sweep or NULL if you dont care and
want to start at the top.
If you decide to define
key1 make sure it is a top level node of a subtree. This is done with
key2 is the key which will trigger an exit condition, or NULL if dont care and want to continue until the end of the
ignore_portion allows you to define the ignored trailing bytes of
key1 which will define the size of the subtree to be sweeped, or zero if you
dont care and want to process all branches.
In these functions,
void (*operate) (DBHashTable *dbh) ) is the function to apply to each selected member of the
dbh_exit_fanout within the
operate function will cause the exit of a currently running sweep or fanout.
0 on error, 1 otherwise.
In order for sweep/fanout functions to be extremely fast, you should prepare the DBHashTable for the trajectory you intend to use with
dbh_regen_fanout first. This allows for extremely efficient use of hardware and operating system caches.
Edscott Wilson Garcia <firstname.lastname@example.org>
|DBHashTables ||DBH_SWEEP (3) ||DBH |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.