cache/cache.c
author Tero Marttila <terom@fixme.fi>
Wed, 27 Aug 2008 22:42:27 +0300
changeset 42 0e503189af2f
parent 31 12d5361e7472
permissions -rw-r--r--
more reply-receiving code, but still incomplete
#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;
}