Configuration/Find_Keyword [ Functions ]
FUNCTION
Find a keyword in the hash table
SYNOPSIS
char *Find_Keyword( char *keyword, int len )
INPUTS
- keyword -- The keyword string
- len -- The length of the keyword string
RETURN VALUE
- pointer to the found keyword string in hash table or
- NULL if the keyword is not found
SOURCE
{ unsigned long hash; struct keywords_hash_s *curr; // Calculate hash value hash = Hash_Keyword( keyword, len ); // Seek through hash table row for ( curr = keywords_hash[hash]; curr; curr = curr->next ) { // Check for keyword in row element if ( !strncmp( keyword, curr->keyword, len ) ) { // Found it! return curr->keyword; } } // Keyword not found return NULL; }