Back to index

libcitadel  8.12
Functions
functions to condense Key to an integer.
Hashlist Key Value list implementation;
Collaboration diagram for functions to condense Key to an integer.:

Functions

long Flathash (const char *str, long len)
 another hashing algorithm; treat it as just a pointer to int.
long lFlathash (const char *str, long len)
 another hashing algorithm; treat it as just a pointer to long.
int HashLittle (const void *key, size_t length)
 This exposes the hashlittle() function to consumers.

Function Documentation

long Flathash ( const char *  str,
long  len 
)

another hashing algorithm; treat it as just a pointer to int.

Parameters:
strOur pointer to the int value
lenthe length of the data pointed to; needs to be sizeof int, else we won't use it!
Returns:
the calculated hash value

Definition at line 577 of file hash.c.

{
       if (len != sizeof (int))
              return 0;
       else return *(int*)str;
}

Here is the caller graph for this function:

int HashLittle ( const void *  key,
size_t  length 
)

This exposes the hashlittle() function to consumers.

Definition at line 1153 of file hash.c.

                                               {
       return (int)hashlittle(key, length, 1);
}

Here is the call graph for this function:

long lFlathash ( const char *  str,
long  len 
)

another hashing algorithm; treat it as just a pointer to long.

Parameters:
strOur pointer to the long value
lenthe length of the data pointed to; needs to be sizeof long, else we won't use it!
Returns:
the calculated hash value

Definition at line 591 of file hash.c.

{
       if (len != sizeof (long))
              return 0;
       else return *(long*)str;
}

Here is the caller graph for this function: