Add new method which allows someone to "take" a value from a result object.
[m6w6/libmemcached] / libmemcached-1.0 / result.h
index 41608b5b8f89e081893f031c29d2a9f4f76adc09..615957f3906420cbb204168b00ca6387b74d9be0 100644 (file)
@@ -2,8 +2,8 @@
  * 
  *  Libmemcached library
  *
- *  Copyright (C) 2011 Data Differential, http://datadifferential.com/
- *  Copyright (C) 2006-2009 Brian Aker All rights reserved.
+ *  Copyright (C) 2011 Data Differential, http://datadifferential.com/ 
+ *  All rights reserved.
  *
  *  Redistribution and use in source and binary forms, with or without
  *  modification, are permitted provided that the following conditions are
  *
  */
 
-#pragma once
+#include <libmemcached-1.0/struct/result.h>
 
-struct memcached_result_st {
-  uint32_t item_flags;
-  time_t item_expiration;
-  size_t key_length;
-  uint64_t item_cas;
-  memcached_st *root;
-  memcached_string_st value;
-  uint64_t count;
-  char item_key[MEMCACHED_MAX_KEY];
-  struct {
-    bool is_allocated:1;
-    bool is_initialized:1;
-  } options;
-  /* Add result callback function */
-};
+#pragma once
 
 #ifdef __cplusplus
 extern "C" {
@@ -77,6 +63,9 @@ size_t memcached_result_key_length(const memcached_result_st *self);
 LIBMEMCACHED_API
 const char *memcached_result_value(const memcached_result_st *self);
 
+LIBMEMCACHED_API
+char *memcached_result_take_value(memcached_result_st *self);
+
 LIBMEMCACHED_API
 size_t memcached_result_length(const memcached_result_st *self);