search for: hasher1

Displaying 1 result from an estimated 1 matches for "hasher1".

Did you mean: hasher
2009 Aug 03
2
[PATCH] New commands to list devices by UUID and label
...quot; +#include "actions.h" + +#include "hash.h" /* Gnulib hash table. */ + +/* Hash used in the first pass. */ +struct h1 { + dev_t dev; /* device */ + char *dname; /* d_dname entry (ie. UUID or label) */ +}; + +static size_t +hasher1 (const void *h1v, size_t table_size) +{ + const struct h1 *h1 = h1v; + + return (unsigned) h1->dev % table_size; +} + +static bool +comparator1 (const void *h11v, const void *h12v) +{ + const struct h1 *h11 = h11v; + const struct h1 *h12 = h12v; + + return h11->dev == h12->dev; +} + +...