-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add generator files. Wrap latest 1.9 release. (#24)
- Loading branch information
Showing
7 changed files
with
316 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[deps] | ||
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31" | ||
LibSpatialIndex_jll = "00e98e2a-4326-5239-88cb-15dcbe1c18d0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
LibSpatialIndex.jl generation documentation | ||
================================ | ||
|
||
### Run the wrapping scripts | ||
1. Run `julia --project` in this directory and `pkg> instantiate` the dependencies. | ||
2. Run `include("generator.jl")` to generate the wrapping. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Clang | ||
using Clang.Generators | ||
using LibSpatialIndex_jll | ||
|
||
# several functions for building docstrings | ||
includedir = joinpath(LibSpatialIndex_jll.artifact_dir, "include/spatialindex/capi") | ||
headerfiles = joinpath.(includedir, ["sidx_api.h", "sidx_config.h"]) | ||
for headerfile in headerfiles | ||
if !isfile(headerfile) | ||
error("Header file missing `($headerfile)") | ||
end | ||
end | ||
|
||
options = load_options(joinpath(@__DIR__, "generator.toml")) | ||
|
||
# add compiler flags, e.g. "-DXXXXXXXXX" | ||
args = get_default_args() | ||
push!(args, "-I$includedir") | ||
|
||
# create context | ||
ctx = create_context(headerfiles, args, options) | ||
|
||
# run generator | ||
build!(ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[general] | ||
library_name = "libspatialindex_c" | ||
output_api_file_path = "../src/include/sidx_api.jl" | ||
output_common_file_path = "../src/include/sidx_config.jl" | ||
print_using_CEnum = true | ||
use_julia_native_enum_type = true | ||
output_ignorelist = ["SIDX_C_API", "SIDX_THREAD", "STRDUP"] | ||
use_deterministic_symbol = true | ||
smart_de_anonymize = true | ||
extract_c_comment_style = "doxygen" | ||
fold_single_line_comment = true | ||
struct_field_comment_style = "outofline" | ||
enumerator_comment_style = "outofline" | ||
show_c_function_prototype = false | ||
|
||
[codegen] | ||
use_ccall_macro = true | ||
is_function_strictly_typed = false | ||
use_julia_bool = true | ||
always_NUL_terminated_string = true | ||
opaque_func_arg_as_PtrCvoid = false | ||
opaque_as_mutable_struct = false | ||
|
||
[codegen.macro] | ||
macro_mode = "basic" | ||
add_comment_for_skipped_macro = true | ||
ignore_header_guards = true | ||
ignore_header_guards_with_suffixes = [] | ||
ignore_pure_definition = true |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,41 @@ | ||
@enum RTError::Int32 RT_None = 0 RT_Debug = 1 RT_Warning = 2 RT_Failure = 3 RT_Fatal = 4 | ||
@enum RTIndexType::Int32 RT_RTree = 0 RT_MVRTree = 1 RT_TPRTree = 2 RT_InvalidIndexType = -99 | ||
@enum RTStorageType::Int32 RT_Memory = 0 RT_Disk = 1 RT_Custom = 2 RT_InvalidStorageType = -99 | ||
@enum RTIndexVariant::Int32 RT_Linear = 0 RT_Quadratic = 1 RT_Star = 2 RT_InvalidIndexVariant = -99 | ||
|
||
IndexH = Ptr{Nothing} | ||
IndexItemH = Ptr{Nothing} | ||
IndexPropertyH = Ptr{Nothing} | ||
const Tools_PropertySet = Cvoid | ||
|
||
const IndexPropertyH = Ptr{Tools_PropertySet} | ||
|
||
const IndexS = Cvoid | ||
|
||
const IndexH = Ptr{IndexS} | ||
|
||
@enum RTError::UInt32 begin | ||
RT_None = 0 | ||
RT_Debug = 1 | ||
RT_Warning = 2 | ||
RT_Failure = 3 | ||
RT_Fatal = 4 | ||
end | ||
|
||
const SpatialIndex_IData = Cvoid | ||
|
||
const IndexItemH = Ptr{SpatialIndex_IData} | ||
|
||
@enum RTIndexType::Int32 begin | ||
RT_RTree = 0 | ||
RT_MVRTree = 1 | ||
RT_TPRTree = 2 | ||
RT_InvalidIndexType = -99 | ||
end | ||
|
||
@enum RTIndexVariant::Int32 begin | ||
RT_Linear = 0 | ||
RT_Quadratic = 1 | ||
RT_Star = 2 | ||
RT_InvalidIndexVariant = -99 | ||
end | ||
|
||
@enum RTStorageType::Int32 begin | ||
RT_Memory = 0 | ||
RT_Disk = 1 | ||
RT_Custom = 2 | ||
RT_InvalidStorageType = -99 | ||
end | ||
|
418d2f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
418d2f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/115500
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: