1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Add debug builtin

And refactor setup of jv dump flags.
This commit is contained in:
Nicolas Williams
2014-12-27 17:15:56 -06:00
parent a9c613e87d
commit 5df20f4954
5 changed files with 65 additions and 17 deletions

View File

@@ -41,6 +41,8 @@ struct jq_state {
jv attrs;
jq_input_cb input_cb;
void *input_cb_data;
jq_debug_cb debug_cb;
void *debug_cb_data;
};
struct closure {
@@ -1049,3 +1051,13 @@ void jq_get_input_cb(jq_state *jq, jq_input_cb *cb, void **data) {
*cb = jq->input_cb;
*data = jq->input_cb_data;
}
void jq_set_debug_cb(jq_state *jq, jq_debug_cb cb, void *data) {
jq->debug_cb = cb;
jq->debug_cb_data = data;
}
void jq_get_debug_cb(jq_state *jq, jq_debug_cb *cb, void **data) {
*cb = jq->debug_cb;
*data = jq->debug_cb_data;
}