#include #include #include #include #include #include #include "memcache-lite-private.h" MC(result_t) *memcache_result_new() { MC(result_t) *res = (MC(result_t) *) malloc(sizeof(MC(result_t))); if (res != NULL) bzero(res, sizeof(MC(result_t))); return res; } MC(return_t) memcache_result_free(MC(result_t) *result) { if (result == NULL) return RETURN_SUCCESS; if (result->data != NULL) free(result->data); free(result); return RETURN_SUCCESS; } int memcache_result_found(MC(result_t) *result) { if (result == NULL) return 0; return result->found; } char *memcache_result_key(MC(result_t) *result) { if (result == NULL) return NULL; return result->key; } char *memcache_result_data(MC(result_t) *result) { if (result == NULL) return NULL; return result->data; } size_t memcache_result_size(MC(result_t) *result) { if (result == NULL) return 0; return result->size; } short memcache_result_flags(MC(result_t) *result) { if (result == NULL) return 0; return result->flags; }