projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Fix macro for Linux
[awesomized/libmemcached]
/
libmemcached
/
callback.c
diff --git
a/libmemcached/callback.c
b/libmemcached/callback.c
index e87d775cf908b5dc86d6ca1a7261843866eceaae..29fcd1f8429de08ad9c676d5c67769f60b76f384 100644
(file)
--- a/
libmemcached/callback.c
+++ b/
libmemcached/callback.c
@@
-9,17
+9,17
@@
*
*/
*
*/
-#include "common.h"
+#include "common.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/tcp.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/tcp.h>
-/*
+/*
These functions provide data and function callback support
*/
These functions provide data and function callback support
*/
-memcached_return_t memcached_callback_set(memcached_st *ptr,
- const memcached_callback_t flag,
+memcached_return_t memcached_callback_set(memcached_st *ptr,
+ const memcached_callback_t flag,
void *data)
{
switch (flag)
void *data)
{
switch (flag)
@@
-38,7
+38,7
@@
memcached_return_t memcached_callback_set(memcached_st *ptr,
}
if ((key_length > MEMCACHED_PREFIX_KEY_MAX_SIZE -1)
}
if ((key_length > MEMCACHED_PREFIX_KEY_MAX_SIZE -1)
- || (str
cpy(ptr->prefix_key, key
) == NULL))
+ || (str
ncpy(ptr->prefix_key, key, MEMCACHED_PREFIX_KEY_MAX_SIZE
) == NULL))
{
ptr->prefix_key_length= 0;
return MEMCACHED_BAD_KEY_PROVIDED;
{
ptr->prefix_key_length= 0;
return MEMCACHED_BAD_KEY_PROVIDED;
@@
-50,7
+50,7
@@
memcached_return_t memcached_callback_set(memcached_st *ptr,
}
else
{
}
else
{
-
memset(ptr->prefix_key, 0, MEMCACHED_PREFIX_KEY_MAX_SIZE)
;
+
ptr->prefix_key[0]= 0
;
ptr->prefix_key_length= 0;
}
ptr->prefix_key_length= 0;
}
@@
-113,7
+113,7
@@
memcached_return_t memcached_callback_set(memcached_st *ptr,
return MEMCACHED_SUCCESS;
}
return MEMCACHED_SUCCESS;
}
-void *memcached_callback_get(memcached_st *ptr,
+void *memcached_callback_get(memcached_st *ptr,
const memcached_callback_t flag,
memcached_return_t *error)
{
const memcached_callback_t flag,
memcached_return_t *error)
{
@@
-126,15
+126,15
@@
void *memcached_callback_get(memcached_st *ptr,
{
case MEMCACHED_CALLBACK_PREFIX_KEY:
{
{
case MEMCACHED_CALLBACK_PREFIX_KEY:
{
- if (ptr->prefix_key
[0] == 0
)
+ if (ptr->prefix_key
_length
)
{
{
- *error= MEMCACHED_
FAILURE
;
- return
NULL
;
+ *error= MEMCACHED_
SUCCESS
;
+ return
(void *)ptr->prefix_key
;
}
else
{
}
else
{
- *error= MEMCACHED_
SUCCESS
;
- return
(void *)ptr->prefix_key
;
+ *error= MEMCACHED_
FAILURE
;
+ return
NULL
;
}
}
case MEMCACHED_CALLBACK_USER_DATA:
}
}
case MEMCACHED_CALLBACK_USER_DATA: