26 #include <sys/types.h>
37 ConfigValue
this = _this;
39 char * key = va_arg(*params,
char *);
40 size_t nkey = va_arg(*params,
size_t);
41 char * value = va_arg(*params,
char *);
42 size_t nvalue = va_arg(*params,
size_t);
44 this->hash =
sdbm((
unsigned char *)key, nkey);
52 if ((
'"' == value[0] &&
'"' == value[nvalue-1])
53 || (
'\'' == value[0] &&
'\'' == value[nvalue-1]))
56 (this->value).
string =
memMalloc(nvalue-1);
57 (this->value).
string[nvalue-2] =
'\0';
58 memcpy((this->value).
string, value+1, nvalue-2);
59 this->nvalue = nvalue;
62 (this->value).number = atoll(value);
63 this->nvalue =
sizeof(
long long);
73 ConfigValue
this = _this;
84 ConfigValue
this = _this;
INIT_IFACE(Class, configValueCtor, configValueDtor, NULL)
static int configValueCtor(void *_this, va_list *params)
unsigned long sdbm(const unsigned char *, size_t)
static void configValueDtor(void *_this)
static void configValueHandleDouble(void *_this, void *_double)
CREATE_CLASS(ConfigValue, NULL, IFACE(Class), IFACE(Hashable))
static unsigned long configValueGetHash(void *_this)