Hi,
I'm developing a module (httpd2.0) and I've come across a situation
where it would be great if I could "cache" an operation, by saving a
variable in memory, and keep it there throughout requests, ie:
/* top level */
static int module_id;
/* in init func */
module_id = cache_init();
/* In some other function */
cache_storage *p;
some_type_t *what_we_want; /* gotta love that variable name :) */
if (cache_get(module_id, &p) == SUCCESS) {
what_we_want = p->data;
}
else {
what_we_want = alloc_new();
cache_store(module_id, &what_we_want);
}
/* Manipulate what_we_want */
Is something like this available? (I don't need a full explanation,
although I wouldn't mind one, just a pointer to the source I should
be looking at...)
Thanks,
Sterling