#ifndef MEMCACHE_LITE_H #define MEMCACHE_LITE_H #include #define MEMCACHE_MAX_KEY_LEN 250 typedef struct memcache_state_type *memcache_state_t; typedef struct memcache_result_type *memcache_result_t; typedef enum { MEMCACHE_FAILURE = -1, MEMCACHE_SUCCESS} memcache_return_t; memcache_state_t *memcache_initialize(); memcache_return_t memcache_destroy(memcache_state_t *state); memcache_return_t memcache_connect(memcache_state_t *state, const char *path_to_socket); memcache_return_t memcache_reconnect(memcache_state_t *state); memcache_return_t memcache_connected(memcache_state_t *state); memcache_return_t memcache_get(memcache_state_t *state, const char *key, memcache_result_t *result); memcache_return_t memcache_set(memcache_state_t *state, const char *key, void *data, time_t expiration, unsigned int flags, size_t size); memcache_return_t memcache_add(memcache_state_t *state, const char *key, void *data, time_t expiration, unsigned int flags, size_t size); memcache_return_t memcache_replace(memcache_state_t *state, const char *key, void *data, size_t data_size, time_t expiration, short int flags); memcache_return_t memcache_del(memcache_state_t *state, const char *key, time_t when); /* TODO */ memcache_return_t memcache_flush_all(memcache_state_t *state, time_t when); memcache_return_t memcache_stats(memcache_state_t *state); memcache_return_t memcache_quit(memcache_state_t *state); /* END TODO */ memcache_result_t *memcache_result_new(); memcache_return_t memcache_result_free(memcache_result_t *result); int memcache_result_found(memcache_result_t *result); char *memcache_result_key(memcache_result_t *result); char *memcache_result_data(memcache_result_t *result); size_t memcache_result_size(memcache_result_t *result); short memcache_result_flags(memcache_result_t *result); #endif