#ifndef CACHE_ENGINE_H
#define CACHE_ENGINE_H
struct cache_engine {
/*
* Allocate a `struct cache`-compatible struct and return it via cache_ptr.
*/
int (*fn_init) (struct cache_engine *, struct cache **);
/*
* Allocate a `struct cache_op`-compatible struct and return it via cache_ptr.
*
* Begin the index lookup.
*/
int (*fn_op_start) (struct cache *, struct cache_op **, struct cache_key *);
/*
* Prepare to write and possibly read this cache entry.
*
* size_hint, if nonzero, provides a guess at the size of the cache entry that can be used to optimize stuff
*/
int (*fn_op_begin_write) (struct cache_op *, size_t size_hint);
int (*fn_op_push) (struct cache_op *op, int fd, size_t *size);
};
#endif /* CACHE_ENGINE_H */