projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge trunk
[m6w6/libmemcached]
/
libhashkit
/
types.h
diff --git
a/libhashkit/types.h
b/libhashkit/types.h
index 23bd9d5c4f22d2a8b992dbd012ba2ff9a6bc7ba5..66e4cd9c7785ec490665e26c0bb67261c49cdcea 100644
(file)
--- a/
libhashkit/types.h
+++ b/
libhashkit/types.h
@@
-36,13
+36,7
@@
*/
*/
-#ifndef HASHKIT_TYPES_H
-#define HASHKIT_TYPES_H
-
-#ifdef __cplusplus
-
-extern "C" {
-#endif
+#pragma once
typedef enum {
HASHKIT_SUCCESS,
typedef enum {
HASHKIT_SUCCESS,
@@
-53,6
+47,9
@@
typedef enum {
HASHKIT_MAXIMUM_RETURN /* Always add new error code before */
} hashkit_return_t;
HASHKIT_MAXIMUM_RETURN /* Always add new error code before */
} hashkit_return_t;
+#define hashkit_success(X) ((X) == HASHKIT_SUCCESS)
+#define hashkit_failed(X) ((X) != HASHKIT_SUCCESS)
+
typedef enum {
HASHKIT_HASH_DEFAULT= 0, // hashkit_one_at_a_time()
HASHKIT_HASH_MD5,
typedef enum {
HASHKIT_HASH_DEFAULT= 0, // hashkit_one_at_a_time()
HASHKIT_HASH_MD5,
@@
-79,6
+76,9
@@
typedef enum
HASHKIT_DISTRIBUTION_MAX /* Always add new values before this. */
} hashkit_distribution_t;
HASHKIT_DISTRIBUTION_MAX /* Always add new values before this. */
} hashkit_distribution_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
typedef struct hashkit_st hashkit_st;
typedef struct hashkit_st hashkit_st;
@@
-87,5
+87,3
@@
typedef uint32_t (*hashkit_hash_fn)(const char *key, size_t key_length, void *co
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
}
#endif
-
-#endif /* HASHKIT_TYPES_H */