Merge lp:~tangent-org/libmemcached/1.0-build/ Build: jenkins-Libmemcached-187
[m6w6/libmemcached] / example / storage.h
1 /* -*- Mode: C; tab-width: 2; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 #pragma once
3
4 struct item {
5 uint64_t cas;
6 void* key;
7 size_t nkey;
8 void* data;
9 size_t size;
10 uint32_t flags;
11 time_t exp;
12 };
13
14 bool initialize_storage(void);
15 void shutdown_storage(void);
16
17 void update_cas(struct item* item);
18 void put_item(struct item* item);
19 struct item* get_item(const void* key, size_t nkey);
20 struct item* create_item(const void* key, size_t nkey, const void *data,
21 size_t size, uint32_t flags, time_t exp);
22 bool delete_item(const void* key, size_t nkey);
23 void flush(uint32_t when);
24 void release_item(struct item* item);