X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fmemcached_types.h;h=d8c68f181548f11ecc5a283359ab3ded6c5a9c28;hb=76869574486dceca688e05b7028d8b88485a36a0;hp=d7bb470ab915d9868df4133e8b7f26260f267294;hpb=20b4431225d4ccd4aa22f6d7f67476c92d1c9546;p=m6w6%2Flibmemcached diff --git a/libmemcached/memcached_types.h b/libmemcached/memcached_types.h index d7bb470a..d8c68f18 100644 --- a/libmemcached/memcached_types.h +++ b/libmemcached/memcached_types.h @@ -6,8 +6,12 @@ * Author: Brian Aker */ -#ifndef __MEMCACHED_TYPES_H__ -#define __MEMCACHED_TYPES_H__ +#ifndef LIBMEMCACHED_MEMCACHED_TYPES_H +#define LIBMEMCACHED_MEMCACHED_TYPES_H + +#ifndef LIBMEMCACHED_MEMCACHED_H +#error "Please include instead" +#endif #ifdef __cplusplus extern "C" { @@ -37,8 +41,70 @@ typedef memcached_return (*memcached_trigger_delete_key)(memcached_st *ptr, typedef memcached_return (*memcached_dump_func)(memcached_st *ptr, const char *key, size_t key_length, void *context); +struct memcached_string_st { + memcached_st *root; + char *end; + char *string; + size_t current_size; + size_t block_size; + bool is_allocated; +}; + +struct memcached_result_st { + uint32_t flags; + bool is_allocated; + time_t expiration; + memcached_st *root; + size_t key_length; + uint64_t cas; + memcached_string_st value; + char key[MEMCACHED_MAX_KEY]; + /* Add result callback function */ +}; + +struct memcached_st { + uint8_t purging; + bool is_allocated; + uint8_t distribution; + uint8_t hash; + uint32_t continuum_points_counter; + memcached_server_st *hosts; + int32_t snd_timeout; + int32_t rcv_timeout; + uint32_t server_failure_limit; + uint32_t io_msg_watermark; + uint32_t io_bytes_watermark; + uint32_t io_key_prefetch; + uint32_t number_of_hosts; + uint32_t cursor_server; + int cached_errno; + uint32_t flags; + int32_t poll_timeout; + int32_t connect_timeout; + int32_t retry_timeout; + uint32_t continuum_count; + int send_size; + int recv_size; + void *user_data; + time_t next_distribution_rebuild; + size_t prefix_key_length; + memcached_hash hash_continuum; + memcached_result_st result; + memcached_continuum_item_st *continuum; + memcached_clone_func on_clone; + memcached_cleanup_func on_cleanup; + memcached_free_function call_free; + memcached_malloc_function call_malloc; + memcached_realloc_function call_realloc; + memcached_calloc_function call_calloc; + memcached_trigger_key get_key_failure; + memcached_trigger_delete_key delete_trigger; + char prefix_key[MEMCACHED_PREFIX_KEY_MAX_SIZE]; + uint32_t number_of_replicas; +}; + #ifdef __cplusplus } #endif -#endif /* __MEMCACHED_TYPES_H__ */ +#endif /* LIBMEMCACHED_MEMCACHED_TYPES_H */