cache/cache.c
author Tero Marttila <terom@fixme.fi>
Thu, 28 Aug 2008 01:42:28 +0300
changeset 45 10d514029c64
parent 31 12d5361e7472
permissions -rw-r--r--
documentation tweaks, add req_abort function prototype
#include <stdlib.h>

#include "../cache.h"
#include "cache.h"
#include "engine.h"

struct cache *cache_open (struct cache_engine *engine) {
    struct cache *cache;

    if (engine->fn_init(engine, &cache))
        goto error;

    return cache;

error:
    return NULL;
}

int cache_init (struct cache *cache, struct cache_engine *engine) {
    cache->engine = engine;

    LIST_INIT(&cache->op_list);

    return 0;
}