diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4241b3d..06800f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,11 +15,12 @@ jobs: fail-fast: false matrix: version: - - '1' - - '1.0' - '1.3' + - '1.6' os: - - [ubuntu-latest] + - ubuntu-latest + - macOS-latest + - windows-latest arch: - x64 steps: diff --git a/Project.toml b/Project.toml index 3547de2..b786c6b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,17 +1,14 @@ name = "MiniQhull" uuid = "978d7f02-9e05-4691-894f-ae31a51d76ca" authors = ["Francesc Verdugo ", "Victor Sande "] -version = "0.3.0" +version = "0.4.0" [deps] -CMake = "631607c0-34d2-5d66-819e-eb0f9aa2061a" -Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" Qhull_jll = "784f63db-0788-585a-bace-daefebcd302b" [compat] -CMake = "1.2.0" Qhull_jll = "v2019.1.0, v2020.2.0" -julia = "1" +julia = "1.3" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/deps/MiniQhullWrapper/CMake/Modules/FindQhull.cmake b/deps/MiniQhullWrapper/CMake/Modules/FindQhull.cmake deleted file mode 100644 index 5e2252a..0000000 --- a/deps/MiniQhullWrapper/CMake/Modules/FindQhull.cmake +++ /dev/null @@ -1,58 +0,0 @@ -# - Find Qhull -# Find the Qhull library -# -# Specify components: -# -# :: -# qhull = Deprecated interface: use imported target Qhull::qhull -# qhullstatic = Recommended alternative to re-entrant interface: use imported target Qhull::qhullstatic -# qhull_r = Recommended (re-entrant) interface: use imported target Qhull::qhull_r -# qhullstatic_r = Recommended (re-entrant) interface: use imported target Qhull::qhullstatic_r -# qhullcpp = C++ interface: use imported target Qhull::libqhullcpp -# -# QHULL_FOUND - True if Qhull was found. -# -# Original Author: -# 2019 Ryan Pavlik -# -# Copyright Collabora, Ltd. 2019 -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) -# -# SPDX-License-Identifier: BSL-1.0 - -set(QHULL_ROOT_DIR - "${QHULL_ROOT_DIR}" - CACHE PATH "Directory to search for Qhull") - -find_path( - QHULL_qhull_INCLUDE_DIR - NAMES libqhull/libqhull.h - PATHS "${QHULL_ROOT_DIR}" "${QHULL_ROOT_DIR}/include") -find_path( - QHULL_qhull_r_INCLUDE_DIR - NAMES libqhull_r/libqhull_r.h - PATHS "${QHULL_ROOT_DIR}" "${QHULL_ROOT_DIR}/include") -find_path( - QHULL_qhullcpp_INCLUDE_DIR - NAMES libqhullcpp/Qhull.h - PATHS "${QHULL_ROOT_DIR}" "${QHULL_ROOT_DIR}/include") - -foreach(_qh_lib qhull qhull_r qhullstatic qhullstatic_r qhullcpp) - find_library( - QHULL_${_qh_lib}_LIBRARY - NAMES ${_qh_lib} lib${_qh_lib} - PATHS "${QHULL_ROOT_DIR}" "${QHULL_ROOT_DIR}/lib") -endforeach() - -mark_as_advanced( - QHULL_qhull_INCLUDE_DIR - QHULL_qhull_LIBRARY - QHULL_qhull_r_INCLUDE_DIR - QHULL_qhull_r_LIBRARY - QHULL_qhullcpp_INCLUDE_DIR - QHULL_qhullcpp_LIBRARY - QHULL_qhullstatic_LIBRARY - QHULL_qhullstatic_r_LIBRARY) - diff --git a/deps/MiniQhullWrapper/CMakeLists.txt b/deps/MiniQhullWrapper/CMakeLists.txt deleted file mode 100644 index 43fe2a2..0000000 --- a/deps/MiniQhullWrapper/CMakeLists.txt +++ /dev/null @@ -1,76 +0,0 @@ -################################################################# -# HEADER -################################################################# -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7) -PROJECT(MiniQhullWrapper C) - -SET(LIB ${PROJECT_NAME}) - -################################################################# -# DEFINE PATHS -################################################################# - -SET(CMAKE_PATH ${CMAKE_SOURCE_DIR}/CMake) -SET(SRC_PATH ${CMAKE_SOURCE_DIR}/src) -SET(CMAKE_MODULE_PATH "${CMAKE_PATH}/Modules") -SET(LIB_PATH ${SRC_PATH}/lib) -SET(INCLUDE_PATH ${SRC_PATH}/include) -SET(TESTS_PATH ${SRC_PATH}/tests) - -################################################################# -# BUILD PATHS -################################################################# - -SET(ROOT_OUTPUT_PATH ${PROJECT_BINARY_DIR}) -SET(LIBRARY_OUTPUT_PATH ${ROOT_OUTPUT_PATH}/lib) -SET(EXECUTABLE_OUTPUT_PATH ${ROOT_OUTPUT_PATH}/bin) - -################################################################# -# FIND QHULL -################################################################# - -FIND_PACKAGE(Qhull REQUIRED) -INCLUDE_DIRECTORIES(${INCLUDE_PATH} ${QHULL_qhull_r_INCLUDE_DIR}) - -################################################################# -# FLAGS depend on the compiler and the build type -################################################################# - -GET_FILENAME_COMPONENT(C_COMPILER_NAME ${CMAKE_C_COMPILER} NAME) - -message(STATUS "COMPILER INFO: ${CMAKE_C_COMPILER_ID} - ${C_COMPILER_NAME}") - -IF (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR C_COMPILER_NAME MATCHES "gcc*") - # gcc -# set (CMAKE_C_FLAGS " " CACHE STRING "" FORCE) -ELSEIF (${CMAKE_C_COMPILER_ID} STREQUAL "Intel" OR C_COMPILER_NAME MATCHES "icc*") - # icc -# set (CMAKE_C_FLAGS " " CACHE STRING "" FORCE) -ENDIF () - -message (STATUS "CMAKE_C_COMPILER full path: " ${CMAKE_C_COMPILER}) -message (STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS}) -message (STATUS "CMAKE_C_FLAGS_RELEASE: " ${CMAKE_C_FLAGS_RELEASE}) -message (STATUS "CMAKE_C_FLAGS_DEBUG: " ${CMAKE_C_FLAGS_DEBUG}) - -################################################################# -# DYNAMIC LIBRARY -################################################################# -SET(BUILD_SHARED_LIBS True) - -################################################################# -# ADD SOURCE SUBDIRS -################################################################# - -ADD_SUBDIRECTORY(${LIB_PATH}) - -################################################################# -# ENABLE TESTING -################################################################# - -ENABLE_TESTING() -INCLUDE(CTest) -ADD_SUBDIRECTORY(${TESTS_PATH}) - - - diff --git a/deps/MiniQhullWrapper/src/include/qhullwrapper.h b/deps/MiniQhullWrapper/src/include/qhullwrapper.h deleted file mode 100644 index 6d23278..0000000 --- a/deps/MiniQhullWrapper/src/include/qhullwrapper.h +++ /dev/null @@ -1,8 +0,0 @@ - -#include - -qhT* new_qhull_handler(); -int delaunay_init_and_compute(qhT *qh, int dim, int numpoints, coordT *points, int* numcells, const char* options); -int delaunay_fill_cells(qhT *qh, int dim, int num_cells, int *cells); -int delaunay_free(qhT *qh); - diff --git a/deps/MiniQhullWrapper/src/lib/CMakeLists.txt b/deps/MiniQhullWrapper/src/lib/CMakeLists.txt deleted file mode 100644 index f6c62a2..0000000 --- a/deps/MiniQhullWrapper/src/lib/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -################################################################# -# Search C files recursively in all subdirs -################################################################# - -FILE(GLOB_RECURSE LIB_SRC *.c) -SET(LIB_SRC ${LIB_SRC} PARENT_SCOPE) - -################################################################# -# Library target -################################################################# -ADD_LIBRARY(${LIB} ${LIB_SRC}) - -TARGET_LINK_LIBRARIES(${LIB} ${QHULL_qhull_r_LIBRARY}) - -SET_TARGET_PROPERTIES(${LIB} PROPERTIES VERSION ${${LIB}_VERSION} SOVERSION ${${LIB}_SOVERSION}) -EXPORT(TARGETS ${LIB} APPEND FILE ${ROOT_OUTPUT_PATH}/${LIB}Targets.cmake) - diff --git a/deps/MiniQhullWrapper/src/lib/qhullwrapper.c b/deps/MiniQhullWrapper/src/lib/qhullwrapper.c deleted file mode 100644 index d74e28e..0000000 --- a/deps/MiniQhullWrapper/src/lib/qhullwrapper.c +++ /dev/null @@ -1,100 +0,0 @@ -#include -#include -#include - -qhT* new_qhull_handler() -{ - qhT qh_qh; - qhT *qh; - FILE *errfile= stderr; - - QHULL_LIB_CHECK - qh = (struct qhT*) malloc (sizeof (struct qhT)); - qh_zero(qh, errfile); - return qh; -} - -int delaunay_init_and_compute(qhT *qh, int dim, int numpoints, coordT *points, int* numcells, const char* flags) -{ - - boolT ismalloc = False; - FILE *outfile; - FILE *errfile= stderr; - char flagsarr[250]; - int exitcode; - int err; - facetT *facet; - - /* Set options */ - outfile = fopen("/dev/null","w"); - if (!outfile) {return -3;} - /*outfile= stdout;*/ - if (!flags) - { - if (dim <= 3) - flags = "qhull d Qt Qbb Qc Qz"; - else - flags = "qhull d Qt Qbb Qc Qx"; - } - snprintf(flagsarr, sizeof flagsarr, "%s", flags); - - /* Run qhull*/ - exitcode = qh_new_qhull(qh, dim, numpoints, points, ismalloc, flagsarr, outfile, errfile); - if (exitcode) return exitcode; - err = fclose(outfile); - if (err == EOF) {return -4;} - - /* Triangulate all the non-simplex cells generated by qhull*/ - qh_triangulate(qh); - - /* Count number of generated cells and double check that they are simplex*/ - (*numcells) = 0; - FORALLfacets - { - if (! facet->upperdelaunay) (*numcells)++; - if (! facet->simplicial) return -1; - } - - return 0; -} - -int delaunay_fill_cells(qhT *qh, int dim, int num_cells, int *cells) -{ - - int icell = 0; - facetT *facet; - vertexT *vertex, **vertexp; - int ivertex; - - /* Fill-in the cells connectivities */ - FORALLfacets - { - if (! facet->upperdelaunay) - { - ivertex = 0; - FOREACHvertex_ (facet->vertices) - { - cells[(dim+1)*icell+ivertex] = 1 + qh_pointid(qh, vertex->point); - ivertex++; - } - icell++; - } - } - - return 0; -} - -int delaunay_free(qhT *qh) -{ - - int curlong, totlong; - - /* Free memory from qhull and check that no memory is leaked */ - qh_freeqhull (qh, ! qh_ALL); - qh_memfreeshort (qh, &curlong, &totlong); - free(qh); - if (curlong || totlong) return -2; - - return 0; -} - diff --git a/deps/MiniQhullWrapper/src/tests/CMakeLists.txt b/deps/MiniQhullWrapper/src/tests/CMakeLists.txt deleted file mode 100644 index e2aaabf..0000000 --- a/deps/MiniQhullWrapper/src/tests/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -################################################################# -# TESTS -################################################################# - -FILE(GLOB_RECURSE TESTS_SRC *.c) -SET(TESTS_SRC ${TESTS_SRC} PARENT_SCOPE) - -################################################################# -# EXTERNAL LIBRARIES -################################################################# - -FOREACH(TEST_SRC ${TESTS_SRC}) - GET_FILENAME_COMPONENT(EXE_NAME ${TEST_SRC} NAME_WE) - ADD_EXECUTABLE(${EXE_NAME} ${TEST_SRC}) - TARGET_LINK_LIBRARIES(${EXE_NAME} ${LIB}) - ADD_TEST(${EXE_NAME}_TEST ${EXECUTABLE_OUTPUT_PATH}/${EXE_NAME}) -ENDFOREACH() - - - diff --git a/deps/MiniQhullWrapper/src/tests/testqhullwrapper.c b/deps/MiniQhullWrapper/src/tests/testqhullwrapper.c deleted file mode 100644 index eaddd7a..0000000 --- a/deps/MiniQhullWrapper/src/tests/testqhullwrapper.c +++ /dev/null @@ -1,35 +0,0 @@ - -#include -#include -#include - -int main(int argc, char *argv[]) { - - int error=0; - int numcells=0; - int dim = 2; - int numpoints = 4; - int *cells; - qhT *qh; - double points[] = {0.0,0.0,0.0,1.0,1.0,0.0,1.0,1.0}; - - qh = new_qhull_handler(); - printf("[ERROR=%d] (delaunay_init_and_compute) *qh = %p \n", error, qh); - error = delaunay_init_and_compute(qh, dim, numpoints, points, &numcells, NULL); - printf("[ERROR=%d] (delaunay_init_and_compute) numcells = %d \n", error, numcells); - if (error != 0) exit(error); - - cells = (int *) malloc((dim+1)*numcells * sizeof(int)); - error = delaunay_fill_cells(qh, dim, numcells, cells ); - printf("[ERROR=%d] (delaunay_fill_cells) cells [ ", error); - for(int i = 0; i < (dim+1)*numcells; i++) - printf("%d ", cells[i]); - printf("] \n"); - if (error != 0) exit(error); - - error = delaunay_free(qh); - if (error != 0) exit(error); - printf("[ERROR=%d] (delaunay_free) \n", error ); - - exit(error); -} diff --git a/deps/build.jl b/deps/build.jl deleted file mode 100644 index e411609..0000000 --- a/deps/build.jl +++ /dev/null @@ -1,111 +0,0 @@ -using CMake -using Libdl - -QHULL_WRAPPER_FOUND = true - -QHULL_WRAPPER_SOURCES = joinpath(@__DIR__, "MiniQhullWrapper") -QHULL_WRAPPER_BUILD = joinpath(QHULL_WRAPPER_SOURCES, "build") -QHULL_WRAPPER_LIB_DIR = joinpath(QHULL_WRAPPER_BUILD,"lib") - -QHULL_WRAPPER_LIB_NAME = "" -QHULL_WRAPPER_LIB_PATH = "" -QHULL_WRAPPER_LIB_NAMES = ["libMiniQhullWrapper.$(Libdl.dlext)"] - -QHULL_ROOT_DIR = "/usr" -if haskey(ENV,"QHULL_ROOT_DIR") - QHULL_ROOT_DIR = ENV["QHULL_ROOT_DIR"] -elseif VERSION >= v"1.3" - using Qhull_jll - QHULL_ROOT_DIR = Qhull_jll.artifact_dir -end - - -# Check QHULL_WRAPPER_SOURCES dir exists -if isdir(QHULL_WRAPPER_SOURCES) - @info "MiniQhullWrapper root directory at: $QHULL_WRAPPER_SOURCES" - - # Check QHULL_WRAPPER_BUILD exists - if isdir(QHULL_WRAPPER_BUILD) - rm(QHULL_WRAPPER_BUILD, recursive=true) - end - mkdir(QHULL_WRAPPER_BUILD) - - # Configure MiniQhullWrapper cmake project - try - configure = run(`$cmake -DQHULL_ROOT_DIR=$QHULL_ROOT_DIR -B $QHULL_WRAPPER_BUILD -S $QHULL_WRAPPER_SOURCES`) - if configure.exitcode != 0 - @warn "MiniQhullWrapper configure step fail with code: $(configure.exitcode)" - global QHULL_WRAPPER_FOUND=false - else - # Build MiniQhullWrapper cmake project - build = run(`$cmake --build $QHULL_WRAPPER_BUILD`) - if build.exitcode != 0 - @warn "MiniQhullWrapper build step fail with code: $(build.exitcode)" - global QHULL_WRAPPER_FOUND=false - else - # Test MiniQhullWrapper cmake project - test = run(`$cmake --build $QHULL_WRAPPER_BUILD --target test`) - if test.exitcode != 0 - @warn "MiniQhullWrapper test step fail with code: $(build.exitcode)" - global QHULL_WRAPPER_FOUND=false - end - end - end - catch e - @warn "Something wrong has happened while building MiniQhullWrapper" - global QHULL_WRAPPER_FOUND=false - end -else - @warn "MiniQhullWrapper root directory not found at: $QHULL_WRAPPER_SOURCES" - global QHULL_WRAPPER_FOUND=false -end - -if QHULL_WRAPPER_FOUND - # Check QHULL_LIB_DIR (.../lib directory) exists - if isdir(QHULL_WRAPPER_LIB_DIR) - @info "MiniQhullWrapper lib directory found at: $QHULL_WRAPPER_LIB_DIR" - else - QHULL_WRAPPER_LIB_DIR = "" - @warn "MiniQhullWrapper lib directory not found: $QHULL_WRAPPER_LIB_DIR" - end - - if isempty(QHULL_WRAPPER_LIB_NAME) - QHULL_WRAPPER_LIB_NAME=Libdl.find_library(QHULL_WRAPPER_LIB_NAMES, [QHULL_WRAPPER_LIB_DIR]) - end - - if isempty(QHULL_WRAPPER_LIB_NAME) - @warn "MiniQhullWrapper library not found: $QHULL_WRAPPER_LIB_NAMES" - QHULL_WRAPPER_FOUND = false - else - QHULL_WRAPPER_LIB_PATH=Libdl.dlpath(QHULL_WRAPPER_LIB_NAME) - @info "MiniQhullWrapper library found: $QHULL_WRAPPER_LIB_NAMES" - end -end - - -# Write QHULL configuration to deps.jl file -deps_jl = "deps.jl" - -if isfile(deps_jl) - rm(deps_jl) -end - -open(deps_jl,"w") do f - println(f, "# This file is automatically generated") - println(f, "# Do not edit") - println(f) - println(f, :(const QHULL_WRAPPER_FOUND = $QHULL_WRAPPER_FOUND)) - println(f, :(const QHULL_WRAPPER_LIB_DIR = $QHULL_WRAPPER_LIB_DIR)) - println(f, :(const QHULL_WRAPPER_LIB_NAME = $QHULL_WRAPPER_LIB_NAME)) - println(f, :(const QHULL_WRAPPER_LIB_PATH = $QHULL_WRAPPER_LIB_PATH)) -end - -@info """ -QHULL configuration: -============================================== - - QHULL_WRAPPER_FOUND = $QHULL_WRAPPER_FOUND - - QHULL_WRAPPER_LIB_DIR = $QHULL_WRAPPER_LIB_DIR - - QHULL_WRAPPER_LIB_NAME = $QHULL_WRAPPER_LIB_NAME - - QHULL_WRAPPER_LIB_PATH = $QHULL_WRAPPER_LIB_PATH -""" - diff --git a/gen/generator.jl b/gen/generator.jl index e28c2d7..1cf93b1 100644 --- a/gen/generator.jl +++ b/gen/generator.jl @@ -1,12 +1,44 @@ +using Pkg +using Pkg.Artifacts using Clang.Generators +using Clang.Generators.JLLEnvs using Qhull_jll cd(@__DIR__) include_dir = joinpath(Qhull_jll.artifact_dir, "include") -options = load_options(joinpath(@__DIR__, "generator.toml")) +for target in JLLEnvs.JLL_ENV_TRIPLES + @info "processing $target" -ctx = create_context(Qhull_jll.libqhull_r_h, ["-I$include_dir"], options) + # programmatically add options + options = Dict{String,Any}( + "general" => Dict{String,Any}(), + "codegen" => Dict{String,Any}(), + ) + general, codegen = options["general"], options["codegen"] + general["library_name"] = "libqhull_r" + general["output_file_path"] = joinpath(@__DIR__, "..", "lib", "$target.jl") + general["use_julia_native_enum_type"] = true + general["use_deterministic_symbol"] = true + general["printer_blacklist"] = [ + "qh_SEARCHdist", + "FORALLpoints", + "qh_CPUclock", + "qh_SECticks", + "qh_RANDOMint", + "qh_DISToutside", + "qh_USEfindbestnew", + ] + codegen["field_access_method_list"] = [ + "qhT", + "setT", + ] -build!(ctx) + args = get_default_args(target) + push!(args, "-I$include_dir") + + ctx = create_context(Qhull_jll.libqhull_r_h, args, options) + + build!(ctx) +end diff --git a/gen/generator.toml b/gen/generator.toml deleted file mode 100644 index a179fe7..0000000 --- a/gen/generator.toml +++ /dev/null @@ -1,98 +0,0 @@ -[general] -# it could also be an expression as long as `Meta.parse` can parse this string successfully. -# basically, it should be the `expression` in the following code: -# ccall((function_name, expression), returntype, (argtype1, ...), argvalue1, ...) -library_name = "libqhull_r" - -# the new generator is able to print everthing into one single file instead of a pair of two files. -output_file_path = "../src/LibQhull.jl" - -# if this entry is not empty, the generator will print the code below to the `output_file_path`. -# module module_name -# -# end # module -module_name = "LibQhull" - -# if this entry is not empty, the generator will print the code below to the `output_file_path`. -# using jll_pkg_name -# export jll_pkg_name -jll_pkg_name = "Qhull_jll" - -# identifiers that starts with the string listed in this entry will be exported. -export_symbol_prefixes = ["qh_", "qhT"] - -# the code in the following file will be copy-pasted to `output_file_path` before the generated code. -# this is often used for applying custom patches, e.g. adding missing definitions. -prologue_file_path = "./prologue.jl" - -# the code in the following file will be copy-pasted to `output_file_path` after the generated code. -# this is often used for applying custom patches. -epilogue_file_path = "" - -# automatically detect system std headers especially for macOS users. -auto_detect_system_headers = true - -# header blacklist -header_blacklist = [] - -# node with an id in the `printer_blacklist` will be ignored in the printing passes. -# this is very useful for custom editing. -printer_blacklist = [] - -# Julia's `@enum` do not allow duplicated values, so by default, C enums are translated to -# CEnum.jl's `@cenum`. -# if this entry is true, those duplicated enum constants are commented. -use_julia_native_enum_type = true - -# by default, only those declarations in the local header file are processed. -# for example, those declarations in the standard C library will be ignored. -# if you'd like to disable this behavior, please set this option to false. -is_local_header_only = true - -# by default, we skip all of those compiler declarations. -skip_compiler_definition = true - -# definitions in the following list will never be skipped -definition_whitelist = [ - "jmp_buf", - "CLOCKS_PER_SEC", -] - -# run `DeAnonymize` pass if this option is set to true. -smart_de_anonymize = true - -[codegen] -# map C's bool to Julia's Bool instead of `Cuchar` a.k.a `UInt8`. -use_julia_bool = true - -# set this to true if the C routine always expects a NUL-terminated string. -# TODO: support filtering -always_NUL_terminated_string = true - -# generate strictly typed function -is_function_strictly_typed = false - -# if true, opaque pointers in function arguments will be translated to `Ptr{Cvoid}`. -opaque_func_arg_as_PtrCvoid = false - -# if true, opaque types are translated to `mutable struct` instead of `Cvoid`. -opaque_as_mutable_struct = true - -# generate getproperty/setproperty! methods for the types in the following list -field_access_method_list = [ - "qhT", - "setT", -] - -[codegen.macro] -# it highly recommended to set this entry to "basic". -# if you'd like to skip all of the macros, please set this entry to "disable". -# if you'd like to aggressive translate macros to Julia, please set this entry to "aggressive". -macro_mode = "basic" - -# if this entry is true, the generator prints the following message as comments. -# "# Skipping MacroDefinition: ..." -add_comment_for_skipped_macro = true - -# ignore any macros that is suffixed with "_H" -ignore_header_guards = true \ No newline at end of file diff --git a/gen/prologue.jl b/gen/prologue.jl deleted file mode 100644 index 4cd7c92..0000000 --- a/gen/prologue.jl +++ /dev/null @@ -1,5 +0,0 @@ -const DBL_MAX = floatmax() -const DBL_MIN = floatmin() -const DBL_EPSILON = eps() -const INT_MAX = typemax(Cint) -const INT_MIN = typemin(Cint) diff --git a/lib/aarch64-apple-darwin20.jl b/lib/aarch64-apple-darwin20.jl new file mode 100644 index 0000000..0675274 --- /dev/null +++ b/lib/aarch64-apple-darwin20.jl @@ -0,0 +1,1934 @@ +const jmp_buf = NTuple{48, Cint} + +const countT = Cint + +struct setelemT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 8) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{120, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_6}(x + 32) + f === :center && return Ptr{Ptr{Cdouble}}(x + 40) + f === :previous && return Ptr{Ptr{facetT}}(x + 48) + f === :next && return Ptr{Ptr{facetT}}(x + 56) + f === :vertices && return Ptr{Ptr{setT}}(x + 64) + f === :ridges && return Ptr{Ptr{setT}}(x + 72) + f === :neighbors && return Ptr{Ptr{setT}}(x + 80) + f === :outsideset && return Ptr{Ptr{setT}}(x + 88) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 96) + f === :visitid && return Ptr{Cuint}(x + 104) + f === :id && return Ptr{Cuint}(x + 108) + f === :nummerge && return Ptr{Cuint}(x + 112) + f === :tricoplanar && return (Ptr{Cuint}(x + 113), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 113), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 113), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 113), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 113), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 113), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 113), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 114) + f === :upperdelaunay && return (Ptr{Cuint}(x + 114), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 114), 2, 1) + f === :good && return (Ptr{Cuint}(x + 114), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 114), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 114), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 114), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 114), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 115) + f === :mergehorizon && return (Ptr{Cuint}(x + 115), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 115), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 115), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 115), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 115), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 115), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 115), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{32, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 8) + f === :bottom && return Ptr{Ptr{facetT}}(x + 16) + f === :id && return Ptr{Cuint}(x + 24) + f === :seen && return Ptr{Cuint}(x + 28) + f === :tested && return (Ptr{Cuint}(x + 28), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 28), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 28), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 28), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 28), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 28), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 112) + f === :GOODvertex && return Ptr{Cint}(x + 116) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 120) + f === :HALFspace && return Ptr{Cuint}(x + 128) + f === :ISqhullQh && return Ptr{Cuint}(x + 132) + f === :IStracing && return Ptr{Cint}(x + 136) + f === :KEEParea && return Ptr{Cint}(x + 140) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 144) + f === :KEEPinside && return Ptr{Cuint}(x + 148) + f === :KEEPmerge && return Ptr{Cint}(x + 152) + f === :KEEPminArea && return Ptr{Cdouble}(x + 160) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 168) + f === :MAXwide && return Ptr{Cint}(x + 176) + f === :MERGEexact && return Ptr{Cuint}(x + 180) + f === :MERGEindependent && return Ptr{Cuint}(x + 184) + f === :MERGING && return Ptr{Cuint}(x + 188) + f === :premerge_centrum && return Ptr{Cdouble}(x + 192) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 200) + f === :MERGEpinched && return Ptr{Cuint}(x + 208) + f === :MERGEvertices && return Ptr{Cuint}(x + 212) + f === :MINvisible && return Ptr{Cdouble}(x + 216) + f === :NOnarrow && return Ptr{Cuint}(x + 224) + f === :NOnearinside && return Ptr{Cuint}(x + 228) + f === :NOpremerge && return Ptr{Cuint}(x + 232) + f === :ONLYgood && return Ptr{Cuint}(x + 236) + f === :ONLYmax && return Ptr{Cuint}(x + 240) + f === :PICKfurthest && return Ptr{Cuint}(x + 244) + f === :POSTmerge && return Ptr{Cuint}(x + 248) + f === :PREmerge && return Ptr{Cuint}(x + 252) + f === :PRINTcentrums && return Ptr{Cuint}(x + 256) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 260) + f === :PRINTdim && return Ptr{Cint}(x + 264) + f === :PRINTdots && return Ptr{Cuint}(x + 268) + f === :PRINTgood && return Ptr{Cuint}(x + 272) + f === :PRINTinner && return Ptr{Cuint}(x + 276) + f === :PRINTneighbors && return Ptr{Cuint}(x + 280) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 284) + f === :PRINToptions1st && return Ptr{Cuint}(x + 288) + f === :PRINTouter && return Ptr{Cuint}(x + 292) + f === :PRINTprecision && return Ptr{Cuint}(x + 296) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 300) + f === :PRINTridges && return Ptr{Cuint}(x + 416) + f === :PRINTspheres && return Ptr{Cuint}(x + 420) + f === :PRINTstatistics && return Ptr{Cuint}(x + 424) + f === :PRINTsummary && return Ptr{Cuint}(x + 428) + f === :PRINTtransparent && return Ptr{Cuint}(x + 432) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 436) + f === :PROJECTinput && return Ptr{Cint}(x + 440) + f === :RANDOMdist && return Ptr{Cuint}(x + 444) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 448) + f === :RANDOMa && return Ptr{Cdouble}(x + 456) + f === :RANDOMb && return Ptr{Cdouble}(x + 464) + f === :RANDOMoutside && return Ptr{Cuint}(x + 472) + f === :REPORTfreq && return Ptr{Cint}(x + 476) + f === :REPORTfreq2 && return Ptr{Cint}(x + 480) + f === :RERUN && return Ptr{Cint}(x + 484) + f === :ROTATErandom && return Ptr{Cint}(x + 488) + f === :SCALEinput && return Ptr{Cuint}(x + 492) + f === :SCALElast && return Ptr{Cuint}(x + 496) + f === :SETroundoff && return Ptr{Cuint}(x + 500) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 504) + f === :SKIPconvex && return Ptr{Cuint}(x + 508) + f === :SPLITthresholds && return Ptr{Cuint}(x + 512) + f === :STOPadd && return Ptr{Cint}(x + 516) + f === :STOPcone && return Ptr{Cint}(x + 520) + f === :STOPpoint && return Ptr{Cint}(x + 524) + f === :TESTpoints && return Ptr{Cint}(x + 528) + f === :TESTvneighbors && return Ptr{Cuint}(x + 532) + f === :TRACElevel && return Ptr{Cint}(x + 536) + f === :TRACElastrun && return Ptr{Cint}(x + 540) + f === :TRACEpoint && return Ptr{Cint}(x + 544) + f === :TRACEdist && return Ptr{Cdouble}(x + 552) + f === :TRACEmerge && return Ptr{Cint}(x + 560) + f === :TRIangulate && return Ptr{Cuint}(x + 564) + f === :TRInormals && return Ptr{Cuint}(x + 568) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 572) + f === :USEstdout && return Ptr{Cuint}(x + 576) + f === :VERIFYoutput && return Ptr{Cuint}(x + 580) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 584) + f === :VORONOI && return Ptr{Cuint}(x + 588) + f === :AREAfactor && return Ptr{Cdouble}(x + 592) + f === :DOcheckmax && return Ptr{Cuint}(x + 600) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 608) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 616) + f === :GETarea && return Ptr{Cuint}(x + 624) + f === :KEEPnearinside && return Ptr{Cuint}(x + 628) + f === :hull_dim && return Ptr{Cint}(x + 632) + f === :input_dim && return Ptr{Cint}(x + 636) + f === :num_points && return Ptr{Cint}(x + 640) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 648) + f === :POINTSmalloc && return Ptr{Cuint}(x + 656) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 664) + f === :input_malloc && return Ptr{Cuint}(x + 672) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 676) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 932) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 936) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1192) + f === :qhull_optionlen && return Ptr{Cint}(x + 1704) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1708) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1712) + f === :run_id && return Ptr{Cint}(x + 1716) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1720) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1724) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1728) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1736) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1744) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1752) + f === :ANGLEround && return Ptr{Cdouble}(x + 1760) + f === :centrum_radius && return Ptr{Cdouble}(x + 1768) + f === :cos_max && return Ptr{Cdouble}(x + 1776) + f === :DISTround && return Ptr{Cdouble}(x + 1784) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1792) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1800) + f === :MAXoutside && return Ptr{Cdouble}(x + 1808) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1816) + f === :MAXwidth && return Ptr{Cdouble}(x + 1824) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1832) + f === :MINdenom && return Ptr{Cdouble}(x + 1840) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1848) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1856) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1864) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1872) + f === :NEARinside && return Ptr{Cdouble}(x + 1880) + f === :ONEmerge && return Ptr{Cdouble}(x + 1888) + f === :outside_err && return Ptr{Cdouble}(x + 1896) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1904) + f === :NARROWhull && return Ptr{Cuint}(x + 1912) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1916) + f === :errexit && return Ptr{jmp_buf}(x + 1924) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2116) + f === :restartexit && return Ptr{jmp_buf}(x + 2156) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2348) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2392) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2400) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2408) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2416) + f === :normal_size && return Ptr{Cint}(x + 2424) + f === :center_size && return Ptr{Cint}(x + 2428) + f === :TEMPsize && return Ptr{Cint}(x + 2432) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 2440) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2448) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 2456) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2464) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 2472) + f === :num_visible && return Ptr{Cint}(x + 2480) + f === :tracefacet_id && return Ptr{Cuint}(x + 2484) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2488) + f === :traceridge_id && return Ptr{Cuint}(x + 2496) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2504) + f === :tracevertex_id && return Ptr{Cuint}(x + 2512) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2520) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2528) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2536) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2544) + f === :num_facets && return Ptr{Cint}(x + 2552) + f === :num_vertices && return Ptr{Cint}(x + 2556) + f === :num_outside && return Ptr{Cint}(x + 2560) + f === :num_good && return Ptr{Cint}(x + 2564) + f === :facet_id && return Ptr{Cuint}(x + 2568) + f === :ridge_id && return Ptr{Cuint}(x + 2572) + f === :vertex_id && return Ptr{Cuint}(x + 2576) + f === :first_newfacet && return Ptr{Cuint}(x + 2580) + f === :hulltime && return Ptr{Culong}(x + 2584) + f === :ALLOWrestart && return Ptr{Cuint}(x + 2592) + f === :build_cnt && return Ptr{Cint}(x + 2596) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 2600) + f === :furthest_id && return Ptr{Cint}(x + 2604) + f === :last_errcode && return Ptr{Cint}(x + 2608) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2616) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2624) + f === :hasAreaVolume && return Ptr{Cuint}(x + 2632) + f === :hasTriangulation && return Ptr{Cuint}(x + 2636) + f === :isRenameVertex && return Ptr{Cuint}(x + 2640) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 2648) + f === :maxoutdone && return Ptr{Cuint}(x + 2656) + f === :max_outside && return Ptr{Cdouble}(x + 2664) + f === :max_vertex && return Ptr{Cdouble}(x + 2672) + f === :min_vertex && return Ptr{Cdouble}(x + 2680) + f === :NEWfacets && return Ptr{Cuint}(x + 2688) + f === :NEWtentative && return Ptr{Cuint}(x + 2692) + f === :findbestnew && return Ptr{Cuint}(x + 2696) + f === :findbest_notsharp && return Ptr{Cuint}(x + 2700) + f === :NOerrexit && return Ptr{Cuint}(x + 2704) + f === :PRINTcradius && return Ptr{Cdouble}(x + 2712) + f === :PRINTradius && return Ptr{Cdouble}(x + 2720) + f === :POSTmerging && return Ptr{Cuint}(x + 2728) + f === :printoutvar && return Ptr{Cint}(x + 2732) + f === :printoutnum && return Ptr{Cint}(x + 2736) + f === :repart_facetid && return Ptr{Cuint}(x + 2740) + f === :retry_addpoint && return Ptr{Cint}(x + 2744) + f === :QHULLfinished && return Ptr{Cuint}(x + 2748) + f === :totarea && return Ptr{Cdouble}(x + 2752) + f === :totvol && return Ptr{Cdouble}(x + 2760) + f === :visit_id && return Ptr{Cuint}(x + 2768) + f === :vertex_visit && return Ptr{Cuint}(x + 2772) + f === :WAScoplanar && return Ptr{Cuint}(x + 2776) + f === :ZEROall_ok && return Ptr{Cuint}(x + 2780) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 2784) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 2792) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 2800) + f === :hash_table && return Ptr{Ptr{setT}}(x + 2808) + f === :other_points && return Ptr{Ptr{setT}}(x + 2816) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 2824) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 2832) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 2840) + f === :line && return Ptr{Ptr{Cchar}}(x + 2848) + f === :maxline && return Ptr{Cint}(x + 2856) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 2864) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 2872) + f === :ERREXITcalled && return Ptr{Cuint}(x + 2880) + f === :firstcentrum && return Ptr{Cuint}(x + 2884) + f === :old_randomdist && return Ptr{Cuint}(x + 2888) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 2896) + f === :last_low && return Ptr{Cdouble}(x + 2904) + f === :last_high && return Ptr{Cdouble}(x + 2912) + f === :last_newhigh && return Ptr{Cdouble}(x + 2920) + f === :lastcpu && return Ptr{Cdouble}(x + 2928) + f === :lastfacets && return Ptr{Cint}(x + 2936) + f === :lastmerges && return Ptr{Cint}(x + 2940) + f === :lastplanes && return Ptr{Cint}(x + 2944) + f === :lastdist && return Ptr{Cint}(x + 2948) + f === :lastreport && return Ptr{Cuint}(x + 2952) + f === :mergereport && return Ptr{Cint}(x + 2956) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 2960) + f === :ridgeoutnum && return Ptr{Cint}(x + 2968) + f === :last_random && return Ptr{Cint}(x + 2972) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 2976) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 3168) + f === :rbox_isinteger && return Ptr{Cint}(x + 3208) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 3216) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 3224) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 3232) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 3240) + f === :qhmem && return Ptr{qhmemT}(x + 3248) + f === :qhstat && return Ptr{qhstatT}(x + 3400) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{48, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 8) + f === :point && return Ptr{Ptr{Cdouble}}(x + 16) + f === :neighbors && return Ptr{Ptr{setT}}(x + 24) + f === :id && return Ptr{Cuint}(x + 32) + f === :visitid && return Ptr{Cuint}(x + 36) + f === :seen && return Ptr{Cuint}(x + 40) + f === :seen2 && return (Ptr{Cuint}(x + 40), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 40), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 40), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 40), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 40), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_6 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_6}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_6, f::Symbol) + r = Ref{__JL_Ctag_6}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_6}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_6}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/lib/aarch64-linux-gnu.jl b/lib/aarch64-linux-gnu.jl new file mode 100644 index 0000000..ea93ba3 --- /dev/null +++ b/lib/aarch64-linux-gnu.jl @@ -0,0 +1,1946 @@ +const __jmp_buf = NTuple{22, Culonglong} + +struct __sigset_t + __val::NTuple{16, Culong} +end + +struct __jmp_buf_tag + __jmpbuf::__jmp_buf + __mask_was_saved::Cint + __saved_mask::__sigset_t +end + +const jmp_buf = NTuple{1, __jmp_buf_tag} + +const countT = Cint + +struct setelemT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 8) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{120, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_9}(x + 32) + f === :center && return Ptr{Ptr{Cdouble}}(x + 40) + f === :previous && return Ptr{Ptr{facetT}}(x + 48) + f === :next && return Ptr{Ptr{facetT}}(x + 56) + f === :vertices && return Ptr{Ptr{setT}}(x + 64) + f === :ridges && return Ptr{Ptr{setT}}(x + 72) + f === :neighbors && return Ptr{Ptr{setT}}(x + 80) + f === :outsideset && return Ptr{Ptr{setT}}(x + 88) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 96) + f === :visitid && return Ptr{Cuint}(x + 104) + f === :id && return Ptr{Cuint}(x + 108) + f === :nummerge && return Ptr{Cuint}(x + 112) + f === :tricoplanar && return (Ptr{Cuint}(x + 113), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 113), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 113), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 113), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 113), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 113), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 113), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 114) + f === :upperdelaunay && return (Ptr{Cuint}(x + 114), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 114), 2, 1) + f === :good && return (Ptr{Cuint}(x + 114), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 114), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 114), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 114), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 114), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 115) + f === :mergehorizon && return (Ptr{Cuint}(x + 115), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 115), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 115), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 115), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 115), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 115), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 115), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{32, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 8) + f === :bottom && return Ptr{Ptr{facetT}}(x + 16) + f === :id && return Ptr{Cuint}(x + 24) + f === :seen && return Ptr{Cuint}(x + 28) + f === :tested && return (Ptr{Cuint}(x + 28), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 28), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 28), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 28), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 28), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 28), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 112) + f === :GOODvertex && return Ptr{Cint}(x + 116) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 120) + f === :HALFspace && return Ptr{Cuint}(x + 128) + f === :ISqhullQh && return Ptr{Cuint}(x + 132) + f === :IStracing && return Ptr{Cint}(x + 136) + f === :KEEParea && return Ptr{Cint}(x + 140) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 144) + f === :KEEPinside && return Ptr{Cuint}(x + 148) + f === :KEEPmerge && return Ptr{Cint}(x + 152) + f === :KEEPminArea && return Ptr{Cdouble}(x + 160) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 168) + f === :MAXwide && return Ptr{Cint}(x + 176) + f === :MERGEexact && return Ptr{Cuint}(x + 180) + f === :MERGEindependent && return Ptr{Cuint}(x + 184) + f === :MERGING && return Ptr{Cuint}(x + 188) + f === :premerge_centrum && return Ptr{Cdouble}(x + 192) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 200) + f === :MERGEpinched && return Ptr{Cuint}(x + 208) + f === :MERGEvertices && return Ptr{Cuint}(x + 212) + f === :MINvisible && return Ptr{Cdouble}(x + 216) + f === :NOnarrow && return Ptr{Cuint}(x + 224) + f === :NOnearinside && return Ptr{Cuint}(x + 228) + f === :NOpremerge && return Ptr{Cuint}(x + 232) + f === :ONLYgood && return Ptr{Cuint}(x + 236) + f === :ONLYmax && return Ptr{Cuint}(x + 240) + f === :PICKfurthest && return Ptr{Cuint}(x + 244) + f === :POSTmerge && return Ptr{Cuint}(x + 248) + f === :PREmerge && return Ptr{Cuint}(x + 252) + f === :PRINTcentrums && return Ptr{Cuint}(x + 256) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 260) + f === :PRINTdim && return Ptr{Cint}(x + 264) + f === :PRINTdots && return Ptr{Cuint}(x + 268) + f === :PRINTgood && return Ptr{Cuint}(x + 272) + f === :PRINTinner && return Ptr{Cuint}(x + 276) + f === :PRINTneighbors && return Ptr{Cuint}(x + 280) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 284) + f === :PRINToptions1st && return Ptr{Cuint}(x + 288) + f === :PRINTouter && return Ptr{Cuint}(x + 292) + f === :PRINTprecision && return Ptr{Cuint}(x + 296) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 300) + f === :PRINTridges && return Ptr{Cuint}(x + 416) + f === :PRINTspheres && return Ptr{Cuint}(x + 420) + f === :PRINTstatistics && return Ptr{Cuint}(x + 424) + f === :PRINTsummary && return Ptr{Cuint}(x + 428) + f === :PRINTtransparent && return Ptr{Cuint}(x + 432) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 436) + f === :PROJECTinput && return Ptr{Cint}(x + 440) + f === :RANDOMdist && return Ptr{Cuint}(x + 444) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 448) + f === :RANDOMa && return Ptr{Cdouble}(x + 456) + f === :RANDOMb && return Ptr{Cdouble}(x + 464) + f === :RANDOMoutside && return Ptr{Cuint}(x + 472) + f === :REPORTfreq && return Ptr{Cint}(x + 476) + f === :REPORTfreq2 && return Ptr{Cint}(x + 480) + f === :RERUN && return Ptr{Cint}(x + 484) + f === :ROTATErandom && return Ptr{Cint}(x + 488) + f === :SCALEinput && return Ptr{Cuint}(x + 492) + f === :SCALElast && return Ptr{Cuint}(x + 496) + f === :SETroundoff && return Ptr{Cuint}(x + 500) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 504) + f === :SKIPconvex && return Ptr{Cuint}(x + 508) + f === :SPLITthresholds && return Ptr{Cuint}(x + 512) + f === :STOPadd && return Ptr{Cint}(x + 516) + f === :STOPcone && return Ptr{Cint}(x + 520) + f === :STOPpoint && return Ptr{Cint}(x + 524) + f === :TESTpoints && return Ptr{Cint}(x + 528) + f === :TESTvneighbors && return Ptr{Cuint}(x + 532) + f === :TRACElevel && return Ptr{Cint}(x + 536) + f === :TRACElastrun && return Ptr{Cint}(x + 540) + f === :TRACEpoint && return Ptr{Cint}(x + 544) + f === :TRACEdist && return Ptr{Cdouble}(x + 552) + f === :TRACEmerge && return Ptr{Cint}(x + 560) + f === :TRIangulate && return Ptr{Cuint}(x + 564) + f === :TRInormals && return Ptr{Cuint}(x + 568) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 572) + f === :USEstdout && return Ptr{Cuint}(x + 576) + f === :VERIFYoutput && return Ptr{Cuint}(x + 580) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 584) + f === :VORONOI && return Ptr{Cuint}(x + 588) + f === :AREAfactor && return Ptr{Cdouble}(x + 592) + f === :DOcheckmax && return Ptr{Cuint}(x + 600) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 608) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 616) + f === :GETarea && return Ptr{Cuint}(x + 624) + f === :KEEPnearinside && return Ptr{Cuint}(x + 628) + f === :hull_dim && return Ptr{Cint}(x + 632) + f === :input_dim && return Ptr{Cint}(x + 636) + f === :num_points && return Ptr{Cint}(x + 640) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 648) + f === :POINTSmalloc && return Ptr{Cuint}(x + 656) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 664) + f === :input_malloc && return Ptr{Cuint}(x + 672) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 676) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 932) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 936) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1192) + f === :qhull_optionlen && return Ptr{Cint}(x + 1704) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1708) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1712) + f === :run_id && return Ptr{Cint}(x + 1716) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1720) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1724) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1728) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1736) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1744) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1752) + f === :ANGLEround && return Ptr{Cdouble}(x + 1760) + f === :centrum_radius && return Ptr{Cdouble}(x + 1768) + f === :cos_max && return Ptr{Cdouble}(x + 1776) + f === :DISTround && return Ptr{Cdouble}(x + 1784) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1792) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1800) + f === :MAXoutside && return Ptr{Cdouble}(x + 1808) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1816) + f === :MAXwidth && return Ptr{Cdouble}(x + 1824) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1832) + f === :MINdenom && return Ptr{Cdouble}(x + 1840) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1848) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1856) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1864) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1872) + f === :NEARinside && return Ptr{Cdouble}(x + 1880) + f === :ONEmerge && return Ptr{Cdouble}(x + 1888) + f === :outside_err && return Ptr{Cdouble}(x + 1896) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1904) + f === :NARROWhull && return Ptr{Cuint}(x + 1912) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1916) + f === :errexit && return Ptr{jmp_buf}(x + 1928) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2240) + f === :restartexit && return Ptr{jmp_buf}(x + 2280) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2592) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2632) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2640) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2648) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2656) + f === :normal_size && return Ptr{Cint}(x + 2664) + f === :center_size && return Ptr{Cint}(x + 2668) + f === :TEMPsize && return Ptr{Cint}(x + 2672) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 2680) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2688) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 2696) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2704) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 2712) + f === :num_visible && return Ptr{Cint}(x + 2720) + f === :tracefacet_id && return Ptr{Cuint}(x + 2724) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2728) + f === :traceridge_id && return Ptr{Cuint}(x + 2736) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2744) + f === :tracevertex_id && return Ptr{Cuint}(x + 2752) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2760) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2768) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2776) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2784) + f === :num_facets && return Ptr{Cint}(x + 2792) + f === :num_vertices && return Ptr{Cint}(x + 2796) + f === :num_outside && return Ptr{Cint}(x + 2800) + f === :num_good && return Ptr{Cint}(x + 2804) + f === :facet_id && return Ptr{Cuint}(x + 2808) + f === :ridge_id && return Ptr{Cuint}(x + 2812) + f === :vertex_id && return Ptr{Cuint}(x + 2816) + f === :first_newfacet && return Ptr{Cuint}(x + 2820) + f === :hulltime && return Ptr{Culong}(x + 2824) + f === :ALLOWrestart && return Ptr{Cuint}(x + 2832) + f === :build_cnt && return Ptr{Cint}(x + 2836) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 2840) + f === :furthest_id && return Ptr{Cint}(x + 2844) + f === :last_errcode && return Ptr{Cint}(x + 2848) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2856) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2864) + f === :hasAreaVolume && return Ptr{Cuint}(x + 2872) + f === :hasTriangulation && return Ptr{Cuint}(x + 2876) + f === :isRenameVertex && return Ptr{Cuint}(x + 2880) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 2888) + f === :maxoutdone && return Ptr{Cuint}(x + 2896) + f === :max_outside && return Ptr{Cdouble}(x + 2904) + f === :max_vertex && return Ptr{Cdouble}(x + 2912) + f === :min_vertex && return Ptr{Cdouble}(x + 2920) + f === :NEWfacets && return Ptr{Cuint}(x + 2928) + f === :NEWtentative && return Ptr{Cuint}(x + 2932) + f === :findbestnew && return Ptr{Cuint}(x + 2936) + f === :findbest_notsharp && return Ptr{Cuint}(x + 2940) + f === :NOerrexit && return Ptr{Cuint}(x + 2944) + f === :PRINTcradius && return Ptr{Cdouble}(x + 2952) + f === :PRINTradius && return Ptr{Cdouble}(x + 2960) + f === :POSTmerging && return Ptr{Cuint}(x + 2968) + f === :printoutvar && return Ptr{Cint}(x + 2972) + f === :printoutnum && return Ptr{Cint}(x + 2976) + f === :repart_facetid && return Ptr{Cuint}(x + 2980) + f === :retry_addpoint && return Ptr{Cint}(x + 2984) + f === :QHULLfinished && return Ptr{Cuint}(x + 2988) + f === :totarea && return Ptr{Cdouble}(x + 2992) + f === :totvol && return Ptr{Cdouble}(x + 3000) + f === :visit_id && return Ptr{Cuint}(x + 3008) + f === :vertex_visit && return Ptr{Cuint}(x + 3012) + f === :WAScoplanar && return Ptr{Cuint}(x + 3016) + f === :ZEROall_ok && return Ptr{Cuint}(x + 3020) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 3024) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 3032) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 3040) + f === :hash_table && return Ptr{Ptr{setT}}(x + 3048) + f === :other_points && return Ptr{Ptr{setT}}(x + 3056) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 3064) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 3072) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 3080) + f === :line && return Ptr{Ptr{Cchar}}(x + 3088) + f === :maxline && return Ptr{Cint}(x + 3096) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 3104) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 3112) + f === :ERREXITcalled && return Ptr{Cuint}(x + 3120) + f === :firstcentrum && return Ptr{Cuint}(x + 3124) + f === :old_randomdist && return Ptr{Cuint}(x + 3128) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 3136) + f === :last_low && return Ptr{Cdouble}(x + 3144) + f === :last_high && return Ptr{Cdouble}(x + 3152) + f === :last_newhigh && return Ptr{Cdouble}(x + 3160) + f === :lastcpu && return Ptr{Cdouble}(x + 3168) + f === :lastfacets && return Ptr{Cint}(x + 3176) + f === :lastmerges && return Ptr{Cint}(x + 3180) + f === :lastplanes && return Ptr{Cint}(x + 3184) + f === :lastdist && return Ptr{Cint}(x + 3188) + f === :lastreport && return Ptr{Cuint}(x + 3192) + f === :mergereport && return Ptr{Cint}(x + 3196) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 3200) + f === :ridgeoutnum && return Ptr{Cint}(x + 3208) + f === :last_random && return Ptr{Cint}(x + 3212) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 3216) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 3528) + f === :rbox_isinteger && return Ptr{Cint}(x + 3568) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 3576) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 3584) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 3592) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 3600) + f === :qhmem && return Ptr{qhmemT}(x + 3608) + f === :qhstat && return Ptr{qhstatT}(x + 3760) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{48, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 8) + f === :point && return Ptr{Ptr{Cdouble}}(x + 16) + f === :neighbors && return Ptr{Ptr{setT}}(x + 24) + f === :id && return Ptr{Cuint}(x + 32) + f === :visitid && return Ptr{Cuint}(x + 36) + f === :seen && return Ptr{Cuint}(x + 40) + f === :seen2 && return (Ptr{Cuint}(x + 40), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 40), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 40), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 40), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 40), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_9 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_9}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_9, f::Symbol) + r = Ref{__JL_Ctag_9}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_9}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_9}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/lib/aarch64-linux-musl.jl b/lib/aarch64-linux-musl.jl new file mode 100644 index 0000000..96a1734 --- /dev/null +++ b/lib/aarch64-linux-musl.jl @@ -0,0 +1,1942 @@ +const __jmp_buf = NTuple{22, Culong} + +struct __jmp_buf_tag + __jb::__jmp_buf + __fl::Culong + __ss::NTuple{16, Culong} +end + +const jmp_buf = NTuple{1, __jmp_buf_tag} + +const countT = Cint + +struct setelemT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 8) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{120, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_4}(x + 32) + f === :center && return Ptr{Ptr{Cdouble}}(x + 40) + f === :previous && return Ptr{Ptr{facetT}}(x + 48) + f === :next && return Ptr{Ptr{facetT}}(x + 56) + f === :vertices && return Ptr{Ptr{setT}}(x + 64) + f === :ridges && return Ptr{Ptr{setT}}(x + 72) + f === :neighbors && return Ptr{Ptr{setT}}(x + 80) + f === :outsideset && return Ptr{Ptr{setT}}(x + 88) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 96) + f === :visitid && return Ptr{Cuint}(x + 104) + f === :id && return Ptr{Cuint}(x + 108) + f === :nummerge && return Ptr{Cuint}(x + 112) + f === :tricoplanar && return (Ptr{Cuint}(x + 113), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 113), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 113), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 113), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 113), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 113), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 113), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 114) + f === :upperdelaunay && return (Ptr{Cuint}(x + 114), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 114), 2, 1) + f === :good && return (Ptr{Cuint}(x + 114), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 114), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 114), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 114), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 114), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 115) + f === :mergehorizon && return (Ptr{Cuint}(x + 115), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 115), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 115), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 115), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 115), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 115), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 115), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{32, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 8) + f === :bottom && return Ptr{Ptr{facetT}}(x + 16) + f === :id && return Ptr{Cuint}(x + 24) + f === :seen && return Ptr{Cuint}(x + 28) + f === :tested && return (Ptr{Cuint}(x + 28), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 28), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 28), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 28), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 28), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 28), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 112) + f === :GOODvertex && return Ptr{Cint}(x + 116) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 120) + f === :HALFspace && return Ptr{Cuint}(x + 128) + f === :ISqhullQh && return Ptr{Cuint}(x + 132) + f === :IStracing && return Ptr{Cint}(x + 136) + f === :KEEParea && return Ptr{Cint}(x + 140) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 144) + f === :KEEPinside && return Ptr{Cuint}(x + 148) + f === :KEEPmerge && return Ptr{Cint}(x + 152) + f === :KEEPminArea && return Ptr{Cdouble}(x + 160) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 168) + f === :MAXwide && return Ptr{Cint}(x + 176) + f === :MERGEexact && return Ptr{Cuint}(x + 180) + f === :MERGEindependent && return Ptr{Cuint}(x + 184) + f === :MERGING && return Ptr{Cuint}(x + 188) + f === :premerge_centrum && return Ptr{Cdouble}(x + 192) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 200) + f === :MERGEpinched && return Ptr{Cuint}(x + 208) + f === :MERGEvertices && return Ptr{Cuint}(x + 212) + f === :MINvisible && return Ptr{Cdouble}(x + 216) + f === :NOnarrow && return Ptr{Cuint}(x + 224) + f === :NOnearinside && return Ptr{Cuint}(x + 228) + f === :NOpremerge && return Ptr{Cuint}(x + 232) + f === :ONLYgood && return Ptr{Cuint}(x + 236) + f === :ONLYmax && return Ptr{Cuint}(x + 240) + f === :PICKfurthest && return Ptr{Cuint}(x + 244) + f === :POSTmerge && return Ptr{Cuint}(x + 248) + f === :PREmerge && return Ptr{Cuint}(x + 252) + f === :PRINTcentrums && return Ptr{Cuint}(x + 256) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 260) + f === :PRINTdim && return Ptr{Cint}(x + 264) + f === :PRINTdots && return Ptr{Cuint}(x + 268) + f === :PRINTgood && return Ptr{Cuint}(x + 272) + f === :PRINTinner && return Ptr{Cuint}(x + 276) + f === :PRINTneighbors && return Ptr{Cuint}(x + 280) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 284) + f === :PRINToptions1st && return Ptr{Cuint}(x + 288) + f === :PRINTouter && return Ptr{Cuint}(x + 292) + f === :PRINTprecision && return Ptr{Cuint}(x + 296) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 300) + f === :PRINTridges && return Ptr{Cuint}(x + 416) + f === :PRINTspheres && return Ptr{Cuint}(x + 420) + f === :PRINTstatistics && return Ptr{Cuint}(x + 424) + f === :PRINTsummary && return Ptr{Cuint}(x + 428) + f === :PRINTtransparent && return Ptr{Cuint}(x + 432) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 436) + f === :PROJECTinput && return Ptr{Cint}(x + 440) + f === :RANDOMdist && return Ptr{Cuint}(x + 444) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 448) + f === :RANDOMa && return Ptr{Cdouble}(x + 456) + f === :RANDOMb && return Ptr{Cdouble}(x + 464) + f === :RANDOMoutside && return Ptr{Cuint}(x + 472) + f === :REPORTfreq && return Ptr{Cint}(x + 476) + f === :REPORTfreq2 && return Ptr{Cint}(x + 480) + f === :RERUN && return Ptr{Cint}(x + 484) + f === :ROTATErandom && return Ptr{Cint}(x + 488) + f === :SCALEinput && return Ptr{Cuint}(x + 492) + f === :SCALElast && return Ptr{Cuint}(x + 496) + f === :SETroundoff && return Ptr{Cuint}(x + 500) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 504) + f === :SKIPconvex && return Ptr{Cuint}(x + 508) + f === :SPLITthresholds && return Ptr{Cuint}(x + 512) + f === :STOPadd && return Ptr{Cint}(x + 516) + f === :STOPcone && return Ptr{Cint}(x + 520) + f === :STOPpoint && return Ptr{Cint}(x + 524) + f === :TESTpoints && return Ptr{Cint}(x + 528) + f === :TESTvneighbors && return Ptr{Cuint}(x + 532) + f === :TRACElevel && return Ptr{Cint}(x + 536) + f === :TRACElastrun && return Ptr{Cint}(x + 540) + f === :TRACEpoint && return Ptr{Cint}(x + 544) + f === :TRACEdist && return Ptr{Cdouble}(x + 552) + f === :TRACEmerge && return Ptr{Cint}(x + 560) + f === :TRIangulate && return Ptr{Cuint}(x + 564) + f === :TRInormals && return Ptr{Cuint}(x + 568) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 572) + f === :USEstdout && return Ptr{Cuint}(x + 576) + f === :VERIFYoutput && return Ptr{Cuint}(x + 580) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 584) + f === :VORONOI && return Ptr{Cuint}(x + 588) + f === :AREAfactor && return Ptr{Cdouble}(x + 592) + f === :DOcheckmax && return Ptr{Cuint}(x + 600) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 608) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 616) + f === :GETarea && return Ptr{Cuint}(x + 624) + f === :KEEPnearinside && return Ptr{Cuint}(x + 628) + f === :hull_dim && return Ptr{Cint}(x + 632) + f === :input_dim && return Ptr{Cint}(x + 636) + f === :num_points && return Ptr{Cint}(x + 640) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 648) + f === :POINTSmalloc && return Ptr{Cuint}(x + 656) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 664) + f === :input_malloc && return Ptr{Cuint}(x + 672) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 676) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 932) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 936) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1192) + f === :qhull_optionlen && return Ptr{Cint}(x + 1704) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1708) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1712) + f === :run_id && return Ptr{Cint}(x + 1716) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1720) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1724) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1728) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1736) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1744) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1752) + f === :ANGLEround && return Ptr{Cdouble}(x + 1760) + f === :centrum_radius && return Ptr{Cdouble}(x + 1768) + f === :cos_max && return Ptr{Cdouble}(x + 1776) + f === :DISTround && return Ptr{Cdouble}(x + 1784) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1792) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1800) + f === :MAXoutside && return Ptr{Cdouble}(x + 1808) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1816) + f === :MAXwidth && return Ptr{Cdouble}(x + 1824) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1832) + f === :MINdenom && return Ptr{Cdouble}(x + 1840) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1848) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1856) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1864) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1872) + f === :NEARinside && return Ptr{Cdouble}(x + 1880) + f === :ONEmerge && return Ptr{Cdouble}(x + 1888) + f === :outside_err && return Ptr{Cdouble}(x + 1896) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1904) + f === :NARROWhull && return Ptr{Cuint}(x + 1912) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1916) + f === :errexit && return Ptr{jmp_buf}(x + 1928) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2240) + f === :restartexit && return Ptr{jmp_buf}(x + 2280) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2592) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2632) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2640) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2648) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2656) + f === :normal_size && return Ptr{Cint}(x + 2664) + f === :center_size && return Ptr{Cint}(x + 2668) + f === :TEMPsize && return Ptr{Cint}(x + 2672) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 2680) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2688) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 2696) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2704) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 2712) + f === :num_visible && return Ptr{Cint}(x + 2720) + f === :tracefacet_id && return Ptr{Cuint}(x + 2724) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2728) + f === :traceridge_id && return Ptr{Cuint}(x + 2736) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2744) + f === :tracevertex_id && return Ptr{Cuint}(x + 2752) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2760) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2768) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2776) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2784) + f === :num_facets && return Ptr{Cint}(x + 2792) + f === :num_vertices && return Ptr{Cint}(x + 2796) + f === :num_outside && return Ptr{Cint}(x + 2800) + f === :num_good && return Ptr{Cint}(x + 2804) + f === :facet_id && return Ptr{Cuint}(x + 2808) + f === :ridge_id && return Ptr{Cuint}(x + 2812) + f === :vertex_id && return Ptr{Cuint}(x + 2816) + f === :first_newfacet && return Ptr{Cuint}(x + 2820) + f === :hulltime && return Ptr{Culong}(x + 2824) + f === :ALLOWrestart && return Ptr{Cuint}(x + 2832) + f === :build_cnt && return Ptr{Cint}(x + 2836) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 2840) + f === :furthest_id && return Ptr{Cint}(x + 2844) + f === :last_errcode && return Ptr{Cint}(x + 2848) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2856) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2864) + f === :hasAreaVolume && return Ptr{Cuint}(x + 2872) + f === :hasTriangulation && return Ptr{Cuint}(x + 2876) + f === :isRenameVertex && return Ptr{Cuint}(x + 2880) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 2888) + f === :maxoutdone && return Ptr{Cuint}(x + 2896) + f === :max_outside && return Ptr{Cdouble}(x + 2904) + f === :max_vertex && return Ptr{Cdouble}(x + 2912) + f === :min_vertex && return Ptr{Cdouble}(x + 2920) + f === :NEWfacets && return Ptr{Cuint}(x + 2928) + f === :NEWtentative && return Ptr{Cuint}(x + 2932) + f === :findbestnew && return Ptr{Cuint}(x + 2936) + f === :findbest_notsharp && return Ptr{Cuint}(x + 2940) + f === :NOerrexit && return Ptr{Cuint}(x + 2944) + f === :PRINTcradius && return Ptr{Cdouble}(x + 2952) + f === :PRINTradius && return Ptr{Cdouble}(x + 2960) + f === :POSTmerging && return Ptr{Cuint}(x + 2968) + f === :printoutvar && return Ptr{Cint}(x + 2972) + f === :printoutnum && return Ptr{Cint}(x + 2976) + f === :repart_facetid && return Ptr{Cuint}(x + 2980) + f === :retry_addpoint && return Ptr{Cint}(x + 2984) + f === :QHULLfinished && return Ptr{Cuint}(x + 2988) + f === :totarea && return Ptr{Cdouble}(x + 2992) + f === :totvol && return Ptr{Cdouble}(x + 3000) + f === :visit_id && return Ptr{Cuint}(x + 3008) + f === :vertex_visit && return Ptr{Cuint}(x + 3012) + f === :WAScoplanar && return Ptr{Cuint}(x + 3016) + f === :ZEROall_ok && return Ptr{Cuint}(x + 3020) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 3024) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 3032) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 3040) + f === :hash_table && return Ptr{Ptr{setT}}(x + 3048) + f === :other_points && return Ptr{Ptr{setT}}(x + 3056) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 3064) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 3072) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 3080) + f === :line && return Ptr{Ptr{Cchar}}(x + 3088) + f === :maxline && return Ptr{Cint}(x + 3096) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 3104) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 3112) + f === :ERREXITcalled && return Ptr{Cuint}(x + 3120) + f === :firstcentrum && return Ptr{Cuint}(x + 3124) + f === :old_randomdist && return Ptr{Cuint}(x + 3128) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 3136) + f === :last_low && return Ptr{Cdouble}(x + 3144) + f === :last_high && return Ptr{Cdouble}(x + 3152) + f === :last_newhigh && return Ptr{Cdouble}(x + 3160) + f === :lastcpu && return Ptr{Cdouble}(x + 3168) + f === :lastfacets && return Ptr{Cint}(x + 3176) + f === :lastmerges && return Ptr{Cint}(x + 3180) + f === :lastplanes && return Ptr{Cint}(x + 3184) + f === :lastdist && return Ptr{Cint}(x + 3188) + f === :lastreport && return Ptr{Cuint}(x + 3192) + f === :mergereport && return Ptr{Cint}(x + 3196) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 3200) + f === :ridgeoutnum && return Ptr{Cint}(x + 3208) + f === :last_random && return Ptr{Cint}(x + 3212) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 3216) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 3528) + f === :rbox_isinteger && return Ptr{Cint}(x + 3568) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 3576) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 3584) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 3592) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 3600) + f === :qhmem && return Ptr{qhmemT}(x + 3608) + f === :qhstat && return Ptr{qhstatT}(x + 3760) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{48, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 8) + f === :point && return Ptr{Ptr{Cdouble}}(x + 16) + f === :neighbors && return Ptr{Ptr{setT}}(x + 24) + f === :id && return Ptr{Cuint}(x + 32) + f === :visitid && return Ptr{Cuint}(x + 36) + f === :seen && return Ptr{Cuint}(x + 40) + f === :seen2 && return (Ptr{Cuint}(x + 40), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 40), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 40), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 40), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 40), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_4 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_4}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_4, f::Symbol) + r = Ref{__JL_Ctag_4}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_4}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_4}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/lib/armv7l-linux-gnueabihf.jl b/lib/armv7l-linux-gnueabihf.jl new file mode 100644 index 0000000..6f91179 --- /dev/null +++ b/lib/armv7l-linux-gnueabihf.jl @@ -0,0 +1,1946 @@ +const __jmp_buf = NTuple{64, Cint} + +struct __sigset_t + __val::NTuple{32, Culong} +end + +struct __jmp_buf_tag + __jmpbuf::__jmp_buf + __mask_was_saved::Cint + __saved_mask::__sigset_t +end + +const jmp_buf = NTuple{1, __jmp_buf_tag} + +const countT = Cint + +struct setelemT + data::NTuple{4, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 4) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{88, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_9}(x + 32) + f === :center && return Ptr{Ptr{Cdouble}}(x + 40) + f === :previous && return Ptr{Ptr{facetT}}(x + 44) + f === :next && return Ptr{Ptr{facetT}}(x + 48) + f === :vertices && return Ptr{Ptr{setT}}(x + 52) + f === :ridges && return Ptr{Ptr{setT}}(x + 56) + f === :neighbors && return Ptr{Ptr{setT}}(x + 60) + f === :outsideset && return Ptr{Ptr{setT}}(x + 64) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 68) + f === :visitid && return Ptr{Cuint}(x + 72) + f === :id && return Ptr{Cuint}(x + 76) + f === :nummerge && return Ptr{Cuint}(x + 80) + f === :tricoplanar && return (Ptr{Cuint}(x + 81), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 81), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 81), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 81), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 81), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 81), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 81), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 82) + f === :upperdelaunay && return (Ptr{Cuint}(x + 82), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 82), 2, 1) + f === :good && return (Ptr{Cuint}(x + 82), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 82), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 82), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 82), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 82), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 83) + f === :mergehorizon && return (Ptr{Cuint}(x + 83), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 83), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 83), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 83), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 83), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 83), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 83), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{20, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 4) + f === :bottom && return Ptr{Ptr{facetT}}(x + 8) + f === :id && return Ptr{Cuint}(x + 12) + f === :seen && return Ptr{Cuint}(x + 16) + f === :tested && return (Ptr{Cuint}(x + 16), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 16), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 16), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 16), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 16), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 16), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 108) + f === :GOODvertex && return Ptr{Cint}(x + 112) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 116) + f === :HALFspace && return Ptr{Cuint}(x + 120) + f === :ISqhullQh && return Ptr{Cuint}(x + 124) + f === :IStracing && return Ptr{Cint}(x + 128) + f === :KEEParea && return Ptr{Cint}(x + 132) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 136) + f === :KEEPinside && return Ptr{Cuint}(x + 140) + f === :KEEPmerge && return Ptr{Cint}(x + 144) + f === :KEEPminArea && return Ptr{Cdouble}(x + 152) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 160) + f === :MAXwide && return Ptr{Cint}(x + 168) + f === :MERGEexact && return Ptr{Cuint}(x + 172) + f === :MERGEindependent && return Ptr{Cuint}(x + 176) + f === :MERGING && return Ptr{Cuint}(x + 180) + f === :premerge_centrum && return Ptr{Cdouble}(x + 184) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 192) + f === :MERGEpinched && return Ptr{Cuint}(x + 200) + f === :MERGEvertices && return Ptr{Cuint}(x + 204) + f === :MINvisible && return Ptr{Cdouble}(x + 208) + f === :NOnarrow && return Ptr{Cuint}(x + 216) + f === :NOnearinside && return Ptr{Cuint}(x + 220) + f === :NOpremerge && return Ptr{Cuint}(x + 224) + f === :ONLYgood && return Ptr{Cuint}(x + 228) + f === :ONLYmax && return Ptr{Cuint}(x + 232) + f === :PICKfurthest && return Ptr{Cuint}(x + 236) + f === :POSTmerge && return Ptr{Cuint}(x + 240) + f === :PREmerge && return Ptr{Cuint}(x + 244) + f === :PRINTcentrums && return Ptr{Cuint}(x + 248) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 252) + f === :PRINTdim && return Ptr{Cint}(x + 256) + f === :PRINTdots && return Ptr{Cuint}(x + 260) + f === :PRINTgood && return Ptr{Cuint}(x + 264) + f === :PRINTinner && return Ptr{Cuint}(x + 268) + f === :PRINTneighbors && return Ptr{Cuint}(x + 272) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 276) + f === :PRINToptions1st && return Ptr{Cuint}(x + 280) + f === :PRINTouter && return Ptr{Cuint}(x + 284) + f === :PRINTprecision && return Ptr{Cuint}(x + 288) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 292) + f === :PRINTridges && return Ptr{Cuint}(x + 408) + f === :PRINTspheres && return Ptr{Cuint}(x + 412) + f === :PRINTstatistics && return Ptr{Cuint}(x + 416) + f === :PRINTsummary && return Ptr{Cuint}(x + 420) + f === :PRINTtransparent && return Ptr{Cuint}(x + 424) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 428) + f === :PROJECTinput && return Ptr{Cint}(x + 432) + f === :RANDOMdist && return Ptr{Cuint}(x + 436) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 440) + f === :RANDOMa && return Ptr{Cdouble}(x + 448) + f === :RANDOMb && return Ptr{Cdouble}(x + 456) + f === :RANDOMoutside && return Ptr{Cuint}(x + 464) + f === :REPORTfreq && return Ptr{Cint}(x + 468) + f === :REPORTfreq2 && return Ptr{Cint}(x + 472) + f === :RERUN && return Ptr{Cint}(x + 476) + f === :ROTATErandom && return Ptr{Cint}(x + 480) + f === :SCALEinput && return Ptr{Cuint}(x + 484) + f === :SCALElast && return Ptr{Cuint}(x + 488) + f === :SETroundoff && return Ptr{Cuint}(x + 492) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 496) + f === :SKIPconvex && return Ptr{Cuint}(x + 500) + f === :SPLITthresholds && return Ptr{Cuint}(x + 504) + f === :STOPadd && return Ptr{Cint}(x + 508) + f === :STOPcone && return Ptr{Cint}(x + 512) + f === :STOPpoint && return Ptr{Cint}(x + 516) + f === :TESTpoints && return Ptr{Cint}(x + 520) + f === :TESTvneighbors && return Ptr{Cuint}(x + 524) + f === :TRACElevel && return Ptr{Cint}(x + 528) + f === :TRACElastrun && return Ptr{Cint}(x + 532) + f === :TRACEpoint && return Ptr{Cint}(x + 536) + f === :TRACEdist && return Ptr{Cdouble}(x + 544) + f === :TRACEmerge && return Ptr{Cint}(x + 552) + f === :TRIangulate && return Ptr{Cuint}(x + 556) + f === :TRInormals && return Ptr{Cuint}(x + 560) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 564) + f === :USEstdout && return Ptr{Cuint}(x + 568) + f === :VERIFYoutput && return Ptr{Cuint}(x + 572) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 576) + f === :VORONOI && return Ptr{Cuint}(x + 580) + f === :AREAfactor && return Ptr{Cdouble}(x + 584) + f === :DOcheckmax && return Ptr{Cuint}(x + 592) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 596) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 600) + f === :GETarea && return Ptr{Cuint}(x + 604) + f === :KEEPnearinside && return Ptr{Cuint}(x + 608) + f === :hull_dim && return Ptr{Cint}(x + 612) + f === :input_dim && return Ptr{Cint}(x + 616) + f === :num_points && return Ptr{Cint}(x + 620) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 624) + f === :POINTSmalloc && return Ptr{Cuint}(x + 628) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 632) + f === :input_malloc && return Ptr{Cuint}(x + 636) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 640) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 896) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 900) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1156) + f === :qhull_optionlen && return Ptr{Cint}(x + 1668) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1672) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1676) + f === :run_id && return Ptr{Cint}(x + 1680) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1684) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1688) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1692) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1696) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1700) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1704) + f === :ANGLEround && return Ptr{Cdouble}(x + 1712) + f === :centrum_radius && return Ptr{Cdouble}(x + 1720) + f === :cos_max && return Ptr{Cdouble}(x + 1728) + f === :DISTround && return Ptr{Cdouble}(x + 1736) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1744) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1752) + f === :MAXoutside && return Ptr{Cdouble}(x + 1760) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1768) + f === :MAXwidth && return Ptr{Cdouble}(x + 1776) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1784) + f === :MINdenom && return Ptr{Cdouble}(x + 1792) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1800) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1808) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1816) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1824) + f === :NEARinside && return Ptr{Cdouble}(x + 1832) + f === :ONEmerge && return Ptr{Cdouble}(x + 1840) + f === :outside_err && return Ptr{Cdouble}(x + 1848) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1856) + f === :NARROWhull && return Ptr{Cuint}(x + 1864) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1868) + f === :errexit && return Ptr{jmp_buf}(x + 1880) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2272) + f === :restartexit && return Ptr{jmp_buf}(x + 2312) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2704) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2744) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2748) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2752) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2756) + f === :normal_size && return Ptr{Cint}(x + 2760) + f === :center_size && return Ptr{Cint}(x + 2764) + f === :TEMPsize && return Ptr{Cint}(x + 2768) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 2772) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2776) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 2780) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2784) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 2788) + f === :num_visible && return Ptr{Cint}(x + 2792) + f === :tracefacet_id && return Ptr{Cuint}(x + 2796) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2800) + f === :traceridge_id && return Ptr{Cuint}(x + 2804) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2808) + f === :tracevertex_id && return Ptr{Cuint}(x + 2812) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2816) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2820) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2824) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2828) + f === :num_facets && return Ptr{Cint}(x + 2832) + f === :num_vertices && return Ptr{Cint}(x + 2836) + f === :num_outside && return Ptr{Cint}(x + 2840) + f === :num_good && return Ptr{Cint}(x + 2844) + f === :facet_id && return Ptr{Cuint}(x + 2848) + f === :ridge_id && return Ptr{Cuint}(x + 2852) + f === :vertex_id && return Ptr{Cuint}(x + 2856) + f === :first_newfacet && return Ptr{Cuint}(x + 2860) + f === :hulltime && return Ptr{Culong}(x + 2864) + f === :ALLOWrestart && return Ptr{Cuint}(x + 2868) + f === :build_cnt && return Ptr{Cint}(x + 2872) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 2876) + f === :furthest_id && return Ptr{Cint}(x + 2880) + f === :last_errcode && return Ptr{Cint}(x + 2884) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2888) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2892) + f === :hasAreaVolume && return Ptr{Cuint}(x + 2896) + f === :hasTriangulation && return Ptr{Cuint}(x + 2900) + f === :isRenameVertex && return Ptr{Cuint}(x + 2904) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 2912) + f === :maxoutdone && return Ptr{Cuint}(x + 2920) + f === :max_outside && return Ptr{Cdouble}(x + 2928) + f === :max_vertex && return Ptr{Cdouble}(x + 2936) + f === :min_vertex && return Ptr{Cdouble}(x + 2944) + f === :NEWfacets && return Ptr{Cuint}(x + 2952) + f === :NEWtentative && return Ptr{Cuint}(x + 2956) + f === :findbestnew && return Ptr{Cuint}(x + 2960) + f === :findbest_notsharp && return Ptr{Cuint}(x + 2964) + f === :NOerrexit && return Ptr{Cuint}(x + 2968) + f === :PRINTcradius && return Ptr{Cdouble}(x + 2976) + f === :PRINTradius && return Ptr{Cdouble}(x + 2984) + f === :POSTmerging && return Ptr{Cuint}(x + 2992) + f === :printoutvar && return Ptr{Cint}(x + 2996) + f === :printoutnum && return Ptr{Cint}(x + 3000) + f === :repart_facetid && return Ptr{Cuint}(x + 3004) + f === :retry_addpoint && return Ptr{Cint}(x + 3008) + f === :QHULLfinished && return Ptr{Cuint}(x + 3012) + f === :totarea && return Ptr{Cdouble}(x + 3016) + f === :totvol && return Ptr{Cdouble}(x + 3024) + f === :visit_id && return Ptr{Cuint}(x + 3032) + f === :vertex_visit && return Ptr{Cuint}(x + 3036) + f === :WAScoplanar && return Ptr{Cuint}(x + 3040) + f === :ZEROall_ok && return Ptr{Cuint}(x + 3044) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 3048) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 3052) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 3056) + f === :hash_table && return Ptr{Ptr{setT}}(x + 3060) + f === :other_points && return Ptr{Ptr{setT}}(x + 3064) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 3068) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 3072) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 3076) + f === :line && return Ptr{Ptr{Cchar}}(x + 3080) + f === :maxline && return Ptr{Cint}(x + 3084) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 3088) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 3092) + f === :ERREXITcalled && return Ptr{Cuint}(x + 3096) + f === :firstcentrum && return Ptr{Cuint}(x + 3100) + f === :old_randomdist && return Ptr{Cuint}(x + 3104) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 3108) + f === :last_low && return Ptr{Cdouble}(x + 3112) + f === :last_high && return Ptr{Cdouble}(x + 3120) + f === :last_newhigh && return Ptr{Cdouble}(x + 3128) + f === :lastcpu && return Ptr{Cdouble}(x + 3136) + f === :lastfacets && return Ptr{Cint}(x + 3144) + f === :lastmerges && return Ptr{Cint}(x + 3148) + f === :lastplanes && return Ptr{Cint}(x + 3152) + f === :lastdist && return Ptr{Cint}(x + 3156) + f === :lastreport && return Ptr{Cuint}(x + 3160) + f === :mergereport && return Ptr{Cint}(x + 3164) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 3168) + f === :ridgeoutnum && return Ptr{Cint}(x + 3172) + f === :last_random && return Ptr{Cint}(x + 3176) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 3184) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 3576) + f === :rbox_isinteger && return Ptr{Cint}(x + 3616) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 3624) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 3632) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 3636) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 3640) + f === :qhmem && return Ptr{qhmemT}(x + 3644) + f === :qhstat && return Ptr{qhstatT}(x + 3760) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{28, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 4) + f === :point && return Ptr{Ptr{Cdouble}}(x + 8) + f === :neighbors && return Ptr{Ptr{setT}}(x + 12) + f === :id && return Ptr{Cuint}(x + 16) + f === :visitid && return Ptr{Cuint}(x + 20) + f === :seen && return Ptr{Cuint}(x + 24) + f === :seen2 && return (Ptr{Cuint}(x + 24), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 24), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 24), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 24), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 24), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_9 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_9}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_9, f::Symbol) + r = Ref{__JL_Ctag_9}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_9}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_9}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/lib/armv7l-linux-musleabihf.jl b/lib/armv7l-linux-musleabihf.jl new file mode 100644 index 0000000..8c0142f --- /dev/null +++ b/lib/armv7l-linux-musleabihf.jl @@ -0,0 +1,1942 @@ +const __jmp_buf = NTuple{32, Culonglong} + +struct __jmp_buf_tag + __jb::__jmp_buf + __fl::Culong + __ss::NTuple{32, Culong} +end + +const jmp_buf = NTuple{1, __jmp_buf_tag} + +const countT = Cint + +struct setelemT + data::NTuple{4, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 4) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{88, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_4}(x + 32) + f === :center && return Ptr{Ptr{Cdouble}}(x + 40) + f === :previous && return Ptr{Ptr{facetT}}(x + 44) + f === :next && return Ptr{Ptr{facetT}}(x + 48) + f === :vertices && return Ptr{Ptr{setT}}(x + 52) + f === :ridges && return Ptr{Ptr{setT}}(x + 56) + f === :neighbors && return Ptr{Ptr{setT}}(x + 60) + f === :outsideset && return Ptr{Ptr{setT}}(x + 64) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 68) + f === :visitid && return Ptr{Cuint}(x + 72) + f === :id && return Ptr{Cuint}(x + 76) + f === :nummerge && return Ptr{Cuint}(x + 80) + f === :tricoplanar && return (Ptr{Cuint}(x + 81), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 81), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 81), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 81), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 81), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 81), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 81), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 82) + f === :upperdelaunay && return (Ptr{Cuint}(x + 82), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 82), 2, 1) + f === :good && return (Ptr{Cuint}(x + 82), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 82), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 82), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 82), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 82), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 83) + f === :mergehorizon && return (Ptr{Cuint}(x + 83), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 83), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 83), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 83), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 83), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 83), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 83), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{20, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 4) + f === :bottom && return Ptr{Ptr{facetT}}(x + 8) + f === :id && return Ptr{Cuint}(x + 12) + f === :seen && return Ptr{Cuint}(x + 16) + f === :tested && return (Ptr{Cuint}(x + 16), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 16), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 16), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 16), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 16), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 16), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 108) + f === :GOODvertex && return Ptr{Cint}(x + 112) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 116) + f === :HALFspace && return Ptr{Cuint}(x + 120) + f === :ISqhullQh && return Ptr{Cuint}(x + 124) + f === :IStracing && return Ptr{Cint}(x + 128) + f === :KEEParea && return Ptr{Cint}(x + 132) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 136) + f === :KEEPinside && return Ptr{Cuint}(x + 140) + f === :KEEPmerge && return Ptr{Cint}(x + 144) + f === :KEEPminArea && return Ptr{Cdouble}(x + 152) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 160) + f === :MAXwide && return Ptr{Cint}(x + 168) + f === :MERGEexact && return Ptr{Cuint}(x + 172) + f === :MERGEindependent && return Ptr{Cuint}(x + 176) + f === :MERGING && return Ptr{Cuint}(x + 180) + f === :premerge_centrum && return Ptr{Cdouble}(x + 184) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 192) + f === :MERGEpinched && return Ptr{Cuint}(x + 200) + f === :MERGEvertices && return Ptr{Cuint}(x + 204) + f === :MINvisible && return Ptr{Cdouble}(x + 208) + f === :NOnarrow && return Ptr{Cuint}(x + 216) + f === :NOnearinside && return Ptr{Cuint}(x + 220) + f === :NOpremerge && return Ptr{Cuint}(x + 224) + f === :ONLYgood && return Ptr{Cuint}(x + 228) + f === :ONLYmax && return Ptr{Cuint}(x + 232) + f === :PICKfurthest && return Ptr{Cuint}(x + 236) + f === :POSTmerge && return Ptr{Cuint}(x + 240) + f === :PREmerge && return Ptr{Cuint}(x + 244) + f === :PRINTcentrums && return Ptr{Cuint}(x + 248) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 252) + f === :PRINTdim && return Ptr{Cint}(x + 256) + f === :PRINTdots && return Ptr{Cuint}(x + 260) + f === :PRINTgood && return Ptr{Cuint}(x + 264) + f === :PRINTinner && return Ptr{Cuint}(x + 268) + f === :PRINTneighbors && return Ptr{Cuint}(x + 272) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 276) + f === :PRINToptions1st && return Ptr{Cuint}(x + 280) + f === :PRINTouter && return Ptr{Cuint}(x + 284) + f === :PRINTprecision && return Ptr{Cuint}(x + 288) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 292) + f === :PRINTridges && return Ptr{Cuint}(x + 408) + f === :PRINTspheres && return Ptr{Cuint}(x + 412) + f === :PRINTstatistics && return Ptr{Cuint}(x + 416) + f === :PRINTsummary && return Ptr{Cuint}(x + 420) + f === :PRINTtransparent && return Ptr{Cuint}(x + 424) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 428) + f === :PROJECTinput && return Ptr{Cint}(x + 432) + f === :RANDOMdist && return Ptr{Cuint}(x + 436) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 440) + f === :RANDOMa && return Ptr{Cdouble}(x + 448) + f === :RANDOMb && return Ptr{Cdouble}(x + 456) + f === :RANDOMoutside && return Ptr{Cuint}(x + 464) + f === :REPORTfreq && return Ptr{Cint}(x + 468) + f === :REPORTfreq2 && return Ptr{Cint}(x + 472) + f === :RERUN && return Ptr{Cint}(x + 476) + f === :ROTATErandom && return Ptr{Cint}(x + 480) + f === :SCALEinput && return Ptr{Cuint}(x + 484) + f === :SCALElast && return Ptr{Cuint}(x + 488) + f === :SETroundoff && return Ptr{Cuint}(x + 492) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 496) + f === :SKIPconvex && return Ptr{Cuint}(x + 500) + f === :SPLITthresholds && return Ptr{Cuint}(x + 504) + f === :STOPadd && return Ptr{Cint}(x + 508) + f === :STOPcone && return Ptr{Cint}(x + 512) + f === :STOPpoint && return Ptr{Cint}(x + 516) + f === :TESTpoints && return Ptr{Cint}(x + 520) + f === :TESTvneighbors && return Ptr{Cuint}(x + 524) + f === :TRACElevel && return Ptr{Cint}(x + 528) + f === :TRACElastrun && return Ptr{Cint}(x + 532) + f === :TRACEpoint && return Ptr{Cint}(x + 536) + f === :TRACEdist && return Ptr{Cdouble}(x + 544) + f === :TRACEmerge && return Ptr{Cint}(x + 552) + f === :TRIangulate && return Ptr{Cuint}(x + 556) + f === :TRInormals && return Ptr{Cuint}(x + 560) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 564) + f === :USEstdout && return Ptr{Cuint}(x + 568) + f === :VERIFYoutput && return Ptr{Cuint}(x + 572) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 576) + f === :VORONOI && return Ptr{Cuint}(x + 580) + f === :AREAfactor && return Ptr{Cdouble}(x + 584) + f === :DOcheckmax && return Ptr{Cuint}(x + 592) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 596) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 600) + f === :GETarea && return Ptr{Cuint}(x + 604) + f === :KEEPnearinside && return Ptr{Cuint}(x + 608) + f === :hull_dim && return Ptr{Cint}(x + 612) + f === :input_dim && return Ptr{Cint}(x + 616) + f === :num_points && return Ptr{Cint}(x + 620) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 624) + f === :POINTSmalloc && return Ptr{Cuint}(x + 628) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 632) + f === :input_malloc && return Ptr{Cuint}(x + 636) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 640) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 896) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 900) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1156) + f === :qhull_optionlen && return Ptr{Cint}(x + 1668) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1672) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1676) + f === :run_id && return Ptr{Cint}(x + 1680) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1684) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1688) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1692) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1696) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1700) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1704) + f === :ANGLEround && return Ptr{Cdouble}(x + 1712) + f === :centrum_radius && return Ptr{Cdouble}(x + 1720) + f === :cos_max && return Ptr{Cdouble}(x + 1728) + f === :DISTround && return Ptr{Cdouble}(x + 1736) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1744) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1752) + f === :MAXoutside && return Ptr{Cdouble}(x + 1760) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1768) + f === :MAXwidth && return Ptr{Cdouble}(x + 1776) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1784) + f === :MINdenom && return Ptr{Cdouble}(x + 1792) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1800) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1808) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1816) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1824) + f === :NEARinside && return Ptr{Cdouble}(x + 1832) + f === :ONEmerge && return Ptr{Cdouble}(x + 1840) + f === :outside_err && return Ptr{Cdouble}(x + 1848) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1856) + f === :NARROWhull && return Ptr{Cuint}(x + 1864) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1868) + f === :errexit && return Ptr{jmp_buf}(x + 1880) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2272) + f === :restartexit && return Ptr{jmp_buf}(x + 2312) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2704) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2744) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2748) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2752) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2756) + f === :normal_size && return Ptr{Cint}(x + 2760) + f === :center_size && return Ptr{Cint}(x + 2764) + f === :TEMPsize && return Ptr{Cint}(x + 2768) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 2772) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2776) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 2780) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2784) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 2788) + f === :num_visible && return Ptr{Cint}(x + 2792) + f === :tracefacet_id && return Ptr{Cuint}(x + 2796) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2800) + f === :traceridge_id && return Ptr{Cuint}(x + 2804) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2808) + f === :tracevertex_id && return Ptr{Cuint}(x + 2812) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2816) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2820) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2824) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2828) + f === :num_facets && return Ptr{Cint}(x + 2832) + f === :num_vertices && return Ptr{Cint}(x + 2836) + f === :num_outside && return Ptr{Cint}(x + 2840) + f === :num_good && return Ptr{Cint}(x + 2844) + f === :facet_id && return Ptr{Cuint}(x + 2848) + f === :ridge_id && return Ptr{Cuint}(x + 2852) + f === :vertex_id && return Ptr{Cuint}(x + 2856) + f === :first_newfacet && return Ptr{Cuint}(x + 2860) + f === :hulltime && return Ptr{Culong}(x + 2864) + f === :ALLOWrestart && return Ptr{Cuint}(x + 2868) + f === :build_cnt && return Ptr{Cint}(x + 2872) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 2876) + f === :furthest_id && return Ptr{Cint}(x + 2880) + f === :last_errcode && return Ptr{Cint}(x + 2884) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2888) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2892) + f === :hasAreaVolume && return Ptr{Cuint}(x + 2896) + f === :hasTriangulation && return Ptr{Cuint}(x + 2900) + f === :isRenameVertex && return Ptr{Cuint}(x + 2904) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 2912) + f === :maxoutdone && return Ptr{Cuint}(x + 2920) + f === :max_outside && return Ptr{Cdouble}(x + 2928) + f === :max_vertex && return Ptr{Cdouble}(x + 2936) + f === :min_vertex && return Ptr{Cdouble}(x + 2944) + f === :NEWfacets && return Ptr{Cuint}(x + 2952) + f === :NEWtentative && return Ptr{Cuint}(x + 2956) + f === :findbestnew && return Ptr{Cuint}(x + 2960) + f === :findbest_notsharp && return Ptr{Cuint}(x + 2964) + f === :NOerrexit && return Ptr{Cuint}(x + 2968) + f === :PRINTcradius && return Ptr{Cdouble}(x + 2976) + f === :PRINTradius && return Ptr{Cdouble}(x + 2984) + f === :POSTmerging && return Ptr{Cuint}(x + 2992) + f === :printoutvar && return Ptr{Cint}(x + 2996) + f === :printoutnum && return Ptr{Cint}(x + 3000) + f === :repart_facetid && return Ptr{Cuint}(x + 3004) + f === :retry_addpoint && return Ptr{Cint}(x + 3008) + f === :QHULLfinished && return Ptr{Cuint}(x + 3012) + f === :totarea && return Ptr{Cdouble}(x + 3016) + f === :totvol && return Ptr{Cdouble}(x + 3024) + f === :visit_id && return Ptr{Cuint}(x + 3032) + f === :vertex_visit && return Ptr{Cuint}(x + 3036) + f === :WAScoplanar && return Ptr{Cuint}(x + 3040) + f === :ZEROall_ok && return Ptr{Cuint}(x + 3044) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 3048) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 3052) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 3056) + f === :hash_table && return Ptr{Ptr{setT}}(x + 3060) + f === :other_points && return Ptr{Ptr{setT}}(x + 3064) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 3068) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 3072) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 3076) + f === :line && return Ptr{Ptr{Cchar}}(x + 3080) + f === :maxline && return Ptr{Cint}(x + 3084) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 3088) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 3092) + f === :ERREXITcalled && return Ptr{Cuint}(x + 3096) + f === :firstcentrum && return Ptr{Cuint}(x + 3100) + f === :old_randomdist && return Ptr{Cuint}(x + 3104) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 3108) + f === :last_low && return Ptr{Cdouble}(x + 3112) + f === :last_high && return Ptr{Cdouble}(x + 3120) + f === :last_newhigh && return Ptr{Cdouble}(x + 3128) + f === :lastcpu && return Ptr{Cdouble}(x + 3136) + f === :lastfacets && return Ptr{Cint}(x + 3144) + f === :lastmerges && return Ptr{Cint}(x + 3148) + f === :lastplanes && return Ptr{Cint}(x + 3152) + f === :lastdist && return Ptr{Cint}(x + 3156) + f === :lastreport && return Ptr{Cuint}(x + 3160) + f === :mergereport && return Ptr{Cint}(x + 3164) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 3168) + f === :ridgeoutnum && return Ptr{Cint}(x + 3172) + f === :last_random && return Ptr{Cint}(x + 3176) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 3184) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 3576) + f === :rbox_isinteger && return Ptr{Cint}(x + 3616) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 3624) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 3632) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 3636) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 3640) + f === :qhmem && return Ptr{qhmemT}(x + 3644) + f === :qhstat && return Ptr{qhstatT}(x + 3760) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{28, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 4) + f === :point && return Ptr{Ptr{Cdouble}}(x + 8) + f === :neighbors && return Ptr{Ptr{setT}}(x + 12) + f === :id && return Ptr{Cuint}(x + 16) + f === :visitid && return Ptr{Cuint}(x + 20) + f === :seen && return Ptr{Cuint}(x + 24) + f === :seen2 && return (Ptr{Cuint}(x + 24), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 24), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 24), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 24), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 24), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_4 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_4}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_4, f::Symbol) + r = Ref{__JL_Ctag_4}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_4}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_4}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/lib/i686-linux-gnu.jl b/lib/i686-linux-gnu.jl new file mode 100644 index 0000000..bcb184c --- /dev/null +++ b/lib/i686-linux-gnu.jl @@ -0,0 +1,1946 @@ +const __jmp_buf = NTuple{6, Cint} + +struct __sigset_t + __val::NTuple{32, Culong} +end + +struct __jmp_buf_tag + __jmpbuf::__jmp_buf + __mask_was_saved::Cint + __saved_mask::__sigset_t +end + +const jmp_buf = NTuple{1, __jmp_buf_tag} + +const countT = Cint + +struct setelemT + data::NTuple{4, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 4) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{80, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_9}(x + 28) + f === :center && return Ptr{Ptr{Cdouble}}(x + 36) + f === :previous && return Ptr{Ptr{facetT}}(x + 40) + f === :next && return Ptr{Ptr{facetT}}(x + 44) + f === :vertices && return Ptr{Ptr{setT}}(x + 48) + f === :ridges && return Ptr{Ptr{setT}}(x + 52) + f === :neighbors && return Ptr{Ptr{setT}}(x + 56) + f === :outsideset && return Ptr{Ptr{setT}}(x + 60) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 64) + f === :visitid && return Ptr{Cuint}(x + 68) + f === :id && return Ptr{Cuint}(x + 72) + f === :nummerge && return Ptr{Cuint}(x + 76) + f === :tricoplanar && return (Ptr{Cuint}(x + 77), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 77), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 77), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 77), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 77), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 77), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 77), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 78) + f === :upperdelaunay && return (Ptr{Cuint}(x + 78), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 78), 2, 1) + f === :good && return (Ptr{Cuint}(x + 78), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 78), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 78), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 78), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 78), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 79) + f === :mergehorizon && return (Ptr{Cuint}(x + 79), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 79), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 79), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 79), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 79), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 79), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 79), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{20, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 4) + f === :bottom && return Ptr{Ptr{facetT}}(x + 8) + f === :id && return Ptr{Cuint}(x + 12) + f === :seen && return Ptr{Cuint}(x + 16) + f === :tested && return (Ptr{Cuint}(x + 16), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 16), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 16), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 16), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 16), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 16), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 108) + f === :GOODvertex && return Ptr{Cint}(x + 112) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 116) + f === :HALFspace && return Ptr{Cuint}(x + 120) + f === :ISqhullQh && return Ptr{Cuint}(x + 124) + f === :IStracing && return Ptr{Cint}(x + 128) + f === :KEEParea && return Ptr{Cint}(x + 132) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 136) + f === :KEEPinside && return Ptr{Cuint}(x + 140) + f === :KEEPmerge && return Ptr{Cint}(x + 144) + f === :KEEPminArea && return Ptr{Cdouble}(x + 148) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 156) + f === :MAXwide && return Ptr{Cint}(x + 164) + f === :MERGEexact && return Ptr{Cuint}(x + 168) + f === :MERGEindependent && return Ptr{Cuint}(x + 172) + f === :MERGING && return Ptr{Cuint}(x + 176) + f === :premerge_centrum && return Ptr{Cdouble}(x + 180) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 188) + f === :MERGEpinched && return Ptr{Cuint}(x + 196) + f === :MERGEvertices && return Ptr{Cuint}(x + 200) + f === :MINvisible && return Ptr{Cdouble}(x + 204) + f === :NOnarrow && return Ptr{Cuint}(x + 212) + f === :NOnearinside && return Ptr{Cuint}(x + 216) + f === :NOpremerge && return Ptr{Cuint}(x + 220) + f === :ONLYgood && return Ptr{Cuint}(x + 224) + f === :ONLYmax && return Ptr{Cuint}(x + 228) + f === :PICKfurthest && return Ptr{Cuint}(x + 232) + f === :POSTmerge && return Ptr{Cuint}(x + 236) + f === :PREmerge && return Ptr{Cuint}(x + 240) + f === :PRINTcentrums && return Ptr{Cuint}(x + 244) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 248) + f === :PRINTdim && return Ptr{Cint}(x + 252) + f === :PRINTdots && return Ptr{Cuint}(x + 256) + f === :PRINTgood && return Ptr{Cuint}(x + 260) + f === :PRINTinner && return Ptr{Cuint}(x + 264) + f === :PRINTneighbors && return Ptr{Cuint}(x + 268) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 272) + f === :PRINToptions1st && return Ptr{Cuint}(x + 276) + f === :PRINTouter && return Ptr{Cuint}(x + 280) + f === :PRINTprecision && return Ptr{Cuint}(x + 284) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 288) + f === :PRINTridges && return Ptr{Cuint}(x + 404) + f === :PRINTspheres && return Ptr{Cuint}(x + 408) + f === :PRINTstatistics && return Ptr{Cuint}(x + 412) + f === :PRINTsummary && return Ptr{Cuint}(x + 416) + f === :PRINTtransparent && return Ptr{Cuint}(x + 420) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 424) + f === :PROJECTinput && return Ptr{Cint}(x + 428) + f === :RANDOMdist && return Ptr{Cuint}(x + 432) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 436) + f === :RANDOMa && return Ptr{Cdouble}(x + 444) + f === :RANDOMb && return Ptr{Cdouble}(x + 452) + f === :RANDOMoutside && return Ptr{Cuint}(x + 460) + f === :REPORTfreq && return Ptr{Cint}(x + 464) + f === :REPORTfreq2 && return Ptr{Cint}(x + 468) + f === :RERUN && return Ptr{Cint}(x + 472) + f === :ROTATErandom && return Ptr{Cint}(x + 476) + f === :SCALEinput && return Ptr{Cuint}(x + 480) + f === :SCALElast && return Ptr{Cuint}(x + 484) + f === :SETroundoff && return Ptr{Cuint}(x + 488) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 492) + f === :SKIPconvex && return Ptr{Cuint}(x + 496) + f === :SPLITthresholds && return Ptr{Cuint}(x + 500) + f === :STOPadd && return Ptr{Cint}(x + 504) + f === :STOPcone && return Ptr{Cint}(x + 508) + f === :STOPpoint && return Ptr{Cint}(x + 512) + f === :TESTpoints && return Ptr{Cint}(x + 516) + f === :TESTvneighbors && return Ptr{Cuint}(x + 520) + f === :TRACElevel && return Ptr{Cint}(x + 524) + f === :TRACElastrun && return Ptr{Cint}(x + 528) + f === :TRACEpoint && return Ptr{Cint}(x + 532) + f === :TRACEdist && return Ptr{Cdouble}(x + 536) + f === :TRACEmerge && return Ptr{Cint}(x + 544) + f === :TRIangulate && return Ptr{Cuint}(x + 548) + f === :TRInormals && return Ptr{Cuint}(x + 552) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 556) + f === :USEstdout && return Ptr{Cuint}(x + 560) + f === :VERIFYoutput && return Ptr{Cuint}(x + 564) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 568) + f === :VORONOI && return Ptr{Cuint}(x + 572) + f === :AREAfactor && return Ptr{Cdouble}(x + 576) + f === :DOcheckmax && return Ptr{Cuint}(x + 584) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 588) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 592) + f === :GETarea && return Ptr{Cuint}(x + 596) + f === :KEEPnearinside && return Ptr{Cuint}(x + 600) + f === :hull_dim && return Ptr{Cint}(x + 604) + f === :input_dim && return Ptr{Cint}(x + 608) + f === :num_points && return Ptr{Cint}(x + 612) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 616) + f === :POINTSmalloc && return Ptr{Cuint}(x + 620) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 624) + f === :input_malloc && return Ptr{Cuint}(x + 628) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 632) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 888) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 892) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1148) + f === :qhull_optionlen && return Ptr{Cint}(x + 1660) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1664) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1668) + f === :run_id && return Ptr{Cint}(x + 1672) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1676) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1680) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1684) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1688) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1692) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1696) + f === :ANGLEround && return Ptr{Cdouble}(x + 1700) + f === :centrum_radius && return Ptr{Cdouble}(x + 1708) + f === :cos_max && return Ptr{Cdouble}(x + 1716) + f === :DISTround && return Ptr{Cdouble}(x + 1724) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1732) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1740) + f === :MAXoutside && return Ptr{Cdouble}(x + 1748) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1756) + f === :MAXwidth && return Ptr{Cdouble}(x + 1764) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1772) + f === :MINdenom && return Ptr{Cdouble}(x + 1780) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1788) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1796) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1804) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1812) + f === :NEARinside && return Ptr{Cdouble}(x + 1816) + f === :ONEmerge && return Ptr{Cdouble}(x + 1824) + f === :outside_err && return Ptr{Cdouble}(x + 1832) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1840) + f === :NARROWhull && return Ptr{Cuint}(x + 1848) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1852) + f === :errexit && return Ptr{jmp_buf}(x + 1860) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2016) + f === :restartexit && return Ptr{jmp_buf}(x + 2056) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2212) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2252) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2256) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2260) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2264) + f === :normal_size && return Ptr{Cint}(x + 2268) + f === :center_size && return Ptr{Cint}(x + 2272) + f === :TEMPsize && return Ptr{Cint}(x + 2276) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 2280) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2284) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 2288) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2292) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 2296) + f === :num_visible && return Ptr{Cint}(x + 2300) + f === :tracefacet_id && return Ptr{Cuint}(x + 2304) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2308) + f === :traceridge_id && return Ptr{Cuint}(x + 2312) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2316) + f === :tracevertex_id && return Ptr{Cuint}(x + 2320) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2324) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2328) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2332) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2336) + f === :num_facets && return Ptr{Cint}(x + 2340) + f === :num_vertices && return Ptr{Cint}(x + 2344) + f === :num_outside && return Ptr{Cint}(x + 2348) + f === :num_good && return Ptr{Cint}(x + 2352) + f === :facet_id && return Ptr{Cuint}(x + 2356) + f === :ridge_id && return Ptr{Cuint}(x + 2360) + f === :vertex_id && return Ptr{Cuint}(x + 2364) + f === :first_newfacet && return Ptr{Cuint}(x + 2368) + f === :hulltime && return Ptr{Culong}(x + 2372) + f === :ALLOWrestart && return Ptr{Cuint}(x + 2376) + f === :build_cnt && return Ptr{Cint}(x + 2380) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 2384) + f === :furthest_id && return Ptr{Cint}(x + 2388) + f === :last_errcode && return Ptr{Cint}(x + 2392) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2396) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2400) + f === :hasAreaVolume && return Ptr{Cuint}(x + 2404) + f === :hasTriangulation && return Ptr{Cuint}(x + 2408) + f === :isRenameVertex && return Ptr{Cuint}(x + 2412) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 2416) + f === :maxoutdone && return Ptr{Cuint}(x + 2424) + f === :max_outside && return Ptr{Cdouble}(x + 2428) + f === :max_vertex && return Ptr{Cdouble}(x + 2436) + f === :min_vertex && return Ptr{Cdouble}(x + 2444) + f === :NEWfacets && return Ptr{Cuint}(x + 2452) + f === :NEWtentative && return Ptr{Cuint}(x + 2456) + f === :findbestnew && return Ptr{Cuint}(x + 2460) + f === :findbest_notsharp && return Ptr{Cuint}(x + 2464) + f === :NOerrexit && return Ptr{Cuint}(x + 2468) + f === :PRINTcradius && return Ptr{Cdouble}(x + 2472) + f === :PRINTradius && return Ptr{Cdouble}(x + 2480) + f === :POSTmerging && return Ptr{Cuint}(x + 2488) + f === :printoutvar && return Ptr{Cint}(x + 2492) + f === :printoutnum && return Ptr{Cint}(x + 2496) + f === :repart_facetid && return Ptr{Cuint}(x + 2500) + f === :retry_addpoint && return Ptr{Cint}(x + 2504) + f === :QHULLfinished && return Ptr{Cuint}(x + 2508) + f === :totarea && return Ptr{Cdouble}(x + 2512) + f === :totvol && return Ptr{Cdouble}(x + 2520) + f === :visit_id && return Ptr{Cuint}(x + 2528) + f === :vertex_visit && return Ptr{Cuint}(x + 2532) + f === :WAScoplanar && return Ptr{Cuint}(x + 2536) + f === :ZEROall_ok && return Ptr{Cuint}(x + 2540) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 2544) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 2548) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 2552) + f === :hash_table && return Ptr{Ptr{setT}}(x + 2556) + f === :other_points && return Ptr{Ptr{setT}}(x + 2560) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 2564) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 2568) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 2572) + f === :line && return Ptr{Ptr{Cchar}}(x + 2576) + f === :maxline && return Ptr{Cint}(x + 2580) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 2584) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 2588) + f === :ERREXITcalled && return Ptr{Cuint}(x + 2592) + f === :firstcentrum && return Ptr{Cuint}(x + 2596) + f === :old_randomdist && return Ptr{Cuint}(x + 2600) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 2604) + f === :last_low && return Ptr{Cdouble}(x + 2608) + f === :last_high && return Ptr{Cdouble}(x + 2616) + f === :last_newhigh && return Ptr{Cdouble}(x + 2624) + f === :lastcpu && return Ptr{Cdouble}(x + 2632) + f === :lastfacets && return Ptr{Cint}(x + 2640) + f === :lastmerges && return Ptr{Cint}(x + 2644) + f === :lastplanes && return Ptr{Cint}(x + 2648) + f === :lastdist && return Ptr{Cint}(x + 2652) + f === :lastreport && return Ptr{Cuint}(x + 2656) + f === :mergereport && return Ptr{Cint}(x + 2660) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 2664) + f === :ridgeoutnum && return Ptr{Cint}(x + 2668) + f === :last_random && return Ptr{Cint}(x + 2672) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 2676) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 2832) + f === :rbox_isinteger && return Ptr{Cint}(x + 2872) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 2876) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 2884) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 2888) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 2892) + f === :qhmem && return Ptr{qhmemT}(x + 2896) + f === :qhstat && return Ptr{qhstatT}(x + 3012) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{28, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 4) + f === :point && return Ptr{Ptr{Cdouble}}(x + 8) + f === :neighbors && return Ptr{Ptr{setT}}(x + 12) + f === :id && return Ptr{Cuint}(x + 16) + f === :visitid && return Ptr{Cuint}(x + 20) + f === :seen && return Ptr{Cuint}(x + 24) + f === :seen2 && return (Ptr{Cuint}(x + 24), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 24), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 24), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 24), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 24), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_9 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_9}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_9, f::Symbol) + r = Ref{__JL_Ctag_9}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_9}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_9}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/lib/i686-linux-musl.jl b/lib/i686-linux-musl.jl new file mode 100644 index 0000000..44f5ed8 --- /dev/null +++ b/lib/i686-linux-musl.jl @@ -0,0 +1,1942 @@ +const __jmp_buf = NTuple{6, Culong} + +struct __jmp_buf_tag + __jb::__jmp_buf + __fl::Culong + __ss::NTuple{32, Culong} +end + +const jmp_buf = NTuple{1, __jmp_buf_tag} + +const countT = Cint + +struct setelemT + data::NTuple{4, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 4) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{80, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_4}(x + 28) + f === :center && return Ptr{Ptr{Cdouble}}(x + 36) + f === :previous && return Ptr{Ptr{facetT}}(x + 40) + f === :next && return Ptr{Ptr{facetT}}(x + 44) + f === :vertices && return Ptr{Ptr{setT}}(x + 48) + f === :ridges && return Ptr{Ptr{setT}}(x + 52) + f === :neighbors && return Ptr{Ptr{setT}}(x + 56) + f === :outsideset && return Ptr{Ptr{setT}}(x + 60) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 64) + f === :visitid && return Ptr{Cuint}(x + 68) + f === :id && return Ptr{Cuint}(x + 72) + f === :nummerge && return Ptr{Cuint}(x + 76) + f === :tricoplanar && return (Ptr{Cuint}(x + 77), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 77), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 77), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 77), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 77), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 77), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 77), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 78) + f === :upperdelaunay && return (Ptr{Cuint}(x + 78), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 78), 2, 1) + f === :good && return (Ptr{Cuint}(x + 78), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 78), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 78), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 78), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 78), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 79) + f === :mergehorizon && return (Ptr{Cuint}(x + 79), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 79), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 79), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 79), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 79), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 79), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 79), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{20, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 4) + f === :bottom && return Ptr{Ptr{facetT}}(x + 8) + f === :id && return Ptr{Cuint}(x + 12) + f === :seen && return Ptr{Cuint}(x + 16) + f === :tested && return (Ptr{Cuint}(x + 16), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 16), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 16), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 16), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 16), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 16), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 108) + f === :GOODvertex && return Ptr{Cint}(x + 112) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 116) + f === :HALFspace && return Ptr{Cuint}(x + 120) + f === :ISqhullQh && return Ptr{Cuint}(x + 124) + f === :IStracing && return Ptr{Cint}(x + 128) + f === :KEEParea && return Ptr{Cint}(x + 132) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 136) + f === :KEEPinside && return Ptr{Cuint}(x + 140) + f === :KEEPmerge && return Ptr{Cint}(x + 144) + f === :KEEPminArea && return Ptr{Cdouble}(x + 148) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 156) + f === :MAXwide && return Ptr{Cint}(x + 164) + f === :MERGEexact && return Ptr{Cuint}(x + 168) + f === :MERGEindependent && return Ptr{Cuint}(x + 172) + f === :MERGING && return Ptr{Cuint}(x + 176) + f === :premerge_centrum && return Ptr{Cdouble}(x + 180) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 188) + f === :MERGEpinched && return Ptr{Cuint}(x + 196) + f === :MERGEvertices && return Ptr{Cuint}(x + 200) + f === :MINvisible && return Ptr{Cdouble}(x + 204) + f === :NOnarrow && return Ptr{Cuint}(x + 212) + f === :NOnearinside && return Ptr{Cuint}(x + 216) + f === :NOpremerge && return Ptr{Cuint}(x + 220) + f === :ONLYgood && return Ptr{Cuint}(x + 224) + f === :ONLYmax && return Ptr{Cuint}(x + 228) + f === :PICKfurthest && return Ptr{Cuint}(x + 232) + f === :POSTmerge && return Ptr{Cuint}(x + 236) + f === :PREmerge && return Ptr{Cuint}(x + 240) + f === :PRINTcentrums && return Ptr{Cuint}(x + 244) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 248) + f === :PRINTdim && return Ptr{Cint}(x + 252) + f === :PRINTdots && return Ptr{Cuint}(x + 256) + f === :PRINTgood && return Ptr{Cuint}(x + 260) + f === :PRINTinner && return Ptr{Cuint}(x + 264) + f === :PRINTneighbors && return Ptr{Cuint}(x + 268) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 272) + f === :PRINToptions1st && return Ptr{Cuint}(x + 276) + f === :PRINTouter && return Ptr{Cuint}(x + 280) + f === :PRINTprecision && return Ptr{Cuint}(x + 284) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 288) + f === :PRINTridges && return Ptr{Cuint}(x + 404) + f === :PRINTspheres && return Ptr{Cuint}(x + 408) + f === :PRINTstatistics && return Ptr{Cuint}(x + 412) + f === :PRINTsummary && return Ptr{Cuint}(x + 416) + f === :PRINTtransparent && return Ptr{Cuint}(x + 420) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 424) + f === :PROJECTinput && return Ptr{Cint}(x + 428) + f === :RANDOMdist && return Ptr{Cuint}(x + 432) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 436) + f === :RANDOMa && return Ptr{Cdouble}(x + 444) + f === :RANDOMb && return Ptr{Cdouble}(x + 452) + f === :RANDOMoutside && return Ptr{Cuint}(x + 460) + f === :REPORTfreq && return Ptr{Cint}(x + 464) + f === :REPORTfreq2 && return Ptr{Cint}(x + 468) + f === :RERUN && return Ptr{Cint}(x + 472) + f === :ROTATErandom && return Ptr{Cint}(x + 476) + f === :SCALEinput && return Ptr{Cuint}(x + 480) + f === :SCALElast && return Ptr{Cuint}(x + 484) + f === :SETroundoff && return Ptr{Cuint}(x + 488) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 492) + f === :SKIPconvex && return Ptr{Cuint}(x + 496) + f === :SPLITthresholds && return Ptr{Cuint}(x + 500) + f === :STOPadd && return Ptr{Cint}(x + 504) + f === :STOPcone && return Ptr{Cint}(x + 508) + f === :STOPpoint && return Ptr{Cint}(x + 512) + f === :TESTpoints && return Ptr{Cint}(x + 516) + f === :TESTvneighbors && return Ptr{Cuint}(x + 520) + f === :TRACElevel && return Ptr{Cint}(x + 524) + f === :TRACElastrun && return Ptr{Cint}(x + 528) + f === :TRACEpoint && return Ptr{Cint}(x + 532) + f === :TRACEdist && return Ptr{Cdouble}(x + 536) + f === :TRACEmerge && return Ptr{Cint}(x + 544) + f === :TRIangulate && return Ptr{Cuint}(x + 548) + f === :TRInormals && return Ptr{Cuint}(x + 552) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 556) + f === :USEstdout && return Ptr{Cuint}(x + 560) + f === :VERIFYoutput && return Ptr{Cuint}(x + 564) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 568) + f === :VORONOI && return Ptr{Cuint}(x + 572) + f === :AREAfactor && return Ptr{Cdouble}(x + 576) + f === :DOcheckmax && return Ptr{Cuint}(x + 584) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 588) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 592) + f === :GETarea && return Ptr{Cuint}(x + 596) + f === :KEEPnearinside && return Ptr{Cuint}(x + 600) + f === :hull_dim && return Ptr{Cint}(x + 604) + f === :input_dim && return Ptr{Cint}(x + 608) + f === :num_points && return Ptr{Cint}(x + 612) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 616) + f === :POINTSmalloc && return Ptr{Cuint}(x + 620) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 624) + f === :input_malloc && return Ptr{Cuint}(x + 628) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 632) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 888) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 892) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1148) + f === :qhull_optionlen && return Ptr{Cint}(x + 1660) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1664) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1668) + f === :run_id && return Ptr{Cint}(x + 1672) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1676) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1680) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1684) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1688) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1692) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1696) + f === :ANGLEround && return Ptr{Cdouble}(x + 1700) + f === :centrum_radius && return Ptr{Cdouble}(x + 1708) + f === :cos_max && return Ptr{Cdouble}(x + 1716) + f === :DISTround && return Ptr{Cdouble}(x + 1724) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1732) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1740) + f === :MAXoutside && return Ptr{Cdouble}(x + 1748) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1756) + f === :MAXwidth && return Ptr{Cdouble}(x + 1764) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1772) + f === :MINdenom && return Ptr{Cdouble}(x + 1780) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1788) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1796) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1804) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1812) + f === :NEARinside && return Ptr{Cdouble}(x + 1816) + f === :ONEmerge && return Ptr{Cdouble}(x + 1824) + f === :outside_err && return Ptr{Cdouble}(x + 1832) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1840) + f === :NARROWhull && return Ptr{Cuint}(x + 1848) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1852) + f === :errexit && return Ptr{jmp_buf}(x + 1860) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2016) + f === :restartexit && return Ptr{jmp_buf}(x + 2056) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2212) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2252) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2256) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2260) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2264) + f === :normal_size && return Ptr{Cint}(x + 2268) + f === :center_size && return Ptr{Cint}(x + 2272) + f === :TEMPsize && return Ptr{Cint}(x + 2276) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 2280) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2284) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 2288) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2292) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 2296) + f === :num_visible && return Ptr{Cint}(x + 2300) + f === :tracefacet_id && return Ptr{Cuint}(x + 2304) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2308) + f === :traceridge_id && return Ptr{Cuint}(x + 2312) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2316) + f === :tracevertex_id && return Ptr{Cuint}(x + 2320) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2324) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2328) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2332) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2336) + f === :num_facets && return Ptr{Cint}(x + 2340) + f === :num_vertices && return Ptr{Cint}(x + 2344) + f === :num_outside && return Ptr{Cint}(x + 2348) + f === :num_good && return Ptr{Cint}(x + 2352) + f === :facet_id && return Ptr{Cuint}(x + 2356) + f === :ridge_id && return Ptr{Cuint}(x + 2360) + f === :vertex_id && return Ptr{Cuint}(x + 2364) + f === :first_newfacet && return Ptr{Cuint}(x + 2368) + f === :hulltime && return Ptr{Culong}(x + 2372) + f === :ALLOWrestart && return Ptr{Cuint}(x + 2376) + f === :build_cnt && return Ptr{Cint}(x + 2380) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 2384) + f === :furthest_id && return Ptr{Cint}(x + 2388) + f === :last_errcode && return Ptr{Cint}(x + 2392) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2396) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2400) + f === :hasAreaVolume && return Ptr{Cuint}(x + 2404) + f === :hasTriangulation && return Ptr{Cuint}(x + 2408) + f === :isRenameVertex && return Ptr{Cuint}(x + 2412) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 2416) + f === :maxoutdone && return Ptr{Cuint}(x + 2424) + f === :max_outside && return Ptr{Cdouble}(x + 2428) + f === :max_vertex && return Ptr{Cdouble}(x + 2436) + f === :min_vertex && return Ptr{Cdouble}(x + 2444) + f === :NEWfacets && return Ptr{Cuint}(x + 2452) + f === :NEWtentative && return Ptr{Cuint}(x + 2456) + f === :findbestnew && return Ptr{Cuint}(x + 2460) + f === :findbest_notsharp && return Ptr{Cuint}(x + 2464) + f === :NOerrexit && return Ptr{Cuint}(x + 2468) + f === :PRINTcradius && return Ptr{Cdouble}(x + 2472) + f === :PRINTradius && return Ptr{Cdouble}(x + 2480) + f === :POSTmerging && return Ptr{Cuint}(x + 2488) + f === :printoutvar && return Ptr{Cint}(x + 2492) + f === :printoutnum && return Ptr{Cint}(x + 2496) + f === :repart_facetid && return Ptr{Cuint}(x + 2500) + f === :retry_addpoint && return Ptr{Cint}(x + 2504) + f === :QHULLfinished && return Ptr{Cuint}(x + 2508) + f === :totarea && return Ptr{Cdouble}(x + 2512) + f === :totvol && return Ptr{Cdouble}(x + 2520) + f === :visit_id && return Ptr{Cuint}(x + 2528) + f === :vertex_visit && return Ptr{Cuint}(x + 2532) + f === :WAScoplanar && return Ptr{Cuint}(x + 2536) + f === :ZEROall_ok && return Ptr{Cuint}(x + 2540) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 2544) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 2548) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 2552) + f === :hash_table && return Ptr{Ptr{setT}}(x + 2556) + f === :other_points && return Ptr{Ptr{setT}}(x + 2560) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 2564) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 2568) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 2572) + f === :line && return Ptr{Ptr{Cchar}}(x + 2576) + f === :maxline && return Ptr{Cint}(x + 2580) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 2584) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 2588) + f === :ERREXITcalled && return Ptr{Cuint}(x + 2592) + f === :firstcentrum && return Ptr{Cuint}(x + 2596) + f === :old_randomdist && return Ptr{Cuint}(x + 2600) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 2604) + f === :last_low && return Ptr{Cdouble}(x + 2608) + f === :last_high && return Ptr{Cdouble}(x + 2616) + f === :last_newhigh && return Ptr{Cdouble}(x + 2624) + f === :lastcpu && return Ptr{Cdouble}(x + 2632) + f === :lastfacets && return Ptr{Cint}(x + 2640) + f === :lastmerges && return Ptr{Cint}(x + 2644) + f === :lastplanes && return Ptr{Cint}(x + 2648) + f === :lastdist && return Ptr{Cint}(x + 2652) + f === :lastreport && return Ptr{Cuint}(x + 2656) + f === :mergereport && return Ptr{Cint}(x + 2660) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 2664) + f === :ridgeoutnum && return Ptr{Cint}(x + 2668) + f === :last_random && return Ptr{Cint}(x + 2672) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 2676) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 2832) + f === :rbox_isinteger && return Ptr{Cint}(x + 2872) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 2876) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 2884) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 2888) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 2892) + f === :qhmem && return Ptr{qhmemT}(x + 2896) + f === :qhstat && return Ptr{qhstatT}(x + 3012) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{28, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 4) + f === :point && return Ptr{Ptr{Cdouble}}(x + 8) + f === :neighbors && return Ptr{Ptr{setT}}(x + 12) + f === :id && return Ptr{Cuint}(x + 16) + f === :visitid && return Ptr{Cuint}(x + 20) + f === :seen && return Ptr{Cuint}(x + 24) + f === :seen2 && return (Ptr{Cuint}(x + 24), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 24), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 24), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 24), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 24), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_4 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_4}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_4, f::Symbol) + r = Ref{__JL_Ctag_4}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_4}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_4}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/lib/i686-w64-mingw32.jl b/lib/i686-w64-mingw32.jl new file mode 100644 index 0000000..66dd922 --- /dev/null +++ b/lib/i686-w64-mingw32.jl @@ -0,0 +1,1934 @@ +const jmp_buf = NTuple{16, Cint} + +const countT = Cint + +struct setelemT + data::NTuple{4, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 4) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{88, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_4}(x + 32) + f === :center && return Ptr{Ptr{Cdouble}}(x + 40) + f === :previous && return Ptr{Ptr{facetT}}(x + 44) + f === :next && return Ptr{Ptr{facetT}}(x + 48) + f === :vertices && return Ptr{Ptr{setT}}(x + 52) + f === :ridges && return Ptr{Ptr{setT}}(x + 56) + f === :neighbors && return Ptr{Ptr{setT}}(x + 60) + f === :outsideset && return Ptr{Ptr{setT}}(x + 64) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 68) + f === :visitid && return Ptr{Cuint}(x + 72) + f === :id && return Ptr{Cuint}(x + 76) + f === :nummerge && return Ptr{Cuint}(x + 80) + f === :tricoplanar && return (Ptr{Cuint}(x + 81), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 81), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 81), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 81), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 81), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 81), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 81), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 82) + f === :upperdelaunay && return (Ptr{Cuint}(x + 82), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 82), 2, 1) + f === :good && return (Ptr{Cuint}(x + 82), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 82), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 82), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 82), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 82), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 83) + f === :mergehorizon && return (Ptr{Cuint}(x + 83), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 83), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 83), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 83), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 83), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 83), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 83), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{20, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 4) + f === :bottom && return Ptr{Ptr{facetT}}(x + 8) + f === :id && return Ptr{Cuint}(x + 12) + f === :seen && return Ptr{Cuint}(x + 16) + f === :tested && return (Ptr{Cuint}(x + 16), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 16), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 16), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 16), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 16), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 16), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 108) + f === :GOODvertex && return Ptr{Cint}(x + 112) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 116) + f === :HALFspace && return Ptr{Cuint}(x + 120) + f === :ISqhullQh && return Ptr{Cuint}(x + 124) + f === :IStracing && return Ptr{Cint}(x + 128) + f === :KEEParea && return Ptr{Cint}(x + 132) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 136) + f === :KEEPinside && return Ptr{Cuint}(x + 140) + f === :KEEPmerge && return Ptr{Cint}(x + 144) + f === :KEEPminArea && return Ptr{Cdouble}(x + 152) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 160) + f === :MAXwide && return Ptr{Cint}(x + 168) + f === :MERGEexact && return Ptr{Cuint}(x + 172) + f === :MERGEindependent && return Ptr{Cuint}(x + 176) + f === :MERGING && return Ptr{Cuint}(x + 180) + f === :premerge_centrum && return Ptr{Cdouble}(x + 184) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 192) + f === :MERGEpinched && return Ptr{Cuint}(x + 200) + f === :MERGEvertices && return Ptr{Cuint}(x + 204) + f === :MINvisible && return Ptr{Cdouble}(x + 208) + f === :NOnarrow && return Ptr{Cuint}(x + 216) + f === :NOnearinside && return Ptr{Cuint}(x + 220) + f === :NOpremerge && return Ptr{Cuint}(x + 224) + f === :ONLYgood && return Ptr{Cuint}(x + 228) + f === :ONLYmax && return Ptr{Cuint}(x + 232) + f === :PICKfurthest && return Ptr{Cuint}(x + 236) + f === :POSTmerge && return Ptr{Cuint}(x + 240) + f === :PREmerge && return Ptr{Cuint}(x + 244) + f === :PRINTcentrums && return Ptr{Cuint}(x + 248) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 252) + f === :PRINTdim && return Ptr{Cint}(x + 256) + f === :PRINTdots && return Ptr{Cuint}(x + 260) + f === :PRINTgood && return Ptr{Cuint}(x + 264) + f === :PRINTinner && return Ptr{Cuint}(x + 268) + f === :PRINTneighbors && return Ptr{Cuint}(x + 272) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 276) + f === :PRINToptions1st && return Ptr{Cuint}(x + 280) + f === :PRINTouter && return Ptr{Cuint}(x + 284) + f === :PRINTprecision && return Ptr{Cuint}(x + 288) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 292) + f === :PRINTridges && return Ptr{Cuint}(x + 408) + f === :PRINTspheres && return Ptr{Cuint}(x + 412) + f === :PRINTstatistics && return Ptr{Cuint}(x + 416) + f === :PRINTsummary && return Ptr{Cuint}(x + 420) + f === :PRINTtransparent && return Ptr{Cuint}(x + 424) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 428) + f === :PROJECTinput && return Ptr{Cint}(x + 432) + f === :RANDOMdist && return Ptr{Cuint}(x + 436) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 440) + f === :RANDOMa && return Ptr{Cdouble}(x + 448) + f === :RANDOMb && return Ptr{Cdouble}(x + 456) + f === :RANDOMoutside && return Ptr{Cuint}(x + 464) + f === :REPORTfreq && return Ptr{Cint}(x + 468) + f === :REPORTfreq2 && return Ptr{Cint}(x + 472) + f === :RERUN && return Ptr{Cint}(x + 476) + f === :ROTATErandom && return Ptr{Cint}(x + 480) + f === :SCALEinput && return Ptr{Cuint}(x + 484) + f === :SCALElast && return Ptr{Cuint}(x + 488) + f === :SETroundoff && return Ptr{Cuint}(x + 492) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 496) + f === :SKIPconvex && return Ptr{Cuint}(x + 500) + f === :SPLITthresholds && return Ptr{Cuint}(x + 504) + f === :STOPadd && return Ptr{Cint}(x + 508) + f === :STOPcone && return Ptr{Cint}(x + 512) + f === :STOPpoint && return Ptr{Cint}(x + 516) + f === :TESTpoints && return Ptr{Cint}(x + 520) + f === :TESTvneighbors && return Ptr{Cuint}(x + 524) + f === :TRACElevel && return Ptr{Cint}(x + 528) + f === :TRACElastrun && return Ptr{Cint}(x + 532) + f === :TRACEpoint && return Ptr{Cint}(x + 536) + f === :TRACEdist && return Ptr{Cdouble}(x + 544) + f === :TRACEmerge && return Ptr{Cint}(x + 552) + f === :TRIangulate && return Ptr{Cuint}(x + 556) + f === :TRInormals && return Ptr{Cuint}(x + 560) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 564) + f === :USEstdout && return Ptr{Cuint}(x + 568) + f === :VERIFYoutput && return Ptr{Cuint}(x + 572) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 576) + f === :VORONOI && return Ptr{Cuint}(x + 580) + f === :AREAfactor && return Ptr{Cdouble}(x + 584) + f === :DOcheckmax && return Ptr{Cuint}(x + 592) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 596) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 600) + f === :GETarea && return Ptr{Cuint}(x + 604) + f === :KEEPnearinside && return Ptr{Cuint}(x + 608) + f === :hull_dim && return Ptr{Cint}(x + 612) + f === :input_dim && return Ptr{Cint}(x + 616) + f === :num_points && return Ptr{Cint}(x + 620) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 624) + f === :POINTSmalloc && return Ptr{Cuint}(x + 628) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 632) + f === :input_malloc && return Ptr{Cuint}(x + 636) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 640) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 896) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 900) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1156) + f === :qhull_optionlen && return Ptr{Cint}(x + 1668) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1672) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1676) + f === :run_id && return Ptr{Cint}(x + 1680) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1684) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1688) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1692) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1696) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1700) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1704) + f === :ANGLEround && return Ptr{Cdouble}(x + 1712) + f === :centrum_radius && return Ptr{Cdouble}(x + 1720) + f === :cos_max && return Ptr{Cdouble}(x + 1728) + f === :DISTround && return Ptr{Cdouble}(x + 1736) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1744) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1752) + f === :MAXoutside && return Ptr{Cdouble}(x + 1760) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1768) + f === :MAXwidth && return Ptr{Cdouble}(x + 1776) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1784) + f === :MINdenom && return Ptr{Cdouble}(x + 1792) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1800) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1808) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1816) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1824) + f === :NEARinside && return Ptr{Cdouble}(x + 1832) + f === :ONEmerge && return Ptr{Cdouble}(x + 1840) + f === :outside_err && return Ptr{Cdouble}(x + 1848) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1856) + f === :NARROWhull && return Ptr{Cuint}(x + 1864) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1868) + f === :errexit && return Ptr{jmp_buf}(x + 1876) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 1940) + f === :restartexit && return Ptr{jmp_buf}(x + 1980) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2044) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2084) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2088) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2092) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2096) + f === :normal_size && return Ptr{Cint}(x + 2100) + f === :center_size && return Ptr{Cint}(x + 2104) + f === :TEMPsize && return Ptr{Cint}(x + 2108) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 2112) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2116) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 2120) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2124) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 2128) + f === :num_visible && return Ptr{Cint}(x + 2132) + f === :tracefacet_id && return Ptr{Cuint}(x + 2136) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2140) + f === :traceridge_id && return Ptr{Cuint}(x + 2144) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2148) + f === :tracevertex_id && return Ptr{Cuint}(x + 2152) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2156) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2160) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2164) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2168) + f === :num_facets && return Ptr{Cint}(x + 2172) + f === :num_vertices && return Ptr{Cint}(x + 2176) + f === :num_outside && return Ptr{Cint}(x + 2180) + f === :num_good && return Ptr{Cint}(x + 2184) + f === :facet_id && return Ptr{Cuint}(x + 2188) + f === :ridge_id && return Ptr{Cuint}(x + 2192) + f === :vertex_id && return Ptr{Cuint}(x + 2196) + f === :first_newfacet && return Ptr{Cuint}(x + 2200) + f === :hulltime && return Ptr{Culong}(x + 2204) + f === :ALLOWrestart && return Ptr{Cuint}(x + 2208) + f === :build_cnt && return Ptr{Cint}(x + 2212) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 2216) + f === :furthest_id && return Ptr{Cint}(x + 2220) + f === :last_errcode && return Ptr{Cint}(x + 2224) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2228) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2232) + f === :hasAreaVolume && return Ptr{Cuint}(x + 2236) + f === :hasTriangulation && return Ptr{Cuint}(x + 2240) + f === :isRenameVertex && return Ptr{Cuint}(x + 2244) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 2248) + f === :maxoutdone && return Ptr{Cuint}(x + 2256) + f === :max_outside && return Ptr{Cdouble}(x + 2264) + f === :max_vertex && return Ptr{Cdouble}(x + 2272) + f === :min_vertex && return Ptr{Cdouble}(x + 2280) + f === :NEWfacets && return Ptr{Cuint}(x + 2288) + f === :NEWtentative && return Ptr{Cuint}(x + 2292) + f === :findbestnew && return Ptr{Cuint}(x + 2296) + f === :findbest_notsharp && return Ptr{Cuint}(x + 2300) + f === :NOerrexit && return Ptr{Cuint}(x + 2304) + f === :PRINTcradius && return Ptr{Cdouble}(x + 2312) + f === :PRINTradius && return Ptr{Cdouble}(x + 2320) + f === :POSTmerging && return Ptr{Cuint}(x + 2328) + f === :printoutvar && return Ptr{Cint}(x + 2332) + f === :printoutnum && return Ptr{Cint}(x + 2336) + f === :repart_facetid && return Ptr{Cuint}(x + 2340) + f === :retry_addpoint && return Ptr{Cint}(x + 2344) + f === :QHULLfinished && return Ptr{Cuint}(x + 2348) + f === :totarea && return Ptr{Cdouble}(x + 2352) + f === :totvol && return Ptr{Cdouble}(x + 2360) + f === :visit_id && return Ptr{Cuint}(x + 2368) + f === :vertex_visit && return Ptr{Cuint}(x + 2372) + f === :WAScoplanar && return Ptr{Cuint}(x + 2376) + f === :ZEROall_ok && return Ptr{Cuint}(x + 2380) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 2384) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 2388) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 2392) + f === :hash_table && return Ptr{Ptr{setT}}(x + 2396) + f === :other_points && return Ptr{Ptr{setT}}(x + 2400) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 2404) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 2408) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 2412) + f === :line && return Ptr{Ptr{Cchar}}(x + 2416) + f === :maxline && return Ptr{Cint}(x + 2420) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 2424) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 2428) + f === :ERREXITcalled && return Ptr{Cuint}(x + 2432) + f === :firstcentrum && return Ptr{Cuint}(x + 2436) + f === :old_randomdist && return Ptr{Cuint}(x + 2440) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 2444) + f === :last_low && return Ptr{Cdouble}(x + 2448) + f === :last_high && return Ptr{Cdouble}(x + 2456) + f === :last_newhigh && return Ptr{Cdouble}(x + 2464) + f === :lastcpu && return Ptr{Cdouble}(x + 2472) + f === :lastfacets && return Ptr{Cint}(x + 2480) + f === :lastmerges && return Ptr{Cint}(x + 2484) + f === :lastplanes && return Ptr{Cint}(x + 2488) + f === :lastdist && return Ptr{Cint}(x + 2492) + f === :lastreport && return Ptr{Cuint}(x + 2496) + f === :mergereport && return Ptr{Cint}(x + 2500) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 2504) + f === :ridgeoutnum && return Ptr{Cint}(x + 2508) + f === :last_random && return Ptr{Cint}(x + 2512) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 2516) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 2580) + f === :rbox_isinteger && return Ptr{Cint}(x + 2620) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 2624) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 2632) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 2636) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 2640) + f === :qhmem && return Ptr{qhmemT}(x + 2644) + f === :qhstat && return Ptr{qhstatT}(x + 2760) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{28, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 4) + f === :point && return Ptr{Ptr{Cdouble}}(x + 8) + f === :neighbors && return Ptr{Ptr{setT}}(x + 12) + f === :id && return Ptr{Cuint}(x + 16) + f === :visitid && return Ptr{Cuint}(x + 20) + f === :seen && return Ptr{Cuint}(x + 24) + f === :seen2 && return (Ptr{Cuint}(x + 24), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 24), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 24), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 24), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 24), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_4 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_4}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_4, f::Symbol) + r = Ref{__JL_Ctag_4}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_4}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_4}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/lib/powerpc64le-linux-gnu.jl b/lib/powerpc64le-linux-gnu.jl new file mode 100644 index 0000000..57bccf1 --- /dev/null +++ b/lib/powerpc64le-linux-gnu.jl @@ -0,0 +1,1946 @@ +const __jmp_buf = NTuple{64, Clong} + +struct __sigset_t + __val::NTuple{16, Culong} +end + +struct __jmp_buf_tag + __jmpbuf::__jmp_buf + __mask_was_saved::Cint + __saved_mask::__sigset_t +end + +const jmp_buf = NTuple{1, __jmp_buf_tag} + +const countT = Cint + +struct setelemT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 8) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{120, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_9}(x + 32) + f === :center && return Ptr{Ptr{Cdouble}}(x + 40) + f === :previous && return Ptr{Ptr{facetT}}(x + 48) + f === :next && return Ptr{Ptr{facetT}}(x + 56) + f === :vertices && return Ptr{Ptr{setT}}(x + 64) + f === :ridges && return Ptr{Ptr{setT}}(x + 72) + f === :neighbors && return Ptr{Ptr{setT}}(x + 80) + f === :outsideset && return Ptr{Ptr{setT}}(x + 88) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 96) + f === :visitid && return Ptr{Cuint}(x + 104) + f === :id && return Ptr{Cuint}(x + 108) + f === :nummerge && return Ptr{Cuint}(x + 112) + f === :tricoplanar && return (Ptr{Cuint}(x + 113), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 113), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 113), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 113), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 113), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 113), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 113), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 114) + f === :upperdelaunay && return (Ptr{Cuint}(x + 114), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 114), 2, 1) + f === :good && return (Ptr{Cuint}(x + 114), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 114), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 114), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 114), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 114), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 115) + f === :mergehorizon && return (Ptr{Cuint}(x + 115), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 115), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 115), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 115), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 115), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 115), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 115), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{32, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 8) + f === :bottom && return Ptr{Ptr{facetT}}(x + 16) + f === :id && return Ptr{Cuint}(x + 24) + f === :seen && return Ptr{Cuint}(x + 28) + f === :tested && return (Ptr{Cuint}(x + 28), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 28), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 28), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 28), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 28), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 28), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 112) + f === :GOODvertex && return Ptr{Cint}(x + 116) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 120) + f === :HALFspace && return Ptr{Cuint}(x + 128) + f === :ISqhullQh && return Ptr{Cuint}(x + 132) + f === :IStracing && return Ptr{Cint}(x + 136) + f === :KEEParea && return Ptr{Cint}(x + 140) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 144) + f === :KEEPinside && return Ptr{Cuint}(x + 148) + f === :KEEPmerge && return Ptr{Cint}(x + 152) + f === :KEEPminArea && return Ptr{Cdouble}(x + 160) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 168) + f === :MAXwide && return Ptr{Cint}(x + 176) + f === :MERGEexact && return Ptr{Cuint}(x + 180) + f === :MERGEindependent && return Ptr{Cuint}(x + 184) + f === :MERGING && return Ptr{Cuint}(x + 188) + f === :premerge_centrum && return Ptr{Cdouble}(x + 192) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 200) + f === :MERGEpinched && return Ptr{Cuint}(x + 208) + f === :MERGEvertices && return Ptr{Cuint}(x + 212) + f === :MINvisible && return Ptr{Cdouble}(x + 216) + f === :NOnarrow && return Ptr{Cuint}(x + 224) + f === :NOnearinside && return Ptr{Cuint}(x + 228) + f === :NOpremerge && return Ptr{Cuint}(x + 232) + f === :ONLYgood && return Ptr{Cuint}(x + 236) + f === :ONLYmax && return Ptr{Cuint}(x + 240) + f === :PICKfurthest && return Ptr{Cuint}(x + 244) + f === :POSTmerge && return Ptr{Cuint}(x + 248) + f === :PREmerge && return Ptr{Cuint}(x + 252) + f === :PRINTcentrums && return Ptr{Cuint}(x + 256) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 260) + f === :PRINTdim && return Ptr{Cint}(x + 264) + f === :PRINTdots && return Ptr{Cuint}(x + 268) + f === :PRINTgood && return Ptr{Cuint}(x + 272) + f === :PRINTinner && return Ptr{Cuint}(x + 276) + f === :PRINTneighbors && return Ptr{Cuint}(x + 280) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 284) + f === :PRINToptions1st && return Ptr{Cuint}(x + 288) + f === :PRINTouter && return Ptr{Cuint}(x + 292) + f === :PRINTprecision && return Ptr{Cuint}(x + 296) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 300) + f === :PRINTridges && return Ptr{Cuint}(x + 416) + f === :PRINTspheres && return Ptr{Cuint}(x + 420) + f === :PRINTstatistics && return Ptr{Cuint}(x + 424) + f === :PRINTsummary && return Ptr{Cuint}(x + 428) + f === :PRINTtransparent && return Ptr{Cuint}(x + 432) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 436) + f === :PROJECTinput && return Ptr{Cint}(x + 440) + f === :RANDOMdist && return Ptr{Cuint}(x + 444) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 448) + f === :RANDOMa && return Ptr{Cdouble}(x + 456) + f === :RANDOMb && return Ptr{Cdouble}(x + 464) + f === :RANDOMoutside && return Ptr{Cuint}(x + 472) + f === :REPORTfreq && return Ptr{Cint}(x + 476) + f === :REPORTfreq2 && return Ptr{Cint}(x + 480) + f === :RERUN && return Ptr{Cint}(x + 484) + f === :ROTATErandom && return Ptr{Cint}(x + 488) + f === :SCALEinput && return Ptr{Cuint}(x + 492) + f === :SCALElast && return Ptr{Cuint}(x + 496) + f === :SETroundoff && return Ptr{Cuint}(x + 500) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 504) + f === :SKIPconvex && return Ptr{Cuint}(x + 508) + f === :SPLITthresholds && return Ptr{Cuint}(x + 512) + f === :STOPadd && return Ptr{Cint}(x + 516) + f === :STOPcone && return Ptr{Cint}(x + 520) + f === :STOPpoint && return Ptr{Cint}(x + 524) + f === :TESTpoints && return Ptr{Cint}(x + 528) + f === :TESTvneighbors && return Ptr{Cuint}(x + 532) + f === :TRACElevel && return Ptr{Cint}(x + 536) + f === :TRACElastrun && return Ptr{Cint}(x + 540) + f === :TRACEpoint && return Ptr{Cint}(x + 544) + f === :TRACEdist && return Ptr{Cdouble}(x + 552) + f === :TRACEmerge && return Ptr{Cint}(x + 560) + f === :TRIangulate && return Ptr{Cuint}(x + 564) + f === :TRInormals && return Ptr{Cuint}(x + 568) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 572) + f === :USEstdout && return Ptr{Cuint}(x + 576) + f === :VERIFYoutput && return Ptr{Cuint}(x + 580) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 584) + f === :VORONOI && return Ptr{Cuint}(x + 588) + f === :AREAfactor && return Ptr{Cdouble}(x + 592) + f === :DOcheckmax && return Ptr{Cuint}(x + 600) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 608) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 616) + f === :GETarea && return Ptr{Cuint}(x + 624) + f === :KEEPnearinside && return Ptr{Cuint}(x + 628) + f === :hull_dim && return Ptr{Cint}(x + 632) + f === :input_dim && return Ptr{Cint}(x + 636) + f === :num_points && return Ptr{Cint}(x + 640) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 648) + f === :POINTSmalloc && return Ptr{Cuint}(x + 656) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 664) + f === :input_malloc && return Ptr{Cuint}(x + 672) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 676) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 932) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 936) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1192) + f === :qhull_optionlen && return Ptr{Cint}(x + 1704) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1708) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1712) + f === :run_id && return Ptr{Cint}(x + 1716) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1720) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1724) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1728) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1736) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1744) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1752) + f === :ANGLEround && return Ptr{Cdouble}(x + 1760) + f === :centrum_radius && return Ptr{Cdouble}(x + 1768) + f === :cos_max && return Ptr{Cdouble}(x + 1776) + f === :DISTround && return Ptr{Cdouble}(x + 1784) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1792) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1800) + f === :MAXoutside && return Ptr{Cdouble}(x + 1808) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1816) + f === :MAXwidth && return Ptr{Cdouble}(x + 1824) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1832) + f === :MINdenom && return Ptr{Cdouble}(x + 1840) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1848) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1856) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1864) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1872) + f === :NEARinside && return Ptr{Cdouble}(x + 1880) + f === :ONEmerge && return Ptr{Cdouble}(x + 1888) + f === :outside_err && return Ptr{Cdouble}(x + 1896) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1904) + f === :NARROWhull && return Ptr{Cuint}(x + 1912) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1916) + f === :errexit && return Ptr{jmp_buf}(x + 1936) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2592) + f === :restartexit && return Ptr{jmp_buf}(x + 2640) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 3296) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 3336) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 3344) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 3352) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 3360) + f === :normal_size && return Ptr{Cint}(x + 3368) + f === :center_size && return Ptr{Cint}(x + 3372) + f === :TEMPsize && return Ptr{Cint}(x + 3376) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 3384) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 3392) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 3400) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 3408) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 3416) + f === :num_visible && return Ptr{Cint}(x + 3424) + f === :tracefacet_id && return Ptr{Cuint}(x + 3428) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 3432) + f === :traceridge_id && return Ptr{Cuint}(x + 3440) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 3448) + f === :tracevertex_id && return Ptr{Cuint}(x + 3456) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 3464) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 3472) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 3480) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 3488) + f === :num_facets && return Ptr{Cint}(x + 3496) + f === :num_vertices && return Ptr{Cint}(x + 3500) + f === :num_outside && return Ptr{Cint}(x + 3504) + f === :num_good && return Ptr{Cint}(x + 3508) + f === :facet_id && return Ptr{Cuint}(x + 3512) + f === :ridge_id && return Ptr{Cuint}(x + 3516) + f === :vertex_id && return Ptr{Cuint}(x + 3520) + f === :first_newfacet && return Ptr{Cuint}(x + 3524) + f === :hulltime && return Ptr{Culong}(x + 3528) + f === :ALLOWrestart && return Ptr{Cuint}(x + 3536) + f === :build_cnt && return Ptr{Cint}(x + 3540) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 3544) + f === :furthest_id && return Ptr{Cint}(x + 3548) + f === :last_errcode && return Ptr{Cint}(x + 3552) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 3560) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 3568) + f === :hasAreaVolume && return Ptr{Cuint}(x + 3576) + f === :hasTriangulation && return Ptr{Cuint}(x + 3580) + f === :isRenameVertex && return Ptr{Cuint}(x + 3584) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 3592) + f === :maxoutdone && return Ptr{Cuint}(x + 3600) + f === :max_outside && return Ptr{Cdouble}(x + 3608) + f === :max_vertex && return Ptr{Cdouble}(x + 3616) + f === :min_vertex && return Ptr{Cdouble}(x + 3624) + f === :NEWfacets && return Ptr{Cuint}(x + 3632) + f === :NEWtentative && return Ptr{Cuint}(x + 3636) + f === :findbestnew && return Ptr{Cuint}(x + 3640) + f === :findbest_notsharp && return Ptr{Cuint}(x + 3644) + f === :NOerrexit && return Ptr{Cuint}(x + 3648) + f === :PRINTcradius && return Ptr{Cdouble}(x + 3656) + f === :PRINTradius && return Ptr{Cdouble}(x + 3664) + f === :POSTmerging && return Ptr{Cuint}(x + 3672) + f === :printoutvar && return Ptr{Cint}(x + 3676) + f === :printoutnum && return Ptr{Cint}(x + 3680) + f === :repart_facetid && return Ptr{Cuint}(x + 3684) + f === :retry_addpoint && return Ptr{Cint}(x + 3688) + f === :QHULLfinished && return Ptr{Cuint}(x + 3692) + f === :totarea && return Ptr{Cdouble}(x + 3696) + f === :totvol && return Ptr{Cdouble}(x + 3704) + f === :visit_id && return Ptr{Cuint}(x + 3712) + f === :vertex_visit && return Ptr{Cuint}(x + 3716) + f === :WAScoplanar && return Ptr{Cuint}(x + 3720) + f === :ZEROall_ok && return Ptr{Cuint}(x + 3724) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 3728) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 3736) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 3744) + f === :hash_table && return Ptr{Ptr{setT}}(x + 3752) + f === :other_points && return Ptr{Ptr{setT}}(x + 3760) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 3768) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 3776) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 3784) + f === :line && return Ptr{Ptr{Cchar}}(x + 3792) + f === :maxline && return Ptr{Cint}(x + 3800) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 3808) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 3816) + f === :ERREXITcalled && return Ptr{Cuint}(x + 3824) + f === :firstcentrum && return Ptr{Cuint}(x + 3828) + f === :old_randomdist && return Ptr{Cuint}(x + 3832) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 3840) + f === :last_low && return Ptr{Cdouble}(x + 3848) + f === :last_high && return Ptr{Cdouble}(x + 3856) + f === :last_newhigh && return Ptr{Cdouble}(x + 3864) + f === :lastcpu && return Ptr{Cdouble}(x + 3872) + f === :lastfacets && return Ptr{Cint}(x + 3880) + f === :lastmerges && return Ptr{Cint}(x + 3884) + f === :lastplanes && return Ptr{Cint}(x + 3888) + f === :lastdist && return Ptr{Cint}(x + 3892) + f === :lastreport && return Ptr{Cuint}(x + 3896) + f === :mergereport && return Ptr{Cint}(x + 3900) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 3904) + f === :ridgeoutnum && return Ptr{Cint}(x + 3912) + f === :last_random && return Ptr{Cint}(x + 3916) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 3920) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 4576) + f === :rbox_isinteger && return Ptr{Cint}(x + 4616) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 4624) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 4632) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 4640) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 4648) + f === :qhmem && return Ptr{qhmemT}(x + 4656) + f === :qhstat && return Ptr{qhstatT}(x + 4808) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{48, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 8) + f === :point && return Ptr{Ptr{Cdouble}}(x + 16) + f === :neighbors && return Ptr{Ptr{setT}}(x + 24) + f === :id && return Ptr{Cuint}(x + 32) + f === :visitid && return Ptr{Cuint}(x + 36) + f === :seen && return Ptr{Cuint}(x + 40) + f === :seen2 && return (Ptr{Cuint}(x + 40), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 40), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 40), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 40), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 40), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_9 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_9}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_9, f::Symbol) + r = Ref{__JL_Ctag_9}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_9}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_9}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/lib/x86_64-apple-darwin14.jl b/lib/x86_64-apple-darwin14.jl new file mode 100644 index 0000000..c7845f7 --- /dev/null +++ b/lib/x86_64-apple-darwin14.jl @@ -0,0 +1,1934 @@ +const jmp_buf = NTuple{37, Cint} + +const countT = Cint + +struct setelemT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 8) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{120, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_6}(x + 32) + f === :center && return Ptr{Ptr{Cdouble}}(x + 40) + f === :previous && return Ptr{Ptr{facetT}}(x + 48) + f === :next && return Ptr{Ptr{facetT}}(x + 56) + f === :vertices && return Ptr{Ptr{setT}}(x + 64) + f === :ridges && return Ptr{Ptr{setT}}(x + 72) + f === :neighbors && return Ptr{Ptr{setT}}(x + 80) + f === :outsideset && return Ptr{Ptr{setT}}(x + 88) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 96) + f === :visitid && return Ptr{Cuint}(x + 104) + f === :id && return Ptr{Cuint}(x + 108) + f === :nummerge && return Ptr{Cuint}(x + 112) + f === :tricoplanar && return (Ptr{Cuint}(x + 113), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 113), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 113), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 113), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 113), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 113), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 113), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 114) + f === :upperdelaunay && return (Ptr{Cuint}(x + 114), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 114), 2, 1) + f === :good && return (Ptr{Cuint}(x + 114), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 114), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 114), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 114), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 114), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 115) + f === :mergehorizon && return (Ptr{Cuint}(x + 115), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 115), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 115), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 115), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 115), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 115), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 115), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{32, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 8) + f === :bottom && return Ptr{Ptr{facetT}}(x + 16) + f === :id && return Ptr{Cuint}(x + 24) + f === :seen && return Ptr{Cuint}(x + 28) + f === :tested && return (Ptr{Cuint}(x + 28), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 28), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 28), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 28), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 28), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 28), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 112) + f === :GOODvertex && return Ptr{Cint}(x + 116) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 120) + f === :HALFspace && return Ptr{Cuint}(x + 128) + f === :ISqhullQh && return Ptr{Cuint}(x + 132) + f === :IStracing && return Ptr{Cint}(x + 136) + f === :KEEParea && return Ptr{Cint}(x + 140) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 144) + f === :KEEPinside && return Ptr{Cuint}(x + 148) + f === :KEEPmerge && return Ptr{Cint}(x + 152) + f === :KEEPminArea && return Ptr{Cdouble}(x + 160) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 168) + f === :MAXwide && return Ptr{Cint}(x + 176) + f === :MERGEexact && return Ptr{Cuint}(x + 180) + f === :MERGEindependent && return Ptr{Cuint}(x + 184) + f === :MERGING && return Ptr{Cuint}(x + 188) + f === :premerge_centrum && return Ptr{Cdouble}(x + 192) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 200) + f === :MERGEpinched && return Ptr{Cuint}(x + 208) + f === :MERGEvertices && return Ptr{Cuint}(x + 212) + f === :MINvisible && return Ptr{Cdouble}(x + 216) + f === :NOnarrow && return Ptr{Cuint}(x + 224) + f === :NOnearinside && return Ptr{Cuint}(x + 228) + f === :NOpremerge && return Ptr{Cuint}(x + 232) + f === :ONLYgood && return Ptr{Cuint}(x + 236) + f === :ONLYmax && return Ptr{Cuint}(x + 240) + f === :PICKfurthest && return Ptr{Cuint}(x + 244) + f === :POSTmerge && return Ptr{Cuint}(x + 248) + f === :PREmerge && return Ptr{Cuint}(x + 252) + f === :PRINTcentrums && return Ptr{Cuint}(x + 256) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 260) + f === :PRINTdim && return Ptr{Cint}(x + 264) + f === :PRINTdots && return Ptr{Cuint}(x + 268) + f === :PRINTgood && return Ptr{Cuint}(x + 272) + f === :PRINTinner && return Ptr{Cuint}(x + 276) + f === :PRINTneighbors && return Ptr{Cuint}(x + 280) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 284) + f === :PRINToptions1st && return Ptr{Cuint}(x + 288) + f === :PRINTouter && return Ptr{Cuint}(x + 292) + f === :PRINTprecision && return Ptr{Cuint}(x + 296) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 300) + f === :PRINTridges && return Ptr{Cuint}(x + 416) + f === :PRINTspheres && return Ptr{Cuint}(x + 420) + f === :PRINTstatistics && return Ptr{Cuint}(x + 424) + f === :PRINTsummary && return Ptr{Cuint}(x + 428) + f === :PRINTtransparent && return Ptr{Cuint}(x + 432) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 436) + f === :PROJECTinput && return Ptr{Cint}(x + 440) + f === :RANDOMdist && return Ptr{Cuint}(x + 444) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 448) + f === :RANDOMa && return Ptr{Cdouble}(x + 456) + f === :RANDOMb && return Ptr{Cdouble}(x + 464) + f === :RANDOMoutside && return Ptr{Cuint}(x + 472) + f === :REPORTfreq && return Ptr{Cint}(x + 476) + f === :REPORTfreq2 && return Ptr{Cint}(x + 480) + f === :RERUN && return Ptr{Cint}(x + 484) + f === :ROTATErandom && return Ptr{Cint}(x + 488) + f === :SCALEinput && return Ptr{Cuint}(x + 492) + f === :SCALElast && return Ptr{Cuint}(x + 496) + f === :SETroundoff && return Ptr{Cuint}(x + 500) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 504) + f === :SKIPconvex && return Ptr{Cuint}(x + 508) + f === :SPLITthresholds && return Ptr{Cuint}(x + 512) + f === :STOPadd && return Ptr{Cint}(x + 516) + f === :STOPcone && return Ptr{Cint}(x + 520) + f === :STOPpoint && return Ptr{Cint}(x + 524) + f === :TESTpoints && return Ptr{Cint}(x + 528) + f === :TESTvneighbors && return Ptr{Cuint}(x + 532) + f === :TRACElevel && return Ptr{Cint}(x + 536) + f === :TRACElastrun && return Ptr{Cint}(x + 540) + f === :TRACEpoint && return Ptr{Cint}(x + 544) + f === :TRACEdist && return Ptr{Cdouble}(x + 552) + f === :TRACEmerge && return Ptr{Cint}(x + 560) + f === :TRIangulate && return Ptr{Cuint}(x + 564) + f === :TRInormals && return Ptr{Cuint}(x + 568) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 572) + f === :USEstdout && return Ptr{Cuint}(x + 576) + f === :VERIFYoutput && return Ptr{Cuint}(x + 580) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 584) + f === :VORONOI && return Ptr{Cuint}(x + 588) + f === :AREAfactor && return Ptr{Cdouble}(x + 592) + f === :DOcheckmax && return Ptr{Cuint}(x + 600) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 608) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 616) + f === :GETarea && return Ptr{Cuint}(x + 624) + f === :KEEPnearinside && return Ptr{Cuint}(x + 628) + f === :hull_dim && return Ptr{Cint}(x + 632) + f === :input_dim && return Ptr{Cint}(x + 636) + f === :num_points && return Ptr{Cint}(x + 640) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 648) + f === :POINTSmalloc && return Ptr{Cuint}(x + 656) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 664) + f === :input_malloc && return Ptr{Cuint}(x + 672) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 676) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 932) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 936) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1192) + f === :qhull_optionlen && return Ptr{Cint}(x + 1704) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1708) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1712) + f === :run_id && return Ptr{Cint}(x + 1716) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1720) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1724) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1728) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1736) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1744) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1752) + f === :ANGLEround && return Ptr{Cdouble}(x + 1760) + f === :centrum_radius && return Ptr{Cdouble}(x + 1768) + f === :cos_max && return Ptr{Cdouble}(x + 1776) + f === :DISTround && return Ptr{Cdouble}(x + 1784) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1792) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1800) + f === :MAXoutside && return Ptr{Cdouble}(x + 1808) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1816) + f === :MAXwidth && return Ptr{Cdouble}(x + 1824) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1832) + f === :MINdenom && return Ptr{Cdouble}(x + 1840) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1848) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1856) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1864) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1872) + f === :NEARinside && return Ptr{Cdouble}(x + 1880) + f === :ONEmerge && return Ptr{Cdouble}(x + 1888) + f === :outside_err && return Ptr{Cdouble}(x + 1896) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1904) + f === :NARROWhull && return Ptr{Cuint}(x + 1912) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1916) + f === :errexit && return Ptr{jmp_buf}(x + 1924) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2072) + f === :restartexit && return Ptr{jmp_buf}(x + 2112) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2260) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2304) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2312) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2320) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2328) + f === :normal_size && return Ptr{Cint}(x + 2336) + f === :center_size && return Ptr{Cint}(x + 2340) + f === :TEMPsize && return Ptr{Cint}(x + 2344) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 2352) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2360) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 2368) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2376) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 2384) + f === :num_visible && return Ptr{Cint}(x + 2392) + f === :tracefacet_id && return Ptr{Cuint}(x + 2396) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2400) + f === :traceridge_id && return Ptr{Cuint}(x + 2408) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2416) + f === :tracevertex_id && return Ptr{Cuint}(x + 2424) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2432) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2440) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2448) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2456) + f === :num_facets && return Ptr{Cint}(x + 2464) + f === :num_vertices && return Ptr{Cint}(x + 2468) + f === :num_outside && return Ptr{Cint}(x + 2472) + f === :num_good && return Ptr{Cint}(x + 2476) + f === :facet_id && return Ptr{Cuint}(x + 2480) + f === :ridge_id && return Ptr{Cuint}(x + 2484) + f === :vertex_id && return Ptr{Cuint}(x + 2488) + f === :first_newfacet && return Ptr{Cuint}(x + 2492) + f === :hulltime && return Ptr{Culong}(x + 2496) + f === :ALLOWrestart && return Ptr{Cuint}(x + 2504) + f === :build_cnt && return Ptr{Cint}(x + 2508) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 2512) + f === :furthest_id && return Ptr{Cint}(x + 2516) + f === :last_errcode && return Ptr{Cint}(x + 2520) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2528) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2536) + f === :hasAreaVolume && return Ptr{Cuint}(x + 2544) + f === :hasTriangulation && return Ptr{Cuint}(x + 2548) + f === :isRenameVertex && return Ptr{Cuint}(x + 2552) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 2560) + f === :maxoutdone && return Ptr{Cuint}(x + 2568) + f === :max_outside && return Ptr{Cdouble}(x + 2576) + f === :max_vertex && return Ptr{Cdouble}(x + 2584) + f === :min_vertex && return Ptr{Cdouble}(x + 2592) + f === :NEWfacets && return Ptr{Cuint}(x + 2600) + f === :NEWtentative && return Ptr{Cuint}(x + 2604) + f === :findbestnew && return Ptr{Cuint}(x + 2608) + f === :findbest_notsharp && return Ptr{Cuint}(x + 2612) + f === :NOerrexit && return Ptr{Cuint}(x + 2616) + f === :PRINTcradius && return Ptr{Cdouble}(x + 2624) + f === :PRINTradius && return Ptr{Cdouble}(x + 2632) + f === :POSTmerging && return Ptr{Cuint}(x + 2640) + f === :printoutvar && return Ptr{Cint}(x + 2644) + f === :printoutnum && return Ptr{Cint}(x + 2648) + f === :repart_facetid && return Ptr{Cuint}(x + 2652) + f === :retry_addpoint && return Ptr{Cint}(x + 2656) + f === :QHULLfinished && return Ptr{Cuint}(x + 2660) + f === :totarea && return Ptr{Cdouble}(x + 2664) + f === :totvol && return Ptr{Cdouble}(x + 2672) + f === :visit_id && return Ptr{Cuint}(x + 2680) + f === :vertex_visit && return Ptr{Cuint}(x + 2684) + f === :WAScoplanar && return Ptr{Cuint}(x + 2688) + f === :ZEROall_ok && return Ptr{Cuint}(x + 2692) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 2696) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 2704) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 2712) + f === :hash_table && return Ptr{Ptr{setT}}(x + 2720) + f === :other_points && return Ptr{Ptr{setT}}(x + 2728) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 2736) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 2744) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 2752) + f === :line && return Ptr{Ptr{Cchar}}(x + 2760) + f === :maxline && return Ptr{Cint}(x + 2768) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 2776) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 2784) + f === :ERREXITcalled && return Ptr{Cuint}(x + 2792) + f === :firstcentrum && return Ptr{Cuint}(x + 2796) + f === :old_randomdist && return Ptr{Cuint}(x + 2800) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 2808) + f === :last_low && return Ptr{Cdouble}(x + 2816) + f === :last_high && return Ptr{Cdouble}(x + 2824) + f === :last_newhigh && return Ptr{Cdouble}(x + 2832) + f === :lastcpu && return Ptr{Cdouble}(x + 2840) + f === :lastfacets && return Ptr{Cint}(x + 2848) + f === :lastmerges && return Ptr{Cint}(x + 2852) + f === :lastplanes && return Ptr{Cint}(x + 2856) + f === :lastdist && return Ptr{Cint}(x + 2860) + f === :lastreport && return Ptr{Cuint}(x + 2864) + f === :mergereport && return Ptr{Cint}(x + 2868) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 2872) + f === :ridgeoutnum && return Ptr{Cint}(x + 2880) + f === :last_random && return Ptr{Cint}(x + 2884) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 2888) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 3036) + f === :rbox_isinteger && return Ptr{Cint}(x + 3076) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 3080) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 3088) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 3096) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 3104) + f === :qhmem && return Ptr{qhmemT}(x + 3112) + f === :qhstat && return Ptr{qhstatT}(x + 3264) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{48, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 8) + f === :point && return Ptr{Ptr{Cdouble}}(x + 16) + f === :neighbors && return Ptr{Ptr{setT}}(x + 24) + f === :id && return Ptr{Cuint}(x + 32) + f === :visitid && return Ptr{Cuint}(x + 36) + f === :seen && return Ptr{Cuint}(x + 40) + f === :seen2 && return (Ptr{Cuint}(x + 40), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 40), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 40), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 40), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 40), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_6 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_6}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_6, f::Symbol) + r = Ref{__JL_Ctag_6}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_6}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_6}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/lib/x86_64-linux-gnu.jl b/lib/x86_64-linux-gnu.jl new file mode 100644 index 0000000..22294db --- /dev/null +++ b/lib/x86_64-linux-gnu.jl @@ -0,0 +1,1946 @@ +const __jmp_buf = NTuple{8, Clong} + +struct __sigset_t + __val::NTuple{16, Culong} +end + +struct __jmp_buf_tag + __jmpbuf::__jmp_buf + __mask_was_saved::Cint + __saved_mask::__sigset_t +end + +const jmp_buf = NTuple{1, __jmp_buf_tag} + +const countT = Cint + +struct setelemT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 8) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{120, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_9}(x + 32) + f === :center && return Ptr{Ptr{Cdouble}}(x + 40) + f === :previous && return Ptr{Ptr{facetT}}(x + 48) + f === :next && return Ptr{Ptr{facetT}}(x + 56) + f === :vertices && return Ptr{Ptr{setT}}(x + 64) + f === :ridges && return Ptr{Ptr{setT}}(x + 72) + f === :neighbors && return Ptr{Ptr{setT}}(x + 80) + f === :outsideset && return Ptr{Ptr{setT}}(x + 88) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 96) + f === :visitid && return Ptr{Cuint}(x + 104) + f === :id && return Ptr{Cuint}(x + 108) + f === :nummerge && return Ptr{Cuint}(x + 112) + f === :tricoplanar && return (Ptr{Cuint}(x + 113), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 113), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 113), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 113), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 113), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 113), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 113), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 114) + f === :upperdelaunay && return (Ptr{Cuint}(x + 114), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 114), 2, 1) + f === :good && return (Ptr{Cuint}(x + 114), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 114), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 114), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 114), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 114), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 115) + f === :mergehorizon && return (Ptr{Cuint}(x + 115), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 115), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 115), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 115), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 115), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 115), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 115), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{32, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 8) + f === :bottom && return Ptr{Ptr{facetT}}(x + 16) + f === :id && return Ptr{Cuint}(x + 24) + f === :seen && return Ptr{Cuint}(x + 28) + f === :tested && return (Ptr{Cuint}(x + 28), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 28), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 28), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 28), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 28), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 28), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 112) + f === :GOODvertex && return Ptr{Cint}(x + 116) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 120) + f === :HALFspace && return Ptr{Cuint}(x + 128) + f === :ISqhullQh && return Ptr{Cuint}(x + 132) + f === :IStracing && return Ptr{Cint}(x + 136) + f === :KEEParea && return Ptr{Cint}(x + 140) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 144) + f === :KEEPinside && return Ptr{Cuint}(x + 148) + f === :KEEPmerge && return Ptr{Cint}(x + 152) + f === :KEEPminArea && return Ptr{Cdouble}(x + 160) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 168) + f === :MAXwide && return Ptr{Cint}(x + 176) + f === :MERGEexact && return Ptr{Cuint}(x + 180) + f === :MERGEindependent && return Ptr{Cuint}(x + 184) + f === :MERGING && return Ptr{Cuint}(x + 188) + f === :premerge_centrum && return Ptr{Cdouble}(x + 192) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 200) + f === :MERGEpinched && return Ptr{Cuint}(x + 208) + f === :MERGEvertices && return Ptr{Cuint}(x + 212) + f === :MINvisible && return Ptr{Cdouble}(x + 216) + f === :NOnarrow && return Ptr{Cuint}(x + 224) + f === :NOnearinside && return Ptr{Cuint}(x + 228) + f === :NOpremerge && return Ptr{Cuint}(x + 232) + f === :ONLYgood && return Ptr{Cuint}(x + 236) + f === :ONLYmax && return Ptr{Cuint}(x + 240) + f === :PICKfurthest && return Ptr{Cuint}(x + 244) + f === :POSTmerge && return Ptr{Cuint}(x + 248) + f === :PREmerge && return Ptr{Cuint}(x + 252) + f === :PRINTcentrums && return Ptr{Cuint}(x + 256) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 260) + f === :PRINTdim && return Ptr{Cint}(x + 264) + f === :PRINTdots && return Ptr{Cuint}(x + 268) + f === :PRINTgood && return Ptr{Cuint}(x + 272) + f === :PRINTinner && return Ptr{Cuint}(x + 276) + f === :PRINTneighbors && return Ptr{Cuint}(x + 280) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 284) + f === :PRINToptions1st && return Ptr{Cuint}(x + 288) + f === :PRINTouter && return Ptr{Cuint}(x + 292) + f === :PRINTprecision && return Ptr{Cuint}(x + 296) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 300) + f === :PRINTridges && return Ptr{Cuint}(x + 416) + f === :PRINTspheres && return Ptr{Cuint}(x + 420) + f === :PRINTstatistics && return Ptr{Cuint}(x + 424) + f === :PRINTsummary && return Ptr{Cuint}(x + 428) + f === :PRINTtransparent && return Ptr{Cuint}(x + 432) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 436) + f === :PROJECTinput && return Ptr{Cint}(x + 440) + f === :RANDOMdist && return Ptr{Cuint}(x + 444) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 448) + f === :RANDOMa && return Ptr{Cdouble}(x + 456) + f === :RANDOMb && return Ptr{Cdouble}(x + 464) + f === :RANDOMoutside && return Ptr{Cuint}(x + 472) + f === :REPORTfreq && return Ptr{Cint}(x + 476) + f === :REPORTfreq2 && return Ptr{Cint}(x + 480) + f === :RERUN && return Ptr{Cint}(x + 484) + f === :ROTATErandom && return Ptr{Cint}(x + 488) + f === :SCALEinput && return Ptr{Cuint}(x + 492) + f === :SCALElast && return Ptr{Cuint}(x + 496) + f === :SETroundoff && return Ptr{Cuint}(x + 500) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 504) + f === :SKIPconvex && return Ptr{Cuint}(x + 508) + f === :SPLITthresholds && return Ptr{Cuint}(x + 512) + f === :STOPadd && return Ptr{Cint}(x + 516) + f === :STOPcone && return Ptr{Cint}(x + 520) + f === :STOPpoint && return Ptr{Cint}(x + 524) + f === :TESTpoints && return Ptr{Cint}(x + 528) + f === :TESTvneighbors && return Ptr{Cuint}(x + 532) + f === :TRACElevel && return Ptr{Cint}(x + 536) + f === :TRACElastrun && return Ptr{Cint}(x + 540) + f === :TRACEpoint && return Ptr{Cint}(x + 544) + f === :TRACEdist && return Ptr{Cdouble}(x + 552) + f === :TRACEmerge && return Ptr{Cint}(x + 560) + f === :TRIangulate && return Ptr{Cuint}(x + 564) + f === :TRInormals && return Ptr{Cuint}(x + 568) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 572) + f === :USEstdout && return Ptr{Cuint}(x + 576) + f === :VERIFYoutput && return Ptr{Cuint}(x + 580) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 584) + f === :VORONOI && return Ptr{Cuint}(x + 588) + f === :AREAfactor && return Ptr{Cdouble}(x + 592) + f === :DOcheckmax && return Ptr{Cuint}(x + 600) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 608) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 616) + f === :GETarea && return Ptr{Cuint}(x + 624) + f === :KEEPnearinside && return Ptr{Cuint}(x + 628) + f === :hull_dim && return Ptr{Cint}(x + 632) + f === :input_dim && return Ptr{Cint}(x + 636) + f === :num_points && return Ptr{Cint}(x + 640) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 648) + f === :POINTSmalloc && return Ptr{Cuint}(x + 656) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 664) + f === :input_malloc && return Ptr{Cuint}(x + 672) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 676) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 932) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 936) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1192) + f === :qhull_optionlen && return Ptr{Cint}(x + 1704) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1708) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1712) + f === :run_id && return Ptr{Cint}(x + 1716) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1720) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1724) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1728) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1736) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1744) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1752) + f === :ANGLEround && return Ptr{Cdouble}(x + 1760) + f === :centrum_radius && return Ptr{Cdouble}(x + 1768) + f === :cos_max && return Ptr{Cdouble}(x + 1776) + f === :DISTround && return Ptr{Cdouble}(x + 1784) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1792) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1800) + f === :MAXoutside && return Ptr{Cdouble}(x + 1808) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1816) + f === :MAXwidth && return Ptr{Cdouble}(x + 1824) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1832) + f === :MINdenom && return Ptr{Cdouble}(x + 1840) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1848) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1856) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1864) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1872) + f === :NEARinside && return Ptr{Cdouble}(x + 1880) + f === :ONEmerge && return Ptr{Cdouble}(x + 1888) + f === :outside_err && return Ptr{Cdouble}(x + 1896) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1904) + f === :NARROWhull && return Ptr{Cuint}(x + 1912) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1916) + f === :errexit && return Ptr{jmp_buf}(x + 1928) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2128) + f === :restartexit && return Ptr{jmp_buf}(x + 2168) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2368) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2408) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2416) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2424) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2432) + f === :normal_size && return Ptr{Cint}(x + 2440) + f === :center_size && return Ptr{Cint}(x + 2444) + f === :TEMPsize && return Ptr{Cint}(x + 2448) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 2456) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2464) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 2472) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2480) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 2488) + f === :num_visible && return Ptr{Cint}(x + 2496) + f === :tracefacet_id && return Ptr{Cuint}(x + 2500) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2504) + f === :traceridge_id && return Ptr{Cuint}(x + 2512) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2520) + f === :tracevertex_id && return Ptr{Cuint}(x + 2528) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2536) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2544) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2552) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2560) + f === :num_facets && return Ptr{Cint}(x + 2568) + f === :num_vertices && return Ptr{Cint}(x + 2572) + f === :num_outside && return Ptr{Cint}(x + 2576) + f === :num_good && return Ptr{Cint}(x + 2580) + f === :facet_id && return Ptr{Cuint}(x + 2584) + f === :ridge_id && return Ptr{Cuint}(x + 2588) + f === :vertex_id && return Ptr{Cuint}(x + 2592) + f === :first_newfacet && return Ptr{Cuint}(x + 2596) + f === :hulltime && return Ptr{Culong}(x + 2600) + f === :ALLOWrestart && return Ptr{Cuint}(x + 2608) + f === :build_cnt && return Ptr{Cint}(x + 2612) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 2616) + f === :furthest_id && return Ptr{Cint}(x + 2620) + f === :last_errcode && return Ptr{Cint}(x + 2624) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2632) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2640) + f === :hasAreaVolume && return Ptr{Cuint}(x + 2648) + f === :hasTriangulation && return Ptr{Cuint}(x + 2652) + f === :isRenameVertex && return Ptr{Cuint}(x + 2656) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 2664) + f === :maxoutdone && return Ptr{Cuint}(x + 2672) + f === :max_outside && return Ptr{Cdouble}(x + 2680) + f === :max_vertex && return Ptr{Cdouble}(x + 2688) + f === :min_vertex && return Ptr{Cdouble}(x + 2696) + f === :NEWfacets && return Ptr{Cuint}(x + 2704) + f === :NEWtentative && return Ptr{Cuint}(x + 2708) + f === :findbestnew && return Ptr{Cuint}(x + 2712) + f === :findbest_notsharp && return Ptr{Cuint}(x + 2716) + f === :NOerrexit && return Ptr{Cuint}(x + 2720) + f === :PRINTcradius && return Ptr{Cdouble}(x + 2728) + f === :PRINTradius && return Ptr{Cdouble}(x + 2736) + f === :POSTmerging && return Ptr{Cuint}(x + 2744) + f === :printoutvar && return Ptr{Cint}(x + 2748) + f === :printoutnum && return Ptr{Cint}(x + 2752) + f === :repart_facetid && return Ptr{Cuint}(x + 2756) + f === :retry_addpoint && return Ptr{Cint}(x + 2760) + f === :QHULLfinished && return Ptr{Cuint}(x + 2764) + f === :totarea && return Ptr{Cdouble}(x + 2768) + f === :totvol && return Ptr{Cdouble}(x + 2776) + f === :visit_id && return Ptr{Cuint}(x + 2784) + f === :vertex_visit && return Ptr{Cuint}(x + 2788) + f === :WAScoplanar && return Ptr{Cuint}(x + 2792) + f === :ZEROall_ok && return Ptr{Cuint}(x + 2796) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 2800) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 2808) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 2816) + f === :hash_table && return Ptr{Ptr{setT}}(x + 2824) + f === :other_points && return Ptr{Ptr{setT}}(x + 2832) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 2840) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 2848) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 2856) + f === :line && return Ptr{Ptr{Cchar}}(x + 2864) + f === :maxline && return Ptr{Cint}(x + 2872) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 2880) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 2888) + f === :ERREXITcalled && return Ptr{Cuint}(x + 2896) + f === :firstcentrum && return Ptr{Cuint}(x + 2900) + f === :old_randomdist && return Ptr{Cuint}(x + 2904) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 2912) + f === :last_low && return Ptr{Cdouble}(x + 2920) + f === :last_high && return Ptr{Cdouble}(x + 2928) + f === :last_newhigh && return Ptr{Cdouble}(x + 2936) + f === :lastcpu && return Ptr{Cdouble}(x + 2944) + f === :lastfacets && return Ptr{Cint}(x + 2952) + f === :lastmerges && return Ptr{Cint}(x + 2956) + f === :lastplanes && return Ptr{Cint}(x + 2960) + f === :lastdist && return Ptr{Cint}(x + 2964) + f === :lastreport && return Ptr{Cuint}(x + 2968) + f === :mergereport && return Ptr{Cint}(x + 2972) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 2976) + f === :ridgeoutnum && return Ptr{Cint}(x + 2984) + f === :last_random && return Ptr{Cint}(x + 2988) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 2992) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 3192) + f === :rbox_isinteger && return Ptr{Cint}(x + 3232) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 3240) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 3248) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 3256) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 3264) + f === :qhmem && return Ptr{qhmemT}(x + 3272) + f === :qhstat && return Ptr{qhstatT}(x + 3424) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{48, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 8) + f === :point && return Ptr{Ptr{Cdouble}}(x + 16) + f === :neighbors && return Ptr{Ptr{setT}}(x + 24) + f === :id && return Ptr{Cuint}(x + 32) + f === :visitid && return Ptr{Cuint}(x + 36) + f === :seen && return Ptr{Cuint}(x + 40) + f === :seen2 && return (Ptr{Cuint}(x + 40), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 40), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 40), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 40), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 40), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_9 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_9}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_9, f::Symbol) + r = Ref{__JL_Ctag_9}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_9}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_9}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/lib/x86_64-linux-musl.jl b/lib/x86_64-linux-musl.jl new file mode 100644 index 0000000..7a98f4c --- /dev/null +++ b/lib/x86_64-linux-musl.jl @@ -0,0 +1,1942 @@ +const __jmp_buf = NTuple{8, Culong} + +struct __jmp_buf_tag + __jb::__jmp_buf + __fl::Culong + __ss::NTuple{16, Culong} +end + +const jmp_buf = NTuple{1, __jmp_buf_tag} + +const countT = Cint + +struct setelemT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 8) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{120, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_4}(x + 32) + f === :center && return Ptr{Ptr{Cdouble}}(x + 40) + f === :previous && return Ptr{Ptr{facetT}}(x + 48) + f === :next && return Ptr{Ptr{facetT}}(x + 56) + f === :vertices && return Ptr{Ptr{setT}}(x + 64) + f === :ridges && return Ptr{Ptr{setT}}(x + 72) + f === :neighbors && return Ptr{Ptr{setT}}(x + 80) + f === :outsideset && return Ptr{Ptr{setT}}(x + 88) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 96) + f === :visitid && return Ptr{Cuint}(x + 104) + f === :id && return Ptr{Cuint}(x + 108) + f === :nummerge && return Ptr{Cuint}(x + 112) + f === :tricoplanar && return (Ptr{Cuint}(x + 113), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 113), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 113), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 113), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 113), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 113), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 113), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 114) + f === :upperdelaunay && return (Ptr{Cuint}(x + 114), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 114), 2, 1) + f === :good && return (Ptr{Cuint}(x + 114), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 114), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 114), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 114), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 114), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 115) + f === :mergehorizon && return (Ptr{Cuint}(x + 115), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 115), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 115), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 115), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 115), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 115), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 115), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{32, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 8) + f === :bottom && return Ptr{Ptr{facetT}}(x + 16) + f === :id && return Ptr{Cuint}(x + 24) + f === :seen && return Ptr{Cuint}(x + 28) + f === :tested && return (Ptr{Cuint}(x + 28), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 28), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 28), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 28), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 28), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 28), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 112) + f === :GOODvertex && return Ptr{Cint}(x + 116) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 120) + f === :HALFspace && return Ptr{Cuint}(x + 128) + f === :ISqhullQh && return Ptr{Cuint}(x + 132) + f === :IStracing && return Ptr{Cint}(x + 136) + f === :KEEParea && return Ptr{Cint}(x + 140) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 144) + f === :KEEPinside && return Ptr{Cuint}(x + 148) + f === :KEEPmerge && return Ptr{Cint}(x + 152) + f === :KEEPminArea && return Ptr{Cdouble}(x + 160) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 168) + f === :MAXwide && return Ptr{Cint}(x + 176) + f === :MERGEexact && return Ptr{Cuint}(x + 180) + f === :MERGEindependent && return Ptr{Cuint}(x + 184) + f === :MERGING && return Ptr{Cuint}(x + 188) + f === :premerge_centrum && return Ptr{Cdouble}(x + 192) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 200) + f === :MERGEpinched && return Ptr{Cuint}(x + 208) + f === :MERGEvertices && return Ptr{Cuint}(x + 212) + f === :MINvisible && return Ptr{Cdouble}(x + 216) + f === :NOnarrow && return Ptr{Cuint}(x + 224) + f === :NOnearinside && return Ptr{Cuint}(x + 228) + f === :NOpremerge && return Ptr{Cuint}(x + 232) + f === :ONLYgood && return Ptr{Cuint}(x + 236) + f === :ONLYmax && return Ptr{Cuint}(x + 240) + f === :PICKfurthest && return Ptr{Cuint}(x + 244) + f === :POSTmerge && return Ptr{Cuint}(x + 248) + f === :PREmerge && return Ptr{Cuint}(x + 252) + f === :PRINTcentrums && return Ptr{Cuint}(x + 256) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 260) + f === :PRINTdim && return Ptr{Cint}(x + 264) + f === :PRINTdots && return Ptr{Cuint}(x + 268) + f === :PRINTgood && return Ptr{Cuint}(x + 272) + f === :PRINTinner && return Ptr{Cuint}(x + 276) + f === :PRINTneighbors && return Ptr{Cuint}(x + 280) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 284) + f === :PRINToptions1st && return Ptr{Cuint}(x + 288) + f === :PRINTouter && return Ptr{Cuint}(x + 292) + f === :PRINTprecision && return Ptr{Cuint}(x + 296) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 300) + f === :PRINTridges && return Ptr{Cuint}(x + 416) + f === :PRINTspheres && return Ptr{Cuint}(x + 420) + f === :PRINTstatistics && return Ptr{Cuint}(x + 424) + f === :PRINTsummary && return Ptr{Cuint}(x + 428) + f === :PRINTtransparent && return Ptr{Cuint}(x + 432) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 436) + f === :PROJECTinput && return Ptr{Cint}(x + 440) + f === :RANDOMdist && return Ptr{Cuint}(x + 444) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 448) + f === :RANDOMa && return Ptr{Cdouble}(x + 456) + f === :RANDOMb && return Ptr{Cdouble}(x + 464) + f === :RANDOMoutside && return Ptr{Cuint}(x + 472) + f === :REPORTfreq && return Ptr{Cint}(x + 476) + f === :REPORTfreq2 && return Ptr{Cint}(x + 480) + f === :RERUN && return Ptr{Cint}(x + 484) + f === :ROTATErandom && return Ptr{Cint}(x + 488) + f === :SCALEinput && return Ptr{Cuint}(x + 492) + f === :SCALElast && return Ptr{Cuint}(x + 496) + f === :SETroundoff && return Ptr{Cuint}(x + 500) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 504) + f === :SKIPconvex && return Ptr{Cuint}(x + 508) + f === :SPLITthresholds && return Ptr{Cuint}(x + 512) + f === :STOPadd && return Ptr{Cint}(x + 516) + f === :STOPcone && return Ptr{Cint}(x + 520) + f === :STOPpoint && return Ptr{Cint}(x + 524) + f === :TESTpoints && return Ptr{Cint}(x + 528) + f === :TESTvneighbors && return Ptr{Cuint}(x + 532) + f === :TRACElevel && return Ptr{Cint}(x + 536) + f === :TRACElastrun && return Ptr{Cint}(x + 540) + f === :TRACEpoint && return Ptr{Cint}(x + 544) + f === :TRACEdist && return Ptr{Cdouble}(x + 552) + f === :TRACEmerge && return Ptr{Cint}(x + 560) + f === :TRIangulate && return Ptr{Cuint}(x + 564) + f === :TRInormals && return Ptr{Cuint}(x + 568) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 572) + f === :USEstdout && return Ptr{Cuint}(x + 576) + f === :VERIFYoutput && return Ptr{Cuint}(x + 580) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 584) + f === :VORONOI && return Ptr{Cuint}(x + 588) + f === :AREAfactor && return Ptr{Cdouble}(x + 592) + f === :DOcheckmax && return Ptr{Cuint}(x + 600) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 608) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 616) + f === :GETarea && return Ptr{Cuint}(x + 624) + f === :KEEPnearinside && return Ptr{Cuint}(x + 628) + f === :hull_dim && return Ptr{Cint}(x + 632) + f === :input_dim && return Ptr{Cint}(x + 636) + f === :num_points && return Ptr{Cint}(x + 640) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 648) + f === :POINTSmalloc && return Ptr{Cuint}(x + 656) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 664) + f === :input_malloc && return Ptr{Cuint}(x + 672) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 676) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 932) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 936) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1192) + f === :qhull_optionlen && return Ptr{Cint}(x + 1704) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1708) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1712) + f === :run_id && return Ptr{Cint}(x + 1716) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1720) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1724) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1728) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1736) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1744) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1752) + f === :ANGLEround && return Ptr{Cdouble}(x + 1760) + f === :centrum_radius && return Ptr{Cdouble}(x + 1768) + f === :cos_max && return Ptr{Cdouble}(x + 1776) + f === :DISTround && return Ptr{Cdouble}(x + 1784) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1792) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1800) + f === :MAXoutside && return Ptr{Cdouble}(x + 1808) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1816) + f === :MAXwidth && return Ptr{Cdouble}(x + 1824) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1832) + f === :MINdenom && return Ptr{Cdouble}(x + 1840) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1848) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1856) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1864) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1872) + f === :NEARinside && return Ptr{Cdouble}(x + 1880) + f === :ONEmerge && return Ptr{Cdouble}(x + 1888) + f === :outside_err && return Ptr{Cdouble}(x + 1896) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1904) + f === :NARROWhull && return Ptr{Cuint}(x + 1912) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1916) + f === :errexit && return Ptr{jmp_buf}(x + 1928) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2128) + f === :restartexit && return Ptr{jmp_buf}(x + 2168) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2368) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2408) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2416) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2424) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2432) + f === :normal_size && return Ptr{Cint}(x + 2440) + f === :center_size && return Ptr{Cint}(x + 2444) + f === :TEMPsize && return Ptr{Cint}(x + 2448) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 2456) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2464) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 2472) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2480) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 2488) + f === :num_visible && return Ptr{Cint}(x + 2496) + f === :tracefacet_id && return Ptr{Cuint}(x + 2500) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2504) + f === :traceridge_id && return Ptr{Cuint}(x + 2512) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2520) + f === :tracevertex_id && return Ptr{Cuint}(x + 2528) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2536) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2544) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2552) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2560) + f === :num_facets && return Ptr{Cint}(x + 2568) + f === :num_vertices && return Ptr{Cint}(x + 2572) + f === :num_outside && return Ptr{Cint}(x + 2576) + f === :num_good && return Ptr{Cint}(x + 2580) + f === :facet_id && return Ptr{Cuint}(x + 2584) + f === :ridge_id && return Ptr{Cuint}(x + 2588) + f === :vertex_id && return Ptr{Cuint}(x + 2592) + f === :first_newfacet && return Ptr{Cuint}(x + 2596) + f === :hulltime && return Ptr{Culong}(x + 2600) + f === :ALLOWrestart && return Ptr{Cuint}(x + 2608) + f === :build_cnt && return Ptr{Cint}(x + 2612) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 2616) + f === :furthest_id && return Ptr{Cint}(x + 2620) + f === :last_errcode && return Ptr{Cint}(x + 2624) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2632) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2640) + f === :hasAreaVolume && return Ptr{Cuint}(x + 2648) + f === :hasTriangulation && return Ptr{Cuint}(x + 2652) + f === :isRenameVertex && return Ptr{Cuint}(x + 2656) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 2664) + f === :maxoutdone && return Ptr{Cuint}(x + 2672) + f === :max_outside && return Ptr{Cdouble}(x + 2680) + f === :max_vertex && return Ptr{Cdouble}(x + 2688) + f === :min_vertex && return Ptr{Cdouble}(x + 2696) + f === :NEWfacets && return Ptr{Cuint}(x + 2704) + f === :NEWtentative && return Ptr{Cuint}(x + 2708) + f === :findbestnew && return Ptr{Cuint}(x + 2712) + f === :findbest_notsharp && return Ptr{Cuint}(x + 2716) + f === :NOerrexit && return Ptr{Cuint}(x + 2720) + f === :PRINTcradius && return Ptr{Cdouble}(x + 2728) + f === :PRINTradius && return Ptr{Cdouble}(x + 2736) + f === :POSTmerging && return Ptr{Cuint}(x + 2744) + f === :printoutvar && return Ptr{Cint}(x + 2748) + f === :printoutnum && return Ptr{Cint}(x + 2752) + f === :repart_facetid && return Ptr{Cuint}(x + 2756) + f === :retry_addpoint && return Ptr{Cint}(x + 2760) + f === :QHULLfinished && return Ptr{Cuint}(x + 2764) + f === :totarea && return Ptr{Cdouble}(x + 2768) + f === :totvol && return Ptr{Cdouble}(x + 2776) + f === :visit_id && return Ptr{Cuint}(x + 2784) + f === :vertex_visit && return Ptr{Cuint}(x + 2788) + f === :WAScoplanar && return Ptr{Cuint}(x + 2792) + f === :ZEROall_ok && return Ptr{Cuint}(x + 2796) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 2800) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 2808) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 2816) + f === :hash_table && return Ptr{Ptr{setT}}(x + 2824) + f === :other_points && return Ptr{Ptr{setT}}(x + 2832) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 2840) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 2848) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 2856) + f === :line && return Ptr{Ptr{Cchar}}(x + 2864) + f === :maxline && return Ptr{Cint}(x + 2872) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 2880) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 2888) + f === :ERREXITcalled && return Ptr{Cuint}(x + 2896) + f === :firstcentrum && return Ptr{Cuint}(x + 2900) + f === :old_randomdist && return Ptr{Cuint}(x + 2904) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 2912) + f === :last_low && return Ptr{Cdouble}(x + 2920) + f === :last_high && return Ptr{Cdouble}(x + 2928) + f === :last_newhigh && return Ptr{Cdouble}(x + 2936) + f === :lastcpu && return Ptr{Cdouble}(x + 2944) + f === :lastfacets && return Ptr{Cint}(x + 2952) + f === :lastmerges && return Ptr{Cint}(x + 2956) + f === :lastplanes && return Ptr{Cint}(x + 2960) + f === :lastdist && return Ptr{Cint}(x + 2964) + f === :lastreport && return Ptr{Cuint}(x + 2968) + f === :mergereport && return Ptr{Cint}(x + 2972) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 2976) + f === :ridgeoutnum && return Ptr{Cint}(x + 2984) + f === :last_random && return Ptr{Cint}(x + 2988) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 2992) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 3192) + f === :rbox_isinteger && return Ptr{Cint}(x + 3232) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 3240) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 3248) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 3256) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 3264) + f === :qhmem && return Ptr{qhmemT}(x + 3272) + f === :qhstat && return Ptr{qhstatT}(x + 3424) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{48, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 8) + f === :point && return Ptr{Ptr{Cdouble}}(x + 16) + f === :neighbors && return Ptr{Ptr{setT}}(x + 24) + f === :id && return Ptr{Cuint}(x + 32) + f === :visitid && return Ptr{Cuint}(x + 36) + f === :seen && return Ptr{Cuint}(x + 40) + f === :seen2 && return (Ptr{Cuint}(x + 40), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 40), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 40), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 40), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 40), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_4 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_4}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_4, f::Symbol) + r = Ref{__JL_Ctag_4}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_4}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_4}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/lib/x86_64-unknown-freebsd11.1.jl b/lib/x86_64-unknown-freebsd11.1.jl new file mode 100644 index 0000000..5847c7d --- /dev/null +++ b/lib/x86_64-unknown-freebsd11.1.jl @@ -0,0 +1,1938 @@ +struct _jmp_buf + _jb::NTuple{12, Clong} +end + +const jmp_buf = NTuple{1, _jmp_buf} + +const countT = Cint + +struct setelemT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 8) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{120, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_7}(x + 32) + f === :center && return Ptr{Ptr{Cdouble}}(x + 40) + f === :previous && return Ptr{Ptr{facetT}}(x + 48) + f === :next && return Ptr{Ptr{facetT}}(x + 56) + f === :vertices && return Ptr{Ptr{setT}}(x + 64) + f === :ridges && return Ptr{Ptr{setT}}(x + 72) + f === :neighbors && return Ptr{Ptr{setT}}(x + 80) + f === :outsideset && return Ptr{Ptr{setT}}(x + 88) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 96) + f === :visitid && return Ptr{Cuint}(x + 104) + f === :id && return Ptr{Cuint}(x + 108) + f === :nummerge && return Ptr{Cuint}(x + 112) + f === :tricoplanar && return (Ptr{Cuint}(x + 113), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 113), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 113), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 113), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 113), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 113), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 113), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 114) + f === :upperdelaunay && return (Ptr{Cuint}(x + 114), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 114), 2, 1) + f === :good && return (Ptr{Cuint}(x + 114), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 114), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 114), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 114), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 114), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 115) + f === :mergehorizon && return (Ptr{Cuint}(x + 115), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 115), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 115), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 115), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 115), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 115), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 115), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{32, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 8) + f === :bottom && return Ptr{Ptr{facetT}}(x + 16) + f === :id && return Ptr{Cuint}(x + 24) + f === :seen && return Ptr{Cuint}(x + 28) + f === :tested && return (Ptr{Cuint}(x + 28), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 28), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 28), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 28), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 28), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 28), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 112) + f === :GOODvertex && return Ptr{Cint}(x + 116) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 120) + f === :HALFspace && return Ptr{Cuint}(x + 128) + f === :ISqhullQh && return Ptr{Cuint}(x + 132) + f === :IStracing && return Ptr{Cint}(x + 136) + f === :KEEParea && return Ptr{Cint}(x + 140) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 144) + f === :KEEPinside && return Ptr{Cuint}(x + 148) + f === :KEEPmerge && return Ptr{Cint}(x + 152) + f === :KEEPminArea && return Ptr{Cdouble}(x + 160) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 168) + f === :MAXwide && return Ptr{Cint}(x + 176) + f === :MERGEexact && return Ptr{Cuint}(x + 180) + f === :MERGEindependent && return Ptr{Cuint}(x + 184) + f === :MERGING && return Ptr{Cuint}(x + 188) + f === :premerge_centrum && return Ptr{Cdouble}(x + 192) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 200) + f === :MERGEpinched && return Ptr{Cuint}(x + 208) + f === :MERGEvertices && return Ptr{Cuint}(x + 212) + f === :MINvisible && return Ptr{Cdouble}(x + 216) + f === :NOnarrow && return Ptr{Cuint}(x + 224) + f === :NOnearinside && return Ptr{Cuint}(x + 228) + f === :NOpremerge && return Ptr{Cuint}(x + 232) + f === :ONLYgood && return Ptr{Cuint}(x + 236) + f === :ONLYmax && return Ptr{Cuint}(x + 240) + f === :PICKfurthest && return Ptr{Cuint}(x + 244) + f === :POSTmerge && return Ptr{Cuint}(x + 248) + f === :PREmerge && return Ptr{Cuint}(x + 252) + f === :PRINTcentrums && return Ptr{Cuint}(x + 256) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 260) + f === :PRINTdim && return Ptr{Cint}(x + 264) + f === :PRINTdots && return Ptr{Cuint}(x + 268) + f === :PRINTgood && return Ptr{Cuint}(x + 272) + f === :PRINTinner && return Ptr{Cuint}(x + 276) + f === :PRINTneighbors && return Ptr{Cuint}(x + 280) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 284) + f === :PRINToptions1st && return Ptr{Cuint}(x + 288) + f === :PRINTouter && return Ptr{Cuint}(x + 292) + f === :PRINTprecision && return Ptr{Cuint}(x + 296) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 300) + f === :PRINTridges && return Ptr{Cuint}(x + 416) + f === :PRINTspheres && return Ptr{Cuint}(x + 420) + f === :PRINTstatistics && return Ptr{Cuint}(x + 424) + f === :PRINTsummary && return Ptr{Cuint}(x + 428) + f === :PRINTtransparent && return Ptr{Cuint}(x + 432) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 436) + f === :PROJECTinput && return Ptr{Cint}(x + 440) + f === :RANDOMdist && return Ptr{Cuint}(x + 444) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 448) + f === :RANDOMa && return Ptr{Cdouble}(x + 456) + f === :RANDOMb && return Ptr{Cdouble}(x + 464) + f === :RANDOMoutside && return Ptr{Cuint}(x + 472) + f === :REPORTfreq && return Ptr{Cint}(x + 476) + f === :REPORTfreq2 && return Ptr{Cint}(x + 480) + f === :RERUN && return Ptr{Cint}(x + 484) + f === :ROTATErandom && return Ptr{Cint}(x + 488) + f === :SCALEinput && return Ptr{Cuint}(x + 492) + f === :SCALElast && return Ptr{Cuint}(x + 496) + f === :SETroundoff && return Ptr{Cuint}(x + 500) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 504) + f === :SKIPconvex && return Ptr{Cuint}(x + 508) + f === :SPLITthresholds && return Ptr{Cuint}(x + 512) + f === :STOPadd && return Ptr{Cint}(x + 516) + f === :STOPcone && return Ptr{Cint}(x + 520) + f === :STOPpoint && return Ptr{Cint}(x + 524) + f === :TESTpoints && return Ptr{Cint}(x + 528) + f === :TESTvneighbors && return Ptr{Cuint}(x + 532) + f === :TRACElevel && return Ptr{Cint}(x + 536) + f === :TRACElastrun && return Ptr{Cint}(x + 540) + f === :TRACEpoint && return Ptr{Cint}(x + 544) + f === :TRACEdist && return Ptr{Cdouble}(x + 552) + f === :TRACEmerge && return Ptr{Cint}(x + 560) + f === :TRIangulate && return Ptr{Cuint}(x + 564) + f === :TRInormals && return Ptr{Cuint}(x + 568) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 572) + f === :USEstdout && return Ptr{Cuint}(x + 576) + f === :VERIFYoutput && return Ptr{Cuint}(x + 580) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 584) + f === :VORONOI && return Ptr{Cuint}(x + 588) + f === :AREAfactor && return Ptr{Cdouble}(x + 592) + f === :DOcheckmax && return Ptr{Cuint}(x + 600) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 608) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 616) + f === :GETarea && return Ptr{Cuint}(x + 624) + f === :KEEPnearinside && return Ptr{Cuint}(x + 628) + f === :hull_dim && return Ptr{Cint}(x + 632) + f === :input_dim && return Ptr{Cint}(x + 636) + f === :num_points && return Ptr{Cint}(x + 640) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 648) + f === :POINTSmalloc && return Ptr{Cuint}(x + 656) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 664) + f === :input_malloc && return Ptr{Cuint}(x + 672) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 676) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 932) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 936) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1192) + f === :qhull_optionlen && return Ptr{Cint}(x + 1704) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1708) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1712) + f === :run_id && return Ptr{Cint}(x + 1716) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1720) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1724) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1728) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1736) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1744) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1752) + f === :ANGLEround && return Ptr{Cdouble}(x + 1760) + f === :centrum_radius && return Ptr{Cdouble}(x + 1768) + f === :cos_max && return Ptr{Cdouble}(x + 1776) + f === :DISTround && return Ptr{Cdouble}(x + 1784) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1792) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1800) + f === :MAXoutside && return Ptr{Cdouble}(x + 1808) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1816) + f === :MAXwidth && return Ptr{Cdouble}(x + 1824) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1832) + f === :MINdenom && return Ptr{Cdouble}(x + 1840) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1848) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1856) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1864) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1872) + f === :NEARinside && return Ptr{Cdouble}(x + 1880) + f === :ONEmerge && return Ptr{Cdouble}(x + 1888) + f === :outside_err && return Ptr{Cdouble}(x + 1896) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1904) + f === :NARROWhull && return Ptr{Cuint}(x + 1912) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1916) + f === :errexit && return Ptr{jmp_buf}(x + 1928) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2024) + f === :restartexit && return Ptr{jmp_buf}(x + 2064) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2160) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2200) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2208) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2216) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2224) + f === :normal_size && return Ptr{Cint}(x + 2232) + f === :center_size && return Ptr{Cint}(x + 2236) + f === :TEMPsize && return Ptr{Cint}(x + 2240) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 2248) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2256) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 2264) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2272) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 2280) + f === :num_visible && return Ptr{Cint}(x + 2288) + f === :tracefacet_id && return Ptr{Cuint}(x + 2292) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2296) + f === :traceridge_id && return Ptr{Cuint}(x + 2304) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2312) + f === :tracevertex_id && return Ptr{Cuint}(x + 2320) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2328) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2336) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2344) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2352) + f === :num_facets && return Ptr{Cint}(x + 2360) + f === :num_vertices && return Ptr{Cint}(x + 2364) + f === :num_outside && return Ptr{Cint}(x + 2368) + f === :num_good && return Ptr{Cint}(x + 2372) + f === :facet_id && return Ptr{Cuint}(x + 2376) + f === :ridge_id && return Ptr{Cuint}(x + 2380) + f === :vertex_id && return Ptr{Cuint}(x + 2384) + f === :first_newfacet && return Ptr{Cuint}(x + 2388) + f === :hulltime && return Ptr{Culong}(x + 2392) + f === :ALLOWrestart && return Ptr{Cuint}(x + 2400) + f === :build_cnt && return Ptr{Cint}(x + 2404) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 2408) + f === :furthest_id && return Ptr{Cint}(x + 2412) + f === :last_errcode && return Ptr{Cint}(x + 2416) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2424) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2432) + f === :hasAreaVolume && return Ptr{Cuint}(x + 2440) + f === :hasTriangulation && return Ptr{Cuint}(x + 2444) + f === :isRenameVertex && return Ptr{Cuint}(x + 2448) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 2456) + f === :maxoutdone && return Ptr{Cuint}(x + 2464) + f === :max_outside && return Ptr{Cdouble}(x + 2472) + f === :max_vertex && return Ptr{Cdouble}(x + 2480) + f === :min_vertex && return Ptr{Cdouble}(x + 2488) + f === :NEWfacets && return Ptr{Cuint}(x + 2496) + f === :NEWtentative && return Ptr{Cuint}(x + 2500) + f === :findbestnew && return Ptr{Cuint}(x + 2504) + f === :findbest_notsharp && return Ptr{Cuint}(x + 2508) + f === :NOerrexit && return Ptr{Cuint}(x + 2512) + f === :PRINTcradius && return Ptr{Cdouble}(x + 2520) + f === :PRINTradius && return Ptr{Cdouble}(x + 2528) + f === :POSTmerging && return Ptr{Cuint}(x + 2536) + f === :printoutvar && return Ptr{Cint}(x + 2540) + f === :printoutnum && return Ptr{Cint}(x + 2544) + f === :repart_facetid && return Ptr{Cuint}(x + 2548) + f === :retry_addpoint && return Ptr{Cint}(x + 2552) + f === :QHULLfinished && return Ptr{Cuint}(x + 2556) + f === :totarea && return Ptr{Cdouble}(x + 2560) + f === :totvol && return Ptr{Cdouble}(x + 2568) + f === :visit_id && return Ptr{Cuint}(x + 2576) + f === :vertex_visit && return Ptr{Cuint}(x + 2580) + f === :WAScoplanar && return Ptr{Cuint}(x + 2584) + f === :ZEROall_ok && return Ptr{Cuint}(x + 2588) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 2592) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 2600) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 2608) + f === :hash_table && return Ptr{Ptr{setT}}(x + 2616) + f === :other_points && return Ptr{Ptr{setT}}(x + 2624) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 2632) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 2640) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 2648) + f === :line && return Ptr{Ptr{Cchar}}(x + 2656) + f === :maxline && return Ptr{Cint}(x + 2664) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 2672) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 2680) + f === :ERREXITcalled && return Ptr{Cuint}(x + 2688) + f === :firstcentrum && return Ptr{Cuint}(x + 2692) + f === :old_randomdist && return Ptr{Cuint}(x + 2696) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 2704) + f === :last_low && return Ptr{Cdouble}(x + 2712) + f === :last_high && return Ptr{Cdouble}(x + 2720) + f === :last_newhigh && return Ptr{Cdouble}(x + 2728) + f === :lastcpu && return Ptr{Cdouble}(x + 2736) + f === :lastfacets && return Ptr{Cint}(x + 2744) + f === :lastmerges && return Ptr{Cint}(x + 2748) + f === :lastplanes && return Ptr{Cint}(x + 2752) + f === :lastdist && return Ptr{Cint}(x + 2756) + f === :lastreport && return Ptr{Cuint}(x + 2760) + f === :mergereport && return Ptr{Cint}(x + 2764) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 2768) + f === :ridgeoutnum && return Ptr{Cint}(x + 2776) + f === :last_random && return Ptr{Cint}(x + 2780) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 2784) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 2880) + f === :rbox_isinteger && return Ptr{Cint}(x + 2920) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 2928) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 2936) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 2944) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 2952) + f === :qhmem && return Ptr{qhmemT}(x + 2960) + f === :qhstat && return Ptr{qhstatT}(x + 3112) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{48, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 8) + f === :point && return Ptr{Ptr{Cdouble}}(x + 16) + f === :neighbors && return Ptr{Ptr{setT}}(x + 24) + f === :id && return Ptr{Cuint}(x + 32) + f === :visitid && return Ptr{Cuint}(x + 36) + f === :seen && return Ptr{Cuint}(x + 40) + f === :seen2 && return (Ptr{Cuint}(x + 40), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 40), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 40), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 40), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 40), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_7 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_7}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_7, f::Symbol) + r = Ref{__JL_Ctag_7}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_7}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_7}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/lib/x86_64-w64-mingw32.jl b/lib/x86_64-w64-mingw32.jl new file mode 100644 index 0000000..7bdd520 --- /dev/null +++ b/lib/x86_64-w64-mingw32.jl @@ -0,0 +1,1958 @@ +struct _SETJMP_FLOAT128 + data::NTuple{16, UInt8} +end + +function Base.getproperty(x::Ptr{_SETJMP_FLOAT128}, f::Symbol) + f === :Part && return Ptr{NTuple{2, Culonglong}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::_SETJMP_FLOAT128, f::Symbol) + r = Ref{_SETJMP_FLOAT128}(x) + ptr = Base.unsafe_convert(Ptr{_SETJMP_FLOAT128}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{_SETJMP_FLOAT128}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const SETJMP_FLOAT128 = _SETJMP_FLOAT128 + +const _JBTYPE = SETJMP_FLOAT128 + +const jmp_buf = NTuple{16, _JBTYPE} + +const countT = Cint + +struct setelemT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{setelemT}, f::Symbol) + f === :p && return Ptr{Ptr{Cvoid}}(x + 0) + f === :i && return Ptr{Cint}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::setelemT, f::Symbol) + r = Ref{setelemT}(x) + ptr = Base.unsafe_convert(Ptr{setelemT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct setT + maxsize::Cint + e::NTuple{1, setelemT} +end + +function Base.getproperty(x::Ptr{setT}, f::Symbol) + f === :maxsize && return Ptr{Cint}(x + 0) + f === :e && return Ptr{NTuple{1, setelemT}}(x + 8) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_PRINT::UInt32 begin + qh_PRINTnone = 0 + qh_PRINTarea = 1 + qh_PRINTaverage = 2 + qh_PRINTcoplanars = 3 + qh_PRINTcentrums = 4 + qh_PRINTfacets = 5 + qh_PRINTfacets_xridge = 6 + qh_PRINTgeom = 7 + qh_PRINTids = 8 + qh_PRINTinner = 9 + qh_PRINTneighbors = 10 + qh_PRINTnormals = 11 + qh_PRINTouter = 12 + qh_PRINTmaple = 13 + qh_PRINTincidences = 14 + qh_PRINTmathematica = 15 + qh_PRINTmerges = 16 + qh_PRINToff = 17 + qh_PRINToptions = 18 + qh_PRINTpointintersect = 19 + qh_PRINTpointnearest = 20 + qh_PRINTpoints = 21 + qh_PRINTqhull = 22 + qh_PRINTsize = 23 + qh_PRINTsummary = 24 + qh_PRINTtriangles = 25 + qh_PRINTvertices = 26 + qh_PRINTvneighbors = 27 + qh_PRINTextremes = 28 + qh_PRINTEND = 29 +end + +struct facetT + data::NTuple{120, UInt8} +end + +function Base.getproperty(x::Ptr{facetT}, f::Symbol) + f === :furthestdist && return Ptr{Cdouble}(x + 0) + f === :maxoutside && return Ptr{Cdouble}(x + 8) + f === :offset && return Ptr{Cdouble}(x + 16) + f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) + f === :f && return Ptr{__JL_Ctag_4}(x + 32) + f === :center && return Ptr{Ptr{Cdouble}}(x + 40) + f === :previous && return Ptr{Ptr{facetT}}(x + 48) + f === :next && return Ptr{Ptr{facetT}}(x + 56) + f === :vertices && return Ptr{Ptr{setT}}(x + 64) + f === :ridges && return Ptr{Ptr{setT}}(x + 72) + f === :neighbors && return Ptr{Ptr{setT}}(x + 80) + f === :outsideset && return Ptr{Ptr{setT}}(x + 88) + f === :coplanarset && return Ptr{Ptr{setT}}(x + 96) + f === :visitid && return Ptr{Cuint}(x + 104) + f === :id && return Ptr{Cuint}(x + 108) + f === :nummerge && return Ptr{Cuint}(x + 112) + f === :tricoplanar && return (Ptr{Cuint}(x + 113), 1, 1) + f === :newfacet && return (Ptr{Cuint}(x + 113), 2, 1) + f === :visible && return (Ptr{Cuint}(x + 113), 3, 1) + f === :toporient && return (Ptr{Cuint}(x + 113), 4, 1) + f === :simplicial && return (Ptr{Cuint}(x + 113), 5, 1) + f === :seen && return (Ptr{Cuint}(x + 113), 6, 1) + f === :seen2 && return (Ptr{Cuint}(x + 113), 7, 1) + f === :flipped && return Ptr{Cuint}(x + 114) + f === :upperdelaunay && return (Ptr{Cuint}(x + 114), 1, 1) + f === :notfurthest && return (Ptr{Cuint}(x + 114), 2, 1) + f === :good && return (Ptr{Cuint}(x + 114), 3, 1) + f === :isarea && return (Ptr{Cuint}(x + 114), 4, 1) + f === :dupridge && return (Ptr{Cuint}(x + 114), 5, 1) + f === :mergeridge && return (Ptr{Cuint}(x + 114), 6, 1) + f === :mergeridge2 && return (Ptr{Cuint}(x + 114), 7, 1) + f === :coplanarhorizon && return Ptr{Cuint}(x + 115) + f === :mergehorizon && return (Ptr{Cuint}(x + 115), 1, 1) + f === :cycledone && return (Ptr{Cuint}(x + 115), 2, 1) + f === :tested && return (Ptr{Cuint}(x + 115), 3, 1) + f === :keepcentrum && return (Ptr{Cuint}(x + 115), 4, 1) + f === :newmerge && return (Ptr{Cuint}(x + 115), 5, 1) + f === :degenerate && return (Ptr{Cuint}(x + 115), 6, 1) + f === :redundant && return (Ptr{Cuint}(x + 115), 7, 1) + return getfield(x, f) +end + +function Base.getproperty(x::facetT, f::Symbol) + r = Ref{facetT}(x) + ptr = Base.unsafe_convert(Ptr{facetT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct ridgeT + data::NTuple{32, UInt8} +end + +function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) + f === :vertices && return Ptr{Ptr{setT}}(x + 0) + f === :top && return Ptr{Ptr{facetT}}(x + 8) + f === :bottom && return Ptr{Ptr{facetT}}(x + 16) + f === :id && return Ptr{Cuint}(x + 24) + f === :seen && return Ptr{Cuint}(x + 28) + f === :tested && return (Ptr{Cuint}(x + 28), 1, 1) + f === :nonconvex && return (Ptr{Cuint}(x + 28), 2, 1) + f === :mergevertex && return (Ptr{Cuint}(x + 28), 3, 1) + f === :mergevertex2 && return (Ptr{Cuint}(x + 28), 4, 1) + f === :simplicialtop && return (Ptr{Cuint}(x + 28), 5, 1) + f === :simplicialbot && return (Ptr{Cuint}(x + 28), 6, 1) + return getfield(x, f) +end + +function Base.getproperty(x::ridgeT, f::Symbol) + r = Ref{ridgeT}(x) + ptr = Base.unsafe_convert(Ptr{ridgeT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +@enum qh_CENTER::UInt32 begin + qh_ASnone = 0 + qh_ASvoronoi = 1 + qh_AScentrum = 2 +end + +struct qhmemT + BUFsize::Cint + BUFinit::Cint + TABLEsize::Cint + NUMsizes::Cint + LASTsize::Cint + ALIGNmask::Cint + freelists::Ptr{Ptr{Cvoid}} + sizetable::Ptr{Cint} + indextable::Ptr{Cint} + curbuffer::Ptr{Cvoid} + freemem::Ptr{Cvoid} + freesize::Cint + tempstack::Ptr{setT} + ferr::Ptr{Libc.FILE} + IStracing::Cint + cntquick::Cint + cntshort::Cint + cntlong::Cint + freeshort::Cint + freelong::Cint + totbuffer::Cint + totdropped::Cint + totfree::Cint + totlong::Cint + maxlong::Cint + totshort::Cint + totunused::Cint + cntlarger::Cint + totlarger::Cint +end + +struct intrealT + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{intrealT}, f::Symbol) + f === :i && return Ptr{Cint}(x + 0) + f === :r && return Ptr{Cdouble}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::intrealT, f::Symbol) + r = Ref{intrealT}(x) + ptr = Base.unsafe_convert(Ptr{intrealT}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +struct qhstatT + stats::NTuple{249, intrealT} + id::NTuple{259, Cuchar} + doc::NTuple{249, Ptr{Cchar}} + count::NTuple{249, Cshort} + type::NTuple{249, Cchar} + printed::NTuple{249, Cchar} + init::NTuple{9, intrealT} + next::Cint + precision::Cint + vridges::Cint + tempi::Cint + tempr::Cdouble +end + +struct qhT + ALLpoints::Cuint + ALLOWshort::Cuint + ALLOWwarning::Cuint + ALLOWwide::Cuint + ANGLEmerge::Cuint + APPROXhull::Cuint + MINoutside::Cdouble + ANNOTATEoutput::Cuint + ATinfinity::Cuint + AVOIDold::Cuint + BESToutside::Cuint + CDDinput::Cuint + CDDoutput::Cuint + CHECKduplicates::Cuint + CHECKfrequently::Cuint + premerge_cos::Cdouble + postmerge_cos::Cdouble + DELAUNAY::Cuint + DOintersections::Cuint + DROPdim::Cint + FLUSHprint::Cuint + FORCEoutput::Cuint + GOODpoint::Cint + GOODpointp::Ptr{Cdouble} + GOODthreshold::Cuint + GOODvertex::Cint + GOODvertexp::Ptr{Cdouble} + HALFspace::Cuint + ISqhullQh::Cuint + IStracing::Cint + KEEParea::Cint + KEEPcoplanar::Cuint + KEEPinside::Cuint + KEEPmerge::Cint + KEEPminArea::Cdouble + MAXcoplanar::Cdouble + MAXwide::Cint + MERGEexact::Cuint + MERGEindependent::Cuint + MERGING::Cuint + premerge_centrum::Cdouble + postmerge_centrum::Cdouble + MERGEpinched::Cuint + MERGEvertices::Cuint + MINvisible::Cdouble + NOnarrow::Cuint + NOnearinside::Cuint + NOpremerge::Cuint + ONLYgood::Cuint + ONLYmax::Cuint + PICKfurthest::Cuint + POSTmerge::Cuint + PREmerge::Cuint + PRINTcentrums::Cuint + PRINTcoplanar::Cuint + PRINTdim::Cint + PRINTdots::Cuint + PRINTgood::Cuint + PRINTinner::Cuint + PRINTneighbors::Cuint + PRINTnoplanes::Cuint + PRINToptions1st::Cuint + PRINTouter::Cuint + PRINTprecision::Cuint + PRINTout::NTuple{29, qh_PRINT} + PRINTridges::Cuint + PRINTspheres::Cuint + PRINTstatistics::Cuint + PRINTsummary::Cuint + PRINTtransparent::Cuint + PROJECTdelaunay::Cuint + PROJECTinput::Cint + RANDOMdist::Cuint + RANDOMfactor::Cdouble + RANDOMa::Cdouble + RANDOMb::Cdouble + RANDOMoutside::Cuint + REPORTfreq::Cint + REPORTfreq2::Cint + RERUN::Cint + ROTATErandom::Cint + SCALEinput::Cuint + SCALElast::Cuint + SETroundoff::Cuint + SKIPcheckmax::Cuint + SKIPconvex::Cuint + SPLITthresholds::Cuint + STOPadd::Cint + STOPcone::Cint + STOPpoint::Cint + TESTpoints::Cint + TESTvneighbors::Cuint + TRACElevel::Cint + TRACElastrun::Cint + TRACEpoint::Cint + TRACEdist::Cdouble + TRACEmerge::Cint + TRIangulate::Cuint + TRInormals::Cuint + UPPERdelaunay::Cuint + USEstdout::Cuint + VERIFYoutput::Cuint + VIRTUALmemory::Cuint + VORONOI::Cuint + AREAfactor::Cdouble + DOcheckmax::Cuint + feasible_string::Ptr{Cchar} + feasible_point::Ptr{Cdouble} + GETarea::Cuint + KEEPnearinside::Cuint + hull_dim::Cint + input_dim::Cint + num_points::Cint + first_point::Ptr{Cdouble} + POINTSmalloc::Cuint + input_points::Ptr{Cdouble} + input_malloc::Cuint + qhull_command::NTuple{256, Cchar} + qhull_commandsiz2::Cint + rbox_command::NTuple{256, Cchar} + qhull_options::NTuple{512, Cchar} + qhull_optionlen::Cint + qhull_optionsiz::Cint + qhull_optionsiz2::Cint + run_id::Cint + VERTEXneighbors::Cuint + ZEROcentrum::Cuint + upper_threshold::Ptr{Cdouble} + lower_threshold::Ptr{Cdouble} + upper_bound::Ptr{Cdouble} + lower_bound::Ptr{Cdouble} + ANGLEround::Cdouble + centrum_radius::Cdouble + cos_max::Cdouble + DISTround::Cdouble + MAXabs_coord::Cdouble + MAXlastcoord::Cdouble + MAXoutside::Cdouble + MAXsumcoord::Cdouble + MAXwidth::Cdouble + MINdenom_1::Cdouble + MINdenom::Cdouble + MINdenom_1_2::Cdouble + MINdenom_2::Cdouble + MINlastcoord::Cdouble + NEARzero::Ptr{Cdouble} + NEARinside::Cdouble + ONEmerge::Cdouble + outside_err::Cdouble + WIDEfacet::Cdouble + NARROWhull::Cuint + qhull::NTuple{6, Cchar} + errexit::jmp_buf + jmpXtra::NTuple{40, Cchar} + restartexit::jmp_buf + jmpXtra2::NTuple{40, Cchar} + # fin::Ptr{Libc.FILE} + fin::Ptr{Libc.FILE} + # fout::Ptr{Libc.FILE} + fout::Ptr{Libc.FILE} + # ferr::Ptr{Libc.FILE} + ferr::Ptr{Libc.FILE} + interior_point::Ptr{Cdouble} + normal_size::Cint + center_size::Cint + TEMPsize::Cint + facet_list::Ptr{facetT} + facet_tail::Ptr{facetT} + facet_next::Ptr{facetT} + newfacet_list::Ptr{facetT} + visible_list::Ptr{facetT} + num_visible::Cint + tracefacet_id::Cuint + tracefacet::Ptr{facetT} + traceridge_id::Cuint + traceridge::Ptr{ridgeT} + tracevertex_id::Cuint + # tracevertex::Ptr{vertexT} + tracevertex::Ptr{Cvoid} + # vertex_list::Ptr{vertexT} + vertex_list::Ptr{Cvoid} + # vertex_tail::Ptr{vertexT} + vertex_tail::Ptr{Cvoid} + # newvertex_list::Ptr{vertexT} + newvertex_list::Ptr{Cvoid} + num_facets::Cint + num_vertices::Cint + num_outside::Cint + num_good::Cint + facet_id::Cuint + ridge_id::Cuint + vertex_id::Cuint + first_newfacet::Cuint + hulltime::Culong + ALLOWrestart::Cuint + build_cnt::Cint + CENTERtype::qh_CENTER + furthest_id::Cint + last_errcode::Cint + GOODclosest::Ptr{facetT} + coplanar_apex::Ptr{Cdouble} + hasAreaVolume::Cuint + hasTriangulation::Cuint + isRenameVertex::Cuint + JOGGLEmax::Cdouble + maxoutdone::Cuint + max_outside::Cdouble + max_vertex::Cdouble + min_vertex::Cdouble + NEWfacets::Cuint + NEWtentative::Cuint + findbestnew::Cuint + findbest_notsharp::Cuint + NOerrexit::Cuint + PRINTcradius::Cdouble + PRINTradius::Cdouble + POSTmerging::Cuint + printoutvar::Cint + printoutnum::Cint + repart_facetid::Cuint + retry_addpoint::Cint + QHULLfinished::Cuint + totarea::Cdouble + totvol::Cdouble + visit_id::Cuint + vertex_visit::Cuint + WAScoplanar::Cuint + ZEROall_ok::Cuint + facet_mergeset::Ptr{setT} + degen_mergeset::Ptr{setT} + vertex_mergeset::Ptr{setT} + hash_table::Ptr{setT} + other_points::Ptr{setT} + del_vertices::Ptr{setT} + gm_matrix::Ptr{Cdouble} + gm_row::Ptr{Ptr{Cdouble}} + line::Ptr{Cchar} + maxline::Cint + half_space::Ptr{Cdouble} + temp_malloc::Ptr{Cdouble} + ERREXITcalled::Cuint + firstcentrum::Cuint + old_randomdist::Cuint + coplanarfacetset::Ptr{setT} + last_low::Cdouble + last_high::Cdouble + last_newhigh::Cdouble + lastcpu::Cdouble + lastfacets::Cint + lastmerges::Cint + lastplanes::Cint + lastdist::Cint + lastreport::Cuint + mergereport::Cint + old_tempstack::Ptr{setT} + ridgeoutnum::Cint + last_random::Cint + rbox_errexit::jmp_buf + jmpXtra3::NTuple{40, Cchar} + rbox_isinteger::Cint + rbox_out_offset::Cdouble + cpp_object::Ptr{Cvoid} + cpp_other::Ptr{Cvoid} + cpp_user::Ptr{Cvoid} + qhmem::qhmemT + qhstat::qhstatT +end + +function Base.getproperty(x::qhT, f::Symbol) + f === :fin && return Ptr{Libc.FILE}(getfield(x, f)) + f === :fout && return Ptr{Libc.FILE}(getfield(x, f)) + f === :ferr && return Ptr{Libc.FILE}(getfield(x, f)) + f === :tracevertex && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_list && return Ptr{vertexT}(getfield(x, f)) + f === :vertex_tail && return Ptr{vertexT}(getfield(x, f)) + f === :newvertex_list && return Ptr{vertexT}(getfield(x, f)) + return getfield(x, f) +end + +function Base.getproperty(x::Ptr{qhT}, f::Symbol) + f === :ALLpoints && return Ptr{Cuint}(x + 0) + f === :ALLOWshort && return Ptr{Cuint}(x + 4) + f === :ALLOWwarning && return Ptr{Cuint}(x + 8) + f === :ALLOWwide && return Ptr{Cuint}(x + 12) + f === :ANGLEmerge && return Ptr{Cuint}(x + 16) + f === :APPROXhull && return Ptr{Cuint}(x + 20) + f === :MINoutside && return Ptr{Cdouble}(x + 24) + f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) + f === :ATinfinity && return Ptr{Cuint}(x + 36) + f === :AVOIDold && return Ptr{Cuint}(x + 40) + f === :BESToutside && return Ptr{Cuint}(x + 44) + f === :CDDinput && return Ptr{Cuint}(x + 48) + f === :CDDoutput && return Ptr{Cuint}(x + 52) + f === :CHECKduplicates && return Ptr{Cuint}(x + 56) + f === :CHECKfrequently && return Ptr{Cuint}(x + 60) + f === :premerge_cos && return Ptr{Cdouble}(x + 64) + f === :postmerge_cos && return Ptr{Cdouble}(x + 72) + f === :DELAUNAY && return Ptr{Cuint}(x + 80) + f === :DOintersections && return Ptr{Cuint}(x + 84) + f === :DROPdim && return Ptr{Cint}(x + 88) + f === :FLUSHprint && return Ptr{Cuint}(x + 92) + f === :FORCEoutput && return Ptr{Cuint}(x + 96) + f === :GOODpoint && return Ptr{Cint}(x + 100) + f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) + f === :GOODthreshold && return Ptr{Cuint}(x + 112) + f === :GOODvertex && return Ptr{Cint}(x + 116) + f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 120) + f === :HALFspace && return Ptr{Cuint}(x + 128) + f === :ISqhullQh && return Ptr{Cuint}(x + 132) + f === :IStracing && return Ptr{Cint}(x + 136) + f === :KEEParea && return Ptr{Cint}(x + 140) + f === :KEEPcoplanar && return Ptr{Cuint}(x + 144) + f === :KEEPinside && return Ptr{Cuint}(x + 148) + f === :KEEPmerge && return Ptr{Cint}(x + 152) + f === :KEEPminArea && return Ptr{Cdouble}(x + 160) + f === :MAXcoplanar && return Ptr{Cdouble}(x + 168) + f === :MAXwide && return Ptr{Cint}(x + 176) + f === :MERGEexact && return Ptr{Cuint}(x + 180) + f === :MERGEindependent && return Ptr{Cuint}(x + 184) + f === :MERGING && return Ptr{Cuint}(x + 188) + f === :premerge_centrum && return Ptr{Cdouble}(x + 192) + f === :postmerge_centrum && return Ptr{Cdouble}(x + 200) + f === :MERGEpinched && return Ptr{Cuint}(x + 208) + f === :MERGEvertices && return Ptr{Cuint}(x + 212) + f === :MINvisible && return Ptr{Cdouble}(x + 216) + f === :NOnarrow && return Ptr{Cuint}(x + 224) + f === :NOnearinside && return Ptr{Cuint}(x + 228) + f === :NOpremerge && return Ptr{Cuint}(x + 232) + f === :ONLYgood && return Ptr{Cuint}(x + 236) + f === :ONLYmax && return Ptr{Cuint}(x + 240) + f === :PICKfurthest && return Ptr{Cuint}(x + 244) + f === :POSTmerge && return Ptr{Cuint}(x + 248) + f === :PREmerge && return Ptr{Cuint}(x + 252) + f === :PRINTcentrums && return Ptr{Cuint}(x + 256) + f === :PRINTcoplanar && return Ptr{Cuint}(x + 260) + f === :PRINTdim && return Ptr{Cint}(x + 264) + f === :PRINTdots && return Ptr{Cuint}(x + 268) + f === :PRINTgood && return Ptr{Cuint}(x + 272) + f === :PRINTinner && return Ptr{Cuint}(x + 276) + f === :PRINTneighbors && return Ptr{Cuint}(x + 280) + f === :PRINTnoplanes && return Ptr{Cuint}(x + 284) + f === :PRINToptions1st && return Ptr{Cuint}(x + 288) + f === :PRINTouter && return Ptr{Cuint}(x + 292) + f === :PRINTprecision && return Ptr{Cuint}(x + 296) + f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 300) + f === :PRINTridges && return Ptr{Cuint}(x + 416) + f === :PRINTspheres && return Ptr{Cuint}(x + 420) + f === :PRINTstatistics && return Ptr{Cuint}(x + 424) + f === :PRINTsummary && return Ptr{Cuint}(x + 428) + f === :PRINTtransparent && return Ptr{Cuint}(x + 432) + f === :PROJECTdelaunay && return Ptr{Cuint}(x + 436) + f === :PROJECTinput && return Ptr{Cint}(x + 440) + f === :RANDOMdist && return Ptr{Cuint}(x + 444) + f === :RANDOMfactor && return Ptr{Cdouble}(x + 448) + f === :RANDOMa && return Ptr{Cdouble}(x + 456) + f === :RANDOMb && return Ptr{Cdouble}(x + 464) + f === :RANDOMoutside && return Ptr{Cuint}(x + 472) + f === :REPORTfreq && return Ptr{Cint}(x + 476) + f === :REPORTfreq2 && return Ptr{Cint}(x + 480) + f === :RERUN && return Ptr{Cint}(x + 484) + f === :ROTATErandom && return Ptr{Cint}(x + 488) + f === :SCALEinput && return Ptr{Cuint}(x + 492) + f === :SCALElast && return Ptr{Cuint}(x + 496) + f === :SETroundoff && return Ptr{Cuint}(x + 500) + f === :SKIPcheckmax && return Ptr{Cuint}(x + 504) + f === :SKIPconvex && return Ptr{Cuint}(x + 508) + f === :SPLITthresholds && return Ptr{Cuint}(x + 512) + f === :STOPadd && return Ptr{Cint}(x + 516) + f === :STOPcone && return Ptr{Cint}(x + 520) + f === :STOPpoint && return Ptr{Cint}(x + 524) + f === :TESTpoints && return Ptr{Cint}(x + 528) + f === :TESTvneighbors && return Ptr{Cuint}(x + 532) + f === :TRACElevel && return Ptr{Cint}(x + 536) + f === :TRACElastrun && return Ptr{Cint}(x + 540) + f === :TRACEpoint && return Ptr{Cint}(x + 544) + f === :TRACEdist && return Ptr{Cdouble}(x + 552) + f === :TRACEmerge && return Ptr{Cint}(x + 560) + f === :TRIangulate && return Ptr{Cuint}(x + 564) + f === :TRInormals && return Ptr{Cuint}(x + 568) + f === :UPPERdelaunay && return Ptr{Cuint}(x + 572) + f === :USEstdout && return Ptr{Cuint}(x + 576) + f === :VERIFYoutput && return Ptr{Cuint}(x + 580) + f === :VIRTUALmemory && return Ptr{Cuint}(x + 584) + f === :VORONOI && return Ptr{Cuint}(x + 588) + f === :AREAfactor && return Ptr{Cdouble}(x + 592) + f === :DOcheckmax && return Ptr{Cuint}(x + 600) + f === :feasible_string && return Ptr{Ptr{Cchar}}(x + 608) + f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 616) + f === :GETarea && return Ptr{Cuint}(x + 624) + f === :KEEPnearinside && return Ptr{Cuint}(x + 628) + f === :hull_dim && return Ptr{Cint}(x + 632) + f === :input_dim && return Ptr{Cint}(x + 636) + f === :num_points && return Ptr{Cint}(x + 640) + f === :first_point && return Ptr{Ptr{Cdouble}}(x + 648) + f === :POINTSmalloc && return Ptr{Cuint}(x + 656) + f === :input_points && return Ptr{Ptr{Cdouble}}(x + 664) + f === :input_malloc && return Ptr{Cuint}(x + 672) + f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 676) + f === :qhull_commandsiz2 && return Ptr{Cint}(x + 932) + f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 936) + f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1192) + f === :qhull_optionlen && return Ptr{Cint}(x + 1704) + f === :qhull_optionsiz && return Ptr{Cint}(x + 1708) + f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1712) + f === :run_id && return Ptr{Cint}(x + 1716) + f === :VERTEXneighbors && return Ptr{Cuint}(x + 1720) + f === :ZEROcentrum && return Ptr{Cuint}(x + 1724) + f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1728) + f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1736) + f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1744) + f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1752) + f === :ANGLEround && return Ptr{Cdouble}(x + 1760) + f === :centrum_radius && return Ptr{Cdouble}(x + 1768) + f === :cos_max && return Ptr{Cdouble}(x + 1776) + f === :DISTround && return Ptr{Cdouble}(x + 1784) + f === :MAXabs_coord && return Ptr{Cdouble}(x + 1792) + f === :MAXlastcoord && return Ptr{Cdouble}(x + 1800) + f === :MAXoutside && return Ptr{Cdouble}(x + 1808) + f === :MAXsumcoord && return Ptr{Cdouble}(x + 1816) + f === :MAXwidth && return Ptr{Cdouble}(x + 1824) + f === :MINdenom_1 && return Ptr{Cdouble}(x + 1832) + f === :MINdenom && return Ptr{Cdouble}(x + 1840) + f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1848) + f === :MINdenom_2 && return Ptr{Cdouble}(x + 1856) + f === :MINlastcoord && return Ptr{Cdouble}(x + 1864) + f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1872) + f === :NEARinside && return Ptr{Cdouble}(x + 1880) + f === :ONEmerge && return Ptr{Cdouble}(x + 1888) + f === :outside_err && return Ptr{Cdouble}(x + 1896) + f === :WIDEfacet && return Ptr{Cdouble}(x + 1904) + f === :NARROWhull && return Ptr{Cuint}(x + 1912) + f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1916) + f === :errexit && return Ptr{jmp_buf}(x + 1936) + f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2192) + f === :restartexit && return Ptr{jmp_buf}(x + 2240) + f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2496) + f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2536) + f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2544) + f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2552) + f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2560) + f === :normal_size && return Ptr{Cint}(x + 2568) + f === :center_size && return Ptr{Cint}(x + 2572) + f === :TEMPsize && return Ptr{Cint}(x + 2576) + f === :facet_list && return Ptr{Ptr{facetT}}(x + 2584) + f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2592) + f === :facet_next && return Ptr{Ptr{facetT}}(x + 2600) + f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2608) + f === :visible_list && return Ptr{Ptr{facetT}}(x + 2616) + f === :num_visible && return Ptr{Cint}(x + 2624) + f === :tracefacet_id && return Ptr{Cuint}(x + 2628) + f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2632) + f === :traceridge_id && return Ptr{Cuint}(x + 2640) + f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2648) + f === :tracevertex_id && return Ptr{Cuint}(x + 2656) + f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2664) + f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2672) + f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2680) + f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2688) + f === :num_facets && return Ptr{Cint}(x + 2696) + f === :num_vertices && return Ptr{Cint}(x + 2700) + f === :num_outside && return Ptr{Cint}(x + 2704) + f === :num_good && return Ptr{Cint}(x + 2708) + f === :facet_id && return Ptr{Cuint}(x + 2712) + f === :ridge_id && return Ptr{Cuint}(x + 2716) + f === :vertex_id && return Ptr{Cuint}(x + 2720) + f === :first_newfacet && return Ptr{Cuint}(x + 2724) + f === :hulltime && return Ptr{Culong}(x + 2728) + f === :ALLOWrestart && return Ptr{Cuint}(x + 2732) + f === :build_cnt && return Ptr{Cint}(x + 2736) + f === :CENTERtype && return Ptr{qh_CENTER}(x + 2740) + f === :furthest_id && return Ptr{Cint}(x + 2744) + f === :last_errcode && return Ptr{Cint}(x + 2748) + f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2752) + f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2760) + f === :hasAreaVolume && return Ptr{Cuint}(x + 2768) + f === :hasTriangulation && return Ptr{Cuint}(x + 2772) + f === :isRenameVertex && return Ptr{Cuint}(x + 2776) + f === :JOGGLEmax && return Ptr{Cdouble}(x + 2784) + f === :maxoutdone && return Ptr{Cuint}(x + 2792) + f === :max_outside && return Ptr{Cdouble}(x + 2800) + f === :max_vertex && return Ptr{Cdouble}(x + 2808) + f === :min_vertex && return Ptr{Cdouble}(x + 2816) + f === :NEWfacets && return Ptr{Cuint}(x + 2824) + f === :NEWtentative && return Ptr{Cuint}(x + 2828) + f === :findbestnew && return Ptr{Cuint}(x + 2832) + f === :findbest_notsharp && return Ptr{Cuint}(x + 2836) + f === :NOerrexit && return Ptr{Cuint}(x + 2840) + f === :PRINTcradius && return Ptr{Cdouble}(x + 2848) + f === :PRINTradius && return Ptr{Cdouble}(x + 2856) + f === :POSTmerging && return Ptr{Cuint}(x + 2864) + f === :printoutvar && return Ptr{Cint}(x + 2868) + f === :printoutnum && return Ptr{Cint}(x + 2872) + f === :repart_facetid && return Ptr{Cuint}(x + 2876) + f === :retry_addpoint && return Ptr{Cint}(x + 2880) + f === :QHULLfinished && return Ptr{Cuint}(x + 2884) + f === :totarea && return Ptr{Cdouble}(x + 2888) + f === :totvol && return Ptr{Cdouble}(x + 2896) + f === :visit_id && return Ptr{Cuint}(x + 2904) + f === :vertex_visit && return Ptr{Cuint}(x + 2908) + f === :WAScoplanar && return Ptr{Cuint}(x + 2912) + f === :ZEROall_ok && return Ptr{Cuint}(x + 2916) + f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 2920) + f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 2928) + f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 2936) + f === :hash_table && return Ptr{Ptr{setT}}(x + 2944) + f === :other_points && return Ptr{Ptr{setT}}(x + 2952) + f === :del_vertices && return Ptr{Ptr{setT}}(x + 2960) + f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 2968) + f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 2976) + f === :line && return Ptr{Ptr{Cchar}}(x + 2984) + f === :maxline && return Ptr{Cint}(x + 2992) + f === :half_space && return Ptr{Ptr{Cdouble}}(x + 3000) + f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 3008) + f === :ERREXITcalled && return Ptr{Cuint}(x + 3016) + f === :firstcentrum && return Ptr{Cuint}(x + 3020) + f === :old_randomdist && return Ptr{Cuint}(x + 3024) + f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 3032) + f === :last_low && return Ptr{Cdouble}(x + 3040) + f === :last_high && return Ptr{Cdouble}(x + 3048) + f === :last_newhigh && return Ptr{Cdouble}(x + 3056) + f === :lastcpu && return Ptr{Cdouble}(x + 3064) + f === :lastfacets && return Ptr{Cint}(x + 3072) + f === :lastmerges && return Ptr{Cint}(x + 3076) + f === :lastplanes && return Ptr{Cint}(x + 3080) + f === :lastdist && return Ptr{Cint}(x + 3084) + f === :lastreport && return Ptr{Cuint}(x + 3088) + f === :mergereport && return Ptr{Cint}(x + 3092) + f === :old_tempstack && return Ptr{Ptr{setT}}(x + 3096) + f === :ridgeoutnum && return Ptr{Cint}(x + 3104) + f === :last_random && return Ptr{Cint}(x + 3108) + f === :rbox_errexit && return Ptr{jmp_buf}(x + 3120) + f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 3376) + f === :rbox_isinteger && return Ptr{Cint}(x + 3416) + f === :rbox_out_offset && return Ptr{Cdouble}(x + 3424) + f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 3432) + f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 3440) + f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 3448) + f === :qhmem && return Ptr{qhmemT}(x + 3456) + f === :qhstat && return Ptr{qhstatT}(x + 3608) + return getfield(x, f) +end + +function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const ptr_intT = Clonglong + +function qh_memalloc(qh, insize) + ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) +end + +function qh_memcheck(qh) + ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memfree(qh, object, insize) + ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) +end + +function qh_memfreeshort(qh, curlong, totlong) + ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) +end + +function qh_meminit(qh, ferr) + ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) +end + +function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) + ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) +end + +function qh_memsetup(qh) + ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_memsize(qh, size) + ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) +end + +function qh_memstatistics(qh, fp) + ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) + ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) +end + +function qh_setaddsorted(qh, setp, elem) + ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setaddnth(qh, setp, nth, newelem) + ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) +end + +function qh_setappend(qh, setp, elem) + ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setappend_set(qh, setp, setA) + ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) +end + +function qh_setappend2ndlast(qh, setp, elem) + ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) +end + +function qh_setcheck(qh, set, tname, id) + ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cchar}, Cuint), qh, set, tname, id) +end + +function qh_setcompact(qh, set) + ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_setcopy(qh, set, extra) + ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) +end + +function qh_setdel(set, elem) + ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) +end + +function qh_setdellast(set) + ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setdelnth(qh, set, nth) + ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelnthsorted(qh, set, nth) + ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) +end + +function qh_setdelsorted(set, newelem) + ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) +end + +function qh_setduplicate(qh, set, elemsize) + ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) +end + +function qh_setendpointer(set) + ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) +end + +function qh_setequal(setA, setB) + ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) +end + +function qh_setequal_except(setA, skipelemA, setB, skipelemB) + ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) +end + +function qh_setequal_skip(setA, skipA, setB, skipB) + ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) +end + +function qh_setfree(qh, set) + ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setfree2(qh, setp, elemsize) + ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) +end + +function qh_setfreelong(qh, set) + ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_setin(set, setelem) + ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setindex(set, setelem) + ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) +end + +function qh_setlarger(qh, setp) + ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) +end + +function qh_setlarger_quick(qh, setsize, newsize) + ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) +end + +function qh_setlast(set) + ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) +end + +function qh_setnew(qh, size) + ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) +end + +function qh_setnew_delnthsorted(qh, set, size, nth, prepend) + ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) +end + +function qh_setprint(qh, fp, string, set) + ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}, Ptr{setT}), qh, fp, string, set) +end + +function qh_setreplace(qh, set, oldelem, newelem) + ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) +end + +function qh_setsize(qh, set) + ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settemp(qh, setsize) + ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) +end + +function qh_settempfree(qh, set) + ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) +end + +function qh_settempfree_all(qh) + ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_settemppop(qh) + ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_settemppush(qh, set) + ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) +end + +function qh_settruncate(qh, set, size) + ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) +end + +function qh_setunique(qh, set, elem) + ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) +end + +function qh_setzero(qh, set, idx, size) + ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) +end + +@enum qh_pointT::Int32 begin + qh_IDnone = -3 + qh_IDinterior = -2 + qh_IDunknown = -1 +end + +@enum qh_statistics::UInt32 begin + Zacoplanar = 0 + Wacoplanarmax = 1 + Wacoplanartot = 2 + Zangle = 3 + Wangle = 4 + Wanglemax = 5 + Wanglemin = 6 + Zangletests = 7 + Wareatot = 8 + Wareamax = 9 + Wareamin = 10 + Zavoidold = 11 + Wavoidoldmax = 12 + Wavoidoldtot = 13 + Zback0 = 14 + Zbestcentrum = 15 + Zbestdist = 16 + Zbestlower = 17 + Zbestlowerall = 18 + Zbestloweralln = 19 + Zbestlowerv = 20 + Zcentrumtests = 21 + Zcheckpart = 22 + Zcomputefurthest = 23 + Zconcave = 24 + Wconcavemax = 25 + Wconcavetot = 26 + Zconcavecoplanar = 27 + Wconcavecoplanarmax = 28 + Wconcavecoplanartot = 29 + Zconcavecoplanarridge = 30 + Zconcaveridge = 31 + Zconcaveridges = 32 + Zcoplanar = 33 + Wcoplanarmax = 34 + Wcoplanartot = 35 + Zcoplanarangle = 36 + Zcoplanarcentrum = 37 + Zcoplanarhorizon = 38 + Zcoplanarinside = 39 + Zcoplanarpart = 40 + Zcoplanarridges = 41 + Wcpu = 42 + Zcyclefacetmax = 43 + Zcyclefacettot = 44 + Zcyclehorizon = 45 + Zcyclevertex = 46 + Zdegen = 47 + Wdegenmax = 48 + Wdegentot = 49 + Zdegenvertex = 50 + Zdelfacetdup = 51 + Zdelridge = 52 + Zdelvertextot = 53 + Zdelvertexmax = 54 + Zdetfacetarea = 55 + Zdetsimplex = 56 + Zdistcheck = 57 + Zdistconvex = 58 + Zdistgood = 59 + Zdistio = 60 + Zdistplane = 61 + Zdiststat = 62 + Zdistvertex = 63 + Zdistzero = 64 + Zdoc1 = 65 + Zdoc2 = 66 + Zdoc3 = 67 + Zdoc4 = 68 + Zdoc5 = 69 + Zdoc6 = 70 + Zdoc7 = 71 + Zdoc8 = 72 + Zdoc9 = 73 + Zdoc10 = 74 + Zdoc11 = 75 + Zdoc12 = 76 + Zdropdegen = 77 + Zdropneighbor = 78 + Zdupflip = 79 + Zduplicate = 80 + Wduplicatemax = 81 + Wduplicatetot = 82 + Zdupsame = 83 + Zflipped = 84 + Wflippedmax = 85 + Wflippedtot = 86 + Zflippedfacets = 87 + Zflipridge = 88 + Zflipridge2 = 89 + Zfindbest = 90 + Zfindbestmax = 91 + Zfindbesttot = 92 + Zfindcoplanar = 93 + Zfindfail = 94 + Zfindhorizon = 95 + Zfindhorizonmax = 96 + Zfindhorizontot = 97 + Zfindjump = 98 + Zfindnew = 99 + Zfindnewmax = 100 + Zfindnewtot = 101 + Zfindnewjump = 102 + Zfindnewsharp = 103 + Zgauss0 = 104 + Zgoodfacet = 105 + Zhashlookup = 106 + Zhashridge = 107 + Zhashridgetest = 108 + Zhashtests = 109 + Zinsidevisible = 110 + Zintersect = 111 + Zintersectfail = 112 + Zintersectmax = 113 + Zintersectnum = 114 + Zintersecttot = 115 + Zmaxneighbors = 116 + Wmaxout = 117 + Wmaxoutside = 118 + Zmaxridges = 119 + Zmaxvertex = 120 + Zmaxvertices = 121 + Zmaxvneighbors = 122 + Zmemfacets = 123 + Zmempoints = 124 + Zmemridges = 125 + Zmemvertices = 126 + Zmergeflipdup = 127 + Zmergehorizon = 128 + Zmergeinittot = 129 + Zmergeinitmax = 130 + Zmergeinittot2 = 131 + Zmergeintocoplanar = 132 + Zmergeintohorizon = 133 + Zmergenew = 134 + Zmergesettot = 135 + Zmergesetmax = 136 + Zmergesettot2 = 137 + Zmergesimplex = 138 + Zmergevertex = 139 + Wmindenom = 140 + Wminvertex = 141 + Zminnorm = 142 + Zmultiridge = 143 + Znearlysingular = 144 + Zredundant = 145 + Wnewbalance = 146 + Wnewbalance2 = 147 + Znewbesthorizon = 148 + Znewfacettot = 149 + Znewfacetmax = 150 + Znewvertex = 151 + Wnewvertex = 152 + Wnewvertexmax = 153 + Znewvertexridge = 154 + Znoarea = 155 + Znonsimplicial = 156 + Znowsimplicial = 157 + Znotgood = 158 + Znotgoodnew = 159 + Znotmax = 160 + Znumfacets = 161 + Znummergemax = 162 + Znummergetot = 163 + Znumneighbors = 164 + Znumridges = 165 + Znumvertices = 166 + Znumvisibility = 167 + Znumvneighbors = 168 + Zonehorizon = 169 + Zpartangle = 170 + Zpartcoplanar = 171 + Zpartcorner = 172 + Zparthidden = 173 + Zpartinside = 174 + Zpartition = 175 + Zpartitionall = 176 + Zpartnear = 177 + Zparttwisted = 178 + Zpbalance = 179 + Wpbalance = 180 + Wpbalance2 = 181 + Zpinchduplicate = 182 + Zpinchedapex = 183 + Zpinchedvertex = 184 + Zpostfacets = 185 + Zpremergetot = 186 + Zprocessed = 187 + Zremvertex = 188 + Zremvertexdel = 189 + Zredundantmerge = 190 + Zrenameall = 191 + Zrenamepinch = 192 + Zrenameshare = 193 + Zretry = 194 + Wretrymax = 195 + Zretryadd = 196 + Zretryaddmax = 197 + Zretryaddtot = 198 + Zridge = 199 + Wridge = 200 + Wridgemax = 201 + Zridge0 = 202 + Wridge0 = 203 + Wridge0max = 204 + Zridgemid = 205 + Wridgemid = 206 + Wridgemidmax = 207 + Zridgeok = 208 + Wridgeok = 209 + Wridgeokmax = 210 + Zsearchpoints = 211 + Zsetplane = 212 + Ztestvneighbor = 213 + Ztotcheck = 214 + Ztothorizon = 215 + Ztotmerge = 216 + Ztotpartcoplanar = 217 + Ztotpartition = 218 + Ztotridges = 219 + Ztotvertices = 220 + Ztotvisible = 221 + Ztricoplanar = 222 + Ztricoplanarmax = 223 + Ztricoplanartot = 224 + Ztridegen = 225 + Ztrimirror = 226 + Ztrinull = 227 + Ztwisted = 228 + Wtwistedtot = 229 + Wtwistedmax = 230 + Ztwistedridge = 231 + Zvertextests = 232 + Wvertexmax = 233 + Wvertexmin = 234 + Zvertexridge = 235 + Zvertexridgetot = 236 + Zvertexridgemax = 237 + Zvertices = 238 + Zvisfacettot = 239 + Zvisfacetmax = 240 + Zvisit = 241 + Zvisit2max = 242 + Zvisvertextot = 243 + Zvisvertexmax = 244 + Zvvisit = 245 + Zvvisit2max = 246 + Zwidefacet = 247 + Zwidevertices = 248 + ZEND = 249 +end + +@enum ztypes::UInt32 begin + zdoc = 0 + zinc = 1 + zadd = 2 + zmax = 3 + zmin = 4 + ZTYPEreal = 5 + wadd = 6 + wmax = 7 + wmin = 8 + ZTYPEend = 9 +end + +function qh_allstatA(qh) + ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatB(qh) + ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatC(qh) + ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatD(qh) + ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE(qh) + ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatE2(qh) + ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatF(qh) + ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatG(qh) + ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatH(qh) + ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatI(qh) + ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_allstatistics(qh) + ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_collectstatistics(qh) + ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initstatistics(qh) + ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_newstats(qh, idx, nextindex) + ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) +end + +function qh_nostatistic(qh, i) + ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) +end + +function qh_printallstatistics(qh, fp, string) + ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatistics(qh, fp, string) + ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Cchar}), qh, fp, string) +end + +function qh_printstatlevel(qh, fp, id) + ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) +end + +function qh_printstats(qh, fp, idx, nextindex) + ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) +end + +function qh_stddev(qh, num, tot, tot2, ave) + ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) +end + +struct vertexT + data::NTuple{48, UInt8} +end + +function Base.getproperty(x::Ptr{vertexT}, f::Symbol) + f === :next && return Ptr{Ptr{vertexT}}(x + 0) + f === :previous && return Ptr{Ptr{vertexT}}(x + 8) + f === :point && return Ptr{Ptr{Cdouble}}(x + 16) + f === :neighbors && return Ptr{Ptr{setT}}(x + 24) + f === :id && return Ptr{Cuint}(x + 32) + f === :visitid && return Ptr{Cuint}(x + 36) + f === :seen && return Ptr{Cuint}(x + 40) + f === :seen2 && return (Ptr{Cuint}(x + 40), 1, 1) + f === :deleted && return (Ptr{Cuint}(x + 40), 2, 1) + f === :delridge && return (Ptr{Cuint}(x + 40), 3, 1) + f === :newfacet && return (Ptr{Cuint}(x + 40), 4, 1) + f === :partitioned && return (Ptr{Cuint}(x + 40), 5, 1) + return getfield(x, f) +end + +function Base.getproperty(x::vertexT, f::Symbol) + r = Ref{vertexT}(x) + ptr = Base.unsafe_convert(Ptr{vertexT}, r) + fptr = getproperty(ptr, f) + begin + if fptr isa Ptr + return GC.@preserve(r, unsafe_load(fptr)) + else + (baseptr, offset, width) = fptr + ty = eltype(baseptr) + i8 = GC.@preserve(r, unsafe_load(baseptr)) + bitstr = bitstring(i8) + sig = bitstr[(end - offset) - (width - 1):end - offset] + zexted = lpad(sig, 8 * sizeof(ty), '0') + return parse(ty, zexted; base = 2) + end + end +end + +function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +function qh_qhull(qh) + ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_addpoint(qh, furthest, facet, checkdist) + ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) +end + +function qh_errexit2(qh, exitcode, facet, otherfacet) + ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) +end + +function qh_printsummary(qh, fp) + ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_errexit(qh, exitcode, facet, ridge) + ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) +end + +function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) + ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) +end + +function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) + ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Ptr{Cchar}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) +end + +function qh_printfacetlist(qh, facetlist, facets, printall) + ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) +end + +function qh_printhelp_degenerate(qh, fp) + ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_internal(qh, fp) + ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_narrowhull(qh, fp, minangle) + ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) +end + +function qh_printhelp_singular(qh, fp) + ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_topology(qh, fp) + ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_printhelp_wide(qh, fp) + ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) +end + +function qh_user_memsizes(qh) + ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_exit(exitcode) + ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) +end + +function qh_free(mem) + ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) +end + +function qh_malloc(size) + ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) +end + +function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) + ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) +end + +function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) + ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) +end + +function qh_gram_schmidt(qh, dim, rows) + ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) +end + +function qh_outerinner(qh, facet, outerplane, innerplane) + ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) +end + +function qh_projectinput(qh) + ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_randommatrix(qh, buffer, dim, row) + ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) +end + +function qh_rotateinput(qh, rows) + ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) +end + +function qh_scaleinput(qh) + ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_setdelaunay(qh, dim, count, points) + ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) +end + +function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) + ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) +end + +function qh_clock(qh) + ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) +end + +function qh_checkflags(qh, command, hiddenflags) + ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cchar}), qh, command, hiddenflags) +end + +function qh_clear_outputflags(qh) + ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freebuffers(qh) + ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_freeqhull(qh, allmem) + ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) +end + +function qh_init_A(qh, infile, outfile, errfile, argc, argv) + ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Ptr{Cchar}}), qh, infile, outfile, errfile, argc, argv) +end + +function qh_init_B(qh, points, numpoints, dim, ismalloc) + ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_init_qhull_command(qh, argc, argv) + ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Ptr{Cchar}}), qh, argc, argv) +end + +function qh_initbuffers(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initflags(qh, command) + ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_initqhull_buffers(qh) + ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) + ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) +end + +function qh_initqhull_mem(qh) + ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_outputflags(qh) + ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_initqhull_start(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initqhull_start2(qh, infile, outfile, errfile) + ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) +end + +function qh_initthresholds(qh, command) + ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}), qh, command) +end + +function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) + ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) +end + +function qh_option(qh, option, i, r) + ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cchar}, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) +end + +function qh_zero(qh, errfile) + ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) +end + +function qh_dfacet(qh, id) + ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_dvertex(qh, id) + ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) +end + +function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) + ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) +end + +function qh_produce_output(qh) + ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_readpoints(qh, numpoints, dimension, ismalloc) + ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) +end + +function qh_check_output(qh) + ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_check_points(qh) + ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_facetvertices(qh, facetlist, facets, allfacets) + ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) +end + +function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) + ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) +end + +function qh_nearvertex(qh, facet, point, bestdistp) + ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) +end + +function qh_point(qh, id) + ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) +end + +function qh_pointfacet(qh) + ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_pointid(qh, point) + ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) +end + +function qh_pointvertex(qh) + ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) +end + +function qh_setvoronoi_all(qh) + ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_triangulate(qh) + ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) +end + +function qh_rboxpoints(qh, rbox_command) + ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cchar}), qh, rbox_command) +end + +function qh_errexit_rbox(qh, exitcode) + ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) +end + +struct __JL_Ctag_4 + data::NTuple{8, UInt8} +end + +function Base.getproperty(x::Ptr{__JL_Ctag_4}, f::Symbol) + f === :area && return Ptr{Cdouble}(x + 0) + f === :replace && return Ptr{Ptr{facetT}}(x + 0) + f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) + f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) + f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) + f === :triowner && return Ptr{Ptr{facetT}}(x + 0) + return getfield(x, f) +end + +function Base.getproperty(x::__JL_Ctag_4, f::Symbol) + r = Ref{__JL_Ctag_4}(x) + ptr = Base.unsafe_convert(Ptr{__JL_Ctag_4}, r) + fptr = getproperty(ptr, f) + GC.@preserve r unsafe_load(fptr) +end + +function Base.setproperty!(x::Ptr{__JL_Ctag_4}, f::Symbol, v) + unsafe_store!(getproperty(x, f), v) +end + +const qhDEFlibqhull = 1 + +const qhDEFuser = 1 + +const qh_FILENAMElen = 500 + +const MSG_TRACE0 = 0 + +const MSG_TRACE1 = 1000 + +const MSG_TRACE2 = 2000 + +const MSG_TRACE3 = 3000 + +const MSG_TRACE4 = 4000 + +const MSG_TRACE5 = 5000 + +const MSG_ERROR = 6000 + +const MSG_WARNING = 7000 + +const MSG_STDERR = 8000 + +const MSG_OUTPUT = 9000 + +const MSG_QHULL_ERROR = 10000 + +const MSG_FIX = 11000 + +const MSG_MAXLEN = 3000 + +const qh_OPTIONline = 80 + +const REALfloat = 0 + +const realT = Float64 + +const REALmax = DBL_MAX + +const REALmin = DBL_MIN + +const REALepsilon = DBL_EPSILON + +const qh_REALdigits = 16 + +const qh_REAL_1 = "%6.16g " + +const qh_REAL_2n = "%6.16g %6.16g\n" + +const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" + +const DEFcountT = 1 + +const COUNTmax = INT_MAX + +const qh_POINTSmax = INT_MAX - 16 + +const qh_CLOCKtype = 1 + +const qh_RANDOMtype = 5 + +const qh_RANDOMmax = realT(Culong(2147483646)) + +const qh_ORIENTclock = 0 + +const qh_JOGGLEdefault = 30000.0 + +const qh_JOGGLEincrease = 10.0 + +const qh_JOGGLEretry = 2 + +const qh_JOGGLEagain = 1 + +const qh_JOGGLEmaxincrease = 0.01 + +const qh_JOGGLEmaxretry = 50 + +const qh_HASHfactor = 2 + +const qh_VERIFYdirect = 1000000 + +const qh_INITIALsearch = 6 + +const qh_INITIALmax = 8 + +# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) + +const qh_MEMbufsize = 0x00010000 + +const qh_MEMinitbuf = 0x00020000 + +const qh_INFINITE = -10.101 + +const qh_DEFAULTbox = 0.5 + +const qh_DEFAULTzbox = 1.0e6 + +const qh_COMPUTEfurthest = 0 + +const qh_KEEPstatistics = 1 + +const qh_MAXoutside = 1 + +const qh_QUICKhelp = 0 + +const qh_BESTcentrum = 20 + +const qh_BESTcentrum2 = 2 + +const qh_BESTnonconvex = 15 + +const qh_COPLANARratio = 3 + +const qh_DIMmergeVertex = 6 + +const qh_DIMreduceBuild = 5 + +const qh_MAXcheckpoint = 10 + +const qh_MAXcoplanarcentrum = 10 + +const qh_MAXnewcentrum = 5 + +const qh_MAXnewmerges = 2 + +const qh_RATIOconcavehorizon = 20.0 + +const qh_RATIOconvexmerge = 10.0 + +const qh_RATIOcoplanarapex = 3.0 + +const qh_RATIOcoplanaroutside = 30.0 + +const qh_RATIOmaxsimplex = 0.001 + +const qh_RATIOnearinside = 5 + +const qh_RATIOpinchedsubridge = 10.0 + +const qh_RATIOtrypinched = 4.0 + +const qh_RATIOtwisted = 20.0 + +const qh_MAXnarrow = -0.99999999 + +const qh_WARNnarrow = -0.999999999999999 + +const qh_WIDEcoplanar = 6 + +const qh_WIDEduplicate = 100 + +const qh_WIDEdupridge = 50 + +const qh_WIDEmaxoutside = 100 + +const qh_WIDEmaxoutside2 = 10qh_WIDEmaxoutside + +const qh_WIDEpinched = 100 + +const qh_ZEROdelaunay = 2 + +const qhDEFmem = 1 + +const DEFsetT = 1 + +const DEFqhT = 1 + +const qhmem_ERRmem = 4 + +const qhmem_ERRqhull = 5 + +const qhDEFset = 1 + +# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) + +const coordT = realT + +const pointT = coordT + +const flagT = Cuint + +const boolT = Cuint + +const False = 0 + +const True = 1 + +const qh_False = 0 + +const qh_True = 1 + +const qhDEFstat = 1 + +const DEFqhstatT = 1 + +const qh_ALL = True + +const qh_NOupper = True + +const qh_IScheckmax = True + +const qh_ISnewfacets = True + +const qh_RESETvisible = True + +const qh_ERRnone = 0 + +const qh_ERRinput = 1 + +const qh_ERRsingular = 2 + +const qh_ERRprec = 3 + +const qh_ERRmem = 4 + +const qh_ERRqhull = 5 + +const qh_ERRother = 6 + +const qh_ERRtopology = 7 + +const qh_ERRwide = 8 + +const qh_ERRdebug = 9 + +# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) + +const qh_MAXnummerge = 511 + +const QHULL_NON_REENTRANT = 0 + +const QHULL_QH_POINTER = 1 + +const QHULL_REENTRANT = 2 + +const QHULL_LIB_TYPE = QHULL_REENTRANT + +# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; + +# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; + +# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) + +# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) + diff --git a/src/LibQhull.jl b/src/LibQhull.jl index bc4744e..80e3670 100644 --- a/src/LibQhull.jl +++ b/src/LibQhull.jl @@ -9,1971 +9,45 @@ const DBL_EPSILON = eps() const INT_MAX = typemax(Cint) const INT_MIN = typemin(Cint) - -const countT = Cint - -struct setelemT - data::NTuple{8, UInt8} -end - -function Base.getproperty(x::Ptr{setelemT}, f::Symbol) - f === :p && return Ptr{Ptr{Cvoid}}(x + 0) - f === :i && return Ptr{Cint}(x + 0) - return getfield(x, f) -end - -function Base.getproperty(x::setelemT, f::Symbol) - r = Ref{setelemT}(x) - ptr = Base.unsafe_convert(Ptr{setelemT}, r) - fptr = getproperty(ptr, f) - GC.@preserve r unsafe_load(fptr) -end - -function Base.setproperty!(x::Ptr{setelemT}, f::Symbol, v) - unsafe_store!(getproperty(x, f), v) -end - -struct setT - maxsize::Cint - e::NTuple{1, setelemT} -end - -function Base.getproperty(x::Ptr{setT}, f::Symbol) - f === :maxsize && return Ptr{Cint}(x + 0) - f === :e && return Ptr{NTuple{1, setelemT}}(x + 8) - return getfield(x, f) -end - -function Base.getproperty(x::setT, f::Symbol) - r = Ref{setT}(x) - ptr = Base.unsafe_convert(Ptr{setT}, r) - fptr = getproperty(ptr, f) - GC.@preserve r unsafe_load(fptr) -end - -function Base.setproperty!(x::Ptr{setT}, f::Symbol, v) - unsafe_store!(getproperty(x, f), v) -end - -@enum qh_PRINT::UInt32 begin - qh_PRINTnone = 0 - qh_PRINTarea = 1 - qh_PRINTaverage = 2 - qh_PRINTcoplanars = 3 - qh_PRINTcentrums = 4 - qh_PRINTfacets = 5 - qh_PRINTfacets_xridge = 6 - qh_PRINTgeom = 7 - qh_PRINTids = 8 - qh_PRINTinner = 9 - qh_PRINTneighbors = 10 - qh_PRINTnormals = 11 - qh_PRINTouter = 12 - qh_PRINTmaple = 13 - qh_PRINTincidences = 14 - qh_PRINTmathematica = 15 - qh_PRINTmerges = 16 - qh_PRINToff = 17 - qh_PRINToptions = 18 - qh_PRINTpointintersect = 19 - qh_PRINTpointnearest = 20 - qh_PRINTpoints = 21 - qh_PRINTqhull = 22 - qh_PRINTsize = 23 - qh_PRINTsummary = 24 - qh_PRINTtriangles = 25 - qh_PRINTvertices = 26 - qh_PRINTvneighbors = 27 - qh_PRINTextremes = 28 - qh_PRINTEND = 29 -end - -const jmp_buf = NTuple{37, Cint} - -struct facetT - data::NTuple{120, UInt8} -end - -function Base.getproperty(x::Ptr{facetT}, f::Symbol) - f === :furthestdist && return Ptr{Cdouble}(x + 0) - f === :maxoutside && return Ptr{Cdouble}(x + 8) - f === :offset && return Ptr{Cdouble}(x + 16) - f === :normal && return Ptr{Ptr{Cdouble}}(x + 24) - f === :f && return Ptr{var"##Ctag#264"}(x + 32) - f === :center && return Ptr{Ptr{Cdouble}}(x + 40) - f === :previous && return Ptr{Ptr{facetT}}(x + 48) - f === :next && return Ptr{Ptr{facetT}}(x + 56) - f === :vertices && return Ptr{Ptr{setT}}(x + 64) - f === :ridges && return Ptr{Ptr{setT}}(x + 72) - f === :neighbors && return Ptr{Ptr{setT}}(x + 80) - f === :outsideset && return Ptr{Ptr{setT}}(x + 88) - f === :coplanarset && return Ptr{Ptr{setT}}(x + 96) - f === :visitid && return Ptr{Cuint}(x + 104) - f === :id && return Ptr{Cuint}(x + 108) - f === :nummerge && return Ptr{Cuint}(x + 112) - f === :tricoplanar && return (Ptr{Cuint}(x + 113), 1, 1) - f === :newfacet && return (Ptr{Cuint}(x + 113), 2, 1) - f === :visible && return (Ptr{Cuint}(x + 113), 3, 1) - f === :toporient && return (Ptr{Cuint}(x + 113), 4, 1) - f === :simplicial && return (Ptr{Cuint}(x + 113), 5, 1) - f === :seen && return (Ptr{Cuint}(x + 113), 6, 1) - f === :seen2 && return (Ptr{Cuint}(x + 113), 7, 1) - f === :flipped && return Ptr{Cuint}(x + 114) - f === :upperdelaunay && return (Ptr{Cuint}(x + 114), 1, 1) - f === :notfurthest && return (Ptr{Cuint}(x + 114), 2, 1) - f === :good && return (Ptr{Cuint}(x + 114), 3, 1) - f === :isarea && return (Ptr{Cuint}(x + 114), 4, 1) - f === :dupridge && return (Ptr{Cuint}(x + 114), 5, 1) - f === :mergeridge && return (Ptr{Cuint}(x + 114), 6, 1) - f === :mergeridge2 && return (Ptr{Cuint}(x + 114), 7, 1) - f === :coplanarhorizon && return Ptr{Cuint}(x + 115) - f === :mergehorizon && return (Ptr{Cuint}(x + 115), 1, 1) - f === :cycledone && return (Ptr{Cuint}(x + 115), 2, 1) - f === :tested && return (Ptr{Cuint}(x + 115), 3, 1) - f === :keepcentrum && return (Ptr{Cuint}(x + 115), 4, 1) - f === :newmerge && return (Ptr{Cuint}(x + 115), 5, 1) - f === :degenerate && return (Ptr{Cuint}(x + 115), 6, 1) - f === :redundant && return (Ptr{Cuint}(x + 115), 7, 1) - return getfield(x, f) -end - -function Base.getproperty(x::facetT, f::Symbol) - r = Ref{facetT}(x) - ptr = Base.unsafe_convert(Ptr{facetT}, r) - fptr = getproperty(ptr, f) - begin - if fptr isa Ptr - return GC.@preserve(r, unsafe_load(fptr)) - else - (baseptr, offset, width) = fptr - ty = eltype(baseptr) - i8 = GC.@preserve(r, unsafe_load(baseptr)) - bitstr = bitstring(i8) - sig = bitstr[(end - offset) - (width - 1):end - offset] - zexted = lpad(sig, 8 * sizeof(ty), '0') - return parse(ty, zexted; base = 2) - end - end -end - -function Base.setproperty!(x::Ptr{facetT}, f::Symbol, v) - unsafe_store!(getproperty(x, f), v) -end - -struct ridgeT - data::NTuple{32, UInt8} -end - -function Base.getproperty(x::Ptr{ridgeT}, f::Symbol) - f === :vertices && return Ptr{Ptr{setT}}(x + 0) - f === :top && return Ptr{Ptr{facetT}}(x + 8) - f === :bottom && return Ptr{Ptr{facetT}}(x + 16) - f === :id && return Ptr{Cuint}(x + 24) - f === :seen && return Ptr{Cuint}(x + 28) - f === :tested && return (Ptr{Cuint}(x + 28), 1, 1) - f === :nonconvex && return (Ptr{Cuint}(x + 28), 2, 1) - f === :mergevertex && return (Ptr{Cuint}(x + 28), 3, 1) - f === :mergevertex2 && return (Ptr{Cuint}(x + 28), 4, 1) - f === :simplicialtop && return (Ptr{Cuint}(x + 28), 5, 1) - f === :simplicialbot && return (Ptr{Cuint}(x + 28), 6, 1) - return getfield(x, f) -end - -function Base.getproperty(x::ridgeT, f::Symbol) - r = Ref{ridgeT}(x) - ptr = Base.unsafe_convert(Ptr{ridgeT}, r) - fptr = getproperty(ptr, f) - begin - if fptr isa Ptr - return GC.@preserve(r, unsafe_load(fptr)) - else - (baseptr, offset, width) = fptr - ty = eltype(baseptr) - i8 = GC.@preserve(r, unsafe_load(baseptr)) - bitstr = bitstring(i8) - sig = bitstr[(end - offset) - (width - 1):end - offset] - zexted = lpad(sig, 8 * sizeof(ty), '0') - return parse(ty, zexted; base = 2) - end - end -end - -function Base.setproperty!(x::Ptr{ridgeT}, f::Symbol, v) - unsafe_store!(getproperty(x, f), v) -end - -@enum qh_CENTER::UInt32 begin - qh_ASnone = 0 - qh_ASvoronoi = 1 - qh_AScentrum = 2 -end - -struct qhmemT - BUFsize::Cint - BUFinit::Cint - TABLEsize::Cint - NUMsizes::Cint - LASTsize::Cint - ALIGNmask::Cint - freelists::Ptr{Ptr{Cvoid}} - sizetable::Ptr{Cint} - indextable::Ptr{Cint} - curbuffer::Ptr{Cvoid} - freemem::Ptr{Cvoid} - freesize::Cint - tempstack::Ptr{setT} - ferr::Ptr{Libc.FILE} - IStracing::Cint - cntquick::Cint - cntshort::Cint - cntlong::Cint - freeshort::Cint - freelong::Cint - totbuffer::Cint - totdropped::Cint - totfree::Cint - totlong::Cint - maxlong::Cint - totshort::Cint - totunused::Cint - cntlarger::Cint - totlarger::Cint -end - -struct intrealT - data::NTuple{8, UInt8} -end - -function Base.getproperty(x::Ptr{intrealT}, f::Symbol) - f === :i && return Ptr{Cint}(x + 0) - f === :r && return Ptr{Cdouble}(x + 0) - return getfield(x, f) -end - -function Base.getproperty(x::intrealT, f::Symbol) - r = Ref{intrealT}(x) - ptr = Base.unsafe_convert(Ptr{intrealT}, r) - fptr = getproperty(ptr, f) - GC.@preserve r unsafe_load(fptr) -end - -function Base.setproperty!(x::Ptr{intrealT}, f::Symbol, v) - unsafe_store!(getproperty(x, f), v) -end - -struct qhstatT - stats::NTuple{249, intrealT} - id::NTuple{259, Cuchar} - doc::NTuple{249, Cstring} - count::NTuple{249, Cshort} - type::NTuple{249, Cchar} - printed::NTuple{249, Cchar} - init::NTuple{9, intrealT} - next::Cint - precision::Cint - vridges::Cint - tempi::Cint - tempr::Cdouble -end - -struct qhT - ALLpoints::Cuint - ALLOWshort::Cuint - ALLOWwarning::Cuint - ALLOWwide::Cuint - ANGLEmerge::Cuint - APPROXhull::Cuint - MINoutside::Cdouble - ANNOTATEoutput::Cuint - ATinfinity::Cuint - AVOIDold::Cuint - BESToutside::Cuint - CDDinput::Cuint - CDDoutput::Cuint - CHECKduplicates::Cuint - CHECKfrequently::Cuint - premerge_cos::Cdouble - postmerge_cos::Cdouble - DELAUNAY::Cuint - DOintersections::Cuint - DROPdim::Cint - FLUSHprint::Cuint - FORCEoutput::Cuint - GOODpoint::Cint - GOODpointp::Ptr{Cdouble} - GOODthreshold::Cuint - GOODvertex::Cint - GOODvertexp::Ptr{Cdouble} - HALFspace::Cuint - ISqhullQh::Cuint - IStracing::Cint - KEEParea::Cint - KEEPcoplanar::Cuint - KEEPinside::Cuint - KEEPmerge::Cint - KEEPminArea::Cdouble - MAXcoplanar::Cdouble - MAXwide::Cint - MERGEexact::Cuint - MERGEindependent::Cuint - MERGING::Cuint - premerge_centrum::Cdouble - postmerge_centrum::Cdouble - MERGEpinched::Cuint - MERGEvertices::Cuint - MINvisible::Cdouble - NOnarrow::Cuint - NOnearinside::Cuint - NOpremerge::Cuint - ONLYgood::Cuint - ONLYmax::Cuint - PICKfurthest::Cuint - POSTmerge::Cuint - PREmerge::Cuint - PRINTcentrums::Cuint - PRINTcoplanar::Cuint - PRINTdim::Cint - PRINTdots::Cuint - PRINTgood::Cuint - PRINTinner::Cuint - PRINTneighbors::Cuint - PRINTnoplanes::Cuint - PRINToptions1st::Cuint - PRINTouter::Cuint - PRINTprecision::Cuint - PRINTout::NTuple{29, qh_PRINT} - PRINTridges::Cuint - PRINTspheres::Cuint - PRINTstatistics::Cuint - PRINTsummary::Cuint - PRINTtransparent::Cuint - PROJECTdelaunay::Cuint - PROJECTinput::Cint - RANDOMdist::Cuint - RANDOMfactor::Cdouble - RANDOMa::Cdouble - RANDOMb::Cdouble - RANDOMoutside::Cuint - REPORTfreq::Cint - REPORTfreq2::Cint - RERUN::Cint - ROTATErandom::Cint - SCALEinput::Cuint - SCALElast::Cuint - SETroundoff::Cuint - SKIPcheckmax::Cuint - SKIPconvex::Cuint - SPLITthresholds::Cuint - STOPadd::Cint - STOPcone::Cint - STOPpoint::Cint - TESTpoints::Cint - TESTvneighbors::Cuint - TRACElevel::Cint - TRACElastrun::Cint - TRACEpoint::Cint - TRACEdist::Cdouble - TRACEmerge::Cint - TRIangulate::Cuint - TRInormals::Cuint - UPPERdelaunay::Cuint - USEstdout::Cuint - VERIFYoutput::Cuint - VIRTUALmemory::Cuint - VORONOI::Cuint - AREAfactor::Cdouble - DOcheckmax::Cuint - feasible_string::Cstring - feasible_point::Ptr{Cdouble} - GETarea::Cuint - KEEPnearinside::Cuint - hull_dim::Cint - input_dim::Cint - num_points::Cint - first_point::Ptr{Cdouble} - POINTSmalloc::Cuint - input_points::Ptr{Cdouble} - input_malloc::Cuint - qhull_command::NTuple{256, Cchar} - qhull_commandsiz2::Cint - rbox_command::NTuple{256, Cchar} - qhull_options::NTuple{512, Cchar} - qhull_optionlen::Cint - qhull_optionsiz::Cint - qhull_optionsiz2::Cint - run_id::Cint - VERTEXneighbors::Cuint - ZEROcentrum::Cuint - upper_threshold::Ptr{Cdouble} - lower_threshold::Ptr{Cdouble} - upper_bound::Ptr{Cdouble} - lower_bound::Ptr{Cdouble} - ANGLEround::Cdouble - centrum_radius::Cdouble - cos_max::Cdouble - DISTround::Cdouble - MAXabs_coord::Cdouble - MAXlastcoord::Cdouble - MAXoutside::Cdouble - MAXsumcoord::Cdouble - MAXwidth::Cdouble - MINdenom_1::Cdouble - MINdenom::Cdouble - MINdenom_1_2::Cdouble - MINdenom_2::Cdouble - MINlastcoord::Cdouble - NEARzero::Ptr{Cdouble} - NEARinside::Cdouble - ONEmerge::Cdouble - outside_err::Cdouble - WIDEfacet::Cdouble - NARROWhull::Cuint - qhull::NTuple{6, Cchar} - errexit::jmp_buf - jmpXtra::NTuple{40, Cchar} - restartexit::jmp_buf - jmpXtra2::NTuple{40, Cchar} - # fin::Ptr{Libc.FILE} - fin::Ptr{Libc.FILE} - # fout::Ptr{Libc.FILE} - fout::Ptr{Libc.FILE} - # ferr::Ptr{Libc.FILE} - ferr::Ptr{Libc.FILE} - interior_point::Ptr{Cdouble} - normal_size::Cint - center_size::Cint - TEMPsize::Cint - facet_list::Ptr{facetT} - facet_tail::Ptr{facetT} - facet_next::Ptr{facetT} - newfacet_list::Ptr{facetT} - visible_list::Ptr{facetT} - num_visible::Cint - tracefacet_id::Cuint - tracefacet::Ptr{facetT} - traceridge_id::Cuint - traceridge::Ptr{ridgeT} - tracevertex_id::Cuint - # tracevertex::Ptr{vertexT} - tracevertex::Ptr{Cvoid} - # vertex_list::Ptr{vertexT} - vertex_list::Ptr{Cvoid} - # vertex_tail::Ptr{vertexT} - vertex_tail::Ptr{Cvoid} - # newvertex_list::Ptr{vertexT} - newvertex_list::Ptr{Cvoid} - num_facets::Cint - num_vertices::Cint - num_outside::Cint - num_good::Cint - facet_id::Cuint - ridge_id::Cuint - vertex_id::Cuint - first_newfacet::Cuint - hulltime::Culong - ALLOWrestart::Cuint - build_cnt::Cint - CENTERtype::qh_CENTER - furthest_id::Cint - last_errcode::Cint - GOODclosest::Ptr{facetT} - coplanar_apex::Ptr{Cdouble} - hasAreaVolume::Cuint - hasTriangulation::Cuint - isRenameVertex::Cuint - JOGGLEmax::Cdouble - maxoutdone::Cuint - max_outside::Cdouble - max_vertex::Cdouble - min_vertex::Cdouble - NEWfacets::Cuint - NEWtentative::Cuint - findbestnew::Cuint - findbest_notsharp::Cuint - NOerrexit::Cuint - PRINTcradius::Cdouble - PRINTradius::Cdouble - POSTmerging::Cuint - printoutvar::Cint - printoutnum::Cint - repart_facetid::Cuint - retry_addpoint::Cint - QHULLfinished::Cuint - totarea::Cdouble - totvol::Cdouble - visit_id::Cuint - vertex_visit::Cuint - WAScoplanar::Cuint - ZEROall_ok::Cuint - facet_mergeset::Ptr{setT} - degen_mergeset::Ptr{setT} - vertex_mergeset::Ptr{setT} - hash_table::Ptr{setT} - other_points::Ptr{setT} - del_vertices::Ptr{setT} - gm_matrix::Ptr{Cdouble} - gm_row::Ptr{Ptr{Cdouble}} - line::Cstring - maxline::Cint - half_space::Ptr{Cdouble} - temp_malloc::Ptr{Cdouble} - ERREXITcalled::Cuint - firstcentrum::Cuint - old_randomdist::Cuint - coplanarfacetset::Ptr{setT} - last_low::Cdouble - last_high::Cdouble - last_newhigh::Cdouble - lastcpu::Cdouble - lastfacets::Cint - lastmerges::Cint - lastplanes::Cint - lastdist::Cint - lastreport::Cuint - mergereport::Cint - old_tempstack::Ptr{setT} - ridgeoutnum::Cint - last_random::Cint - rbox_errexit::jmp_buf - jmpXtra3::NTuple{40, Cchar} - rbox_isinteger::Cint - rbox_out_offset::Cdouble - cpp_object::Ptr{Cvoid} - cpp_other::Ptr{Cvoid} - cpp_user::Ptr{Cvoid} - qhmem::qhmemT - qhstat::qhstatT -end - -function Base.getproperty(x::Ptr{qhT}, f::Symbol) - f === :ALLpoints && return Ptr{Cuint}(x + 0) - f === :ALLOWshort && return Ptr{Cuint}(x + 4) - f === :ALLOWwarning && return Ptr{Cuint}(x + 8) - f === :ALLOWwide && return Ptr{Cuint}(x + 12) - f === :ANGLEmerge && return Ptr{Cuint}(x + 16) - f === :APPROXhull && return Ptr{Cuint}(x + 20) - f === :MINoutside && return Ptr{Cdouble}(x + 24) - f === :ANNOTATEoutput && return Ptr{Cuint}(x + 32) - f === :ATinfinity && return Ptr{Cuint}(x + 36) - f === :AVOIDold && return Ptr{Cuint}(x + 40) - f === :BESToutside && return Ptr{Cuint}(x + 44) - f === :CDDinput && return Ptr{Cuint}(x + 48) - f === :CDDoutput && return Ptr{Cuint}(x + 52) - f === :CHECKduplicates && return Ptr{Cuint}(x + 56) - f === :CHECKfrequently && return Ptr{Cuint}(x + 60) - f === :premerge_cos && return Ptr{Cdouble}(x + 64) - f === :postmerge_cos && return Ptr{Cdouble}(x + 72) - f === :DELAUNAY && return Ptr{Cuint}(x + 80) - f === :DOintersections && return Ptr{Cuint}(x + 84) - f === :DROPdim && return Ptr{Cint}(x + 88) - f === :FLUSHprint && return Ptr{Cuint}(x + 92) - f === :FORCEoutput && return Ptr{Cuint}(x + 96) - f === :GOODpoint && return Ptr{Cint}(x + 100) - f === :GOODpointp && return Ptr{Ptr{Cdouble}}(x + 104) - f === :GOODthreshold && return Ptr{Cuint}(x + 112) - f === :GOODvertex && return Ptr{Cint}(x + 116) - f === :GOODvertexp && return Ptr{Ptr{Cdouble}}(x + 120) - f === :HALFspace && return Ptr{Cuint}(x + 128) - f === :ISqhullQh && return Ptr{Cuint}(x + 132) - f === :IStracing && return Ptr{Cint}(x + 136) - f === :KEEParea && return Ptr{Cint}(x + 140) - f === :KEEPcoplanar && return Ptr{Cuint}(x + 144) - f === :KEEPinside && return Ptr{Cuint}(x + 148) - f === :KEEPmerge && return Ptr{Cint}(x + 152) - f === :KEEPminArea && return Ptr{Cdouble}(x + 160) - f === :MAXcoplanar && return Ptr{Cdouble}(x + 168) - f === :MAXwide && return Ptr{Cint}(x + 176) - f === :MERGEexact && return Ptr{Cuint}(x + 180) - f === :MERGEindependent && return Ptr{Cuint}(x + 184) - f === :MERGING && return Ptr{Cuint}(x + 188) - f === :premerge_centrum && return Ptr{Cdouble}(x + 192) - f === :postmerge_centrum && return Ptr{Cdouble}(x + 200) - f === :MERGEpinched && return Ptr{Cuint}(x + 208) - f === :MERGEvertices && return Ptr{Cuint}(x + 212) - f === :MINvisible && return Ptr{Cdouble}(x + 216) - f === :NOnarrow && return Ptr{Cuint}(x + 224) - f === :NOnearinside && return Ptr{Cuint}(x + 228) - f === :NOpremerge && return Ptr{Cuint}(x + 232) - f === :ONLYgood && return Ptr{Cuint}(x + 236) - f === :ONLYmax && return Ptr{Cuint}(x + 240) - f === :PICKfurthest && return Ptr{Cuint}(x + 244) - f === :POSTmerge && return Ptr{Cuint}(x + 248) - f === :PREmerge && return Ptr{Cuint}(x + 252) - f === :PRINTcentrums && return Ptr{Cuint}(x + 256) - f === :PRINTcoplanar && return Ptr{Cuint}(x + 260) - f === :PRINTdim && return Ptr{Cint}(x + 264) - f === :PRINTdots && return Ptr{Cuint}(x + 268) - f === :PRINTgood && return Ptr{Cuint}(x + 272) - f === :PRINTinner && return Ptr{Cuint}(x + 276) - f === :PRINTneighbors && return Ptr{Cuint}(x + 280) - f === :PRINTnoplanes && return Ptr{Cuint}(x + 284) - f === :PRINToptions1st && return Ptr{Cuint}(x + 288) - f === :PRINTouter && return Ptr{Cuint}(x + 292) - f === :PRINTprecision && return Ptr{Cuint}(x + 296) - f === :PRINTout && return Ptr{NTuple{29, qh_PRINT}}(x + 300) - f === :PRINTridges && return Ptr{Cuint}(x + 416) - f === :PRINTspheres && return Ptr{Cuint}(x + 420) - f === :PRINTstatistics && return Ptr{Cuint}(x + 424) - f === :PRINTsummary && return Ptr{Cuint}(x + 428) - f === :PRINTtransparent && return Ptr{Cuint}(x + 432) - f === :PROJECTdelaunay && return Ptr{Cuint}(x + 436) - f === :PROJECTinput && return Ptr{Cint}(x + 440) - f === :RANDOMdist && return Ptr{Cuint}(x + 444) - f === :RANDOMfactor && return Ptr{Cdouble}(x + 448) - f === :RANDOMa && return Ptr{Cdouble}(x + 456) - f === :RANDOMb && return Ptr{Cdouble}(x + 464) - f === :RANDOMoutside && return Ptr{Cuint}(x + 472) - f === :REPORTfreq && return Ptr{Cint}(x + 476) - f === :REPORTfreq2 && return Ptr{Cint}(x + 480) - f === :RERUN && return Ptr{Cint}(x + 484) - f === :ROTATErandom && return Ptr{Cint}(x + 488) - f === :SCALEinput && return Ptr{Cuint}(x + 492) - f === :SCALElast && return Ptr{Cuint}(x + 496) - f === :SETroundoff && return Ptr{Cuint}(x + 500) - f === :SKIPcheckmax && return Ptr{Cuint}(x + 504) - f === :SKIPconvex && return Ptr{Cuint}(x + 508) - f === :SPLITthresholds && return Ptr{Cuint}(x + 512) - f === :STOPadd && return Ptr{Cint}(x + 516) - f === :STOPcone && return Ptr{Cint}(x + 520) - f === :STOPpoint && return Ptr{Cint}(x + 524) - f === :TESTpoints && return Ptr{Cint}(x + 528) - f === :TESTvneighbors && return Ptr{Cuint}(x + 532) - f === :TRACElevel && return Ptr{Cint}(x + 536) - f === :TRACElastrun && return Ptr{Cint}(x + 540) - f === :TRACEpoint && return Ptr{Cint}(x + 544) - f === :TRACEdist && return Ptr{Cdouble}(x + 552) - f === :TRACEmerge && return Ptr{Cint}(x + 560) - f === :TRIangulate && return Ptr{Cuint}(x + 564) - f === :TRInormals && return Ptr{Cuint}(x + 568) - f === :UPPERdelaunay && return Ptr{Cuint}(x + 572) - f === :USEstdout && return Ptr{Cuint}(x + 576) - f === :VERIFYoutput && return Ptr{Cuint}(x + 580) - f === :VIRTUALmemory && return Ptr{Cuint}(x + 584) - f === :VORONOI && return Ptr{Cuint}(x + 588) - f === :AREAfactor && return Ptr{Cdouble}(x + 592) - f === :DOcheckmax && return Ptr{Cuint}(x + 600) - f === :feasible_string && return Ptr{Cstring}(x + 608) - f === :feasible_point && return Ptr{Ptr{Cdouble}}(x + 616) - f === :GETarea && return Ptr{Cuint}(x + 624) - f === :KEEPnearinside && return Ptr{Cuint}(x + 628) - f === :hull_dim && return Ptr{Cint}(x + 632) - f === :input_dim && return Ptr{Cint}(x + 636) - f === :num_points && return Ptr{Cint}(x + 640) - f === :first_point && return Ptr{Ptr{Cdouble}}(x + 648) - f === :POINTSmalloc && return Ptr{Cuint}(x + 656) - f === :input_points && return Ptr{Ptr{Cdouble}}(x + 664) - f === :input_malloc && return Ptr{Cuint}(x + 672) - f === :qhull_command && return Ptr{NTuple{256, Cchar}}(x + 676) - f === :qhull_commandsiz2 && return Ptr{Cint}(x + 932) - f === :rbox_command && return Ptr{NTuple{256, Cchar}}(x + 936) - f === :qhull_options && return Ptr{NTuple{512, Cchar}}(x + 1192) - f === :qhull_optionlen && return Ptr{Cint}(x + 1704) - f === :qhull_optionsiz && return Ptr{Cint}(x + 1708) - f === :qhull_optionsiz2 && return Ptr{Cint}(x + 1712) - f === :run_id && return Ptr{Cint}(x + 1716) - f === :VERTEXneighbors && return Ptr{Cuint}(x + 1720) - f === :ZEROcentrum && return Ptr{Cuint}(x + 1724) - f === :upper_threshold && return Ptr{Ptr{Cdouble}}(x + 1728) - f === :lower_threshold && return Ptr{Ptr{Cdouble}}(x + 1736) - f === :upper_bound && return Ptr{Ptr{Cdouble}}(x + 1744) - f === :lower_bound && return Ptr{Ptr{Cdouble}}(x + 1752) - f === :ANGLEround && return Ptr{Cdouble}(x + 1760) - f === :centrum_radius && return Ptr{Cdouble}(x + 1768) - f === :cos_max && return Ptr{Cdouble}(x + 1776) - f === :DISTround && return Ptr{Cdouble}(x + 1784) - f === :MAXabs_coord && return Ptr{Cdouble}(x + 1792) - f === :MAXlastcoord && return Ptr{Cdouble}(x + 1800) - f === :MAXoutside && return Ptr{Cdouble}(x + 1808) - f === :MAXsumcoord && return Ptr{Cdouble}(x + 1816) - f === :MAXwidth && return Ptr{Cdouble}(x + 1824) - f === :MINdenom_1 && return Ptr{Cdouble}(x + 1832) - f === :MINdenom && return Ptr{Cdouble}(x + 1840) - f === :MINdenom_1_2 && return Ptr{Cdouble}(x + 1848) - f === :MINdenom_2 && return Ptr{Cdouble}(x + 1856) - f === :MINlastcoord && return Ptr{Cdouble}(x + 1864) - f === :NEARzero && return Ptr{Ptr{Cdouble}}(x + 1872) - f === :NEARinside && return Ptr{Cdouble}(x + 1880) - f === :ONEmerge && return Ptr{Cdouble}(x + 1888) - f === :outside_err && return Ptr{Cdouble}(x + 1896) - f === :WIDEfacet && return Ptr{Cdouble}(x + 1904) - f === :NARROWhull && return Ptr{Cuint}(x + 1912) - f === :qhull && return Ptr{NTuple{6, Cchar}}(x + 1916) - f === :errexit && return Ptr{jmp_buf}(x + 1924) - f === :jmpXtra && return Ptr{NTuple{40, Cchar}}(x + 2072) - f === :restartexit && return Ptr{jmp_buf}(x + 2112) - f === :jmpXtra2 && return Ptr{NTuple{40, Cchar}}(x + 2260) - f === :fin && return Ptr{Ptr{Libc.FILE}}(x + 2304) - f === :fout && return Ptr{Ptr{Libc.FILE}}(x + 2312) - f === :ferr && return Ptr{Ptr{Libc.FILE}}(x + 2320) - f === :interior_point && return Ptr{Ptr{Cdouble}}(x + 2328) - f === :normal_size && return Ptr{Cint}(x + 2336) - f === :center_size && return Ptr{Cint}(x + 2340) - f === :TEMPsize && return Ptr{Cint}(x + 2344) - f === :facet_list && return Ptr{Ptr{facetT}}(x + 2352) - f === :facet_tail && return Ptr{Ptr{facetT}}(x + 2360) - f === :facet_next && return Ptr{Ptr{facetT}}(x + 2368) - f === :newfacet_list && return Ptr{Ptr{facetT}}(x + 2376) - f === :visible_list && return Ptr{Ptr{facetT}}(x + 2384) - f === :num_visible && return Ptr{Cint}(x + 2392) - f === :tracefacet_id && return Ptr{Cuint}(x + 2396) - f === :tracefacet && return Ptr{Ptr{facetT}}(x + 2400) - f === :traceridge_id && return Ptr{Cuint}(x + 2408) - f === :traceridge && return Ptr{Ptr{ridgeT}}(x + 2416) - f === :tracevertex_id && return Ptr{Cuint}(x + 2424) - f === :tracevertex && return Ptr{Ptr{vertexT}}(x + 2432) - f === :vertex_list && return Ptr{Ptr{vertexT}}(x + 2440) - f === :vertex_tail && return Ptr{Ptr{vertexT}}(x + 2448) - f === :newvertex_list && return Ptr{Ptr{vertexT}}(x + 2456) - f === :num_facets && return Ptr{Cint}(x + 2464) - f === :num_vertices && return Ptr{Cint}(x + 2468) - f === :num_outside && return Ptr{Cint}(x + 2472) - f === :num_good && return Ptr{Cint}(x + 2476) - f === :facet_id && return Ptr{Cuint}(x + 2480) - f === :ridge_id && return Ptr{Cuint}(x + 2484) - f === :vertex_id && return Ptr{Cuint}(x + 2488) - f === :first_newfacet && return Ptr{Cuint}(x + 2492) - f === :hulltime && return Ptr{Culong}(x + 2496) - f === :ALLOWrestart && return Ptr{Cuint}(x + 2504) - f === :build_cnt && return Ptr{Cint}(x + 2508) - f === :CENTERtype && return Ptr{qh_CENTER}(x + 2512) - f === :furthest_id && return Ptr{Cint}(x + 2516) - f === :last_errcode && return Ptr{Cint}(x + 2520) - f === :GOODclosest && return Ptr{Ptr{facetT}}(x + 2528) - f === :coplanar_apex && return Ptr{Ptr{Cdouble}}(x + 2536) - f === :hasAreaVolume && return Ptr{Cuint}(x + 2544) - f === :hasTriangulation && return Ptr{Cuint}(x + 2548) - f === :isRenameVertex && return Ptr{Cuint}(x + 2552) - f === :JOGGLEmax && return Ptr{Cdouble}(x + 2560) - f === :maxoutdone && return Ptr{Cuint}(x + 2568) - f === :max_outside && return Ptr{Cdouble}(x + 2576) - f === :max_vertex && return Ptr{Cdouble}(x + 2584) - f === :min_vertex && return Ptr{Cdouble}(x + 2592) - f === :NEWfacets && return Ptr{Cuint}(x + 2600) - f === :NEWtentative && return Ptr{Cuint}(x + 2604) - f === :findbestnew && return Ptr{Cuint}(x + 2608) - f === :findbest_notsharp && return Ptr{Cuint}(x + 2612) - f === :NOerrexit && return Ptr{Cuint}(x + 2616) - f === :PRINTcradius && return Ptr{Cdouble}(x + 2624) - f === :PRINTradius && return Ptr{Cdouble}(x + 2632) - f === :POSTmerging && return Ptr{Cuint}(x + 2640) - f === :printoutvar && return Ptr{Cint}(x + 2644) - f === :printoutnum && return Ptr{Cint}(x + 2648) - f === :repart_facetid && return Ptr{Cuint}(x + 2652) - f === :retry_addpoint && return Ptr{Cint}(x + 2656) - f === :QHULLfinished && return Ptr{Cuint}(x + 2660) - f === :totarea && return Ptr{Cdouble}(x + 2664) - f === :totvol && return Ptr{Cdouble}(x + 2672) - f === :visit_id && return Ptr{Cuint}(x + 2680) - f === :vertex_visit && return Ptr{Cuint}(x + 2684) - f === :WAScoplanar && return Ptr{Cuint}(x + 2688) - f === :ZEROall_ok && return Ptr{Cuint}(x + 2692) - f === :facet_mergeset && return Ptr{Ptr{setT}}(x + 2696) - f === :degen_mergeset && return Ptr{Ptr{setT}}(x + 2704) - f === :vertex_mergeset && return Ptr{Ptr{setT}}(x + 2712) - f === :hash_table && return Ptr{Ptr{setT}}(x + 2720) - f === :other_points && return Ptr{Ptr{setT}}(x + 2728) - f === :del_vertices && return Ptr{Ptr{setT}}(x + 2736) - f === :gm_matrix && return Ptr{Ptr{Cdouble}}(x + 2744) - f === :gm_row && return Ptr{Ptr{Ptr{Cdouble}}}(x + 2752) - f === :line && return Ptr{Cstring}(x + 2760) - f === :maxline && return Ptr{Cint}(x + 2768) - f === :half_space && return Ptr{Ptr{Cdouble}}(x + 2776) - f === :temp_malloc && return Ptr{Ptr{Cdouble}}(x + 2784) - f === :ERREXITcalled && return Ptr{Cuint}(x + 2792) - f === :firstcentrum && return Ptr{Cuint}(x + 2796) - f === :old_randomdist && return Ptr{Cuint}(x + 2800) - f === :coplanarfacetset && return Ptr{Ptr{setT}}(x + 2808) - f === :last_low && return Ptr{Cdouble}(x + 2816) - f === :last_high && return Ptr{Cdouble}(x + 2824) - f === :last_newhigh && return Ptr{Cdouble}(x + 2832) - f === :lastcpu && return Ptr{Cdouble}(x + 2840) - f === :lastfacets && return Ptr{Cint}(x + 2848) - f === :lastmerges && return Ptr{Cint}(x + 2852) - f === :lastplanes && return Ptr{Cint}(x + 2856) - f === :lastdist && return Ptr{Cint}(x + 2860) - f === :lastreport && return Ptr{Cuint}(x + 2864) - f === :mergereport && return Ptr{Cint}(x + 2868) - f === :old_tempstack && return Ptr{Ptr{setT}}(x + 2872) - f === :ridgeoutnum && return Ptr{Cint}(x + 2880) - f === :last_random && return Ptr{Cint}(x + 2884) - f === :rbox_errexit && return Ptr{jmp_buf}(x + 2888) - f === :jmpXtra3 && return Ptr{NTuple{40, Cchar}}(x + 3036) - f === :rbox_isinteger && return Ptr{Cint}(x + 3076) - f === :rbox_out_offset && return Ptr{Cdouble}(x + 3080) - f === :cpp_object && return Ptr{Ptr{Cvoid}}(x + 3088) - f === :cpp_other && return Ptr{Ptr{Cvoid}}(x + 3096) - f === :cpp_user && return Ptr{Ptr{Cvoid}}(x + 3104) - f === :qhmem && return Ptr{qhmemT}(x + 3112) - f === :qhstat && return Ptr{qhstatT}(x + 3264) - return getfield(x, f) -end - -function Base.getproperty(x::qhT, f::Symbol) - r = Ref{qhT}(x) - ptr = Base.unsafe_convert(Ptr{qhT}, r) - fptr = getproperty(ptr, f) - GC.@preserve r unsafe_load(fptr) -end - -function Base.setproperty!(x::Ptr{qhT}, f::Symbol, v) - unsafe_store!(getproperty(x, f), v) -end - -const ptr_intT = Clong - -function qh_memalloc(qh, insize) - ccall((:qh_memalloc, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Cint), qh, insize) -end - -function qh_memcheck(qh) - ccall((:qh_memcheck, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_memfree(qh, object, insize) - ccall((:qh_memfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cvoid}, Cint), qh, object, insize) -end - -function qh_memfreeshort(qh, curlong, totlong) - ccall((:qh_memfreeshort, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}), qh, curlong, totlong) -end - -function qh_meminit(qh, ferr) - ccall((:qh_meminit, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, ferr) -end - -function qh_meminitbuffers(qh, tracelevel, alignment, numsizes, bufsize, bufinit) - ccall((:qh_meminitbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Cint, Cint, Cint), qh, tracelevel, alignment, numsizes, bufsize, bufinit) -end - -function qh_memsetup(qh) - ccall((:qh_memsetup, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_memsize(qh, size) - ccall((:qh_memsize, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, size) -end - -function qh_memstatistics(qh, fp) - ccall((:qh_memstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) -end - -function qh_memtotal(qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) - ccall((:qh_memtotal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), qh, totlong, curlong, totshort, curshort, maxlong, totbuffer) -end - -function qh_setaddsorted(qh, setp, elem) - ccall((:qh_setaddsorted, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) -end - -function qh_setaddnth(qh, setp, nth, newelem) - ccall((:qh_setaddnth, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint, Ptr{Cvoid}), qh, setp, nth, newelem) -end - -function qh_setappend(qh, setp, elem) - ccall((:qh_setappend, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) -end - -function qh_setappend_set(qh, setp, setA) - ccall((:qh_setappend_set, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{setT}), qh, setp, setA) -end - -function qh_setappend2ndlast(qh, setp, elem) - ccall((:qh_setappend2ndlast, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, setp, elem) -end - -function qh_setcheck(qh, set, tname, id) - ccall((:qh_setcheck, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cstring, Cuint), qh, set, tname, id) -end - -function qh_setcompact(qh, set) - ccall((:qh_setcompact, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) -end - -function qh_setcopy(qh, set, extra) - ccall((:qh_setcopy, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, extra) -end - -function qh_setdel(set, elem) - ccall((:qh_setdel, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, elem) -end - -function qh_setdellast(set) - ccall((:qh_setdellast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) -end - -function qh_setdelnth(qh, set, nth) - ccall((:qh_setdelnth, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) -end - -function qh_setdelnthsorted(qh, set, nth) - ccall((:qh_setdelnthsorted, libqhull_r), Ptr{Cvoid}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, nth) -end - -function qh_setdelsorted(set, newelem) - ccall((:qh_setdelsorted, libqhull_r), Ptr{Cvoid}, (Ptr{setT}, Ptr{Cvoid}), set, newelem) -end - -function qh_setduplicate(qh, set, elemsize) - ccall((:qh_setduplicate, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, elemsize) -end - -function qh_setendpointer(set) - ccall((:qh_setendpointer, libqhull_r), Ptr{Ptr{Cvoid}}, (Ptr{setT},), set) -end - -function qh_setequal(setA, setB) - ccall((:qh_setequal, libqhull_r), Cint, (Ptr{setT}, Ptr{setT}), setA, setB) -end - -function qh_setequal_except(setA, skipelemA, setB, skipelemB) - ccall((:qh_setequal_except, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}, Ptr{setT}, Ptr{Cvoid}), setA, skipelemA, setB, skipelemB) -end - -function qh_setequal_skip(setA, skipA, setB, skipB) - ccall((:qh_setequal_skip, libqhull_r), Cint, (Ptr{setT}, Cint, Ptr{setT}, Cint), setA, skipA, setB, skipB) -end - -function qh_setfree(qh, set) - ccall((:qh_setfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) -end - -function qh_setfree2(qh, setp, elemsize) - ccall((:qh_setfree2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}, Cint), qh, setp, elemsize) -end - -function qh_setfreelong(qh, set) - ccall((:qh_setfreelong, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) -end - -function qh_setin(set, setelem) - ccall((:qh_setin, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) -end - -function qh_setindex(set, setelem) - ccall((:qh_setindex, libqhull_r), Cint, (Ptr{setT}, Ptr{Cvoid}), set, setelem) -end - -function qh_setlarger(qh, setp) - ccall((:qh_setlarger, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, setp) -end - -function qh_setlarger_quick(qh, setsize, newsize) - ccall((:qh_setlarger_quick, libqhull_r), Cint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, setsize, newsize) -end - -function qh_setlast(set) - ccall((:qh_setlast, libqhull_r), Ptr{Cvoid}, (Ptr{setT},), set) -end - -function qh_setnew(qh, size) - ccall((:qh_setnew, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, size) -end - -function qh_setnew_delnthsorted(qh, set, size, nth, prepend) - ccall((:qh_setnew_delnthsorted, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{setT}, Cint, Cint, Cint), qh, set, size, nth, prepend) -end - -function qh_setprint(qh, fp, string, set) - ccall((:qh_setprint, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cstring, Ptr{setT}), qh, fp, string, set) -end - -function qh_setreplace(qh, set, oldelem, newelem) - ccall((:qh_setreplace, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Ptr{Cvoid}, Ptr{Cvoid}), qh, set, oldelem, newelem) -end - -function qh_setsize(qh, set) - ccall((:qh_setsize, libqhull_r), Cint, (Ptr{qhT}, Ptr{setT}), qh, set) -end - -function qh_settemp(qh, setsize) - ccall((:qh_settemp, libqhull_r), Ptr{setT}, (Ptr{qhT}, Cint), qh, setsize) -end - -function qh_settempfree(qh, set) - ccall((:qh_settempfree, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{setT}}), qh, set) -end - -function qh_settempfree_all(qh) - ccall((:qh_settempfree_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_settemppop(qh) - ccall((:qh_settemppop, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) -end - -function qh_settemppush(qh, set) - ccall((:qh_settemppush, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}), qh, set) -end - -function qh_settruncate(qh, set, size) - ccall((:qh_settruncate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint), qh, set, size) -end - -function qh_setunique(qh, set, elem) - ccall((:qh_setunique, libqhull_r), Cint, (Ptr{qhT}, Ptr{Ptr{setT}}, Ptr{Cvoid}), qh, set, elem) -end - -function qh_setzero(qh, set, idx, size) - ccall((:qh_setzero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{setT}, Cint, Cint), qh, set, idx, size) -end - -@enum qh_pointT::Int32 begin - qh_IDnone = -3 - qh_IDinterior = -2 - qh_IDunknown = -1 -end - -@enum qh_statistics::UInt32 begin - Zacoplanar = 0 - Wacoplanarmax = 1 - Wacoplanartot = 2 - Zangle = 3 - Wangle = 4 - Wanglemax = 5 - Wanglemin = 6 - Zangletests = 7 - Wareatot = 8 - Wareamax = 9 - Wareamin = 10 - Zavoidold = 11 - Wavoidoldmax = 12 - Wavoidoldtot = 13 - Zback0 = 14 - Zbestcentrum = 15 - Zbestdist = 16 - Zbestlower = 17 - Zbestlowerall = 18 - Zbestloweralln = 19 - Zbestlowerv = 20 - Zcentrumtests = 21 - Zcheckpart = 22 - Zcomputefurthest = 23 - Zconcave = 24 - Wconcavemax = 25 - Wconcavetot = 26 - Zconcavecoplanar = 27 - Wconcavecoplanarmax = 28 - Wconcavecoplanartot = 29 - Zconcavecoplanarridge = 30 - Zconcaveridge = 31 - Zconcaveridges = 32 - Zcoplanar = 33 - Wcoplanarmax = 34 - Wcoplanartot = 35 - Zcoplanarangle = 36 - Zcoplanarcentrum = 37 - Zcoplanarhorizon = 38 - Zcoplanarinside = 39 - Zcoplanarpart = 40 - Zcoplanarridges = 41 - Wcpu = 42 - Zcyclefacetmax = 43 - Zcyclefacettot = 44 - Zcyclehorizon = 45 - Zcyclevertex = 46 - Zdegen = 47 - Wdegenmax = 48 - Wdegentot = 49 - Zdegenvertex = 50 - Zdelfacetdup = 51 - Zdelridge = 52 - Zdelvertextot = 53 - Zdelvertexmax = 54 - Zdetfacetarea = 55 - Zdetsimplex = 56 - Zdistcheck = 57 - Zdistconvex = 58 - Zdistgood = 59 - Zdistio = 60 - Zdistplane = 61 - Zdiststat = 62 - Zdistvertex = 63 - Zdistzero = 64 - Zdoc1 = 65 - Zdoc2 = 66 - Zdoc3 = 67 - Zdoc4 = 68 - Zdoc5 = 69 - Zdoc6 = 70 - Zdoc7 = 71 - Zdoc8 = 72 - Zdoc9 = 73 - Zdoc10 = 74 - Zdoc11 = 75 - Zdoc12 = 76 - Zdropdegen = 77 - Zdropneighbor = 78 - Zdupflip = 79 - Zduplicate = 80 - Wduplicatemax = 81 - Wduplicatetot = 82 - Zdupsame = 83 - Zflipped = 84 - Wflippedmax = 85 - Wflippedtot = 86 - Zflippedfacets = 87 - Zflipridge = 88 - Zflipridge2 = 89 - Zfindbest = 90 - Zfindbestmax = 91 - Zfindbesttot = 92 - Zfindcoplanar = 93 - Zfindfail = 94 - Zfindhorizon = 95 - Zfindhorizonmax = 96 - Zfindhorizontot = 97 - Zfindjump = 98 - Zfindnew = 99 - Zfindnewmax = 100 - Zfindnewtot = 101 - Zfindnewjump = 102 - Zfindnewsharp = 103 - Zgauss0 = 104 - Zgoodfacet = 105 - Zhashlookup = 106 - Zhashridge = 107 - Zhashridgetest = 108 - Zhashtests = 109 - Zinsidevisible = 110 - Zintersect = 111 - Zintersectfail = 112 - Zintersectmax = 113 - Zintersectnum = 114 - Zintersecttot = 115 - Zmaxneighbors = 116 - Wmaxout = 117 - Wmaxoutside = 118 - Zmaxridges = 119 - Zmaxvertex = 120 - Zmaxvertices = 121 - Zmaxvneighbors = 122 - Zmemfacets = 123 - Zmempoints = 124 - Zmemridges = 125 - Zmemvertices = 126 - Zmergeflipdup = 127 - Zmergehorizon = 128 - Zmergeinittot = 129 - Zmergeinitmax = 130 - Zmergeinittot2 = 131 - Zmergeintocoplanar = 132 - Zmergeintohorizon = 133 - Zmergenew = 134 - Zmergesettot = 135 - Zmergesetmax = 136 - Zmergesettot2 = 137 - Zmergesimplex = 138 - Zmergevertex = 139 - Wmindenom = 140 - Wminvertex = 141 - Zminnorm = 142 - Zmultiridge = 143 - Znearlysingular = 144 - Zredundant = 145 - Wnewbalance = 146 - Wnewbalance2 = 147 - Znewbesthorizon = 148 - Znewfacettot = 149 - Znewfacetmax = 150 - Znewvertex = 151 - Wnewvertex = 152 - Wnewvertexmax = 153 - Znewvertexridge = 154 - Znoarea = 155 - Znonsimplicial = 156 - Znowsimplicial = 157 - Znotgood = 158 - Znotgoodnew = 159 - Znotmax = 160 - Znumfacets = 161 - Znummergemax = 162 - Znummergetot = 163 - Znumneighbors = 164 - Znumridges = 165 - Znumvertices = 166 - Znumvisibility = 167 - Znumvneighbors = 168 - Zonehorizon = 169 - Zpartangle = 170 - Zpartcoplanar = 171 - Zpartcorner = 172 - Zparthidden = 173 - Zpartinside = 174 - Zpartition = 175 - Zpartitionall = 176 - Zpartnear = 177 - Zparttwisted = 178 - Zpbalance = 179 - Wpbalance = 180 - Wpbalance2 = 181 - Zpinchduplicate = 182 - Zpinchedapex = 183 - Zpinchedvertex = 184 - Zpostfacets = 185 - Zpremergetot = 186 - Zprocessed = 187 - Zremvertex = 188 - Zremvertexdel = 189 - Zredundantmerge = 190 - Zrenameall = 191 - Zrenamepinch = 192 - Zrenameshare = 193 - Zretry = 194 - Wretrymax = 195 - Zretryadd = 196 - Zretryaddmax = 197 - Zretryaddtot = 198 - Zridge = 199 - Wridge = 200 - Wridgemax = 201 - Zridge0 = 202 - Wridge0 = 203 - Wridge0max = 204 - Zridgemid = 205 - Wridgemid = 206 - Wridgemidmax = 207 - Zridgeok = 208 - Wridgeok = 209 - Wridgeokmax = 210 - Zsearchpoints = 211 - Zsetplane = 212 - Ztestvneighbor = 213 - Ztotcheck = 214 - Ztothorizon = 215 - Ztotmerge = 216 - Ztotpartcoplanar = 217 - Ztotpartition = 218 - Ztotridges = 219 - Ztotvertices = 220 - Ztotvisible = 221 - Ztricoplanar = 222 - Ztricoplanarmax = 223 - Ztricoplanartot = 224 - Ztridegen = 225 - Ztrimirror = 226 - Ztrinull = 227 - Ztwisted = 228 - Wtwistedtot = 229 - Wtwistedmax = 230 - Ztwistedridge = 231 - Zvertextests = 232 - Wvertexmax = 233 - Wvertexmin = 234 - Zvertexridge = 235 - Zvertexridgetot = 236 - Zvertexridgemax = 237 - Zvertices = 238 - Zvisfacettot = 239 - Zvisfacetmax = 240 - Zvisit = 241 - Zvisit2max = 242 - Zvisvertextot = 243 - Zvisvertexmax = 244 - Zvvisit = 245 - Zvvisit2max = 246 - Zwidefacet = 247 - Zwidevertices = 248 - ZEND = 249 -end - -@enum ztypes::UInt32 begin - zdoc = 0 - zinc = 1 - zadd = 2 - zmax = 3 - zmin = 4 - ZTYPEreal = 5 - wadd = 6 - wmax = 7 - wmin = 8 - ZTYPEend = 9 -end - -function qh_allstatA(qh) - ccall((:qh_allstatA, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_allstatB(qh) - ccall((:qh_allstatB, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_allstatC(qh) - ccall((:qh_allstatC, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_allstatD(qh) - ccall((:qh_allstatD, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_allstatE(qh) - ccall((:qh_allstatE, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_allstatE2(qh) - ccall((:qh_allstatE2, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_allstatF(qh) - ccall((:qh_allstatF, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_allstatG(qh) - ccall((:qh_allstatG, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_allstatH(qh) - ccall((:qh_allstatH, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_allstatI(qh) - ccall((:qh_allstatI, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_allstatistics(qh) - ccall((:qh_allstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_collectstatistics(qh) - ccall((:qh_collectstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_initstatistics(qh) - ccall((:qh_initstatistics, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_newstats(qh, idx, nextindex) - ccall((:qh_newstats, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Cint}), qh, idx, nextindex) -end - -function qh_nostatistic(qh, i) - ccall((:qh_nostatistic, libqhull_r), Cuint, (Ptr{qhT}, Cint), qh, i) -end - -function qh_printallstatistics(qh, fp, string) - ccall((:qh_printallstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cstring), qh, fp, string) -end - -function qh_printstatistics(qh, fp, string) - ccall((:qh_printstatistics, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cstring), qh, fp, string) -end - -function qh_printstatlevel(qh, fp, id) - ccall((:qh_printstatlevel, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint), qh, fp, id) -end - -function qh_printstats(qh, fp, idx, nextindex) - ccall((:qh_printstats, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cint, Ptr{Cint}), qh, fp, idx, nextindex) -end - -function qh_stddev(qh, num, tot, tot2, ave) - ccall((:qh_stddev, libqhull_r), Cdouble, (Ptr{qhT}, Cint, Cdouble, Cdouble, Ptr{Cdouble}), qh, num, tot, tot2, ave) -end - -struct vertexT - data::NTuple{48, UInt8} -end - -function Base.getproperty(x::Ptr{vertexT}, f::Symbol) - f === :next && return Ptr{Ptr{vertexT}}(x + 0) - f === :previous && return Ptr{Ptr{vertexT}}(x + 8) - f === :point && return Ptr{Ptr{Cdouble}}(x + 16) - f === :neighbors && return Ptr{Ptr{setT}}(x + 24) - f === :id && return Ptr{Cuint}(x + 32) - f === :visitid && return Ptr{Cuint}(x + 36) - f === :seen && return Ptr{Cuint}(x + 40) - f === :seen2 && return (Ptr{Cuint}(x + 40), 1, 1) - f === :deleted && return (Ptr{Cuint}(x + 40), 2, 1) - f === :delridge && return (Ptr{Cuint}(x + 40), 3, 1) - f === :newfacet && return (Ptr{Cuint}(x + 40), 4, 1) - f === :partitioned && return (Ptr{Cuint}(x + 40), 5, 1) - return getfield(x, f) -end - -function Base.getproperty(x::vertexT, f::Symbol) - r = Ref{vertexT}(x) - ptr = Base.unsafe_convert(Ptr{vertexT}, r) - fptr = getproperty(ptr, f) - begin - if fptr isa Ptr - return GC.@preserve(r, unsafe_load(fptr)) - else - (baseptr, offset, width) = fptr - ty = eltype(baseptr) - i8 = GC.@preserve(r, unsafe_load(baseptr)) - bitstr = bitstring(i8) - sig = bitstr[(end - offset) - (width - 1):end - offset] - zexted = lpad(sig, 8 * sizeof(ty), '0') - return parse(ty, zexted; base = 2) - end - end -end - -function Base.setproperty!(x::Ptr{vertexT}, f::Symbol, v) - unsafe_store!(getproperty(x, f), v) -end - -function qh_qhull(qh) - ccall((:qh_qhull, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_addpoint(qh, furthest, facet, checkdist) - ccall((:qh_addpoint, libqhull_r), Cuint, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint), qh, furthest, facet, checkdist) -end - -function qh_errexit2(qh, exitcode, facet, otherfacet) - ccall((:qh_errexit2, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{facetT}), qh, exitcode, facet, otherfacet) -end - -function qh_printsummary(qh, fp) - ccall((:qh_printsummary, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) -end - -function qh_errexit(qh, exitcode, facet, ridge) - ccall((:qh_errexit, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{facetT}, Ptr{ridgeT}), qh, exitcode, facet, ridge) -end - -function qh_errprint(qh, string, atfacet, otherfacet, atridge, atvertex) - ccall((:qh_errprint, libqhull_r), Cvoid, (Ptr{qhT}, Cstring, Ptr{facetT}, Ptr{facetT}, Ptr{ridgeT}, Ptr{vertexT}), qh, string, atfacet, otherfacet, atridge, atvertex) -end - -function qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) - ccall((:qh_new_qhull, libqhull_r), Cint, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Cuint, Cstring, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile) -end - -function qh_printfacetlist(qh, facetlist, facets, printall) - ccall((:qh_printfacetlist, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, printall) -end - -function qh_printhelp_degenerate(qh, fp) - ccall((:qh_printhelp_degenerate, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) -end - -function qh_printhelp_internal(qh, fp) - ccall((:qh_printhelp_internal, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) -end - -function qh_printhelp_narrowhull(qh, fp, minangle) - ccall((:qh_printhelp_narrowhull, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Cdouble), qh, fp, minangle) -end - -function qh_printhelp_singular(qh, fp) - ccall((:qh_printhelp_singular, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) -end - -function qh_printhelp_topology(qh, fp) - ccall((:qh_printhelp_topology, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) -end - -function qh_printhelp_wide(qh, fp) - ccall((:qh_printhelp_wide, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, fp) -end - -function qh_user_memsizes(qh) - ccall((:qh_user_memsizes, libqhull_r), Cvoid, (Ptr{qhT},), qh) +const IS_LIBC_MUSL = occursin("musl", Base.BUILD_TRIPLET) + +if Sys.isapple() && Sys.ARCH === :aarch64 + include("../lib/aarch64-apple-darwin20.jl") +elseif Sys.islinux() && Sys.ARCH === :aarch64 && !IS_LIBC_MUSL + include("../lib/aarch64-linux-gnu.jl") +elseif Sys.islinux() && Sys.ARCH === :aarch64 && IS_LIBC_MUSL + include("../lib/aarch64-linux-musl.jl") +elseif Sys.islinux() && startswith(string(Sys.ARCH), "arm") && !IS_LIBC_MUSL + include("../lib/armv7l-linux-gnueabihf.jl") +elseif Sys.islinux() && startswith(string(Sys.ARCH), "arm") && IS_LIBC_MUSL + include("../lib/armv7l-linux-musleabihf.jl") +elseif Sys.islinux() && Sys.ARCH === :i686 && !IS_LIBC_MUSL + include("../lib/i686-linux-gnu.jl") +elseif Sys.islinux() && Sys.ARCH === :i686 && IS_LIBC_MUSL + include("../lib/i686-linux-musl.jl") +elseif Sys.iswindows() && Sys.ARCH === :i686 + include("../lib/i686-w64-mingw32.jl") +elseif Sys.islinux() && Sys.ARCH === :powerpc64le + include("../lib/powerpc64le-linux-gnu.jl") +elseif Sys.isapple() && Sys.ARCH === :x86_64 + include("../lib/x86_64-apple-darwin14.jl") +elseif Sys.islinux() && Sys.ARCH === :x86_64 && !IS_LIBC_MUSL + include("../lib/x86_64-linux-gnu.jl") +elseif Sys.islinux() && Sys.ARCH === :x86_64 && IS_LIBC_MUSL + include("../lib/x86_64-linux-musl.jl") +elseif Sys.isbsd() && !Sys.isapple() + include("../lib/x86_64-unknown-freebsd11.1.jl") +elseif Sys.iswindows() && Sys.ARCH === :x86_64 + include("../lib/x86_64-w64-mingw32.jl") +else + error("Unknown platform: $(Base.BUILD_TRIPLET)") end -function qh_exit(exitcode) - ccall((:qh_exit, libqhull_r), Cvoid, (Cint,), exitcode) -end - -function qh_free(mem) - ccall((:qh_free, libqhull_r), Cvoid, (Ptr{Cvoid},), mem) -end - -function qh_malloc(size) - ccall((:qh_malloc, libqhull_r), Ptr{Cvoid}, (Csize_t,), size) -end - -function qh_findbest(qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) - ccall((:qh_findbest, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Cuint, Cuint, Cuint, Ptr{Cdouble}, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, bestoutside, newfacets, noupper, dist, isoutside, numpart) -end - -function qh_findbestnew(qh, point, startfacet, dist, bestoutside, isoutside, numpart) - ccall((:qh_findbestnew, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Ptr{facetT}, Ptr{Cdouble}, Cuint, Ptr{Cuint}, Ptr{Cint}), qh, point, startfacet, dist, bestoutside, isoutside, numpart) -end - -function qh_gram_schmidt(qh, dim, rows) - ccall((:qh_gram_schmidt, libqhull_r), Cuint, (Ptr{qhT}, Cint, Ptr{Ptr{Cdouble}}), qh, dim, rows) -end - -function qh_outerinner(qh, facet, outerplane, innerplane) - ccall((:qh_outerinner, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, outerplane, innerplane) -end - -function qh_projectinput(qh) - ccall((:qh_projectinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_randommatrix(qh, buffer, dim, row) - ccall((:qh_randommatrix, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Ptr{Ptr{Cdouble}}), qh, buffer, dim, row) -end - -function qh_rotateinput(qh, rows) - ccall((:qh_rotateinput, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Ptr{Cdouble}}), qh, rows) -end - -function qh_scaleinput(qh) - ccall((:qh_scaleinput, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_setdelaunay(qh, dim, count, points) - ccall((:qh_setdelaunay, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}), qh, dim, count, points) -end - -function qh_sethalfspace_all(qh, dim, count, halfspaces, feasible) - ccall((:qh_sethalfspace_all, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint, Cint, Ptr{Cdouble}, Ptr{Cdouble}), qh, dim, count, halfspaces, feasible) -end - -function qh_clock(qh) - ccall((:qh_clock, libqhull_r), Culong, (Ptr{qhT},), qh) -end - -function qh_checkflags(qh, command, hiddenflags) - ccall((:qh_checkflags, libqhull_r), Cvoid, (Ptr{qhT}, Cstring, Cstring), qh, command, hiddenflags) -end - -function qh_clear_outputflags(qh) - ccall((:qh_clear_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_freebuffers(qh) - ccall((:qh_freebuffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_freeqhull(qh, allmem) - ccall((:qh_freeqhull, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, allmem) -end - -function qh_init_A(qh, infile, outfile, errfile, argc, argv) - ccall((:qh_init_A, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Cint, Ptr{Cstring}), qh, infile, outfile, errfile, argc, argv) -end - -function qh_init_B(qh, points, numpoints, dim, ismalloc) - ccall((:qh_init_B, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) -end - -function qh_init_qhull_command(qh, argc, argv) - ccall((:qh_init_qhull_command, libqhull_r), Cvoid, (Ptr{qhT}, Cint, Ptr{Cstring}), qh, argc, argv) -end - -function qh_initbuffers(qh, points, numpoints, dim, ismalloc) - ccall((:qh_initbuffers, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) -end - -function qh_initflags(qh, command) - ccall((:qh_initflags, libqhull_r), Cvoid, (Ptr{qhT}, Cstring), qh, command) -end - -function qh_initqhull_buffers(qh) - ccall((:qh_initqhull_buffers, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_initqhull_globals(qh, points, numpoints, dim, ismalloc) - ccall((:qh_initqhull_globals, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Cdouble}, Cint, Cint, Cuint), qh, points, numpoints, dim, ismalloc) -end - -function qh_initqhull_mem(qh) - ccall((:qh_initqhull_mem, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_initqhull_outputflags(qh) - ccall((:qh_initqhull_outputflags, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_initqhull_start(qh, infile, outfile, errfile) - ccall((:qh_initqhull_start, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) -end - -function qh_initqhull_start2(qh, infile, outfile, errfile) - ccall((:qh_initqhull_start2, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, Ptr{Libc.FILE}, Ptr{Libc.FILE}), qh, infile, outfile, errfile) -end - -function qh_initthresholds(qh, command) - ccall((:qh_initthresholds, libqhull_r), Cvoid, (Ptr{qhT}, Cstring), qh, command) -end - -function qh_lib_check(qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) - ccall((:qh_lib_check, libqhull_r), Cvoid, (Cint, Cint, Cint, Cint, Cint, Cint, Cint), qhullLibraryType, qhTsize, vertexTsize, ridgeTsize, facetTsize, setTsize, qhmemTsize) -end - -function qh_option(qh, option, i, r) - ccall((:qh_option, libqhull_r), Cvoid, (Ptr{qhT}, Cstring, Ptr{Cint}, Ptr{Cdouble}), qh, option, i, r) -end - -function qh_zero(qh, errfile) - ccall((:qh_zero, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}), qh, errfile) -end - -function qh_dfacet(qh, id) - ccall((:qh_dfacet, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) -end - -function qh_dvertex(qh, id) - ccall((:qh_dvertex, libqhull_r), Cvoid, (Ptr{qhT}, Cuint), qh, id) -end - -function qh_printneighborhood(qh, fp, format, facetA, facetB, printall) - ccall((:qh_printneighborhood, libqhull_r), Cvoid, (Ptr{qhT}, Ptr{Libc.FILE}, qh_PRINT, Ptr{facetT}, Ptr{facetT}, Cuint), qh, fp, format, facetA, facetB, printall) -end - -function qh_produce_output(qh) - ccall((:qh_produce_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_readpoints(qh, numpoints, dimension, ismalloc) - ccall((:qh_readpoints, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Ptr{Cint}, Ptr{Cint}, Ptr{Cuint}), qh, numpoints, dimension, ismalloc) -end - -function qh_check_output(qh) - ccall((:qh_check_output, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_check_points(qh) - ccall((:qh_check_points, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_facetvertices(qh, facetlist, facets, allfacets) - ccall((:qh_facetvertices, libqhull_r), Ptr{setT}, (Ptr{qhT}, Ptr{facetT}, Ptr{setT}, Cuint), qh, facetlist, facets, allfacets) -end - -function qh_findbestfacet(qh, point, bestoutside, bestdist, isoutside) - ccall((:qh_findbestfacet, libqhull_r), Ptr{facetT}, (Ptr{qhT}, Ptr{Cdouble}, Cuint, Ptr{Cdouble}, Ptr{Cuint}), qh, point, bestoutside, bestdist, isoutside) -end - -function qh_nearvertex(qh, facet, point, bestdistp) - ccall((:qh_nearvertex, libqhull_r), Ptr{vertexT}, (Ptr{qhT}, Ptr{facetT}, Ptr{Cdouble}, Ptr{Cdouble}), qh, facet, point, bestdistp) -end - -function qh_point(qh, id) - ccall((:qh_point, libqhull_r), Ptr{Cdouble}, (Ptr{qhT}, Cint), qh, id) -end - -function qh_pointfacet(qh) - ccall((:qh_pointfacet, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) -end - -function qh_pointid(qh, point) - ccall((:qh_pointid, libqhull_r), Cint, (Ptr{qhT}, Ptr{Cdouble}), qh, point) -end - -function qh_pointvertex(qh) - ccall((:qh_pointvertex, libqhull_r), Ptr{setT}, (Ptr{qhT},), qh) -end - -function qh_setvoronoi_all(qh) - ccall((:qh_setvoronoi_all, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_triangulate(qh) - ccall((:qh_triangulate, libqhull_r), Cvoid, (Ptr{qhT},), qh) -end - -function qh_rboxpoints(qh, rbox_command) - ccall((:qh_rboxpoints, libqhull_r), Cint, (Ptr{qhT}, Cstring), qh, rbox_command) -end - -function qh_errexit_rbox(qh, exitcode) - ccall((:qh_errexit_rbox, libqhull_r), Cvoid, (Ptr{qhT}, Cint), qh, exitcode) -end - -struct var"##Ctag#264" - data::NTuple{8, UInt8} -end - -function Base.getproperty(x::Ptr{var"##Ctag#264"}, f::Symbol) - f === :area && return Ptr{Cdouble}(x + 0) - f === :replace && return Ptr{Ptr{facetT}}(x + 0) - f === :samecycle && return Ptr{Ptr{facetT}}(x + 0) - f === :newcycle && return Ptr{Ptr{facetT}}(x + 0) - f === :trivisible && return Ptr{Ptr{facetT}}(x + 0) - f === :triowner && return Ptr{Ptr{facetT}}(x + 0) - return getfield(x, f) -end - -function Base.getproperty(x::var"##Ctag#264", f::Symbol) - r = Ref{var"##Ctag#264"}(x) - ptr = Base.unsafe_convert(Ptr{var"##Ctag#264"}, r) - fptr = getproperty(ptr, f) - GC.@preserve r unsafe_load(fptr) -end - -function Base.setproperty!(x::Ptr{var"##Ctag#264"}, f::Symbol, v) - unsafe_store!(getproperty(x, f), v) -end - -const qhDEFlibqhull = 1 - -const CLOCKS_PER_SEC = 1000000 - -const qhDEFuser = 1 - -const qh_FILENAMElen = 500 - -const MSG_TRACE0 = 0 - -const MSG_TRACE1 = 1000 - -const MSG_TRACE2 = 2000 - -const MSG_TRACE3 = 3000 - -const MSG_TRACE4 = 4000 - -const MSG_TRACE5 = 5000 - -const MSG_ERROR = 6000 - -const MSG_WARNING = 7000 - -const MSG_STDERR = 8000 - -const MSG_OUTPUT = 9000 - -const MSG_QHULL_ERROR = 10000 - -const MSG_FIX = 11000 - -const MSG_MAXLEN = 3000 - -const qh_OPTIONline = 80 - -const REALfloat = 0 - -const realT = Float64 - -const REALmax = DBL_MAX - -const REALmin = DBL_MIN - -const REALepsilon = DBL_EPSILON - -const qh_REALdigits = 16 - -const qh_REAL_1 = "%6.16g " - -const qh_REAL_2n = "%6.16g %6.16g\n" - -const qh_REAL_3n = "%6.16g %6.16g %6.16g\n" - -const DEFcountT = 1 - -const COUNTmax = INT_MAX - -# Skipping MacroDefinition: qh_POINTSmax ( INT_MAX - 16 ) - -const qh_CLOCKtype = 1 - -# Skipping MacroDefinition: qh_CPUclock ( ( unsigned long ) clock ( ) ) - -const qh_SECticks = CLOCKS_PER_SEC - -const qh_RANDOMtype = 5 - -# Skipping MacroDefinition: qh_RANDOMmax ( ( realT ) 2147483646UL ) - -# Skipping MacroDefinition: qh_RANDOMint qh_rand ( qh ) - -const qh_ORIENTclock = 0 - -const qh_JOGGLEdefault = 30000.0 - -const qh_JOGGLEincrease = 10.0 - -const qh_JOGGLEretry = 2 - -const qh_JOGGLEagain = 1 - -const qh_JOGGLEmaxincrease = 0.01 - -const qh_JOGGLEmaxretry = 50 - -const qh_HASHfactor = 2 - -const qh_VERIFYdirect = 1000000 - -const qh_INITIALsearch = 6 - -const qh_INITIALmax = 8 - -# Skipping MacroDefinition: qh_MEMalign ( ( int ) ( fmax_ ( sizeof ( realT ) , sizeof ( void * ) ) ) ) - -const qh_MEMbufsize = 0x00010000 - -const qh_MEMinitbuf = 0x00020000 - -# Skipping MacroDefinition: qh_INFINITE - 10.101 - -const qh_DEFAULTbox = 0.5 - -const qh_DEFAULTzbox = 1.0e6 - -const qh_COMPUTEfurthest = 0 - -const qh_KEEPstatistics = 1 - -const qh_MAXoutside = 1 - -const qh_QUICKhelp = 0 - -const qh_BESTcentrum = 20 - -const qh_BESTcentrum2 = 2 - -const qh_BESTnonconvex = 15 - -const qh_COPLANARratio = 3 - -const qh_DIMmergeVertex = 6 - -const qh_DIMreduceBuild = 5 - -# Skipping MacroDefinition: qh_DISToutside ( ( qh_USEfindbestnew ? 2 : 1 ) * fmax_ ( ( qh -> MERGING ? 2 : 1 ) * qh -> MINoutside , qh -> max_outside ) ) - -const qh_MAXcheckpoint = 10 - -const qh_MAXcoplanarcentrum = 10 - -const qh_MAXnewcentrum = 5 - -const qh_MAXnewmerges = 2 - -const qh_RATIOconcavehorizon = 20.0 - -const qh_RATIOconvexmerge = 10.0 - -const qh_RATIOcoplanarapex = 3.0 - -const qh_RATIOcoplanaroutside = 30.0 - -const qh_RATIOmaxsimplex = 0.001 - -const qh_RATIOnearinside = 5 - -const qh_RATIOpinchedsubridge = 10.0 - -const qh_RATIOtrypinched = 4.0 - -const qh_RATIOtwisted = 20.0 - -# Skipping MacroDefinition: qh_SEARCHdist ( ( qh_USEfindbestnew ? 2 : 1 ) * ( qh -> max_outside + 2 * qh -> DISTround + fmax_ ( qh -> MINvisible , qh -> MAXcoplanar ) ) ) ; - -# Skipping MacroDefinition: qh_USEfindbestnew ( zzval_ ( Ztotmerge ) > 50 ) - -# Skipping MacroDefinition: qh_MAXnarrow - 0.99999999 - -# Skipping MacroDefinition: qh_WARNnarrow - 0.999999999999999 - -const qh_WIDEcoplanar = 6 - -const qh_WIDEduplicate = 100 - -const qh_WIDEdupridge = 50 - -const qh_WIDEmaxoutside = 100 - -# Skipping MacroDefinition: qh_WIDEmaxoutside2 ( 10 * qh_WIDEmaxoutside ) - -const qh_WIDEpinched = 100 - -const qh_ZEROdelaunay = 2 - -const qhDEFmem = 1 - -const DEFsetT = 1 - -const DEFqhT = 1 - -const qh_TRACEshort = nothing - -const qhmem_ERRmem = 4 - -const qhmem_ERRqhull = 5 - -const qhDEFset = 1 - -# Skipping MacroDefinition: SETelemsize ( ( int ) sizeof ( setelemT ) ) - -const coordT = realT - -const pointT = coordT - -const flagT = Cuint - -const boolT = Cuint - -const False = 0 - -const True = 1 - -const qh_False = 0 - -const qh_True = 1 - -const qhDEFstat = 1 - -const DEFqhstatT = 1 - -const MAYdebugx = nothing - -const qh_ALL = True - -const qh_NOupper = True - -const qh_IScheckmax = True - -const qh_ISnewfacets = True - -const qh_RESETvisible = True - -const qh_ERRnone = 0 - -const qh_ERRinput = 1 - -const qh_ERRsingular = 2 - -const qh_ERRprec = 3 - -const qh_ERRmem = 4 - -const qh_ERRqhull = 5 - -const qh_ERRother = 6 - -const qh_ERRtopology = 7 - -const qh_ERRwide = 8 - -const qh_ERRdebug = 9 - -# Skipping MacroDefinition: qh_FILEstderr ( ( FILE * ) 1 ) - -const qh_MAXnummerge = 511 - -const QHULL_NON_REENTRANT = 0 - -const QHULL_QH_POINTER = 1 - -const QHULL_REENTRANT = 2 - -const QHULL_LIB_TYPE = QHULL_REENTRANT - -# Skipping MacroDefinition: QHULL_LIB_CHECK qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , sizeof ( setT ) , sizeof ( qhmemT ) ) ; - -# Skipping MacroDefinition: QHULL_LIB_CHECK_RBOX qh_lib_check ( QHULL_LIB_TYPE , sizeof ( qhT ) , sizeof ( vertexT ) , sizeof ( ridgeT ) , sizeof ( facetT ) , 0 , 0 ) ; - -# Skipping MacroDefinition: FORALLfacets for ( facet = qh -> facet_list ; facet && facet -> next ; facet = facet -> next ) - -# Skipping MacroDefinition: FORALLpoints FORALLpoint_ ( qh , qh -> first_point , qh -> num_points ) - -# Skipping MacroDefinition: FORALLvertices for ( vertex = qh -> vertex_list ; vertex && vertex -> next ; vertex = vertex -> next ) - # exports const PREFIXES = ["qh_", "qhT"] -foreach(names(@__MODULE__; all=true)) do s - for prefix in PREFIXES - if startswith(string(s), prefix) - @eval export $s - end +for name in names(@__MODULE__; all=true), prefix in PREFIXES + if startswith(string(name), prefix) + @eval export $name end end diff --git a/src/MiniQhull.jl b/src/MiniQhull.jl index 0ecb970..4d57882 100644 --- a/src/MiniQhull.jl +++ b/src/MiniQhull.jl @@ -1,14 +1,10 @@ module MiniQhull -using Libdl - export delaunay include("LibQhull.jl") using .LibQhull using .LibQhull: vertexT, setelemT - -include("load.jl") include("bindings.jl") function _delaunay(dim::Int32, numpoints::Int32, points, flags::Union{Nothing,AbstractString}) diff --git a/src/bindings.jl b/src/bindings.jl index 829144e..b922088 100644 --- a/src/bindings.jl +++ b/src/bindings.jl @@ -1,16 +1,12 @@ - # qhT* new_qhull_handler(); function new_qhull_handler() - @check_if_loaded qh = Ptr{qhT}(Libc.malloc(sizeof(qhT))) - qh_zero(qh, stderr.handle) + qh_zero(qh, C_NULL) return qh end # int delaunay_init_and_compute( int dim, int numpoints, coordT *points, int* numcells); function delaunay_init_and_compute(qh::Ptr, dim::Int32, numpoints::Int32, points, numcells::Ref{Int32}, flags::Union{Ptr{Nothing},AbstractString}) - @check_if_loaded - ismalloc = false if flags == C_NULL @@ -21,7 +17,7 @@ function delaunay_init_and_compute(qh::Ptr, dim::Int32, numpoints::Int32, points # Run qhull GC.@preserve qhull_cmd begin - exitcode = qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, C_NULL, stderr.handle) + exitcode = qh_new_qhull(qh, dim, numpoints, points, ismalloc, qhull_cmd, C_NULL, C_NULL) end exitcode != 0 && return exitcode @@ -53,7 +49,6 @@ end # int delaunay_fill_cells(int dim, int num_cells, int *cells); function delaunay_fill_cells(qh::Ptr, dim::Int32, numcells::Int32, cells::Array{Int32}) - @check_if_loaded icell = 0 facet = unsafe_load(qh.facet_list) vertex = Ptr{vertexT}(C_NULL) @@ -88,7 +83,6 @@ end #int delaunay_free() function delaunay_free(qh::Ptr) - @check_if_loaded curlong = Ref{Cint}(0) totlong = Ref{Cint}(0) qh_freeqhull(qh, !Bool(qh_ALL)) diff --git a/src/load.jl b/src/load.jl deleted file mode 100644 index eecfb5a..0000000 --- a/src/load.jl +++ /dev/null @@ -1,39 +0,0 @@ -deps_jl = joinpath(@__DIR__, "..", "deps", "deps.jl") - -if !isfile(deps_jl) - error("Package MiniQhull not installed properly.") -end - -include(deps_jl) - -const new_qhull_handler_c = Ref{Ptr}() -const delaunay_init_and_compute_c = Ref{Ptr}() -const delaunay_fill_cells_c = Ref{Ptr}() -const delaunay_free_c = Ref{Ptr}() -const QHULL_WRAPPER_LOADED = Ref(false) - -function __init__() - if QHULL_WRAPPER_FOUND - flags = Libdl.RTLD_LAZY | Libdl.RTLD_DEEPBIND | Libdl.RTLD_GLOBAL - QHULL_WRAPPER = Libdl.dlopen(QHULL_WRAPPER_LIB_PATH, flags) - - MiniQhull.new_qhull_handler_c[] = Libdl.dlsym(QHULL_WRAPPER,:new_qhull_handler) - MiniQhull.delaunay_init_and_compute_c[] = Libdl.dlsym(QHULL_WRAPPER,:delaunay_init_and_compute) - MiniQhull.delaunay_fill_cells_c[] = Libdl.dlsym(QHULL_WRAPPER,:delaunay_fill_cells) - MiniQhull.delaunay_free_c[] = Libdl.dlsym(QHULL_WRAPPER,:delaunay_free) - QHULL_WRAPPER_LOADED[] = true - else - QHULL_WRAPPER_LOADED[] = false - end -end - - -macro check_if_loaded() - quote - if ! QHULL_WRAPPER_LOADED[] - error("QHULL WRAPPER is not properly loaded") - end - end -end - - diff --git a/test/runtests.jl b/test/runtests.jl index d9a8b46..4db66c5 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,46 +2,43 @@ using MiniQhull using Test using StaticArrays -if MiniQhull.QHULL_WRAPPER_LOADED[] - @testset "MiniQhull" begin - @test delaunay(2,4,[0,0,0,1,1,0,1,1]) == delaunay([0 0 1 1; 0 1 0 1]) - end - - @testset "Custom array-type" begin - pts = [[0.,0.], [0.,1.], [1.,0.], [1.,1.]] - dim = 2 - x = reinterpret(Float64, [SVector{dim, Float64}(pt) for pt in pts]) - @test delaunay(dim, length(pts), x) == [4 4; 2 3; 1 1] - end +@testset "MiniQhull" begin + @test delaunay(2,4,[0,0,0,1,1,0,1,1]) == delaunay([0 0 1 1; 0 1 0 1]) +end - @testset "Vector of vectors" begin - pts = [[0.,0.], [0.,1.], [1.,0.], [1.,1.]] +@testset "Custom array-type" begin + pts = [[0.,0.], [0.,1.], [1.,0.], [1.,1.]] + dim = 2 + x = reinterpret(Float64, [SVector{dim, Float64}(pt) for pt in pts]) + @test delaunay(dim, length(pts), x) == [4 4; 2 3; 1 1] +end - @testset "Vector of regular vectors" begin - @test delaunay(pts) == [4 4; 2 3; 1 1] - end +@testset "Vector of vectors" begin + pts = [[0.,0.], [0.,1.], [1.,0.], [1.,1.]] - @testset "Vector of tuples" begin - tups = [(0.,0.,), (0.,1.,), (1.,0.,), (1.,1., )] - @test delaunay(tups) == [4 4; 2 3; 1 1] - end + @testset "Vector of regular vectors" begin + @test delaunay(pts) == [4 4; 2 3; 1 1] + end - @testset "Vector of SVectors" begin - @test delaunay([SVector{2, Float64}(pt) for pt in pts]) == [4 4; 2 3; 1 1] - end + @testset "Vector of tuples" begin + tups = [(0.,0.,), (0.,1.,), (1.,0.,), (1.,1., )] + @test delaunay(tups) == [4 4; 2 3; 1 1] end - @testset "MiniQhull with flags" begin - c0 = delaunay([0 0 1 1; 0 1 0 1]) - c1 = delaunay([0 0 1 1; 0 1 0 1], nothing) - @test c1 == c0 - c2 = delaunay([0 0 1 1; 0 1 0 1], "qhull d Qt Qbb Qc Qz") - @test c2 == c0 - c3 = delaunay([0 0 1 1; 0 1 0 1], "qhull d Qbb Qc QJ Pp") - # QJ randomizes ("joggles") the input, so the output is not deterministic - @test size(c3) == (3, 2) - c4 = delaunay([0 0 1 1; 0 1 0 1], GenericString("qhull d Qt Qbb Qc Qz")) - @test c4 == c0 + @testset "Vector of SVectors" begin + @test delaunay([SVector{2, Float64}(pt) for pt in pts]) == [4 4; 2 3; 1 1] end +end +@testset "MiniQhull with flags" begin + c0 = delaunay([0 0 1 1; 0 1 0 1]) + c1 = delaunay([0 0 1 1; 0 1 0 1], nothing) + @test c1 == c0 + c2 = delaunay([0 0 1 1; 0 1 0 1], "qhull d Qt Qbb Qc Qz") + @test c2 == c0 + c3 = delaunay([0 0 1 1; 0 1 0 1], "qhull d Qbb Qc QJ Pp") + # QJ randomizes ("joggles") the input, so the output is not deterministic + @test size(c3) == (3, 2) + c4 = delaunay([0 0 1 1; 0 1 0 1], GenericString("qhull d Qt Qbb Qc Qz")) + @test c4 == c0 end