-struct redisCommand {
- char *name;
- int arity;
- int flags;
-};
-
-#define CMDFLAG_NONE 0
-#define CMDFLAG_RAWOUTPUT 1
-
-static struct redisCommand cmdTable[] = {
- {"auth",2,CMDFLAG_NONE},
- {"get",2,CMDFLAG_NONE},
- {"set",3,CMDFLAG_NONE},
- {"setnx",3,CMDFLAG_NONE},
- {"setex",4,CMDFLAG_NONE},
- {"append",3,CMDFLAG_NONE},
- {"substr",4,CMDFLAG_NONE},
- {"del",-2,CMDFLAG_NONE},
- {"exists",2,CMDFLAG_NONE},
- {"incr",2,CMDFLAG_NONE},
- {"decr",2,CMDFLAG_NONE},
- {"rpush",3,CMDFLAG_NONE},
- {"lpush",3,CMDFLAG_NONE},
- {"rpop",2,CMDFLAG_NONE},
- {"lpop",2,CMDFLAG_NONE},
- {"brpop",-3,CMDFLAG_NONE},
- {"blpop",-3,CMDFLAG_NONE},
- {"llen",2,CMDFLAG_NONE},
- {"lindex",3,CMDFLAG_NONE},
- {"lset",4,CMDFLAG_NONE},
- {"lrange",4,CMDFLAG_NONE},
- {"ltrim",4,CMDFLAG_NONE},
- {"lrem",4,CMDFLAG_NONE},
- {"rpoplpush",3,CMDFLAG_NONE},
- {"sadd",3,CMDFLAG_NONE},
- {"srem",3,CMDFLAG_NONE},
- {"smove",4,CMDFLAG_NONE},
- {"sismember",3,CMDFLAG_NONE},
- {"scard",2,CMDFLAG_NONE},
- {"spop",2,CMDFLAG_NONE},
- {"srandmember",2,CMDFLAG_NONE},
- {"sinter",-2,CMDFLAG_NONE},
- {"sinterstore",-3,CMDFLAG_NONE},
- {"sunion",-2,CMDFLAG_NONE},
- {"sunionstore",-3,CMDFLAG_NONE},
- {"sdiff",-2,CMDFLAG_NONE},
- {"sdiffstore",-3,CMDFLAG_NONE},
- {"smembers",2,CMDFLAG_NONE},
- {"zadd",4,CMDFLAG_NONE},
- {"zincrby",4,CMDFLAG_NONE},
- {"zrem",3,CMDFLAG_NONE},
- {"zremrangebyscore",4,CMDFLAG_NONE},
- {"zunion",-4,CMDFLAG_NONE},
- {"zinter",-4,CMDFLAG_NONE},
- {"zrange",-4,CMDFLAG_NONE},
- {"zrank",3,CMDFLAG_NONE},
- {"zrevrank",3,CMDFLAG_NONE},
- {"zrangebyscore",-4,CMDFLAG_NONE},
- {"zcount",4,CMDFLAG_NONE},
- {"zrevrange",-4,CMDFLAG_NONE},
- {"zcard",2,CMDFLAG_NONE},
- {"zscore",3,CMDFLAG_NONE},
- {"incrby",3,CMDFLAG_NONE},
- {"decrby",3,CMDFLAG_NONE},
- {"getset",3,CMDFLAG_NONE},
- {"randomkey",1,CMDFLAG_NONE},
- {"select",2,CMDFLAG_NONE},
- {"move",3,CMDFLAG_NONE},
- {"rename",3,CMDFLAG_NONE},
- {"renamenx",3,CMDFLAG_NONE},
- {"keys",2,CMDFLAG_NONE},
- {"dbsize",1,CMDFLAG_NONE},
- {"ping",1,CMDFLAG_NONE},
- {"echo",2,CMDFLAG_NONE},
- {"save",1,CMDFLAG_NONE},
- {"bgsave",1,CMDFLAG_NONE},
- {"rewriteaof",1,CMDFLAG_NONE},
- {"bgrewriteaof",1,CMDFLAG_NONE},
- {"shutdown",1,CMDFLAG_NONE},
- {"lastsave",1,CMDFLAG_NONE},
- {"type",2,CMDFLAG_NONE},
- {"flushdb",1,CMDFLAG_NONE},
- {"flushall",1,CMDFLAG_NONE},
- {"sort",-2,CMDFLAG_NONE},
- {"info",1,CMDFLAG_RAWOUTPUT},
- {"mget",-2,CMDFLAG_NONE},
- {"expire",3,CMDFLAG_NONE},
- {"expireat",3,CMDFLAG_NONE},
- {"ttl",2,CMDFLAG_NONE},
- {"slaveof",3,CMDFLAG_NONE},
- {"debug",-2,CMDFLAG_NONE},
- {"mset",-3,CMDFLAG_NONE},
- {"msetnx",-3,CMDFLAG_NONE},
- {"monitor",1,CMDFLAG_NONE},
- {"multi",1,CMDFLAG_NONE},
- {"exec",1,CMDFLAG_NONE},
- {"discard",1,CMDFLAG_NONE},
- {"hset",4,CMDFLAG_NONE},
- {"hget",3,CMDFLAG_NONE},
- {"hmset",-4,CMDFLAG_NONE},
- {"hmget",-3,CMDFLAG_NONE},
- {"hincrby",4,CMDFLAG_NONE},
- {"hdel",3,CMDFLAG_NONE},
- {"hlen",2,CMDFLAG_NONE},
- {"hkeys",2,CMDFLAG_NONE},
- {"hvals",2,CMDFLAG_NONE},
- {"hgetall",2,CMDFLAG_NONE},
- {"hexists",3,CMDFLAG_NONE},
- {"config",-2,CMDFLAG_NONE},
- {"subscribe",-2,CMDFLAG_NONE},
- {"unsubscribe",-1,CMDFLAG_NONE},
- {"psubscribe",-2,CMDFLAG_NONE},
- {"punsubscribe",-1,CMDFLAG_NONE},
- {"publish",3,CMDFLAG_NONE},
- {NULL,0,CMDFLAG_NONE}
-};
-