projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge in all changes related to being able to read configuration files.
[awesomized/libmemcached]
/
libmemcached
/
string.h
diff --git
a/libmemcached/string.h
b/libmemcached/string.h
index ef567874248a8b47c408648818f8f7398e99f888..f6a13bb000f7b695fad5ed3d9beda7585bb6712b 100644
(file)
--- a/
libmemcached/string.h
+++ b/
libmemcached/string.h
@@
-9,6
+9,7
@@
*
*/
*
*/
+#pragma once
#ifndef __LIBMEMCACHED_STRING_H__
#define __LIBMEMCACHED_STRING_H__
#ifndef __LIBMEMCACHED_STRING_H__
#define __LIBMEMCACHED_STRING_H__
@@
-28,11
+29,16
@@
struct memcached_string_st {
size_t current_size;
const memcached_st *root;
struct {
size_t current_size;
const memcached_st *root;
struct {
- bool is_allocated
MEMCACHED_BITFIELD
;
- bool is_initialized
MEMCACHED_BITFIELD
;
+ bool is_allocated
:1
;
+ bool is_initialized
:1
;
} options;
};
} options;
};
+struct memcached_string_t {
+ size_t size;
+ const char *c_str;
+};
+
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
extern "C" {
#endif
@@
-79,4
+85,10
@@
void memcached_string_set_length(memcached_string_st *self, size_t length);
#endif
#endif
+#ifdef __cplusplus
+#define memcached_string_with_size(X) (X), (static_cast<size_t>((sizeof(X) - 1)))
+#else
+#define memcached_string_with_size(X) (X), ((size_t)((sizeof(X) - 1)))
+#endif
+
#endif /* __LIBMEMCACHED_STRING_H__ */
#endif /* __LIBMEMCACHED_STRING_H__ */