加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
common.h 19.64 KB
一键复制 编辑 原始数据 按行查看 历史
Pavlo Yatsukhnenko 提交于 2020-03-16 22:54 . Fix arginfo for Redis::zadd
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
#include "php.h"
#include "php_ini.h"
#ifndef REDIS_COMMON_H
#define REDIS_COMMON_H
#define PHPREDIS_NOTUSED(v) ((void)v)
#include "zend_llist.h"
#include <ext/standard/php_var.h>
#include <ext/standard/php_math.h>
#include <zend_smart_str.h>
#include <ext/standard/php_smart_string.h>
#define PHPREDIS_ZVAL_IS_STRICT_FALSE(z) (Z_TYPE_P(z) == IS_FALSE)
#define PHPREDIS_GET_OBJECT(class_entry, z) (class_entry *)((char *)Z_OBJ_P(z) - XtOffsetOf(class_entry, std))
/* NULL check so Eclipse doesn't go crazy */
#ifndef NULL
#define NULL ((void *) 0)
#endif
typedef enum {
REDIS_SOCK_STATUS_FAILED = -1,
REDIS_SOCK_STATUS_DISCONNECTED,
REDIS_SOCK_STATUS_CONNECTED
} redis_sock_status;
#define _NL "\r\n"
/* properties */
#define REDIS_NOT_FOUND 0
#define REDIS_STRING 1
#define REDIS_SET 2
#define REDIS_LIST 3
#define REDIS_ZSET 4
#define REDIS_HASH 5
#define REDIS_STREAM 6
#ifdef PHP_WIN32
#define PHP_REDIS_API __declspec(dllexport)
#define phpredis_atoi64(p) _atoi64((p))
#else
#define PHP_REDIS_API
#define phpredis_atoi64(p) atoll((p))
#endif
/* reply types */
typedef enum _REDIS_REPLY_TYPE {
TYPE_EOF = -1,
TYPE_LINE = '+',
TYPE_INT = ':',
TYPE_ERR = '-',
TYPE_BULK = '$',
TYPE_MULTIBULK = '*'
} REDIS_REPLY_TYPE;
/* SCAN variants */
typedef enum _REDIS_SCAN_TYPE {
TYPE_SCAN,
TYPE_SSCAN,
TYPE_HSCAN,
TYPE_ZSCAN
} REDIS_SCAN_TYPE;
/* PUBSUB subcommands */
typedef enum _PUBSUB_TYPE {
PUBSUB_CHANNELS,
PUBSUB_NUMSUB,
PUBSUB_NUMPAT
} PUBSUB_TYPE;
/* options */
#define REDIS_OPT_SERIALIZER 1
#define REDIS_OPT_PREFIX 2
#define REDIS_OPT_READ_TIMEOUT 3
#define REDIS_OPT_SCAN 4
#define REDIS_OPT_FAILOVER 5
#define REDIS_OPT_TCP_KEEPALIVE 6
#define REDIS_OPT_COMPRESSION 7
#define REDIS_OPT_REPLY_LITERAL 8
#define REDIS_OPT_COMPRESSION_LEVEL 9
/* cluster options */
#define REDIS_FAILOVER_NONE 0
#define REDIS_FAILOVER_ERROR 1
#define REDIS_FAILOVER_DISTRIBUTE 2
#define REDIS_FAILOVER_DISTRIBUTE_SLAVES 3
/* serializers */
typedef enum {
REDIS_SERIALIZER_NONE,
REDIS_SERIALIZER_PHP,
REDIS_SERIALIZER_IGBINARY,
REDIS_SERIALIZER_MSGPACK,
REDIS_SERIALIZER_JSON
} redis_serializer;
/* compression */
#define REDIS_COMPRESSION_NONE 0
#define REDIS_COMPRESSION_LZF 1
#define REDIS_COMPRESSION_ZSTD 2
/* SCAN options */
#define REDIS_SCAN_NORETRY 0
#define REDIS_SCAN_RETRY 1
/* GETBIT/SETBIT offset range limits */
#define BITOP_MIN_OFFSET 0
#define BITOP_MAX_OFFSET 4294967295U
/* Transaction modes */
#define ATOMIC 0
#define MULTI 1
#define PIPELINE 2
#define IS_ATOMIC(redis_sock) (redis_sock->mode == ATOMIC)
#define IS_MULTI(redis_sock) (redis_sock->mode & MULTI)
#define IS_PIPELINE(redis_sock) (redis_sock->mode & PIPELINE)
#define PIPELINE_ENQUEUE_COMMAND(cmd, cmd_len) do { \
if (redis_sock->pipeline_cmd == NULL) { \
redis_sock->pipeline_cmd = zend_string_init(cmd, cmd_len, 0); \
} else { \
size_t pipeline_len = ZSTR_LEN(redis_sock->pipeline_cmd); \
redis_sock->pipeline_cmd = zend_string_realloc(redis_sock->pipeline_cmd, pipeline_len + cmd_len, 0); \
memcpy(&ZSTR_VAL(redis_sock->pipeline_cmd)[pipeline_len], cmd, cmd_len); \
} \
} while (0)
#define SOCKET_WRITE_COMMAND(redis_sock, cmd, cmd_len) \
if(redis_sock_write(redis_sock, cmd, cmd_len) < 0) { \
efree(cmd); \
RETURN_FALSE; \
}
#define REDIS_SAVE_CALLBACK(callback, closure_context) do { \
fold_item *fi = malloc(sizeof(fold_item)); \
fi->fun = (void *)callback; \
fi->ctx = closure_context; \
fi->next = NULL; \
if (redis_sock->current) { \
redis_sock->current->next = fi; \
} \
redis_sock->current = fi; \
if (NULL == redis_sock->head) { \
redis_sock->head = redis_sock->current; \
} \
} while (0)
#define REDIS_PROCESS_REQUEST(redis_sock, cmd, cmd_len) \
if (IS_PIPELINE(redis_sock)) { \
PIPELINE_ENQUEUE_COMMAND(cmd, cmd_len); \
} else { \
SOCKET_WRITE_COMMAND(redis_sock, cmd, cmd_len); \
} \
efree(cmd);
#define REDIS_PROCESS_RESPONSE_CLOSURE(function, closure_context) \
if (!IS_PIPELINE(redis_sock)) { \
if (redis_response_enqueued(redis_sock) != SUCCESS) { \
RETURN_FALSE; \
} \
} \
REDIS_SAVE_CALLBACK(function, closure_context); \
RETURN_ZVAL(getThis(), 1, 0); \
#define REDIS_PROCESS_RESPONSE(function) else { \
REDIS_PROCESS_RESPONSE_CLOSURE(function, NULL) \
}
/* Clear redirection info */
#define REDIS_MOVED_CLEAR(redis_sock) \
redis_sock->redir_slot = 0; \
redis_sock->redir_port = 0; \
redis_sock->redir_type = MOVED_NONE; \
/* Process a command assuming our command where our command building
* function is redis_<cmdname>_cmd */
#define REDIS_PROCESS_CMD(cmdname, resp_func) \
RedisSock *redis_sock; char *cmd; int cmd_len; void *ctx=NULL; \
if ((redis_sock = redis_sock_get(getThis(), 0)) == NULL || \
redis_##cmdname##_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU,redis_sock, \
&cmd, &cmd_len, NULL, &ctx)==FAILURE) { \
RETURN_FALSE; \
} \
REDIS_PROCESS_REQUEST(redis_sock, cmd, cmd_len); \
if (IS_ATOMIC(redis_sock)) { \
resp_func(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, NULL, ctx); \
} else { \
REDIS_PROCESS_RESPONSE_CLOSURE(resp_func, ctx) \
}
/* Process a command but with a specific command building function
* and keyword which is passed to us*/
#define REDIS_PROCESS_KW_CMD(kw, cmdfunc, resp_func) \
RedisSock *redis_sock; char *cmd; int cmd_len; void *ctx=NULL; \
if ((redis_sock = redis_sock_get(getThis(), 0)) == NULL || \
cmdfunc(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, kw, &cmd, \
&cmd_len, NULL, &ctx)==FAILURE) { \
RETURN_FALSE; \
} \
REDIS_PROCESS_REQUEST(redis_sock, cmd, cmd_len); \
if (IS_ATOMIC(redis_sock)) { \
resp_func(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock, NULL, ctx); \
} else { \
REDIS_PROCESS_RESPONSE_CLOSURE(resp_func, ctx) \
}
/* Extended SET argument detection */
#define IS_EX_ARG(a) \
((a[0]=='e' || a[0]=='E') && (a[1]=='x' || a[1]=='X') && a[2]=='\0')
#define IS_PX_ARG(a) \
((a[0]=='p' || a[0]=='P') && (a[1]=='x' || a[1]=='X') && a[2]=='\0')
#define IS_NX_ARG(a) \
((a[0]=='n' || a[0]=='N') && (a[1]=='x' || a[1]=='X') && a[2]=='\0')
#define IS_XX_ARG(a) \
((a[0]=='x' || a[0]=='X') && (a[1]=='x' || a[1]=='X') && a[2]=='\0')
#define IS_EX_PX_ARG(a) (IS_EX_ARG(a) || IS_PX_ARG(a))
#define IS_NX_XX_ARG(a) (IS_NX_ARG(a) || IS_XX_ARG(a))
/* Given a string and length, validate a zRangeByLex argument. The semantics
* here are that the argument must start with '(' or '[' or be just the char
* '+' or '-' */
#define IS_LEX_ARG(s,l) \
(l>0 && (*s=='(' || *s=='[' || (l==1 && (*s=='+' || *s=='-'))))
#define REDIS_ENABLE_MODE(redis_sock, m) (redis_sock->mode |= m)
#define REDIS_DISABLE_MODE(redis_sock, m) (redis_sock->mode &= ~m)
/* HOST_NAME_MAX doesn't exist everywhere */
#ifndef HOST_NAME_MAX
#if defined(_POSIX_HOST_NAME_MAX)
#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
#elif defined(MAXHOSTNAMELEN)
#define HOST_NAME_MAX MAXHOSTNAMELEN
#else
#define HOST_NAME_MAX 255
#endif
#endif
typedef struct fold_item {
zval * (*fun)(INTERNAL_FUNCTION_PARAMETERS, void *, ...);
void *ctx;
struct fold_item *next;
} fold_item;
/* {{{ struct RedisSock */
typedef struct {
php_stream *stream;
zend_string *host;
int port;
zend_string *auth;
double timeout;
double read_timeout;
long retry_interval;
redis_sock_status status;
int persistent;
int watching;
zend_string *persistent_id;
redis_serializer serializer;
int compression;
int compression_level;
long dbNumber;
zend_string *prefix;
short mode;
fold_item *head;
fold_item *current;
zend_string *pipeline_cmd;
zend_string *err;
int scan;
int readonly;
int reply_literal;
int tcp_keepalive;
} RedisSock;
/* }}} */
typedef struct {
zend_llist list;
int nb_active;
} ConnectionPool;
typedef struct {
RedisSock *sock;
zend_object std;
} redis_object;
/** Argument info for any function expecting 0 args */
ZEND_BEGIN_ARG_INFO_EX(arginfo_void, 0, 0, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_key, 0, 0, 1)
ZEND_ARG_INFO(0, key)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_value, 0, 0, 1)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_key_value, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_key_expire_value, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, expire)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_key_newkey, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, newkey)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_pairs, 0, 0, 1)
ZEND_ARG_ARRAY_INFO(0, pairs, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_nkeys, 0, 0, 1)
ZEND_ARG_INFO(0, key)
ZEND_ARG_VARIADIC_INFO(0, other_keys)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_dst_nkeys, 0, 0, 2)
ZEND_ARG_INFO(0, dst)
ZEND_ARG_INFO(0, key)
ZEND_ARG_VARIADIC_INFO(0, other_keys)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_key_min_max, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, min)
ZEND_ARG_INFO(0, max)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_key_member, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, member)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_key_member_value, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, member)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_key_members, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, member)
ZEND_ARG_VARIADIC_INFO(0, other_members)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_key_timestamp, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, timestamp)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_key_offset, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_key_offset_value, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_swapdb, 0, 0, 2)
ZEND_ARG_INFO(0, srcdb)
ZEND_ARG_INFO(0, dstdb)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_key_start_end, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, start)
ZEND_ARG_INFO(0, end)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_echo, 0, 0, 1)
ZEND_ARG_INFO(0, msg)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_expire, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, timeout)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_set, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, value)
ZEND_ARG_INFO(0, opts)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_lset, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, index)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_blrpop, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, timeout_or_key)
ZEND_ARG_VARIADIC_INFO(0, extra_args)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_linsert, 0, 0, 4)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, position)
ZEND_ARG_INFO(0, pivot)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_lindex, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, index)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_brpoplpush, 0, 0, 3)
ZEND_ARG_INFO(0, src)
ZEND_ARG_INFO(0, dst)
ZEND_ARG_INFO(0, timeout)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_rpoplpush, 0, 0, 2)
ZEND_ARG_INFO(0, src)
ZEND_ARG_INFO(0, dst)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_sadd_array, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_ARRAY_INFO(0, options, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_srand_member, 0, 0, 1)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, count)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_zadd, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, score)
ZEND_ARG_INFO(0, value)
ZEND_ARG_VARIADIC_INFO(0, extra_args)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_zincrby, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, value)
ZEND_ARG_INFO(0, member)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_hmget, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_ARRAY_INFO(0, keys, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_hmset, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_ARRAY_INFO(0, pairs, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_bitop, 0, 0, 3)
ZEND_ARG_INFO(0, operation)
ZEND_ARG_INFO(0, ret_key)
ZEND_ARG_INFO(0, key)
ZEND_ARG_VARIADIC_INFO(0, other_keys)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_bitpos, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, bit)
ZEND_ARG_INFO(0, start)
ZEND_ARG_INFO(0, end)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ltrim, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, start)
ZEND_ARG_INFO(0, stop)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_publish, 0, 0, 2)
ZEND_ARG_INFO(0, channel)
ZEND_ARG_INFO(0, message)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_pfadd, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_ARRAY_INFO(0, elements, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_pfmerge, 0, 0, 2)
ZEND_ARG_INFO(0, dstkey)
ZEND_ARG_ARRAY_INFO(0, keys, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_restore, 0, 0, 3)
ZEND_ARG_INFO(0, ttl)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_smove, 0, 0, 3)
ZEND_ARG_INFO(0, src)
ZEND_ARG_INFO(0, dst)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_zrange, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, start)
ZEND_ARG_INFO(0, end)
ZEND_ARG_INFO(0, scores)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_zrangebyscore, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, start)
ZEND_ARG_INFO(0, end)
ZEND_ARG_ARRAY_INFO(0, options, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_zrangebylex, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, min)
ZEND_ARG_INFO(0, max)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, limit)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_zstore, 0, 0, 2)
ZEND_ARG_INFO(0, key)
ZEND_ARG_ARRAY_INFO(0, keys, 0)
ZEND_ARG_ARRAY_INFO(0, weights, 1)
ZEND_ARG_INFO(0, aggregate)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_sort, 0, 0, 1)
ZEND_ARG_INFO(0, key)
ZEND_ARG_ARRAY_INFO(0, options, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_object, 0, 0, 2)
ZEND_ARG_INFO(0, field)
ZEND_ARG_INFO(0, key)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_subscribe, 0, 0, 2)
ZEND_ARG_ARRAY_INFO(0, channels, 0)
ZEND_ARG_INFO(0, callback)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_psubscribe, 0, 0, 2)
ZEND_ARG_ARRAY_INFO(0, patterns, 0)
ZEND_ARG_INFO(0, callback)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_unsubscribe, 0, 0, 1)
ZEND_ARG_INFO(0, channel)
ZEND_ARG_VARIADIC_INFO(0, other_channels)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_punsubscribe, 0, 0, 1)
ZEND_ARG_INFO(0, pattern)
ZEND_ARG_VARIADIC_INFO(0, other_patterns)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_eval, 0, 0, 1)
ZEND_ARG_INFO(0, script)
ZEND_ARG_INFO(0, args)
ZEND_ARG_INFO(0, num_keys)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_evalsha, 0, 0, 1)
ZEND_ARG_INFO(0, script_sha)
ZEND_ARG_INFO(0, args)
ZEND_ARG_INFO(0, num_keys)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_getoption, 0, 0, 1)
ZEND_ARG_INFO(0, option)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_setoption, 0, 0, 2)
ZEND_ARG_INFO(0, option)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_watch, 0, 0, 1)
ZEND_ARG_INFO(0, key)
ZEND_ARG_VARIADIC_INFO(0, other_keys)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_command, 0, 0, 0)
ZEND_ARG_VARIADIC_INFO(0, args)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_rawcommand, 0, 0, 1)
ZEND_ARG_INFO(0, cmd)
ZEND_ARG_VARIADIC_INFO(0, args)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_geoadd, 0, 0, 4)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, lng)
ZEND_ARG_INFO(0, lat)
ZEND_ARG_INFO(0, member)
ZEND_ARG_VARIADIC_INFO(0, other_triples)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_geodist, 0, 0, 3)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, src)
ZEND_ARG_INFO(0, dst)
ZEND_ARG_INFO(0, unit)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_georadius, 0, 0, 5)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, lng)
ZEND_ARG_INFO(0, lan)
ZEND_ARG_INFO(0, radius)
ZEND_ARG_INFO(0, unit)
ZEND_ARG_ARRAY_INFO(0, opts, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_georadiusbymember, 0, 0, 4)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, member)
ZEND_ARG_INFO(0, radius)
ZEND_ARG_INFO(0, unit)
ZEND_ARG_ARRAY_INFO(0, opts, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_xadd, 0, 0, 3)
ZEND_ARG_INFO(0, str_key)
ZEND_ARG_INFO(0, str_id)
ZEND_ARG_ARRAY_INFO(0, arr_fields, 0)
ZEND_ARG_INFO(0, i_maxlen)
ZEND_ARG_INFO(0, boo_approximate)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_xpending, 0, 0, 2)
ZEND_ARG_INFO(0, str_key)
ZEND_ARG_INFO(0, str_group)
ZEND_ARG_INFO(0, str_start)
ZEND_ARG_INFO(0, str_end)
ZEND_ARG_INFO(0, i_count)
ZEND_ARG_INFO(0, str_consumer)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_xrange, 0, 0, 3)
ZEND_ARG_INFO(0, str_key)
ZEND_ARG_INFO(0, str_start)
ZEND_ARG_INFO(0, str_end)
ZEND_ARG_INFO(0, i_count)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_xread, 0, 0, 1)
ZEND_ARG_ARRAY_INFO(0, arr_streams, 0)
ZEND_ARG_INFO(0, i_count)
ZEND_ARG_INFO(0, i_block)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_xreadgroup, 0, 0, 3)
ZEND_ARG_INFO(0, str_group)
ZEND_ARG_INFO(0, str_consumer)
ZEND_ARG_ARRAY_INFO(0, arr_streams, 0)
ZEND_ARG_INFO(0, i_count)
ZEND_ARG_INFO(0, i_block)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_xack, 0, 0, 3)
ZEND_ARG_INFO(0, str_key)
ZEND_ARG_INFO(0, str_group)
ZEND_ARG_ARRAY_INFO(0, arr_ids, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_xclaim, 0, 0, 5)
ZEND_ARG_INFO(0, str_key)
ZEND_ARG_INFO(0, str_group)
ZEND_ARG_INFO(0, str_consumer)
ZEND_ARG_INFO(0, i_min_idle)
ZEND_ARG_ARRAY_INFO(0, arr_ids, 0)
ZEND_ARG_ARRAY_INFO(0, arr_opts, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_xgroup, 0, 0, 1)
ZEND_ARG_INFO(0, str_operation)
ZEND_ARG_INFO(0, str_key)
ZEND_ARG_INFO(0, str_arg1)
ZEND_ARG_INFO(0, str_arg2)
ZEND_ARG_INFO(0, str_arg3)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_xinfo, 0, 0, 1)
ZEND_ARG_INFO(0, str_cmd)
ZEND_ARG_INFO(0, str_key)
ZEND_ARG_INFO(0, str_group)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_xtrim, 0, 0, 2)
ZEND_ARG_INFO(0, str_key)
ZEND_ARG_INFO(0, i_maxlen)
ZEND_ARG_INFO(0, boo_approximate)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_xdel, 0, 0, 2)
ZEND_ARG_INFO(0, str_key)
ZEND_ARG_ARRAY_INFO(0, arr_ids, 0)
ZEND_END_ARG_INFO()
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化