added the ctx parameter to the json write callback

This commit is contained in:
2020-06-01 08:52:43 +00:00
parent 25e3744571
commit 775a9b4735
3 changed files with 11 additions and 8 deletions

View File

@ -90,7 +90,7 @@ static int on_json_inst (mio_json_t* json, mio_json_inst_t inst, mio_oow_t level
return 0;
}
static int write_json_element (mio_jsonwr_t* jsonwr, const mio_bch_t* dptr, mio_oow_t dlen)
static int write_json_element (mio_jsonwr_t* jsonwr, const mio_bch_t* dptr, mio_oow_t dlen, void* ctx)
{
write (1, dptr, dlen);
return 0;
@ -146,7 +146,7 @@ int main (int argc, char* argv[])
jsonwr = mio_jsonwr_open (mio, 0);
mio_jsonwr_setwritecb (jsonwr, write_json_element);
mio_jsonwr_setwritecb (jsonwr, write_json_element, MIO_NULL);
mio_jsonwr_startarray (jsonwr);