projects
/
project
/
libubox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
udebug: add functions for manipulating entry length
[project/libubox.git]
/
json_script.h
diff --git
a/json_script.h
b/json_script.h
index 9475baa59507f8284048386fe8fd152192d6146d..66563e9de4350a6ef6c3e03b797b43ca5b9b924d 100644
(file)
--- a/
json_script.h
+++ b/
json_script.h
@@
-28,6
+28,7
@@
struct json_script_ctx {
struct blob_buf buf;
uint32_t run_seq;
struct blob_buf buf;
uint32_t run_seq;
+ bool abort;
/*
* handle_command: handle a command that was not recognized by the
/*
* handle_command: handle a command that was not recognized by the
@@
-99,6
+100,18
@@
void json_script_run(struct json_script_ctx *ctx, const char *filename,
void json_script_run_file(struct json_script_ctx *ctx, struct json_script_file *file,
struct blob_attr *vars);
void json_script_run_file(struct json_script_ctx *ctx, struct json_script_file *file,
struct blob_attr *vars);
+
+/*
+ * json_script_abort - abort current json script run
+ *
+ * to be called from a script context callback
+ */
+static inline void
+json_script_abort(struct json_script_ctx *ctx)
+{
+ ctx->abort = true;
+}
+
/*
* json_script_eval_string - evaluate a string and store the result
*
/*
* json_script_eval_string - evaluate a string and store the result
*