X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=blobdiff_plain;f=json_script.h;h=25cc04ff79ae89c9b01b62d47c4b5971c6231d46;hp=6c46f9935caa5b3ba08f2f98c5d4c03cea2a52db;hb=178fe974af1d0fa4130f865f7b494b0d6b1b05a4;hpb=d07b174de8faf76a20cbe003bfc143552f431f85 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);