diff --git a/src/T8code.jl b/src/T8code.jl index a0fa3cb..f3f73ba 100644 --- a/src/T8code.jl +++ b/src/T8code.jl @@ -19,6 +19,7 @@ include("Libt8.jl") export @t8_adapt_callback export @t8_replace_callback +export @t8_load_tree_data export @T8_ASSERT export t8_free @@ -213,6 +214,20 @@ macro t8_replace_callback(callback) Cint, t8_locidx_t))) end +# typedef void (*t8_geom_load_tree_data_fn) (t8_cmesh_t cmesh, +# t8_gloidx_t gtreeid, +# const void **tree_data); +""" + @t8_load_tree_data(callback) + +Wrap the Julia function `callback` in an `@cfunction` with the appropriate +signature required for callback functions in [`t8_geom_load_tree_data_fn`](@ref). +""" +macro t8_load_tree_data(callback) + :(@cfunction($callback, Cvoid, + (t8_cmesh_t, t8_gloidx_t, Ptr{Cvoid}))) +end + function __init__() if !preferences_set_correctly() @warn "System MPI version detected, but not a system t8code version. To make T8code.jl work, you need to set the preferences, see https://github.com/DLR-AMR/T8code.jl#using-a-custom-version-of-mpi-andor-t8code."