|
Server 0.0.1
HTTP/REST server implementation
|
00001 00023 #include <search.h> 00024 #include <sys/types.h> 00025 00026 #include "hash.h" 00027 #include "utils/hash.h" 00028 00029 static 00030 inline 00031 int 00032 hashGetComp(const void * a, const void * b) 00033 { 00034 return hashableGetHash((void*)b) - *(const unsigned long*)a; 00035 } 00036 00037 void * 00038 hashGet(Hash this, const char * search, size_t nsearch) 00039 { 00040 unsigned long hash = sdbm((const unsigned char *)search, nsearch); 00041 void * found = tfind(&hash, &(this->root), hashGetComp); 00042 00043 return (NULL != found)? *(void**)found : NULL; 00044 } 00045 00046 // vim: set ts=4 sw=4: