httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sterling Hughes <sterl...@designmultimedia.com>
Subject Caching handles?
Date Sat, 18 Aug 2001 05:40:07 GMT
	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


Mime
View raw message