-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nasreddine Bouafif
committed
Apr 1, 2010
1 parent
5646f10
commit f4af354
Showing
6 changed files
with
697 additions
and
683 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include "php.h" | ||
#include "php_ini.h" | ||
|
||
#define redis_sock_name "Redis Socket Buffer" | ||
#define REDIS_SOCK_STATUS_FAILED 0 | ||
#define REDIS_SOCK_STATUS_DISCONNECTED 1 | ||
#define REDIS_SOCK_STATUS_UNKNOWN 2 | ||
#define REDIS_SOCK_STATUS_CONNECTED 3 | ||
|
||
#define redis_multi_access_type_name "Redis Multi type access" | ||
|
||
/* properties */ | ||
#define REDIS_NOT_FOUND 0 | ||
#define REDIS_STRING 1 | ||
#define REDIS_SET 2 | ||
#define REDIS_LIST 3 | ||
|
||
#define REDIS_ATOMIC 0 | ||
#define REDIS_MULTI 1 | ||
#define REDIS_PIPELINE 2 | ||
|
||
#define IF_MULTI() if(get_flag(object) == REDIS_MULTI) | ||
#define IF_PIPELINE() if(get_flag(object) == REDIS_PIPELINE) | ||
#define IF_NOT_MULTI() if(get_flag(object) != REDIS_MULTI) | ||
#define ELSE_IF_MULTI() else {\ | ||
if(redis_response_enqueued(redis_sock TSRMLS_CC) == 1) {\ | ||
RETURN_ZVAL(getThis(), 1, 0);\ | ||
} else {\ | ||
RETURN_FALSE;\ | ||
}\ | ||
}\ | ||
|
||
#define MULTI_RESPONSE(string, callback) IF_MULTI() { \ | ||
fold_item *f1 = malloc(sizeof(fold_item)); \ | ||
f1->function_name = strdup(string); \ | ||
f1->fun = (void *)callback; \ | ||
f1->next = NULL; \ | ||
current->next = f1; \ | ||
current = f1; \ | ||
}\ | ||
|
||
/* {{{ struct RedisSock */ | ||
typedef struct RedisSock_ { | ||
php_stream *stream; | ||
char *host; | ||
unsigned short port; | ||
long timeout; | ||
int failed; | ||
int status; | ||
} RedisSock; | ||
/* }}} */ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.