diff --git a/source/client/inc/clientSml.h b/source/client/inc/clientSml.h index 8cae1fb1e8fe946d12cd6d0771cc751f437bd03c..b74d0b34943af7e5a61e3c0fd8d4bc481736c9d6 100644 --- a/source/client/inc/clientSml.h +++ b/source/client/inc/clientSml.h @@ -204,6 +204,12 @@ extern int64_t smlFactorS[3]; typedef int32_t (*_equal_fn_sml)(const void *, const void *); +SSmlHandle *smlBuildSmlInfo(TAOS *taos); +void smlDestroyInfo(SSmlHandle *info); +void smlJsonParseObjFirst(char **start, SSmlLineInfo *element, int8_t *offset); +void smlJsonParseObj(char **start, SSmlLineInfo *element, int8_t *offset); +SArray *smlJsonParseTags(char *start, char *end); +bool smlParseNumberOld(SSmlKv *kvVal, SSmlMsgBuf *msg); void* nodeListGet(NodeList* list, const void *key, int32_t len, _equal_fn_sml fn); int nodeListSet(NodeList** list, const void *key, int32_t len, void* value, _equal_fn_sml fn); int nodeListSize(NodeList* list); diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 6d251544f6521f26ca7c63cad50bd71ca81481c4..1fb74cb1286ab47d12c286492a633d7b11aba046 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -1021,7 +1021,7 @@ static void smlDestroyTableInfo(SSmlTableInfo *tag) { taosMemoryFree(tag); } -static void smlDestroyInfo(SSmlHandle *info) { +void smlDestroyInfo(SSmlHandle *info) { if (!info) return; qDestroyQuery(info->pQuery); @@ -1063,7 +1063,7 @@ static void smlDestroyInfo(SSmlHandle *info) { taosMemoryFreeClear(info); } -static SSmlHandle *smlBuildSmlInfo(TAOS *taos) { +SSmlHandle *smlBuildSmlInfo(TAOS *taos) { int32_t code = TSDB_CODE_SUCCESS; SSmlHandle *info = (SSmlHandle *)taosMemoryCalloc(1, sizeof(SSmlHandle)); if (NULL == info) { diff --git a/source/client/src/clientSmlJson.c b/source/client/src/clientSmlJson.c index 1c2f62abf6ced981d15fb033787555d3feabb03d..3de1397f72533c2ee35df832116e5e81e45686e2 100644 --- a/source/client/src/clientSmlJson.c +++ b/source/client/src/clientSmlJson.c @@ -27,7 +27,7 @@ while(*(start)){\ (start)++;\ } -static SArray *smlJsonParseTags(char *start, char *end){ +SArray *smlJsonParseTags(char *start, char *end){ SArray *tags = taosArrayInit(4, sizeof(SSmlKv)); while(start < end){ SSmlKv kv = {0}; @@ -233,7 +233,7 @@ static char* smlJsonGetObj(char *payload){ return NULL; } -static inline void smlJsonParseObjFirst(char **start, SSmlLineInfo *element, int8_t *offset){ +void smlJsonParseObjFirst(char **start, SSmlLineInfo *element, int8_t *offset){ int index = 0; while(*(*start)){ if((*start)[0] != '"'){ @@ -335,7 +335,7 @@ static inline void smlJsonParseObjFirst(char **start, SSmlLineInfo *element, int } } -static inline void smlJsonParseObj(char **start, SSmlLineInfo *element, int8_t *offset){ +void smlJsonParseObj(char **start, SSmlLineInfo *element, int8_t *offset){ int index = 0; while(*(*start)){ if((*start)[0] != '"'){ diff --git a/source/client/test/smlTest.cpp b/source/client/test/smlTest.cpp index bbb5a242b35c12905beca14699dd3aca6d478e87..e7e6b5aa9deecf91b45ca20de6159d2894e84b40 100644 --- a/source/client/test/smlTest.cpp +++ b/source/client/test/smlTest.cpp @@ -25,10 +25,7 @@ #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wsign-compare" -#include "../src/clientSmlLine.c" -#include "../src/clientSmlJson.c" -#include "../src/clientSmlTelnet.c" -#include "../src/clientSml.c" +#include "../inc/clientSml.h" #include "taos.h" int main(int argc, char **argv) {