From a281cfaceb1cb036c2c3bae5ffbddf60ea3f0d7d Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 1 Jun 2020 09:05:47 +0000 Subject: [PATCH] added mio_jsonwr_writerawbytes() --- mio/lib/json.c | 6 ++++++ mio/lib/mio-json.h | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/mio/lib/json.c b/mio/lib/json.c index 6ff2695..eb74fce 100644 --- a/mio/lib/json.c +++ b/mio/lib/json.c @@ -1147,3 +1147,9 @@ jsonwr->pretty = 1; return 0; } + +int mio_jsonwr_writerawbytes (mio_jsonwr_t* jsonwr, const mio_uint8_t* dptr, mio_oow_t dlen) +{ + WRITE_BYTES_NOESC (jsonwr, dptr, dlen); + return 0; +} diff --git a/mio/lib/mio-json.h b/mio/lib/mio-json.h index e1a9c88..f4d0af5 100644 --- a/mio/lib/mio-json.h +++ b/mio/lib/mio-json.h @@ -309,6 +309,13 @@ MIO_EXPORT int mio_jsonwr_write ( #define mio_jsonwr_writestringwithbcstr(jsonwr,dptr) mio_jsonwr_write(jsonwr, MIO_JSON_INST_STRING, 0, dptr, mio_count_bcstr(dptr)) + +MIO_EXPORT int mio_jsonwr_writerawbytes ( + mio_jsonwr_t* jsonwr, + const mio_uint8_t* dptr, + mio_oow_t dlen +); + #if defined(__cplusplus) } #endif