X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=example%2Fstorage.h;h=bd1b878097d9ebcdf0a32f91912cb3962c8ce87c;hb=92d18858b417309f6bdee6bce464a4f3d6a375fd;hp=fbe75474d6bdca581e58783574e52ad2878a4e18;hpb=9131482f7923cf9e90b5a715b38e70e3a229b052;p=awesomized%2Flibmemcached diff --git a/example/storage.h b/example/storage.h index fbe75474..bd1b8780 100644 --- a/example/storage.h +++ b/example/storage.h @@ -1,6 +1,5 @@ /* -*- Mode: C; tab-width: 2; c-basic-offset: 2; indent-tabs-mode: nil -*- */ -#ifndef STORAGE_H -#define STORAGE_H +#pragma once struct item { uint64_t cas; @@ -12,12 +11,14 @@ struct item { time_t exp; }; +bool initialize_storage(void); +void shutdown_storage(void); + void update_cas(struct item* item); void put_item(struct item* item); struct item* get_item(const void* key, size_t nkey); -struct item* create_item(const void* key, size_t nkey, const void *data, +struct item* create_item(const void* key, size_t nkey, const void *data, size_t size, uint32_t flags, time_t exp); bool delete_item(const void* key, size_t nkey); void flush(uint32_t when); - -#endif +void release_item(struct item* item);