26 #include <sys/types.h>
40 HashValue
this = _this;
41 char * key = va_arg(* params,
char*);
44 this->nkey = va_arg(* params,
size_t);
45 value = va_arg(* params,
void*);
46 this->nvalue = va_arg(* params,
size_t);
49 this->key[this->nkey] = 0;
50 memcpy(this->key, key, this->nkey);
52 this->hash =
sdbm((
unsigned char *)this->key, this->nkey);
55 this->value =
memMalloc(this->nvalue + 1);
56 ((
char*)this->value)[this->nvalue] = 0;
57 memcpy(this->value, value, this->nvalue);
67 HashValue
this = _this;
77 HashValue
this = _this;
86 HashValue
this = _this;
87 HashValue doub = _double;
97 tmp_value = this->value;
98 this->value = doub->value;
99 doub->value = tmp_value;
101 tmp_nvalue = this->nvalue;
102 this->nvalue = doub->nvalue;
103 doub->nvalue = tmp_nvalue;
static void hashValueDtor(void *_this)
static void hashValueHandleDouble(void *_this, void *_double)
unsigned long sdbm(const unsigned char *, size_t)
static int hashValueCtor(void *_this, va_list *params)
CREATE_CLASS(HashValue, NULL, IFACE(Class), IFACE(Hashable))
static unsigned long hashValueGetHash(void *_this)
INIT_IFACE(Class, hashValueCtor, hashValueDtor, NULL)