Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
a7140047
Unverified
Commit
a7140047
authored
Jul 05, 2019
by
Salvatore Sanfilippo
Committed by
GitHub
Jul 05, 2019
Browse files
Merge pull request #6022 from itamarhaber/RedisModule_ReplyWithCString
Adds RedisModule_ReplyWithCString
parents
6b29f2d8
c184b32d
Changes
2
Show whitespace changes
Inline
Side-by-side
src/module.c
View file @
a7140047
...
@@ -1242,6 +1242,17 @@ int RM_ReplyWithStringBuffer(RedisModuleCtx *ctx, const char *buf, size_t len) {
...
@@ -1242,6 +1242,17 @@ int RM_ReplyWithStringBuffer(RedisModuleCtx *ctx, const char *buf, size_t len) {
return
REDISMODULE_OK
;
return
REDISMODULE_OK
;
}
}
/* Reply with a bulk string, taking in input a C buffer pointer that is
* assumed to be null-terminated.
*
* The function always returns REDISMODULE_OK. */
int
RM_ReplyWithCString
(
RedisModuleCtx
*
ctx
,
const
char
*
buf
)
{
client
*
c
=
moduleGetReplyClient
(
ctx
);
if
(
c
==
NULL
)
return
REDISMODULE_OK
;
addReplyBulkCString
(
c
,(
char
*
)
buf
);
return
REDISMODULE_OK
;
}
/* Reply with a bulk string, taking in input a RedisModuleString object.
/* Reply with a bulk string, taking in input a RedisModuleString object.
*
*
* The function always returns REDISMODULE_OK. */
* The function always returns REDISMODULE_OK. */
...
...
src/redismodule.h
View file @
a7140047
...
@@ -226,6 +226,7 @@ int REDISMODULE_API_FUNC(RedisModule_ReplyWithSimpleString)(RedisModuleCtx *ctx,
...
@@ -226,6 +226,7 @@ int REDISMODULE_API_FUNC(RedisModule_ReplyWithSimpleString)(RedisModuleCtx *ctx,
int
REDISMODULE_API_FUNC
(
RedisModule_ReplyWithArray
)(
RedisModuleCtx
*
ctx
,
long
len
);
int
REDISMODULE_API_FUNC
(
RedisModule_ReplyWithArray
)(
RedisModuleCtx
*
ctx
,
long
len
);
void
REDISMODULE_API_FUNC
(
RedisModule_ReplySetArrayLength
)(
RedisModuleCtx
*
ctx
,
long
len
);
void
REDISMODULE_API_FUNC
(
RedisModule_ReplySetArrayLength
)(
RedisModuleCtx
*
ctx
,
long
len
);
int
REDISMODULE_API_FUNC
(
RedisModule_ReplyWithStringBuffer
)(
RedisModuleCtx
*
ctx
,
const
char
*
buf
,
size_t
len
);
int
REDISMODULE_API_FUNC
(
RedisModule_ReplyWithStringBuffer
)(
RedisModuleCtx
*
ctx
,
const
char
*
buf
,
size_t
len
);
int
REDISMODULE_API_FUNC
(
RedisModule_ReplyWithCString
)(
RedisModuleCtx
*
ctx
,
const
char
*
buf
);
int
REDISMODULE_API_FUNC
(
RedisModule_ReplyWithString
)(
RedisModuleCtx
*
ctx
,
RedisModuleString
*
str
);
int
REDISMODULE_API_FUNC
(
RedisModule_ReplyWithString
)(
RedisModuleCtx
*
ctx
,
RedisModuleString
*
str
);
int
REDISMODULE_API_FUNC
(
RedisModule_ReplyWithNull
)(
RedisModuleCtx
*
ctx
);
int
REDISMODULE_API_FUNC
(
RedisModule_ReplyWithNull
)(
RedisModuleCtx
*
ctx
);
int
REDISMODULE_API_FUNC
(
RedisModule_ReplyWithDouble
)(
RedisModuleCtx
*
ctx
,
double
d
);
int
REDISMODULE_API_FUNC
(
RedisModule_ReplyWithDouble
)(
RedisModuleCtx
*
ctx
,
double
d
);
...
@@ -376,6 +377,7 @@ static int RedisModule_Init(RedisModuleCtx *ctx, const char *name, int ver, int
...
@@ -376,6 +377,7 @@ static int RedisModule_Init(RedisModuleCtx *ctx, const char *name, int ver, int
REDISMODULE_GET_API
(
ReplyWithArray
);
REDISMODULE_GET_API
(
ReplyWithArray
);
REDISMODULE_GET_API
(
ReplySetArrayLength
);
REDISMODULE_GET_API
(
ReplySetArrayLength
);
REDISMODULE_GET_API
(
ReplyWithStringBuffer
);
REDISMODULE_GET_API
(
ReplyWithStringBuffer
);
REDISMODULE_GET_API
(
ReplyWithCString
);
REDISMODULE_GET_API
(
ReplyWithString
);
REDISMODULE_GET_API
(
ReplyWithString
);
REDISMODULE_GET_API
(
ReplyWithNull
);
REDISMODULE_GET_API
(
ReplyWithNull
);
REDISMODULE_GET_API
(
ReplyWithCallReply
);
REDISMODULE_GET_API
(
ReplyWithCallReply
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment