提交 eaca069a 编写于 作者: H Hongze Cheng

more

上级 729aabca
...@@ -125,6 +125,7 @@ static int tDecodeDouble(SCoder* pDecoder, double* val); ...@@ -125,6 +125,7 @@ static int tDecodeDouble(SCoder* pDecoder, double* val);
static int tDecodeBinary(SCoder* pDecoder, const void** val, uint64_t* len); static int tDecodeBinary(SCoder* pDecoder, const void** val, uint64_t* len);
static int tDecodeCStrAndLen(SCoder* pDecoder, const char** val, uint64_t* len); static int tDecodeCStrAndLen(SCoder* pDecoder, const char** val, uint64_t* len);
static int tDecodeCStr(SCoder* pDecoder, const char** val); static int tDecodeCStr(SCoder* pDecoder, const char** val);
static int tDecodeCStrTo(SCoder* pDecoder, char* val);
/* ------------------------ IMPL ------------------------ */ /* ------------------------ IMPL ------------------------ */
#define TD_ENCODE_MACRO(CODER, VAL, TYPE, BITS) \ #define TD_ENCODE_MACRO(CODER, VAL, TYPE, BITS) \
...@@ -385,6 +386,15 @@ static FORCE_INLINE int tDecodeCStr(SCoder* pDecoder, const char** val) { ...@@ -385,6 +386,15 @@ static FORCE_INLINE int tDecodeCStr(SCoder* pDecoder, const char** val) {
return tDecodeCStrAndLen(pDecoder, val, &len); return tDecodeCStrAndLen(pDecoder, val, &len);
} }
static int tDecodeCStrTo(SCoder* pDecoder, char* val) {
const char* pStr;
uint64_t len;
if (tDecodeCStrAndLen(pDecoder, &pStr, &len) < 0) return -1;
memcpy(val, pStr, len+1);
return 0;
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册