@@ -228,7 +228,7 @@ passing arguments computed in C to Julia. For this you will need to invoke Julia
228228using ` jl_call ` :
229229
230230``` c
231- jl_function_t *func = jl_get_function(jl_base_module, " sqrt" );
231+ jl_value_t *func = jl_get_function(jl_base_module, " sqrt" );
232232jl_value_t *argument = jl_box_float64(2.0 );
233233jl_value_t *ret = jl_call1(func, argument);
234234```
@@ -240,7 +240,7 @@ the function is called using `jl_call1`. `jl_call0`, `jl_call2`, and `jl_call3`
240240exist, to conveniently handle different numbers of arguments. To pass more arguments, use ` jl_call ` :
241241
242242```
243- jl_value_t *jl_call(jl_function_t *f, jl_value_t **args, int32_t nargs)
243+ jl_value_t *jl_call(jl_value_t *f, jl_value_t **args, int32_t nargs)
244244```
245245
246246Its second argument ` args ` is an array of ` jl_value_t* ` arguments and ` nargs ` is the number of
@@ -319,7 +319,7 @@ jl_value_t *ret1 = jl_eval_string("sqrt(2.0)");
319319JL_GC_PUSH1 (&ret1);
320320jl_value_t * ret2 = 0;
321321{
322- jl_function_t * func = jl_get_function(jl_base_module, "exp");
322+ jl_value_t * func = jl_get_function(jl_base_module, "exp");
323323 ret2 = jl_call1(func, ret1);
324324 JL_GC_PUSH1(&ret2);
325325 // Do something with ret2.
@@ -350,7 +350,7 @@ properly with mutable types.
350350```c
351351// This functions shall be executed only once, during the initialization.
352352jl_value_t* refs = jl_eval_string("refs = IdDict()");
353- jl_function_t * setindex = jl_get_function(jl_base_module, "setindex!");
353+ jl_value_t * setindex = jl_get_function(jl_base_module, "setindex!");
354354
355355...
356356
@@ -374,7 +374,7 @@ container is created by `jl_call*`, then you will need to reload the pointer to
374374``` c
375375// This functions shall be executed only once, during the initialization.
376376jl_value_t * refs = jl_eval_string(" refs = IdDict()" );
377- jl_function_t * setindex = jl_get_function(jl_base_module, " setindex!" );
377+ jl_value_t * setindex = jl_get_function(jl_base_module, " setindex!" );
378378jl_datatype_t * reft = (jl_datatype_t *)jl_eval_string(" Base.RefValue{Any}" );
379379
380380...
@@ -401,7 +401,7 @@ The GC can be allowed to deallocate a variable by removing the reference to it f
401401the function `delete!`, provided that no other reference to the variable is kept anywhere:
402402
403403```c
404- jl_function_t * delete = jl_get_function(jl_base_module, "delete!");
404+ jl_value_t * delete = jl_get_function(jl_base_module, "delete!");
405405jl_call2(delete, refs, rvar);
406406```
407407
@@ -505,7 +505,7 @@ for (size_t i = 0; i < jl_array_nrows(x); i++)
505505Now let us call a Julia function that performs an in-place operation on ` x ` :
506506
507507``` c
508- jl_function_t *func = jl_get_function(jl_base_module, " reverse!" );
508+ jl_value_t *func = jl_get_function(jl_base_module, " reverse!" );
509509jl_call1 (func, (jl_value_t* )x);
510510```
511511
@@ -517,7 +517,7 @@ If a Julia function returns an array, the return value of `jl_eval_string` and `
517517cast to a `jl_array_t*`:
518518
519519```c
520- jl_function_t *func = jl_get_function(jl_base_module, "reverse");
520+ jl_value_t *func = jl_get_function(jl_base_module, "reverse");
521521jl_array_t *y = (jl_array_t*)jl_call1(func, (jl_value_t*)x);
522522```
523523
@@ -664,7 +664,7 @@ double c_func(int i)
664664 printf("[ C %08x] i = %d\n", pthread_self(), i);
665665
666666 // Call the Julia sqrt() function to compute the square root of i, and return it
667- jl_function_t *sqrt = jl_get_function(jl_base_module, "sqrt");
667+ jl_value_t *sqrt = jl_get_function(jl_base_module, "sqrt");
668668 jl_value_t* arg = jl_box_int32(i);
669669 double ret = jl_unbox_float64(jl_call1(sqrt, arg));
670670
0 commit comments