aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile11
-rw-r--r--src/ffi.rs6
2 files changed, 16 insertions, 1 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..dc55e2f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,11 @@
+BINDGEN ?= bindgen
+LIBNITROKEY ?= $(wildcard libnitrokey-v*)
+
+src/ffi.rs: ${LIBNITROKEY}/NK_C_API.h
+ ${BINDGEN} \
+ --whitelist-function "NK_.*" \
+ --whitelist-var "NK_.*" \
+ --whitelist-var "MAXIMUM_STR_REPLY_LENGTH" \
+ --output "$@" \
+ "$<" \
+ -- "-I${LIBNITROKEY}/libnitrokey"
diff --git a/src/ffi.rs b/src/ffi.rs
index a01eae8..0dea45a 100644
--- a/src/ffi.rs
+++ b/src/ffi.rs
@@ -1,5 +1,9 @@
-/* automatically generated by rust-bindgen, manually modified */
+/* automatically generated by rust-bindgen */
+pub type __uint8_t = ::std::os::raw::c_uchar;
+pub type __uint16_t = ::std::os::raw::c_ushort;
+pub type __uint32_t = ::std::os::raw::c_uint;
+pub type __uint64_t = ::std::os::raw::c_ulong;
extern "C" {
#[link_name = "\u{1}NK_PWS_SLOT_COUNT"]
pub static mut NK_PWS_SLOT_COUNT: u8;