FreeBSD/usr.bin/catman/catman.c
/*
 * Finds a string in a hashtable keyed by inode & device number.
 */
Finds a string in a hashtable keyed by inode & device number.
Finds a string in a hashtable keyed by inode & device number .
static const char *
find_hashtable(struct hash_entry **table,
    ino_t inode_number,
    dev_t device_number)
{
	struct hash_entry *chain;
	chain = table[inode_number & HASH_MASK];
	while (chain != NULL) {
		if (chain->inode_number == inode_number &&
		    chain->device_number == device_number)
			return chain->data;
		chain = chain->next;
	}
	return NULL;
}
static const char * find_hashtable ( struct hash_entry * * table , ino_t inode_number , dev_t device_number ) { struct hash_entry * chain ; chain = table [ inode_number & HASH_MASK ] ; while ( chain != NULL ) { if ( chain -> inode_number == inode_number && chain -> device_number == device_number ) return chain -> data ; chain = chain -> next ; } return NULL ; }
Finds a string in a hashtable keyed by inode & device number.
Finds a string in a hashtable keyed by inode & device number .