Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export @t8_replace_callback #62

Merged
merged 3 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "T8code"
uuid = "d0cc0030-9a40-4274-8435-baadcfd54fa1"
authors = ["Johannes Markert <[email protected]>"]
version = "0.5.3"
version = "0.5.4"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Expand Down
13 changes: 13 additions & 0 deletions src/T8code.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ include("Libt8.jl")
@reexport using .Libt8

export @t8_adapt_callback
export @t8_replace_callback
export @T8_ASSERT
export t8_free

Expand Down Expand Up @@ -180,6 +181,12 @@ end
# const int is_family,
# const int num_elements,
# t8_element_t *elements[]);
"""
@t8_adapt_callback(callback)

Wrap the Julia function `callback` in an `@cfunction` with the appropriate
signature required for callback functions in [`t8_forest_adapt`](@ref).
"""
macro t8_adapt_callback(callback)
:(@cfunction($callback, Cint,
(Ptr{t8_forest}, Ptr{t8_forest}, t8_locidx_t, t8_locidx_t,
Expand All @@ -194,6 +201,12 @@ end
# t8_locidx_t first_outgoing,
# int num_incoming,
# t8_locidx_t first_incoming);
"""
@t8_replace_callback(callback)

Wrap the Julia function `callback` in an `@cfunction` with the appropriate
signature required for callback functions in [`t8_forest_iterate_replace`](@ref).
"""
macro t8_replace_callback(callback)
:(@cfunction($callback, Cvoid,
(Ptr{Cvoid}, Ptr{Cvoid}, t8_locidx_t, Ptr{Cvoid}, Cint, Cint, t8_locidx_t,
Expand Down
Loading