Skip to content
Snippets Groups Projects
Commit 0ba52cca authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

docs: purge long-dead cache API from an example

parent e2621d92
No related branches found
No related tags found
1 merge request!362LMDB fixes
......@@ -279,20 +279,11 @@ Here's an example how a module can expose its property:
{
/* Get cache from engine. */
struct engine *engine = env;
namedb_t *cache = engine->resolver.cache;
/* Open read transaction */
struct kr_cache_txn txn;
int ret = kr_cache_txn_begin(cache, &txn, NAMEDB_RDONLY);
if (ret != 0) {
return NULL;
}
struct kr_cache *cache = &engine->resolver.cache;
/* Read item count */
int count = (cache->api)->count(cache->db);
char *result = NULL;
const namedb_api_t *api = kr_cache_storage();
asprintf(&result, "{ \"result\": %d }", api->count(&txn));
kr_cache_txn_abort(&txn);
asprintf(&result, "{ \"result\": %d }", count);
return result;
}
......@@ -332,4 +323,4 @@ regular tables.
.. _`not present in Go`: http://blog.golang.org/gos-declaration-syntax
.. _CGO: http://golang.org/cmd/cgo/
.. |---| unicode:: U+02014 .. em dash
\ No newline at end of file
.. |---| unicode:: U+02014 .. em dash
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment