X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=json_script.h;h=9475baa59507f8284048386fe8fd152192d6146d;hb=cbf80de7f4df61960f386cb01a899cf4228d38f3;hp=6c46f9935caa5b3ba08f2f98c5d4c03cea2a52db;hpb=b2010c706c85c621d5795304fd94711eb400321a;p=project%2Flibubox.git diff --git a/json_script.h b/json_script.h index 6c46f99..9475baa 100644 --- a/json_script.h +++ b/json_script.h @@ -97,6 +97,18 @@ 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); +void json_script_run_file(struct json_script_ctx *ctx, struct json_script_file *file, + 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);