Skip to content

Commit

Permalink
Small tweaks to redisx array request prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Dec 13, 2024
1 parent 50b02e2 commit 610f888
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/redisx.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ int redisxRemoveDisconnectHook(Redis *redis, void (*cleanupCall)(Redis *));
void redisxClearDisconnectHooks(Redis *redis);

RESP *redisxRequest(Redis *redis, const char *command, const char *arg1, const char *arg2, const char *arg3, int *status);
RESP *redisxArrayRequest(Redis *redis, const char *args[], int length[], int n, int *status);
RESP *redisxArrayRequest(Redis *redis, const char **args, const int *length, int n, int *status);
RESP *redisxGetAttributes(Redis *redis);
int redisxSetValue(Redis *redis, const char *table, const char *key, const char *value, boolean confirm);
RESP *redisxGetValue(Redis*redis, const char *table, const char *key, int *status);
Expand Down Expand Up @@ -450,7 +450,7 @@ int redisxUnlockClient(RedisClient *cl);

// Asynchronous access routines (use within redisxLockClient()/ redisxUnlockClient() blocks)...
int redisxSendRequestAsync(RedisClient *cl, const char *command, const char *arg1, const char *arg2, const char *arg3);
int redisxSendArrayRequestAsync(RedisClient *cl, const char *args[], int length[], int n);
int redisxSendArrayRequestAsync(RedisClient *cl, const char **args, const int *length, int n);
int redisxSetValueAsync(RedisClient *cl, const char *table, const char *key, const char *value, boolean confirm);
int redisxMultiSetAsync(RedisClient *cl, const char *table, const RedisEntry *entries, int n, boolean confirm);
RESP *redisxReadReplyAsync(RedisClient *cl);
Expand Down
5 changes: 3 additions & 2 deletions src/redisx-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,8 @@ int redisxSendRequestAsync(RedisClient *cl, const char *command, const char *arg
* Send a Redis request with an arbitrary number of arguments.
*
* \param cl Pointer to the Redis client.
* \param args The array of string arguments to send.
* \param args The array of string arguments to send. If you have an `char **` array, you
* may need to cast to `(const char **)` to avoid compiler warnings.
* \param lengths Array indicating the number of bytes to send from each string argument. Zero
* or negative values can be used to determine the string length automatically
* using strlen(), and the length argument itself may be NULL to determine the
Expand All @@ -603,7 +604,7 @@ int redisxSendRequestAsync(RedisClient *cl, const char *command, const char *arg
* X_NO_SERVICE if not connected to the client or if send() failed, or
* X_NO_INIT if the client was not initialized.
*/
int redisxSendArrayRequestAsync(RedisClient *cl, const char *args[], int lengths[], int n) {
int redisxSendArrayRequestAsync(RedisClient *cl, const char **args, const int *lengths, int n) {
static const char *fn = "redisxSendArrayRequestAsync";
char buf[REDISX_CMDBUF_SIZE];
int i, L;
Expand Down
4 changes: 3 additions & 1 deletion src/redisx.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,8 @@ RESP *redisxRequest(Redis *redis, const char *command, const char *arg1, const c
*
* \param redis Pointer to a Redis instance.
* \param args An array of strings to send to Redis, corresponding to a single query.
* If you have an `char **` array, you may need to cast to `(const char **)` to avoid
* compiler warnings.
* \param lengths Array indicating the number of bytes to send from each string argument. Zero
* values can be used to determine the string length automatically using strlen(),
* and the length argument itself may be NULL to determine the lengths of all
Expand All @@ -604,7 +606,7 @@ RESP *redisxRequest(Redis *redis, const char *command, const char *arg1, const c
* @sa redisxSendArrayRequestAsync()
* @sa redisxReadReplyAsync()
*/
RESP *redisxArrayRequest(Redis *redis, const char *args[], int lengths[], int n, int *status) {
RESP *redisxArrayRequest(Redis *redis, const char **args, const int *lengths, int n, int *status) {
static const char *fn = "redisxArrayRequest";
RESP *reply = NULL;
RedisClient *cl;
Expand Down

0 comments on commit 610f888

Please sign in to comment.