Эх сурвалжийг харах

ncd: Make it possible to reach the NCDStringIndex from functions.

Ambroz Bizjak 11 жил өмнө
parent
commit
a2eb5bd3b9

+ 1 - 0
ncd/NCDInterpreter.c

@@ -216,6 +216,7 @@ int NCDInterpreter_Init (NCDInterpreter *o, NCDProgram program, struct NCDInterp
     o->module_iparams.func_interp_getretrytime = statement_instance_func_interp_getretrytime;
     o->module_iparams.func_loadgroup = statement_instance_func_interp_loadgroup;
     o->module_func_params.logfunc = function_logfunc;
+    o->module_func_params.iparams = &o->module_iparams;
     
     // init processes list
     LinkedList1_Init(&o->processes);

+ 6 - 0
ncd/NCDModule.h

@@ -1027,6 +1027,12 @@ struct NCDModuleFunction_params {
      * Its user argument will be the user member of {@link NCDModuleFunction_eval_params}.
      */
     BLog_logfunc logfunc;
+    
+    /**
+     * Pointer to an {@link NCDModuleInst_iparams} structure, which exposes
+     * services provided by the interpreter.
+     */
+    const struct NCDModuleInst_iparams *iparams;
 };
 
 /**