26 #include <sys/types.h>
41 HttpCookie
this = _this;
42 char * key = va_arg(* params,
char*);
45 this->nkey = va_arg(* params,
size_t);
46 value = va_arg(* params,
char*);
47 this->nvalue = va_arg(* params,
size_t);
50 this->key[this->nkey] = 0;
51 memcpy(this->key, key, this->nkey);
53 this->value =
memMalloc(this->nvalue + 1);
54 this->value[this->nvalue] = 0;
55 memcpy(this->value, value, this->nvalue);
57 this->hash =
sdbm((
unsigned char *)key, nkey);
66 HttpCookie
this = _this;
78 HttpCookie
this = _this;
87 HttpCookie
this = _this;
88 HttpCookie doub = _double;
90 SWAP(
char*, this->key, doub->key);
91 SWAP(
char*, this->value, doub->value);
92 SWAP(
char*, this->domain, doub->domain);
93 SWAP(
char*, this->path, doub->path);
95 SWAP(
char*, this->nkey, doub->nkey);
96 SWAP(
char*, this->nvalue, doub->nvalue);
static unsigned long httpCookieGetHash(void *_this)
unsigned long sdbm(const unsigned char *, size_t)
CREATE_CLASS(HttpCookie, NULL, IFACE(Class), IFACE(Hashable))
static void httpCookieHandleDouble(void *_this, void *_double)
INIT_IFACE(Class, httpCookieCtor, httpCookieDtor, NULL)
static int httpCookieCtor(void *_this, va_list *params)
static void httpCookieDtor(void *_this, va_list *params)