diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-04-28 18:57:28 +0400 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-04-28 18:57:28 +0400 |
commit | 178fe974af1d0fa4130f865f7b494b0d6b1b05a4 (patch) | |
tree | 407aa329852d19375ade975fab5d3888e5292d63 /json_script.h | |
parent | d07b174de8faf76a20cbe003bfc143552f431f85 (diff) |
json_script: implement json_script_eval_string
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'json_script.h')
-rw-r--r-- | json_script.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/json_script.h b/json_script.h index 6c46f99..25cc04f 100644 --- a/json_script.h +++ b/json_script.h @@ -97,6 +97,16 @@ void json_script_free(struct json_script_ctx *ctx); void json_script_run(struct json_script_ctx *ctx, const char *filename, struct blob_attr *vars); +/* + * json_script_eval_string - evaluate a string and store the result + * + * Can be used to process variable references outside of a script + * in a same way that they would be interpreted in the script context. + */ +int json_script_eval_string(struct json_script_ctx *ctx, struct blob_attr *vars, + struct blob_buf *buf, const char *name, + const char *pattern); + struct json_script_file * json_script_file_from_blobmsg(const char *name, void *data, int len); |