diff --git a/leechcore-sys/build.rs b/leechcore-sys/build.rs index 96e1697..bca8cf9 100644 --- a/leechcore-sys/build.rs +++ b/leechcore-sys/build.rs @@ -61,9 +61,20 @@ fn build_leechcore(target: &str) { if !target.contains("windows") { // setup additional flags - cfg.flag("-fvisibility=hidden"); cfg.flag("-fPIC"); cfg.flag("-pthread"); + cfg.flag("-fvisibility=hidden"); + cfg.flag("-fstack-protector-strong"); + cfg.flag("-D_FORTIFY_SOURCE=2"); + cfg.flag("-O1"); // this is necessary, otherwise inline funcs in leechcore will result in undefined external symbols + cfg.flag("-z,noexecstack"); + cfg.flag("-Wall"); + cfg.flag("-Wno-multichar"); + cfg.flag("-Wno-unused-result"); + cfg.flag("-Wno-unused-variable"); + cfg.flag("-Wno-unused-value"); + cfg.flag("-Wno-pointer-to-int-cast"); + cfg.flag("-Wno-int-to-pointer-cast"); cfg.flag("-g"); cfg.flag("-ldl"); diff --git a/leechcore-sys/src/leechcore_linux.rs b/leechcore-sys/src/leechcore_linux.rs index d87e84f..7788193 100644 --- a/leechcore-sys/src/leechcore_linux.rs +++ b/leechcore-sys/src/leechcore_linux.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.63.0 */ +/* automatically generated by rust-bindgen 0.69.1 */ #[repr(C)] #[derive(Default)] @@ -56,6 +56,7 @@ pub const __USE_ATFILE: u32 = 1; pub const __USE_FORTIFY_LEVEL: u32 = 0; pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; +pub const __GLIBC_USE_C2X_STRTOL: u32 = 0; pub const _STDC_PREDEF_H: u32 = 1; pub const __STDC_IEC_559__: u32 = 1; pub const __STDC_IEC_60559_BFP__: u32 = 201404; @@ -64,7 +65,7 @@ pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404; pub const __STDC_ISO_10646__: u32 = 201706; pub const __GNU_LIBRARY__: u32 = 6; pub const __GLIBC__: u32 = 2; -pub const __GLIBC_MINOR__: u32 = 36; +pub const __GLIBC_MINOR__: u32 = 38; pub const _SYS_CDEFS_H: u32 = 1; pub const __glibc_c99_flexarr_available: u32 = 1; pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0; @@ -127,162 +128,162 @@ pub const SIZE_MAX: i32 = -1; pub const WINT_MIN: u32 = 0; pub const WINT_MAX: u32 = 4294967295; pub const ____gwchar_t_defined: u32 = 1; -pub const __PRI64_PREFIX: &[u8; 2usize] = b"l\0"; -pub const __PRIPTR_PREFIX: &[u8; 2usize] = b"l\0"; -pub const PRId8: &[u8; 2usize] = b"d\0"; -pub const PRId16: &[u8; 2usize] = b"d\0"; -pub const PRId32: &[u8; 2usize] = b"d\0"; -pub const PRId64: &[u8; 3usize] = b"ld\0"; -pub const PRIdLEAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST16: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST32: &[u8; 2usize] = b"d\0"; -pub const PRIdLEAST64: &[u8; 3usize] = b"ld\0"; -pub const PRIdFAST8: &[u8; 2usize] = b"d\0"; -pub const PRIdFAST16: &[u8; 3usize] = b"ld\0"; -pub const PRIdFAST32: &[u8; 3usize] = b"ld\0"; -pub const PRIdFAST64: &[u8; 3usize] = b"ld\0"; -pub const PRIi8: &[u8; 2usize] = b"i\0"; -pub const PRIi16: &[u8; 2usize] = b"i\0"; -pub const PRIi32: &[u8; 2usize] = b"i\0"; -pub const PRIi64: &[u8; 3usize] = b"li\0"; -pub const PRIiLEAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST16: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST32: &[u8; 2usize] = b"i\0"; -pub const PRIiLEAST64: &[u8; 3usize] = b"li\0"; -pub const PRIiFAST8: &[u8; 2usize] = b"i\0"; -pub const PRIiFAST16: &[u8; 3usize] = b"li\0"; -pub const PRIiFAST32: &[u8; 3usize] = b"li\0"; -pub const PRIiFAST64: &[u8; 3usize] = b"li\0"; -pub const PRIo8: &[u8; 2usize] = b"o\0"; -pub const PRIo16: &[u8; 2usize] = b"o\0"; -pub const PRIo32: &[u8; 2usize] = b"o\0"; -pub const PRIo64: &[u8; 3usize] = b"lo\0"; -pub const PRIoLEAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST16: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST32: &[u8; 2usize] = b"o\0"; -pub const PRIoLEAST64: &[u8; 3usize] = b"lo\0"; -pub const PRIoFAST8: &[u8; 2usize] = b"o\0"; -pub const PRIoFAST16: &[u8; 3usize] = b"lo\0"; -pub const PRIoFAST32: &[u8; 3usize] = b"lo\0"; -pub const PRIoFAST64: &[u8; 3usize] = b"lo\0"; -pub const PRIu8: &[u8; 2usize] = b"u\0"; -pub const PRIu16: &[u8; 2usize] = b"u\0"; -pub const PRIu32: &[u8; 2usize] = b"u\0"; -pub const PRIu64: &[u8; 3usize] = b"lu\0"; -pub const PRIuLEAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST16: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST32: &[u8; 2usize] = b"u\0"; -pub const PRIuLEAST64: &[u8; 3usize] = b"lu\0"; -pub const PRIuFAST8: &[u8; 2usize] = b"u\0"; -pub const PRIuFAST16: &[u8; 3usize] = b"lu\0"; -pub const PRIuFAST32: &[u8; 3usize] = b"lu\0"; -pub const PRIuFAST64: &[u8; 3usize] = b"lu\0"; -pub const PRIx8: &[u8; 2usize] = b"x\0"; -pub const PRIx16: &[u8; 2usize] = b"x\0"; -pub const PRIx32: &[u8; 2usize] = b"x\0"; -pub const PRIx64: &[u8; 3usize] = b"lx\0"; -pub const PRIxLEAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST16: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST32: &[u8; 2usize] = b"x\0"; -pub const PRIxLEAST64: &[u8; 3usize] = b"lx\0"; -pub const PRIxFAST8: &[u8; 2usize] = b"x\0"; -pub const PRIxFAST16: &[u8; 3usize] = b"lx\0"; -pub const PRIxFAST32: &[u8; 3usize] = b"lx\0"; -pub const PRIxFAST64: &[u8; 3usize] = b"lx\0"; -pub const PRIX8: &[u8; 2usize] = b"X\0"; -pub const PRIX16: &[u8; 2usize] = b"X\0"; -pub const PRIX32: &[u8; 2usize] = b"X\0"; -pub const PRIX64: &[u8; 3usize] = b"lX\0"; -pub const PRIXLEAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST16: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST32: &[u8; 2usize] = b"X\0"; -pub const PRIXLEAST64: &[u8; 3usize] = b"lX\0"; -pub const PRIXFAST8: &[u8; 2usize] = b"X\0"; -pub const PRIXFAST16: &[u8; 3usize] = b"lX\0"; -pub const PRIXFAST32: &[u8; 3usize] = b"lX\0"; -pub const PRIXFAST64: &[u8; 3usize] = b"lX\0"; -pub const PRIdMAX: &[u8; 3usize] = b"ld\0"; -pub const PRIiMAX: &[u8; 3usize] = b"li\0"; -pub const PRIoMAX: &[u8; 3usize] = b"lo\0"; -pub const PRIuMAX: &[u8; 3usize] = b"lu\0"; -pub const PRIxMAX: &[u8; 3usize] = b"lx\0"; -pub const PRIXMAX: &[u8; 3usize] = b"lX\0"; -pub const PRIdPTR: &[u8; 3usize] = b"ld\0"; -pub const PRIiPTR: &[u8; 3usize] = b"li\0"; -pub const PRIoPTR: &[u8; 3usize] = b"lo\0"; -pub const PRIuPTR: &[u8; 3usize] = b"lu\0"; -pub const PRIxPTR: &[u8; 3usize] = b"lx\0"; -pub const PRIXPTR: &[u8; 3usize] = b"lX\0"; -pub const SCNd8: &[u8; 4usize] = b"hhd\0"; -pub const SCNd16: &[u8; 3usize] = b"hd\0"; -pub const SCNd32: &[u8; 2usize] = b"d\0"; -pub const SCNd64: &[u8; 3usize] = b"ld\0"; -pub const SCNdLEAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdLEAST16: &[u8; 3usize] = b"hd\0"; -pub const SCNdLEAST32: &[u8; 2usize] = b"d\0"; -pub const SCNdLEAST64: &[u8; 3usize] = b"ld\0"; -pub const SCNdFAST8: &[u8; 4usize] = b"hhd\0"; -pub const SCNdFAST16: &[u8; 3usize] = b"ld\0"; -pub const SCNdFAST32: &[u8; 3usize] = b"ld\0"; -pub const SCNdFAST64: &[u8; 3usize] = b"ld\0"; -pub const SCNi8: &[u8; 4usize] = b"hhi\0"; -pub const SCNi16: &[u8; 3usize] = b"hi\0"; -pub const SCNi32: &[u8; 2usize] = b"i\0"; -pub const SCNi64: &[u8; 3usize] = b"li\0"; -pub const SCNiLEAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiLEAST16: &[u8; 3usize] = b"hi\0"; -pub const SCNiLEAST32: &[u8; 2usize] = b"i\0"; -pub const SCNiLEAST64: &[u8; 3usize] = b"li\0"; -pub const SCNiFAST8: &[u8; 4usize] = b"hhi\0"; -pub const SCNiFAST16: &[u8; 3usize] = b"li\0"; -pub const SCNiFAST32: &[u8; 3usize] = b"li\0"; -pub const SCNiFAST64: &[u8; 3usize] = b"li\0"; -pub const SCNu8: &[u8; 4usize] = b"hhu\0"; -pub const SCNu16: &[u8; 3usize] = b"hu\0"; -pub const SCNu32: &[u8; 2usize] = b"u\0"; -pub const SCNu64: &[u8; 3usize] = b"lu\0"; -pub const SCNuLEAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuLEAST16: &[u8; 3usize] = b"hu\0"; -pub const SCNuLEAST32: &[u8; 2usize] = b"u\0"; -pub const SCNuLEAST64: &[u8; 3usize] = b"lu\0"; -pub const SCNuFAST8: &[u8; 4usize] = b"hhu\0"; -pub const SCNuFAST16: &[u8; 3usize] = b"lu\0"; -pub const SCNuFAST32: &[u8; 3usize] = b"lu\0"; -pub const SCNuFAST64: &[u8; 3usize] = b"lu\0"; -pub const SCNo8: &[u8; 4usize] = b"hho\0"; -pub const SCNo16: &[u8; 3usize] = b"ho\0"; -pub const SCNo32: &[u8; 2usize] = b"o\0"; -pub const SCNo64: &[u8; 3usize] = b"lo\0"; -pub const SCNoLEAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoLEAST16: &[u8; 3usize] = b"ho\0"; -pub const SCNoLEAST32: &[u8; 2usize] = b"o\0"; -pub const SCNoLEAST64: &[u8; 3usize] = b"lo\0"; -pub const SCNoFAST8: &[u8; 4usize] = b"hho\0"; -pub const SCNoFAST16: &[u8; 3usize] = b"lo\0"; -pub const SCNoFAST32: &[u8; 3usize] = b"lo\0"; -pub const SCNoFAST64: &[u8; 3usize] = b"lo\0"; -pub const SCNx8: &[u8; 4usize] = b"hhx\0"; -pub const SCNx16: &[u8; 3usize] = b"hx\0"; -pub const SCNx32: &[u8; 2usize] = b"x\0"; -pub const SCNx64: &[u8; 3usize] = b"lx\0"; -pub const SCNxLEAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxLEAST16: &[u8; 3usize] = b"hx\0"; -pub const SCNxLEAST32: &[u8; 2usize] = b"x\0"; -pub const SCNxLEAST64: &[u8; 3usize] = b"lx\0"; -pub const SCNxFAST8: &[u8; 4usize] = b"hhx\0"; -pub const SCNxFAST16: &[u8; 3usize] = b"lx\0"; -pub const SCNxFAST32: &[u8; 3usize] = b"lx\0"; -pub const SCNxFAST64: &[u8; 3usize] = b"lx\0"; -pub const SCNdMAX: &[u8; 3usize] = b"ld\0"; -pub const SCNiMAX: &[u8; 3usize] = b"li\0"; -pub const SCNoMAX: &[u8; 3usize] = b"lo\0"; -pub const SCNuMAX: &[u8; 3usize] = b"lu\0"; -pub const SCNxMAX: &[u8; 3usize] = b"lx\0"; -pub const SCNdPTR: &[u8; 3usize] = b"ld\0"; -pub const SCNiPTR: &[u8; 3usize] = b"li\0"; -pub const SCNoPTR: &[u8; 3usize] = b"lo\0"; -pub const SCNuPTR: &[u8; 3usize] = b"lu\0"; -pub const SCNxPTR: &[u8; 3usize] = b"lx\0"; +pub const __PRI64_PREFIX: &[u8; 2] = b"l\0"; +pub const __PRIPTR_PREFIX: &[u8; 2] = b"l\0"; +pub const PRId8: &[u8; 2] = b"d\0"; +pub const PRId16: &[u8; 2] = b"d\0"; +pub const PRId32: &[u8; 2] = b"d\0"; +pub const PRId64: &[u8; 3] = b"ld\0"; +pub const PRIdLEAST8: &[u8; 2] = b"d\0"; +pub const PRIdLEAST16: &[u8; 2] = b"d\0"; +pub const PRIdLEAST32: &[u8; 2] = b"d\0"; +pub const PRIdLEAST64: &[u8; 3] = b"ld\0"; +pub const PRIdFAST8: &[u8; 2] = b"d\0"; +pub const PRIdFAST16: &[u8; 3] = b"ld\0"; +pub const PRIdFAST32: &[u8; 3] = b"ld\0"; +pub const PRIdFAST64: &[u8; 3] = b"ld\0"; +pub const PRIi8: &[u8; 2] = b"i\0"; +pub const PRIi16: &[u8; 2] = b"i\0"; +pub const PRIi32: &[u8; 2] = b"i\0"; +pub const PRIi64: &[u8; 3] = b"li\0"; +pub const PRIiLEAST8: &[u8; 2] = b"i\0"; +pub const PRIiLEAST16: &[u8; 2] = b"i\0"; +pub const PRIiLEAST32: &[u8; 2] = b"i\0"; +pub const PRIiLEAST64: &[u8; 3] = b"li\0"; +pub const PRIiFAST8: &[u8; 2] = b"i\0"; +pub const PRIiFAST16: &[u8; 3] = b"li\0"; +pub const PRIiFAST32: &[u8; 3] = b"li\0"; +pub const PRIiFAST64: &[u8; 3] = b"li\0"; +pub const PRIo8: &[u8; 2] = b"o\0"; +pub const PRIo16: &[u8; 2] = b"o\0"; +pub const PRIo32: &[u8; 2] = b"o\0"; +pub const PRIo64: &[u8; 3] = b"lo\0"; +pub const PRIoLEAST8: &[u8; 2] = b"o\0"; +pub const PRIoLEAST16: &[u8; 2] = b"o\0"; +pub const PRIoLEAST32: &[u8; 2] = b"o\0"; +pub const PRIoLEAST64: &[u8; 3] = b"lo\0"; +pub const PRIoFAST8: &[u8; 2] = b"o\0"; +pub const PRIoFAST16: &[u8; 3] = b"lo\0"; +pub const PRIoFAST32: &[u8; 3] = b"lo\0"; +pub const PRIoFAST64: &[u8; 3] = b"lo\0"; +pub const PRIu8: &[u8; 2] = b"u\0"; +pub const PRIu16: &[u8; 2] = b"u\0"; +pub const PRIu32: &[u8; 2] = b"u\0"; +pub const PRIu64: &[u8; 3] = b"lu\0"; +pub const PRIuLEAST8: &[u8; 2] = b"u\0"; +pub const PRIuLEAST16: &[u8; 2] = b"u\0"; +pub const PRIuLEAST32: &[u8; 2] = b"u\0"; +pub const PRIuLEAST64: &[u8; 3] = b"lu\0"; +pub const PRIuFAST8: &[u8; 2] = b"u\0"; +pub const PRIuFAST16: &[u8; 3] = b"lu\0"; +pub const PRIuFAST32: &[u8; 3] = b"lu\0"; +pub const PRIuFAST64: &[u8; 3] = b"lu\0"; +pub const PRIx8: &[u8; 2] = b"x\0"; +pub const PRIx16: &[u8; 2] = b"x\0"; +pub const PRIx32: &[u8; 2] = b"x\0"; +pub const PRIx64: &[u8; 3] = b"lx\0"; +pub const PRIxLEAST8: &[u8; 2] = b"x\0"; +pub const PRIxLEAST16: &[u8; 2] = b"x\0"; +pub const PRIxLEAST32: &[u8; 2] = b"x\0"; +pub const PRIxLEAST64: &[u8; 3] = b"lx\0"; +pub const PRIxFAST8: &[u8; 2] = b"x\0"; +pub const PRIxFAST16: &[u8; 3] = b"lx\0"; +pub const PRIxFAST32: &[u8; 3] = b"lx\0"; +pub const PRIxFAST64: &[u8; 3] = b"lx\0"; +pub const PRIX8: &[u8; 2] = b"X\0"; +pub const PRIX16: &[u8; 2] = b"X\0"; +pub const PRIX32: &[u8; 2] = b"X\0"; +pub const PRIX64: &[u8; 3] = b"lX\0"; +pub const PRIXLEAST8: &[u8; 2] = b"X\0"; +pub const PRIXLEAST16: &[u8; 2] = b"X\0"; +pub const PRIXLEAST32: &[u8; 2] = b"X\0"; +pub const PRIXLEAST64: &[u8; 3] = b"lX\0"; +pub const PRIXFAST8: &[u8; 2] = b"X\0"; +pub const PRIXFAST16: &[u8; 3] = b"lX\0"; +pub const PRIXFAST32: &[u8; 3] = b"lX\0"; +pub const PRIXFAST64: &[u8; 3] = b"lX\0"; +pub const PRIdMAX: &[u8; 3] = b"ld\0"; +pub const PRIiMAX: &[u8; 3] = b"li\0"; +pub const PRIoMAX: &[u8; 3] = b"lo\0"; +pub const PRIuMAX: &[u8; 3] = b"lu\0"; +pub const PRIxMAX: &[u8; 3] = b"lx\0"; +pub const PRIXMAX: &[u8; 3] = b"lX\0"; +pub const PRIdPTR: &[u8; 3] = b"ld\0"; +pub const PRIiPTR: &[u8; 3] = b"li\0"; +pub const PRIoPTR: &[u8; 3] = b"lo\0"; +pub const PRIuPTR: &[u8; 3] = b"lu\0"; +pub const PRIxPTR: &[u8; 3] = b"lx\0"; +pub const PRIXPTR: &[u8; 3] = b"lX\0"; +pub const SCNd8: &[u8; 4] = b"hhd\0"; +pub const SCNd16: &[u8; 3] = b"hd\0"; +pub const SCNd32: &[u8; 2] = b"d\0"; +pub const SCNd64: &[u8; 3] = b"ld\0"; +pub const SCNdLEAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdLEAST16: &[u8; 3] = b"hd\0"; +pub const SCNdLEAST32: &[u8; 2] = b"d\0"; +pub const SCNdLEAST64: &[u8; 3] = b"ld\0"; +pub const SCNdFAST8: &[u8; 4] = b"hhd\0"; +pub const SCNdFAST16: &[u8; 3] = b"ld\0"; +pub const SCNdFAST32: &[u8; 3] = b"ld\0"; +pub const SCNdFAST64: &[u8; 3] = b"ld\0"; +pub const SCNi8: &[u8; 4] = b"hhi\0"; +pub const SCNi16: &[u8; 3] = b"hi\0"; +pub const SCNi32: &[u8; 2] = b"i\0"; +pub const SCNi64: &[u8; 3] = b"li\0"; +pub const SCNiLEAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiLEAST16: &[u8; 3] = b"hi\0"; +pub const SCNiLEAST32: &[u8; 2] = b"i\0"; +pub const SCNiLEAST64: &[u8; 3] = b"li\0"; +pub const SCNiFAST8: &[u8; 4] = b"hhi\0"; +pub const SCNiFAST16: &[u8; 3] = b"li\0"; +pub const SCNiFAST32: &[u8; 3] = b"li\0"; +pub const SCNiFAST64: &[u8; 3] = b"li\0"; +pub const SCNu8: &[u8; 4] = b"hhu\0"; +pub const SCNu16: &[u8; 3] = b"hu\0"; +pub const SCNu32: &[u8; 2] = b"u\0"; +pub const SCNu64: &[u8; 3] = b"lu\0"; +pub const SCNuLEAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuLEAST16: &[u8; 3] = b"hu\0"; +pub const SCNuLEAST32: &[u8; 2] = b"u\0"; +pub const SCNuLEAST64: &[u8; 3] = b"lu\0"; +pub const SCNuFAST8: &[u8; 4] = b"hhu\0"; +pub const SCNuFAST16: &[u8; 3] = b"lu\0"; +pub const SCNuFAST32: &[u8; 3] = b"lu\0"; +pub const SCNuFAST64: &[u8; 3] = b"lu\0"; +pub const SCNo8: &[u8; 4] = b"hho\0"; +pub const SCNo16: &[u8; 3] = b"ho\0"; +pub const SCNo32: &[u8; 2] = b"o\0"; +pub const SCNo64: &[u8; 3] = b"lo\0"; +pub const SCNoLEAST8: &[u8; 4] = b"hho\0"; +pub const SCNoLEAST16: &[u8; 3] = b"ho\0"; +pub const SCNoLEAST32: &[u8; 2] = b"o\0"; +pub const SCNoLEAST64: &[u8; 3] = b"lo\0"; +pub const SCNoFAST8: &[u8; 4] = b"hho\0"; +pub const SCNoFAST16: &[u8; 3] = b"lo\0"; +pub const SCNoFAST32: &[u8; 3] = b"lo\0"; +pub const SCNoFAST64: &[u8; 3] = b"lo\0"; +pub const SCNx8: &[u8; 4] = b"hhx\0"; +pub const SCNx16: &[u8; 3] = b"hx\0"; +pub const SCNx32: &[u8; 2] = b"x\0"; +pub const SCNx64: &[u8; 3] = b"lx\0"; +pub const SCNxLEAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxLEAST16: &[u8; 3] = b"hx\0"; +pub const SCNxLEAST32: &[u8; 2] = b"x\0"; +pub const SCNxLEAST64: &[u8; 3] = b"lx\0"; +pub const SCNxFAST8: &[u8; 4] = b"hhx\0"; +pub const SCNxFAST16: &[u8; 3] = b"lx\0"; +pub const SCNxFAST32: &[u8; 3] = b"lx\0"; +pub const SCNxFAST64: &[u8; 3] = b"lx\0"; +pub const SCNdMAX: &[u8; 3] = b"ld\0"; +pub const SCNiMAX: &[u8; 3] = b"li\0"; +pub const SCNoMAX: &[u8; 3] = b"lo\0"; +pub const SCNuMAX: &[u8; 3] = b"lu\0"; +pub const SCNxMAX: &[u8; 3] = b"lx\0"; +pub const SCNdPTR: &[u8; 3] = b"ld\0"; +pub const SCNiPTR: &[u8; 3] = b"li\0"; +pub const SCNoPTR: &[u8; 3] = b"lo\0"; +pub const SCNuPTR: &[u8; 3] = b"lu\0"; +pub const SCNxPTR: &[u8; 3] = b"lx\0"; pub const _STDLIB_H: u32 = 1; pub const WNOHANG: u32 = 1; pub const WUNTRACED: u32 = 2; @@ -381,6 +382,7 @@ pub const LC_OPT_CORE_READONLY: u64 = 1152921556146454528; pub const LC_OPT_MEMORYINFO_VALID: u64 = 144115192370823168; pub const LC_OPT_MEMORYINFO_FLAG_32BIT: u64 = 144115200960757760; pub const LC_OPT_MEMORYINFO_FLAG_PAE: u64 = 144115205255725056; +pub const LC_OPT_MEMORYINFO_ARCH: u64 = 144115265385267200; pub const LC_OPT_MEMORYINFO_OS_VERSION_MINOR: u64 = 144115209550692352; pub const LC_OPT_MEMORYINFO_OS_VERSION_MAJOR: u64 = 144115213845659648; pub const LC_OPT_MEMORYINFO_OS_DTB: u64 = 144115218140626944; @@ -411,9 +413,6 @@ pub const LC_OPT_FPGA_ALGO_SYNCHRONOUS: u64 = 216173353344434176; pub const LC_OPT_FPGA_CFGSPACE_XILINX: u64 = 216173357639401472; pub const LC_OPT_FPGA_TLP_READ_CB_WITHINFO: u64 = 216173400589074432; pub const LC_OPT_FPGA_TLP_READ_CB_FILTERCPL: u64 = 216173404884041728; -pub const LC_OPT_FPGA_TLP_READ_CB_BACKGROUND_THREAD: u64 = 216173409179009024; -pub const LC_CMD_FPGA_WRITE_TLP: u64 = 1103806595072; -pub const LC_CMD_FPGA_LISTEN_TLP: u64 = 1108101562368; pub const LC_CMD_FPGA_PCIECFGSPACE: u64 = 1112396529664; pub const LC_CMD_FPGA_CFGREGPCIE: u64 = 1116691496960; pub const LC_CMD_FPGA_CFGREGCFG: u64 = 1120986464256; @@ -427,7 +426,15 @@ pub const LC_CMD_FPGA_CFGSPACE_SHADOW_WR: u64 = 1155346202624; pub const LC_CMD_FPGA_TLP_WRITE_SINGLE: u64 = 1168231104512; pub const LC_CMD_FPGA_TLP_WRITE_MULTIPLE: u64 = 1172526071808; pub const LC_CMD_FPGA_TLP_TOSTRING: u64 = 1176821039104; -pub const LC_CMD_FPGA_TLP_READ_FUNCTION_CALLBACK: u64 = 1181116006400; +pub const LC_CMD_FPGA_TLP_CONTEXT: u64 = 2305844194624667648; +pub const LC_CMD_FPGA_TLP_CONTEXT_RD: u64 = 2305844224689438720; +pub const LC_CMD_FPGA_TLP_FUNCTION_CALLBACK: u64 = 2305844198919634944; +pub const LC_CMD_FPGA_TLP_FUNCTION_CALLBACK_RD: u64 = 2305844228984406016; +pub const LC_CMD_FPGA_BAR_CONTEXT: u64 = 2305844246164275200; +pub const LC_CMD_FPGA_BAR_CONTEXT_RD: u64 = 2305844250459242496; +pub const LC_CMD_FPGA_BAR_FUNCTION_CALLBACK: u64 = 2305844254754209792; +pub const LC_CMD_FPGA_BAR_FUNCTION_CALLBACK_RD: u64 = 2305844259049177088; +pub const LC_CMD_FPGA_BAR_INFO: u64 = 1254130450432; pub const LC_CMD_FILE_DUMPHEADER_GET: u64 = 2203318222848; pub const LC_CMD_STATISTICS_GET: u64 = 4611687117939015680; pub const LC_CMD_MEMMAP_GET: u64 = 4611688217450643456; @@ -441,6 +448,8 @@ pub const LC_CMD_AGENT_VFS_READ: i64 = -9223372019674906624; pub const LC_CMD_AGENT_VFS_WRITE: i64 = -9223372015379939328; pub const LC_CMD_AGENT_VFS_OPT_GET: i64 = -9223372011084972032; pub const LC_CMD_AGENT_VFS_OPT_SET: i64 = -9223372006790004736; +pub const LC_CMD_AGENT_VFS_INITIALIZE: i64 = -9223372002495037440; +pub const LC_CMD_AGENT_VFS_CONSOLE: i64 = -9223371998200070144; pub const LC_CMD_AGENT_VFS_REQ_VERSION: u32 = 4276944897; pub const LC_CMD_AGENT_VFS_RSP_VERSION: u32 = 4277010433; pub const LC_STATISTICS_VERSION: u32 = 3785424898; @@ -2869,7 +2878,7 @@ extern "C" { ) -> HANDLE; } extern "C" { - pub fn LcClose(hLC: HANDLE) -> VOID; + pub fn LcClose(hLC: HANDLE); } #[repr(C)] #[derive(Copy, Clone)] @@ -3003,7 +3012,7 @@ pub type MEM_SCATTER = tdMEM_SCATTER; pub type PMEM_SCATTER = *mut tdMEM_SCATTER; pub type PPMEM_SCATTER = *mut *mut tdMEM_SCATTER; extern "C" { - pub fn LcMemFree(pv: PVOID) -> VOID; + pub fn LcMemFree(pv: PVOID); } extern "C" { pub fn LcAllocScatter1(cMEMs: DWORD, pppMEMs: *mut PPMEM_SCATTER) -> BOOL; @@ -3027,13 +3036,13 @@ extern "C" { ) -> BOOL; } extern "C" { - pub fn LcReadScatter(hLC: HANDLE, cMEMs: DWORD, ppMEMs: PPMEM_SCATTER) -> VOID; + pub fn LcReadScatter(hLC: HANDLE, cMEMs: DWORD, ppMEMs: PPMEM_SCATTER); } extern "C" { pub fn LcRead(hLC: HANDLE, pa: QWORD, cb: DWORD, pb: PBYTE) -> BOOL; } extern "C" { - pub fn LcWriteScatter(hLC: HANDLE, cMEMs: DWORD, ppMEMs: PPMEM_SCATTER) -> VOID; + pub fn LcWriteScatter(hLC: HANDLE, cMEMs: DWORD, ppMEMs: PPMEM_SCATTER); } extern "C" { pub fn LcWrite(hLC: HANDLE, pa: QWORD, cb: DWORD, pb: PBYTE) -> BOOL; @@ -3442,6 +3451,13 @@ fn bindgen_test_layout_tdLC_MEMMAP_ENTRY() { } pub type LC_MEMMAP_ENTRY = tdLC_MEMMAP_ENTRY; pub type PLC_MEMMAP_ENTRY = *mut tdLC_MEMMAP_ENTRY; +pub const tdLC_ARCH_TP_LC_ARCH_NA: tdLC_ARCH_TP = 0; +pub const tdLC_ARCH_TP_LC_ARCH_X86: tdLC_ARCH_TP = 1; +pub const tdLC_ARCH_TP_LC_ARCH_X86PAE: tdLC_ARCH_TP = 2; +pub const tdLC_ARCH_TP_LC_ARCH_X64: tdLC_ARCH_TP = 3; +pub const tdLC_ARCH_TP_LC_ARCH_ARM64: tdLC_ARCH_TP = 4; +pub type tdLC_ARCH_TP = ::std::os::raw::c_uint; +pub use self::tdLC_ARCH_TP as LC_ARCH_TP; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct tdLC_TLP { @@ -3496,55 +3512,281 @@ fn bindgen_test_layout_tdLC_TLP() { } pub type LC_TLP = tdLC_TLP; pub type PLC_TLP = *mut tdLC_TLP; -pub type PLC_TLP_READ_FUNCTION_CALLBACK = ::std::option::Option< - unsafe extern "C" fn( - ctx: PVOID, - cbTlp: DWORD, - pbTlp: PBYTE, - cbInfo: DWORD, - szInfo: LPSTR, - ) -> VOID, +pub type PLC_TLP_FUNCTION_CALLBACK = ::std::option::Option< + unsafe extern "C" fn(ctx: PVOID, cbTlp: DWORD, pbTlp: PBYTE, cbInfo: DWORD, szInfo: LPSTR), >; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct tdLC_TLP_CALLBACK { - pub ctx: PVOID, - pub pfn: PLC_TLP_READ_FUNCTION_CALLBACK, +pub struct tdLC_BAR { + pub fValid: BOOL, + pub fIO: BOOL, + pub f64Bit: BOOL, + pub fPrefetchable: BOOL, + pub _Filler: [DWORD; 3usize], + pub iBar: DWORD, + pub pa: QWORD, + pub cb: QWORD, } #[test] -fn bindgen_test_layout_tdLC_TLP_CALLBACK() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); +fn bindgen_test_layout_tdLC_BAR() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); let ptr = UNINIT.as_ptr(); assert_eq!( - ::std::mem::size_of::(), + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(tdLC_BAR)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(tdLC_BAR)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fValid) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR), + "::", + stringify!(fValid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fIO) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR), + "::", + stringify!(fIO) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).f64Bit) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR), + "::", + stringify!(f64Bit) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fPrefetchable) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR), + "::", + stringify!(fPrefetchable) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._Filler) as usize - ptr as usize }, 16usize, - concat!("Size of: ", stringify!(tdLC_TLP_CALLBACK)) + concat!( + "Offset of field: ", + stringify!(tdLC_BAR), + "::", + stringify!(_Filler) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).iBar) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR), + "::", + stringify!(iBar) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pa) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR), + "::", + stringify!(pa) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cb) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR), + "::", + stringify!(cb) + ) + ); +} +pub type LC_BAR = tdLC_BAR; +pub type PLC_BAR = *mut tdLC_BAR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tdLC_BAR_REQUEST { + pub ctx: PVOID, + pub pBar: PLC_BAR, + pub bTag: BYTE, + pub bFirstBE: BYTE, + pub bLastBE: BYTE, + pub _Filler: BYTE, + pub f64_: BOOL, + pub fRead: BOOL, + pub fReadReply: BOOL, + pub fWrite: BOOL, + pub cbData: DWORD, + pub oData: QWORD, + pub pbData: [BYTE; 4096usize], +} +#[test] +fn bindgen_test_layout_tdLC_BAR_REQUEST() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 4144usize, + concat!("Size of: ", stringify!(tdLC_BAR_REQUEST)) ); assert_eq!( - ::std::mem::align_of::(), + ::std::mem::align_of::(), 8usize, - concat!("Alignment of ", stringify!(tdLC_TLP_CALLBACK)) + concat!("Alignment of ", stringify!(tdLC_BAR_REQUEST)) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).ctx) as usize - ptr as usize }, 0usize, concat!( "Offset of field: ", - stringify!(tdLC_TLP_CALLBACK), + stringify!(tdLC_BAR_REQUEST), "::", stringify!(ctx) ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pfn) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).pBar) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", - stringify!(tdLC_TLP_CALLBACK), + stringify!(tdLC_BAR_REQUEST), + "::", + stringify!(pBar) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bTag) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR_REQUEST), + "::", + stringify!(bTag) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bFirstBE) as usize - ptr as usize }, + 17usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR_REQUEST), + "::", + stringify!(bFirstBE) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bLastBE) as usize - ptr as usize }, + 18usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR_REQUEST), + "::", + stringify!(bLastBE) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._Filler) as usize - ptr as usize }, + 19usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR_REQUEST), + "::", + stringify!(_Filler) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).f64_) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR_REQUEST), + "::", + stringify!(f64_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fRead) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR_REQUEST), + "::", + stringify!(fRead) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fReadReply) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR_REQUEST), + "::", + stringify!(fReadReply) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fWrite) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR_REQUEST), + "::", + stringify!(fWrite) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cbData) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR_REQUEST), + "::", + stringify!(cbData) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).oData) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR_REQUEST), + "::", + stringify!(oData) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pbData) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(tdLC_BAR_REQUEST), "::", - stringify!(pfn) + stringify!(pbData) ) ); } -pub type LC_TLP_CALLBACK = tdLC_TLP_CALLBACK; -pub type PLC_TLP_CALLBACK = *mut tdLC_TLP_CALLBACK; +pub type LC_BAR_REQUEST = tdLC_BAR_REQUEST; +pub type PLC_BAR_REQUEST = *mut tdLC_BAR_REQUEST; +pub type PLC_BAR_FUNCTION_CALLBACK = + ::std::option::Option;