int ossl_json_flush_cleanup(OSSL_JSON_ENC *json);
/*
- * ossl_json_set_sink
- * ------------------
+ * ossl_json_set0_sink
+ * -------------------
*
* Changes the sink used by the JSON encoder.
*/
-int ossl_json_set_sink(OSSL_JSON_ENC *json, BIO *bio);
+int ossl_json_set0_sink(OSSL_JSON_ENC *json, BIO *bio);
/*
* ossl_json_in_error
wbuf->alloc = 0;
}
-static void wbuf_set_bio(struct json_write_buf *wbuf, BIO *bio)
+static void wbuf_set0_bio(struct json_write_buf *wbuf, BIO *bio)
{
wbuf->bio = bio;
}
return 0;
json->state = STATE_PRE_COMMA;
- return ossl_json_reset(json);
+ return 1;
}
void ossl_json_cleanup(OSSL_JSON_ENC *json)
return wbuf_flush(&json->wbuf);
}
-int ossl_json_set_sink(OSSL_JSON_ENC *json, BIO *bio)
+int ossl_json_set0_sink(OSSL_JSON_ENC *json, BIO *bio)
{
- wbuf_set_bio(&json->wbuf, bio);
+ wbuf_set0_bio(&json->wbuf, bio);
return 1;
}
ossl_qlog_flush(qlog); /* best effort */
BIO_free_all(qlog->bio);
qlog->bio = bio;
- ossl_json_set_sink(&qlog->json, bio);
+ ossl_json_set0_sink(&qlog->json, bio);
return 1;
}