| 1 | /* |
| 2 | * Copyright (c) 2009-2011, Salvatore Sanfilippo <antirez at gmail dot com> |
| 3 | * Copyright (c) 2010-2014, Pieter Noordhuis <pcnoordhuis at gmail dot com> |
| 4 | * Copyright (c) 2015, Matt Stancliff <matt at genges dot com>, |
| 5 | * Jan-Erik Rediger <janerik at fnordig dot com> |
| 6 | * |
| 7 | * All rights reserved. |
| 8 | * |
| 9 | * Redistribution and use in source and binary forms, with or without |
| 10 | * modification, are permitted provided that the following conditions are met: |
| 11 | * |
| 12 | * * Redistributions of source code must retain the above copyright notice, |
| 13 | * this list of conditions and the following disclaimer. |
| 14 | * * Redistributions in binary form must reproduce the above copyright |
| 15 | * notice, this list of conditions and the following disclaimer in the |
| 16 | * documentation and/or other materials provided with the distribution. |
| 17 | * * Neither the name of Redis nor the names of its contributors may be used |
| 18 | * to endorse or promote products derived from this software without |
| 19 | * specific prior written permission. |
| 20 | * |
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 31 | * POSSIBILITY OF SUCH DAMAGE. |
| 32 | */ |
| 33 | |
| 34 | #ifndef __HIREDIS_H |
| 35 | #define __HIREDIS_Hcxx . . $ `contrib/hiredis/hiredis.h:35:9`! |
| 36 | #include "read.h"cxx . . $ `<file>/contrib/hiredis/read.h`/ |
| 37 | #include <stdarg.h> /* for va_list */ |
| 38 | #ifndef _MSC_VER |
| 39 | #include <sys/time.h> /* for struct timeval */ |
| 40 | #else |
| 41 | struct timeval; /* forward declaration */ |
| 42 | typedef long long ssize_t; |
| 43 | #endif |
| 44 | #include <stdint.h> /* uintXX_t, etc */ |
| 45 | #include "sds.h"cxx . . $ `<file>/contrib/hiredis/sds.h`/ /* for sds */ |
| 46 | #include "alloc.h"cxx . . $ `<file>/contrib/hiredis/alloc.h`/ /* for allocation wrappers */ |
| 47 | |
| 48 | #define HIREDIS_MAJORcxx . . $ `contrib/hiredis/hiredis.h:48:9`! 1 |
| 49 | #define HIREDIS_MINORcxx . . $ `contrib/hiredis/hiredis.h:49:9`! 2 |
| 50 | #define HIREDIS_PATCHcxx . . $ `contrib/hiredis/hiredis.h:50:9`! 0 |
| 51 | #define HIREDIS_SONAMEcxx . . $ `contrib/hiredis/hiredis.h:51:9`! 1.1.0 |
| 52 | |
| 53 | /* Connection type can be blocking or non-blocking and is set in the |
| 54 | * least significant bit of the flags field in redisContext. */ |
| 55 | #define REDIS_BLOCKcxx . . $ `contrib/hiredis/hiredis.h:55:9`! 0x1 |
| 56 | |
| 57 | /* Connection may be disconnected before being free'd. The second bit |
| 58 | * in the flags field is set when the context is connected. */ |
| 59 | #define REDIS_CONNECTEDcxx . . $ `contrib/hiredis/hiredis.h:59:9`! 0x2 |
| 60 | |
| 61 | /* The async API might try to disconnect cleanly and flush the output |
| 62 | * buffer and read all subsequent replies before disconnecting. |
| 63 | * This flag means no new commands can come in and the connection |
| 64 | * should be terminated once all replies have been read. */ |
| 65 | #define REDIS_DISCONNECTINGcxx . . $ `contrib/hiredis/hiredis.h:65:9`! 0x4 |
| 66 | |
| 67 | /* Flag specific to the async API which means that the context should be clean |
| 68 | * up as soon as possible. */ |
| 69 | #define REDIS_FREEINGcxx . . $ `contrib/hiredis/hiredis.h:69:9`! 0x8 |
| 70 | |
| 71 | /* Flag that is set when an async callback is executed. */ |
| 72 | #define REDIS_IN_CALLBACKcxx . . $ `contrib/hiredis/hiredis.h:72:9`! 0x10 |
| 73 | |
| 74 | /* Flag that is set when the async context has one or more subscriptions. */ |
| 75 | #define REDIS_SUBSCRIBEDcxx . . $ `contrib/hiredis/hiredis.h:75:9`! 0x20 |
| 76 | |
| 77 | /* Flag that is set when monitor mode is active */ |
| 78 | #define REDIS_MONITORINGcxx . . $ `contrib/hiredis/hiredis.h:78:9`! 0x40 |
| 79 | |
| 80 | /* Flag that is set when we should set SO_REUSEADDR before calling bind() */ |
| 81 | #define REDIS_REUSEADDRcxx . . $ `contrib/hiredis/hiredis.h:81:9`! 0x80 |
| 82 | |
| 83 | /* Flag that is set when the async connection supports push replies. */ |
| 84 | #define REDIS_SUPPORTS_PUSHcxx . . $ `contrib/hiredis/hiredis.h:84:9`! 0x100 |
| 85 | |
| 86 | /** |
| 87 | * Flag that indicates the user does not want the context to |
| 88 | * be automatically freed upon error |
| 89 | */ |
| 90 | #define REDIS_NO_AUTO_FREEcxx . . $ `contrib/hiredis/hiredis.h:90:9`! 0x200 |
| 91 | |
| 92 | /* Flag that indicates the user does not want replies to be automatically freed */ |
| 93 | #define REDIS_NO_AUTO_FREE_REPLIEScxx . . $ `contrib/hiredis/hiredis.h:93:9`! 0x400 |
| 94 | |
| 95 | /* Flags to prefer IPv6 or IPv4 when doing DNS lookup. (If both are set, |
| 96 | * AF_UNSPEC is used.) */ |
| 97 | #define REDIS_PREFER_IPV4cxx . . $ `contrib/hiredis/hiredis.h:97:9`! 0x800 |
| 98 | #define REDIS_PREFER_IPV6cxx . . $ `contrib/hiredis/hiredis.h:98:9`! 0x1000 |
| 99 | |
| 100 | #define REDIS_KEEPALIVE_INTERVALcxx . . $ `contrib/hiredis/hiredis.h:100:9`! 15 /* seconds */ |
| 101 | |
| 102 | /* number of times we retry to connect in the case of EADDRNOTAVAIL and |
| 103 | * SO_REUSEADDR is being used. */ |
| 104 | #define REDIS_CONNECT_RETRIEScxx . . $ `contrib/hiredis/hiredis.h:104:9`! 10 |
| 105 | |
| 106 | /* Forward declarations for structs defined elsewhere */ |
| 107 | struct redisAsyncContextcxx . . $ redisAsyncContext#; |
| 108 | struct redisContextcxx . . $ redisContext#; |
| 109 | |
| 110 | /* RESP3 push helpers and callback prototypes */ |
| 111 | #define redisIsPushReplycxx . . $ `contrib/hiredis/hiredis.h:111:9`!(r) (((redisReply*)(r))->type == REDIS_REPLY_PUSHcxx . . $ `contrib/hiredis/read.h:62:9`!) |
| 112 | typedef void (redisPushFncxx . . $ redisPushFn#)(void *, void *); |
| 113 | typedef void (redisAsyncPushFncxx . . $ redisAsyncPushFn#)(struct redisAsyncContextcxx . . $ redisAsyncContext# *, void *); |
| 114 | |
| 115 | #ifdef __cpluspluscxx . . $ `<built-in>:485:9`! |
| 116 | extern "C" { |
| 117 | #endif |
| 118 | |
| 119 | /* This is the reply object returned by redisCommand() */ |
| 120 | typedef struct redisReplycxx . . $ redisReply# { |
| 121 | int typecxx . . $ redisReply#type.; /* REDIS_REPLY_* */ |
| 122 | long long integercxx . . $ redisReply#integer.; /* The integer when type is REDIS_REPLY_INTEGER */ |
| 123 | double dvalcxx . . $ redisReply#dval.; /* The double when type is REDIS_REPLY_DOUBLE */ |
| 124 | size_t lencxx . . $ redisReply#len.; /* Length of string */ |
| 125 | char *strcxx . . $ redisReply#str.; /* Used for REDIS_REPLY_ERROR, REDIS_REPLY_STRING |
| 126 | REDIS_REPLY_VERB, REDIS_REPLY_DOUBLE (in additional to dval), |
| 127 | and REDIS_REPLY_BIGNUM. */ |
| 128 | char vtypecxx . . $ redisReply#vtype.[4]; /* Used for REDIS_REPLY_VERB, contains the null |
| 129 | terminated 3 character content type, such as "txt". */ |
| 130 | size_t elementscxx . . $ redisReply#elements.; /* number of elements, for REDIS_REPLY_ARRAY */ |
| 131 | struct redisReplycxx . . $ redisReply# **elementcxx . . $ redisReply#element.; /* elements vector for REDIS_REPLY_ARRAY */ |
| 132 | } redisReplycxx . . $ redisReply#; |
| 133 | |
| 134 | redisReadercxx . . $ redisReader# *redisReaderCreatecxx . . $ redisReaderCreate(dcd1f91446b48641).(void); |
| 135 | |
| 136 | /* Function to free the reply objects hiredis returns by default. */ |
| 137 | void freeReplyObjectcxx . . $ freeReplyObject(5d22bdacc48458e8).(void *reply); |
| 138 | |
| 139 | /* Functions to format a command according to the protocol. */ |
| 140 | int redisvFormatCommandcxx . . $ redisvFormatCommand(592150f15fbaad71).(char **target, const char *format, va_listcxx . . $ va_list# ap); |
| 141 | int redisFormatCommandcxx . . $ redisFormatCommand(70ad09b5e10823c4).(char **target, const char *format, ...); |
| 142 | long long redisFormatCommandArgvcxx . . $ redisFormatCommandArgv(7c15de9f613db548).(char **target, int argc, const char **argv, const size_t *argvlen); |
| 143 | long long redisFormatSdsCommandArgvcxx . . $ redisFormatSdsCommandArgv(7c15de9f613db548).(sdscxx . . $ sds# *target, int argc, const char ** argv, const size_t *argvlen); |
| 144 | void redisFreeCommandcxx . . $ redisFreeCommand(fda57c8427c60377).(char *cmd); |
| 145 | void redisFreeSdsCommandcxx . . $ redisFreeSdsCommand(fda57c8427c60377).(sdscxx . . $ sds# cmd); |
| 146 | |
| 147 | enum redisConnectionTypecxx . . $ redisConnectionType# { |
| 148 | REDIS_CONN_TCPcxx . . $ REDIS_CONN_TCP., |
| 149 | REDIS_CONN_UNIXcxx . . $ REDIS_CONN_UNIX., |
| 150 | REDIS_CONN_USERFDcxx . . $ REDIS_CONN_USERFD. |
| 151 | }; |
| 152 | |
| 153 | struct redisSslcxx . . $ redisSsl#; |
| 154 | |
| 155 | #define REDIS_OPT_NONBLOCKcxx . . $ `contrib/hiredis/hiredis.h:155:9`! 0x01 |
| 156 | #define REDIS_OPT_REUSEADDRcxx . . $ `contrib/hiredis/hiredis.h:156:9`! 0x02 |
| 157 | #define REDIS_OPT_NOAUTOFREEcxx . . $ `contrib/hiredis/hiredis.h:157:9`! 0x04 /* Don't automatically free the async |
| 158 | * object on a connection failure, or |
| 159 | * other implicit conditions. Only free |
| 160 | * on an explicit call to disconnect() |
| 161 | * or free() */ |
| 162 | #define REDIS_OPT_NO_PUSH_AUTOFREEcxx . . $ `contrib/hiredis/hiredis.h:162:9`! 0x08 /* Don't automatically intercept and |
| 163 | * free RESP3 PUSH replies. */ |
| 164 | #define REDIS_OPT_NOAUTOFREEREPLIEScxx . . $ `contrib/hiredis/hiredis.h:164:9`! 0x10 /* Don't automatically free replies. */ |
| 165 | #define REDIS_OPT_PREFER_IPV4cxx . . $ `contrib/hiredis/hiredis.h:165:9`! 0x20 /* Prefer IPv4 in DNS lookups. */ |
| 166 | #define REDIS_OPT_PREFER_IPV6cxx . . $ `contrib/hiredis/hiredis.h:166:9`! 0x40 /* Prefer IPv6 in DNS lookups. */ |
| 167 | #define REDIS_OPT_PREFER_IP_UNSPECcxx . . $ `contrib/hiredis/hiredis.h:167:9`! (REDIS_OPT_PREFER_IPV4 | REDIS_OPT_PREFER_IPV6) |
| 168 | |
| 169 | /* In Unix systems a file descriptor is a regular signed int, with -1 |
| 170 | * representing an invalid descriptor. In Windows it is a SOCKET |
| 171 | * (32- or 64-bit unsigned integer depending on the architecture), where |
| 172 | * all bits set (~0) is INVALID_SOCKET. */ |
| 173 | #ifndef _WIN32 |
| 174 | typedef int redisFDcxx . . $ redisFD#; |
| 175 | #define REDIS_INVALID_FDcxx . . $ `contrib/hiredis/hiredis.h:175:9`! -1 |
| 176 | #else |
| 177 | #ifdef _WIN64 |
| 178 | typedef unsigned long long redisFD; /* SOCKET = 64-bit UINT_PTR */ |
| 179 | #else |
| 180 | typedef unsigned long redisFD; /* SOCKET = 32-bit UINT_PTR */ |
| 181 | #endif |
| 182 | #define REDIS_INVALID_FD ((redisFD)(~0)) /* INVALID_SOCKET */ |
| 183 | #endif |
| 184 | |
| 185 | typedef structcxx . . $ $anonymous_type_5b3730af79a84903_0# { |
| 186 | /* |
| 187 | * the type of connection to use. This also indicates which |
| 188 | * `endpoint` member field to use |
| 189 | */ |
| 190 | int typecxx . . $ $anonymous_type_5b3730af79a84903_0#type.; |
| 191 | /* bit field of REDIS_OPT_xxx */ |
| 192 | int optionscxx . . $ $anonymous_type_5b3730af79a84903_0#options.; |
| 193 | /* timeout value for connect operation. If NULL, no timeout is used */ |
| 194 | const struct timevalcxx . . $ timeval# *connect_timeoutcxx . . $ $anonymous_type_5b3730af79a84903_0#connect_timeout.; |
| 195 | /* timeout value for commands. If NULL, no timeout is used. This can be |
| 196 | * updated at runtime with redisSetTimeout/redisAsyncSetTimeout. */ |
| 197 | const struct timevalcxx . . $ timeval# *command_timeoutcxx . . $ $anonymous_type_5b3730af79a84903_0#command_timeout.; |
| 198 | unioncxx . . $ $anonymous_type_5b3730af79a84903_0#$anonymous_type_1# { |
| 199 | /** use this field for tcp/ip connections */ |
| 200 | structcxx . . $ $anonymous_type_5b3730af79a84903_0#$anonymous_type_1#$anonymous_type_2# { |
| 201 | const char *source_addrcxx . . $ $anonymous_type_5b3730af79a84903_0#$anonymous_type_1#$anonymous_type_2#source_addr.; |
| 202 | const char *ipcxx . . $ $anonymous_type_5b3730af79a84903_0#$anonymous_type_1#$anonymous_type_2#ip.; |
| 203 | int portcxx . . $ $anonymous_type_5b3730af79a84903_0#$anonymous_type_1#$anonymous_type_2#port.; |
| 204 | } tcpcxx . . $ $anonymous_type_5b3730af79a84903_0#$anonymous_type_1#tcp.; |
| 205 | /** use this field for unix domain sockets */ |
| 206 | const char *unix_socketcxx . . $ $anonymous_type_5b3730af79a84903_0#$anonymous_type_1#unix_socket.; |
| 207 | /** |
| 208 | * use this field to have hiredis operate an already-open |
| 209 | * file descriptor */ |
| 210 | redisFDcxx . . $ redisFD# fdcxx . . $ $anonymous_type_5b3730af79a84903_0#$anonymous_type_1#fd.; |
| 211 | } endpointcxx . . $ $anonymous_type_5b3730af79a84903_0#endpoint.; |
| 212 | |
| 213 | /* Optional user defined data/destructor */ |
| 214 | void *privdatacxx . . $ $anonymous_type_5b3730af79a84903_0#privdata.; |
| 215 | void (*free_privdatacxx . . $ $anonymous_type_5b3730af79a84903_0#free_privdata.)(void *); |
| 216 | |
| 217 | /* A user defined PUSH message callback */ |
| 218 | redisPushFncxx . . $ redisPushFn# *push_cbcxx . . $ $anonymous_type_5b3730af79a84903_0#push_cb.; |
| 219 | redisAsyncPushFncxx . . $ redisAsyncPushFn# *async_push_cbcxx . . $ $anonymous_type_5b3730af79a84903_0#async_push_cb.; |
| 220 | } redisOptionscxx . . $ redisOptions#; |
| 221 | |
| 222 | /** |
| 223 | * Helper macros to initialize options to their specified fields. |
| 224 | */ |
| 225 | #define REDIS_OPTIONS_SET_TCPcxx . . $ `contrib/hiredis/hiredis.h:225:9`!(opts, ip_, port_) do { \ |
| 226 | (opts)->type = REDIS_CONN_TCP; \ |
| 227 | (opts)->endpoint.tcp.ip = ip_; \ |
| 228 | (opts)->endpoint.tcp.port = port_; \ |
| 229 | } while(0) |
| 230 | |
| 231 | #define REDIS_OPTIONS_SET_UNIXcxx . . $ `contrib/hiredis/hiredis.h:231:9`!(opts, path) do { \ |
| 232 | (opts)->type = REDIS_CONN_UNIX; \ |
| 233 | (opts)->endpoint.unix_socket = path; \ |
| 234 | } while(0) |
| 235 | |
| 236 | #define REDIS_OPTIONS_SET_PRIVDATAcxx . . $ `contrib/hiredis/hiredis.h:236:9`!(opts, data, dtor) do { \ |
| 237 | (opts)->privdata = data; \ |
| 238 | (opts)->free_privdata = dtor; \ |
| 239 | } while(0) |
| 240 | |
| 241 | typedef struct redisContextFuncscxx . . $ redisContextFuncs# { |
| 242 | void (*closecxx . . $ redisContextFuncs#close.)(struct redisContextcxx . . $ redisContext# *); |
| 243 | void (*free_privctxcxx . . $ redisContextFuncs#free_privctx.)(void *); |
| 244 | void (*async_readcxx . . $ redisContextFuncs#async_read.)(struct redisAsyncContextcxx . . $ redisAsyncContext# *); |
| 245 | void (*async_writecxx . . $ redisContextFuncs#async_write.)(struct redisAsyncContextcxx . . $ redisAsyncContext# *); |
| 246 | |
| 247 | /* Read/Write data to the underlying communication stream, returning the |
| 248 | * number of bytes read/written. In the event of an unrecoverable error |
| 249 | * these functions shall return a value < 0. In the event of a |
| 250 | * recoverable error, they should return 0. */ |
| 251 | ssize_tcxx . . $ ssize_t# (*readcxx . . $ redisContextFuncs#read.)(struct redisContextcxx . . $ redisContext# *, char *, size_t); |
| 252 | ssize_tcxx . . $ ssize_t# (*writecxx . . $ redisContextFuncs#write.)(struct redisContextcxx . . $ redisContext# *); |
| 253 | } redisContextFuncscxx . . $ redisContextFuncs#; |
| 254 | |
| 255 | |
| 256 | /* Context for a connection to Redis */ |
| 257 | typedef struct redisContextcxx . . $ redisContext# { |
| 258 | const redisContextFuncscxx . . $ redisContextFuncs# *funcscxx . . $ redisContext#funcs.; /* Function table */ |
| 259 | |
| 260 | int errcxx . . $ redisContext#err.; /* Error flags, 0 when there is no error */ |
| 261 | char errstrcxx . . $ redisContext#errstr.[128]; /* String representation of error when applicable */ |
| 262 | redisFDcxx . . $ redisFD# fdcxx . . $ redisContext#fd.; |
| 263 | int flagscxx . . $ redisContext#flags.; |
| 264 | char *obufcxx . . $ redisContext#obuf.; /* Write buffer */ |
| 265 | redisReadercxx . . $ redisReader# *readercxx . . $ redisContext#reader.; /* Protocol reader */ |
| 266 | |
| 267 | enum redisConnectionTypecxx . . $ redisConnectionType# connection_typecxx . . $ redisContext#connection_type.; |
| 268 | struct timevalcxx . . $ timeval# *connect_timeoutcxx . . $ redisContext#connect_timeout.; |
| 269 | struct timevalcxx . . $ timeval# *command_timeoutcxx . . $ redisContext#command_timeout.; |
| 270 | |
| 271 | structcxx . . $ redisContext#$anonymous_type_0# { |
| 272 | char *hostcxx . . $ redisContext#$anonymous_type_3#host.; |
| 273 | char *source_addrcxx . . $ redisContext#$anonymous_type_3#source_addr.; |
| 274 | int portcxx . . $ redisContext#$anonymous_type_3#port.; |
| 275 | } tcpcxx . . $ redisContext#tcp.; |
| 276 | |
| 277 | structcxx . . $ redisContext#$anonymous_type_1# { |
| 278 | char *pathcxx . . $ redisContext#$anonymous_type_1#path.; |
| 279 | } unix_sockcxx . . $ redisContext#unix_sock.; |
| 280 | |
| 281 | /* For non-blocking connect */ |
| 282 | struct sockaddrcxx . . $ sockaddr# *saddrcxx . . $ redisContext#saddr.; |
| 283 | size_t addrlencxx . . $ redisContext#addrlen.; |
| 284 | |
| 285 | /* Optional data and corresponding destructor users can use to provide |
| 286 | * context to a given redisContext. Not used by hiredis. */ |
| 287 | void *privdatacxx . . $ redisContext#privdata.; |
| 288 | void (*free_privdatacxx . . $ redisContext#free_privdata.)(void *); |
| 289 | |
| 290 | /* Internal context pointer presently used by hiredis to manage |
| 291 | * SSL connections. */ |
| 292 | void *privctxcxx . . $ redisContext#privctx.; |
| 293 | |
| 294 | /* An optional RESP3 PUSH handler */ |
| 295 | redisPushFncxx . . $ redisPushFn# *push_cbcxx . . $ redisContext#push_cb.; |
| 296 | } redisContextcxx . . $ redisContext#; |
| 297 | |
| 298 | redisContextcxx . . $ redisContext# *redisConnectWithOptionscxx . . $ redisConnectWithOptions(45dbf3ccfa7760d5).(const redisOptionscxx . . $ redisOptions# *options); |
| 299 | redisContextcxx . . $ redisContext# *redisConnectcxx . . $ redisConnect(922c3b4567165bc4).(const char *ip, int port); |
| 300 | redisContextcxx . . $ redisContext# *redisConnectWithTimeoutcxx . . $ redisConnectWithTimeout(6ad86c57867785c5).(const char *ip, int port, const struct timevalcxx . . $ timeval# tv); |
| 301 | redisContextcxx . . $ redisContext# *redisConnectNonBlockcxx . . $ redisConnectNonBlock(922c3b4567165bc4).(const char *ip, int port); |
| 302 | redisContextcxx . . $ redisContext# *redisConnectBindNonBlockcxx . . $ redisConnectBindNonBlock(4908239a5694cd93).(const char *ip, int port, |
| 303 | const char *source_addr); |
| 304 | redisContextcxx . . $ redisContext# *redisConnectBindNonBlockWithReusecxx . . $ redisConnectBindNonBlockWithReuse(4908239a5694cd93).(const char *ip, int port, |
| 305 | const char *source_addr); |
| 306 | redisContextcxx . . $ redisContext# *redisConnectUnixcxx . . $ redisConnectUnix(6a79eccb706c4abc).(const char *path); |
| 307 | redisContextcxx . . $ redisContext# *redisConnectUnixWithTimeoutcxx . . $ redisConnectUnixWithTimeout(f3b1123a5a0b84f6).(const char *path, const struct timevalcxx . . $ timeval# tv); |
| 308 | redisContextcxx . . $ redisContext# *redisConnectUnixNonBlockcxx . . $ redisConnectUnixNonBlock(6a79eccb706c4abc).(const char *path); |
| 309 | redisContextcxx . . $ redisContext# *redisConnectFdcxx . . $ redisConnectFd(ca3b310b41beb7d2).(redisFDcxx . . $ redisFD# fd); |
| 310 | |
| 311 | /** |
| 312 | * Reconnect the given context using the saved information. |
| 313 | * |
| 314 | * This re-uses the exact same connect options as in the initial connection. |
| 315 | * host, ip (or path), timeout and bind address are reused, |
| 316 | * flags are used unmodified from the existing context. |
| 317 | * |
| 318 | * Returns REDIS_OK on successful connect or REDIS_ERR otherwise. |
| 319 | */ |
| 320 | int redisReconnectcxx . . $ redisReconnect(903929791d53a485).(redisContextcxx . . $ redisContext# *c); |
| 321 | |
| 322 | redisPushFncxx . . $ redisPushFn# *redisSetPushCallbackcxx . . $ redisSetPushCallback(57299f6a7cb59a07).(redisContextcxx . . $ redisContext# *c, redisPushFncxx . . $ redisPushFn# *fn); |
| 323 | int redisSetTimeoutcxx . . $ redisSetTimeout(21760c1fa6be35a9).(redisContextcxx . . $ redisContext# *c, const struct timevalcxx . . $ timeval# tv); |
| 324 | int redisEnableKeepAlivecxx . . $ redisEnableKeepAlive(903929791d53a485).(redisContextcxx . . $ redisContext# *c); |
| 325 | int redisEnableKeepAliveWithIntervalcxx . . $ redisEnableKeepAliveWithInterval(32331c997cd8559f).(redisContextcxx . . $ redisContext# *c, int interval); |
| 326 | int redisSetTcpUserTimeoutcxx . . $ redisSetTcpUserTimeout(fe9ede4d1d34406b).(redisContextcxx . . $ redisContext# *c, unsigned int timeout); |
| 327 | void redisFreecxx . . $ redisFree(89a25c960dbe8771).(redisContextcxx . . $ redisContext# *c); |
| 328 | redisFDcxx . . $ redisFD# redisFreeKeepFdcxx . . $ redisFreeKeepFd(903929791d53a485).(redisContextcxx . . $ redisContext# *c); |
| 329 | int redisBufferReadcxx . . $ redisBufferRead(903929791d53a485).(redisContextcxx . . $ redisContext# *c); |
| 330 | int redisBufferWritecxx . . $ redisBufferWrite(296b63eadaa43d24).(redisContextcxx . . $ redisContext# *c, int *done); |
| 331 | |
| 332 | /* In a blocking context, this function first checks if there are unconsumed |
| 333 | * replies to return and returns one if so. Otherwise, it flushes the output |
| 334 | * buffer to the socket and reads until it has a reply. In a non-blocking |
| 335 | * context, it will return unconsumed replies until there are no more. */ |
| 336 | int redisGetReplycxx . . $ redisGetReply(2583096213de7e99).(redisContextcxx . . $ redisContext# *c, void **reply); |
| 337 | int redisGetReplyFromReadercxx . . $ redisGetReplyFromReader(2583096213de7e99).(redisContextcxx . . $ redisContext# *c, void **reply); |
| 338 | |
| 339 | /* Write a formatted command to the output buffer. Use these functions in blocking mode |
| 340 | * to get a pipeline of commands. */ |
| 341 | int redisAppendFormattedCommandcxx . . $ redisAppendFormattedCommand(812b6d654aaaab2a).(redisContextcxx . . $ redisContext# *c, const char *cmd, size_t len); |
| 342 | |
| 343 | /* Write a command to the output buffer. Use these functions in blocking mode |
| 344 | * to get a pipeline of commands. */ |
| 345 | int redisvAppendCommandcxx . . $ redisvAppendCommand(834cea54217070e1).(redisContextcxx . . $ redisContext# *c, const char *format, va_listcxx . . $ va_list# ap); |
| 346 | int redisAppendCommandcxx . . $ redisAppendCommand(61d004abb9483092).(redisContextcxx . . $ redisContext# *c, const char *format, ...); |
| 347 | int redisAppendCommandArgvcxx . . $ redisAppendCommandArgv(6baf436ef9c81fd7).(redisContextcxx . . $ redisContext# *c, int argc, const char **argv, const size_t *argvlen); |
| 348 | |
| 349 | /* Issue a command to Redis. In a blocking context, it is identical to calling |
| 350 | * redisAppendCommand, followed by redisGetReply. The function will return |
| 351 | * NULL if there was an error in performing the request, otherwise it will |
| 352 | * return the reply. In a non-blocking context, it is identical to calling |
| 353 | * only redisAppendCommand and will always return NULL. */ |
| 354 | void *redisvCommandcxx . . $ redisvCommand(da5aaa9e4eedecbf).(redisContextcxx . . $ redisContext# *c, const char *format, va_listcxx . . $ va_list# ap); |
| 355 | void *redisCommandcxx . . $ redisCommand(32e40af871cdd48d).(redisContextcxx . . $ redisContext# *c, const char *format, ...); |
| 356 | void *redisCommandArgvcxx . . $ redisCommandArgv(2bb9a625b5e3febf).(redisContextcxx . . $ redisContext# *c, int argc, const char **argv, const size_t *argvlen); |
| 357 | |
| 358 | #ifdef __cpluspluscxx . . $ `<built-in>:485:9`! |
| 359 | } |
| 360 | #endif |
| 361 | |
| 362 | #endif |