X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=example%2Fstorage.c;h=84894476fe7cbc0eff1d6a8edaa1a9a812691140;hb=d4c5a2229396c74f3e66767f01ce4c8853eba92b;hp=39b22cafd40740252c8b346ff7b8c70cd37ad40e;hpb=771170f522f2186b7fb0cde6052dbe37c1a9f1b7;p=awesomized%2Flibmemcached diff --git a/example/storage.c b/example/storage.c index 39b22caf..84894476 100644 --- a/example/storage.c +++ b/example/storage.c @@ -1,4 +1,5 @@ /* -*- Mode: C; tab-width: 2; c-basic-offset: 2; indent-tabs-mode: nil -*- */ +#include "config.h" #include #include #include @@ -15,17 +16,17 @@ struct list_entry { static struct list_entry *root; static uint64_t cas; -bool initialize_storage(void) +bool initialize_storage(void) { return true; } -void shutdown_storage(void) +void shutdown_storage(void) { /* Do nothing */ } -void put_item(struct item* item) +void put_item(struct item* item) { struct list_entry* entry= (void*)item; @@ -46,7 +47,7 @@ void put_item(struct item* item) root= entry; } -struct item* get_item(const void* key, size_t nkey) +struct item* get_item(const void* key, size_t nkey) { struct list_entry *walker= root; @@ -104,7 +105,7 @@ struct item* create_item(const void* key, size_t nkey, const void* data, return ret; } -bool delete_item(const void* key, size_t nkey) +bool delete_item(const void* key, size_t nkey) { struct item* item= get_item(key, nkey); bool ret= false; @@ -137,7 +138,7 @@ bool delete_item(const void* key, size_t nkey) return ret; } -void flush(uint32_t when) +void flush(uint32_t when) { /* FIXME */ (void)when; @@ -159,12 +160,12 @@ void flush(uint32_t when) } } -void update_cas(struct item* item) +void update_cas(struct item* item) { item->cas= ++cas; } -void release_item(struct item* item __attribute__((unused))) +void release_item(struct item* item __attribute__((unused))) { /* EMPTY */ }