hiredis api部分详解

发送命令

  • void* redisCommand(redisContext c,const char format,...);
    • 参数
    • 返回值
      • 返回值是一个void类型的指针,实际为指向一个redisReply类型的指针
      typedef struct redisReply{ // 命令执行结果的返回类型下面有写 int type; // 存储执行结果返回为整数 long long integer; // 字符串值的长度 size_t len; // 存储命令执行结果返回时字符串 char *str; // 返回结果时数组的大小 size_t elements; // 存储执行结果返回时数组 struct redisReply **element;}redisRenly

标识

+ REDIS_REPLY_STRING==1+ REDIS_REPLY_ARRAY==2+ REDIS_REPLY_INEGER==3+ REDIS_REPLY_NIL==4+ REDIS_REPLY_STATUS==5+ REDIS_REPLY_ERROR==6

相关文章