diff --git a/Cargo.toml b/Cargo.toml index b7222df..b625ad1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [lib] name = "onod3000" -crate-type = ["cdylib", "lib"] +crate-type = ["cdylib", "staticlib", "lib"] [dependencies] flate2 = "1.0.35" @@ -19,3 +19,8 @@ python = ["dep:pyo3"] [[bin]] name="onod3000" file="src/bin/onod3000.rs" + +[profile.release] +lto = true +codegen-units = 1 +panic = "abort" \ No newline at end of file diff --git a/include/onod3000.h b/include/onod3000.h new file mode 100644 index 0000000..cfd07c1 --- /dev/null +++ b/include/onod3000.h @@ -0,0 +1,18 @@ +#pragma once +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// Returns true on success. Writes three doubles: obs, z, p +bool onod_run(const char* test, + const uint8_t* samples, + size_t len, + double* result /* length >= 3 */); + +#ifdef __cplusplus +} +#endif