libsensors-sys-0.2.0/.gitignore01006440001750000014400000000022131542260010014701 0ustar0000000000000000target Cargo.lock libsensors-sys-0.2.0/Cargo.toml.orig01006440001750000014400000000305132576760420015626 0ustar0000000000000000[package] name = "libsensors-sys" version = "0.2.0" authors = ["nyantec GmbH "] license = "MirOS" description = "Rust bindings to libsensors" links = "sensors" build = "build.rs" libsensors-sys-0.2.0/Cargo.toml0000644000000013200011043 0ustar00# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g. crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] name = "libsensors-sys" version = "0.2.0" authors = ["nyantec GmbH "] build = "build.rs" links = "sensors" description = "Rust bindings to libsensors" license = "MirOS" libsensors-sys-0.2.0/LICENSE01006440001750000014400000005262131542262270013743 0ustar0000000000000000MirOS License (MirOS) /*- * Copyright © 2017 * nyantec GmbH * * Provided that these terms and disclaimer and all copyright notices * are retained or reproduced in an accompanying document, permission * is granted to deal in this work without restriction, including un‐ * limited rights to use, publicly perform, distribute, sell, modify, * merge, give away, or sublicence. * * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to * the utmost extent permitted by applicable law, neither express nor * implied; without malicious intent or gross negligence. In no event * may a licensor, author or contributor be held liable for indirect, * direct, other damage, loss, or other issues arising in any way out * of dealing in the work, even if advised of the possibility of such * damage or existence of a defect, except proven that it results out * of said person's immediate fault when using the work as intended. */ I_N_S_T_R_U_C_T_I_O_N_S_:_ To apply the template(¹) specify the years of copyright (separated by comma, not as a range), the legal names of the copyright holders, and the real names of the authors if different. Avoid adding text. R_A_T_I_O_N_A_L_E_:_ This licence is apt for any kind of work (such as source code, fonts, documentation, graphics, sound etc.) and the preferred terms for work added to MirBSD. It has been drafted as universally usable equivalent of the "historic permission notice"⁽²⁾ adapted to Europen law because in some (droit d'auteur) countries authors cannot disclaim all liabi‐ lities. Compliance to DFSG⁽³⁾ 1.1 is ensured, and GPLv2 compatibility is asserted unless advertising clauses are used. The MirOS Licence is certified to conform to OKD⁽⁴⁾ 1.0 and OSD⁽⁵⁾ 1.9, and qualifies as a Free Software⁽⁶⁾ and also Free Documentation⁽⁷⁾ licence and is inclu‐ ded in some relevant lists⁽⁸⁾⁽⁹⁾⁽¹⁰⁾. We believe you are not liable for work inserted which is intellectual property of third parties, if you were not aware of the fact, act ap‐ propriately as soon as you become aware of that problem, seek an ami‐ cable solution for all parties, and never knowingly distribute a work without being authorised to do so by its licensors. R_E_F_E_R_E_N_C_E_S_:_ ① also at http://mirbsd.de/MirOS-Licence ② http://www.opensource.org/licenses/historical.php ③ http://www.debian.org/social_contract#guidelines ④ http://www.opendefinition.org/1.0 ⑤ http://www.opensource.org/docs/osd ⑥ http://www.gnu.org/philosophy/free-sw.html ⑦ http://www.gnu.org/philosophy/free-doc.html ⑧ http://www.ifross.de/ifross_html/lizenzcenter.html ⑨ http://www.opendefinition.org/licenses ⑩ http://opensource.org/licenses/miros.html libsensors-sys-0.2.0/build.rs01006440001750000014400000000102132576757610014406 0ustar0000000000000000fn main() { println!("cargo:rustc-link-lib=dylib=sensors"); } libsensors-sys-0.2.0/src/error.rs01006440001750000014400000003177132576757610015246 0ustar0000000000000000/* automatically generated by rust-bindgen */ pub const SENSORS_ERR_WILDCARDS: ::std::os::raw::c_int = 1; pub const SENSORS_ERR_NO_ENTRY: ::std::os::raw::c_int = 2; pub const SENSORS_ERR_ACCESS_R: ::std::os::raw::c_int = 3; pub const SENSORS_ERR_KERNEL: ::std::os::raw::c_int = 4; pub const SENSORS_ERR_DIV_ZERO: ::std::os::raw::c_int = 5; pub const SENSORS_ERR_CHIP_NAME: ::std::os::raw::c_int = 6; pub const SENSORS_ERR_BUS_NAME: ::std::os::raw::c_int = 7; pub const SENSORS_ERR_PARSE: ::std::os::raw::c_int = 8; pub const SENSORS_ERR_ACCESS_W: ::std::os::raw::c_int = 9; pub const SENSORS_ERR_IO: ::std::os::raw::c_int = 10; pub const SENSORS_ERR_RECURSION: ::std::os::raw::c_int = 11; extern "C" { pub fn sensors_strerror(errnum: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; } extern "C" { #[link_name = "\u{1}sensors_parse_error"] pub static mut sensors_parse_error: ::std::option::Option< unsafe extern "C" fn(err: *const ::std::os::raw::c_char, lineno: ::std::os::raw::c_int), >; } extern "C" { #[link_name = "\u{1}sensors_parse_error_wfn"] pub static mut sensors_parse_error_wfn: ::std::option::Option< unsafe extern "C" fn( err: *const ::std::os::raw::c_char, filename: *const ::std::os::raw::c_char, lineno: ::std::os::raw::c_int, ), >; } extern "C" { #[link_name = "\u{1}sensors_fatal_error"] pub static mut sensors_fatal_error: ::std::option::Option< unsafe extern "C" fn( proc_: *const ::std::os::raw::c_char, err: *const ::std::os::raw::c_char, ), >; } libsensors-sys-0.2.0/src/lib.rs01006440001750000014400000000216132576757610014652 0ustar0000000000000000#![allow(non_camel_case_types,non_snake_case,non_upper_case_globals)] pub mod sensors; pub mod error; pub use sensors::*; pub use error::*; libsensors-sys-0.2.0/src/sensors.rs01006440001750000014400000061021132576757610015601 0ustar0000000000000000/* automatically generated by rust-bindgen */ pub const SENSORS_API_VERSION: u32 = 1088; pub const SENSORS_CHIP_NAME_ADDR_ANY: i32 = -1; pub const SENSORS_BUS_TYPE_ANY: i32 = -1; pub const SENSORS_BUS_TYPE_I2C: u32 = 0; pub const SENSORS_BUS_TYPE_ISA: u32 = 1; pub const SENSORS_BUS_TYPE_PCI: u32 = 2; pub const SENSORS_BUS_TYPE_SPI: u32 = 3; pub const SENSORS_BUS_TYPE_VIRTUAL: u32 = 4; pub const SENSORS_BUS_TYPE_ACPI: u32 = 5; pub const SENSORS_BUS_TYPE_HID: u32 = 6; pub const SENSORS_BUS_NR_ANY: i32 = -1; pub const SENSORS_BUS_NR_IGNORE: i32 = -2; pub const SENSORS_MODE_R: u32 = 1; pub const SENSORS_MODE_W: u32 = 2; pub const SENSORS_COMPUTE_MAPPING: u32 = 4; pub type __off_t = ::std::os::raw::c_long; pub type __off64_t = ::std::os::raw::c_long; pub type FILE = _IO_FILE; pub type _IO_lock_t = ::std::os::raw::c_void; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _IO_marker { pub _next: *mut _IO_marker, pub _sbuf: *mut _IO_FILE, pub _pos: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout__IO_marker() { assert_eq!( ::std::mem::size_of::<_IO_marker>(), 24usize, concat!("Size of: ", stringify!(_IO_marker)) ); assert_eq!( ::std::mem::align_of::<_IO_marker>(), 8usize, concat!("Alignment of ", stringify!(_IO_marker)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_marker>()))._next as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(_IO_marker), "::", stringify!(_next) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_marker>()))._sbuf as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(_IO_marker), "::", stringify!(_sbuf) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_marker>()))._pos as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(_IO_marker), "::", stringify!(_pos) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _IO_FILE { pub _flags: ::std::os::raw::c_int, pub _IO_read_ptr: *mut ::std::os::raw::c_char, pub _IO_read_end: *mut ::std::os::raw::c_char, pub _IO_read_base: *mut ::std::os::raw::c_char, pub _IO_write_base: *mut ::std::os::raw::c_char, pub _IO_write_ptr: *mut ::std::os::raw::c_char, pub _IO_write_end: *mut ::std::os::raw::c_char, pub _IO_buf_base: *mut ::std::os::raw::c_char, pub _IO_buf_end: *mut ::std::os::raw::c_char, pub _IO_save_base: *mut ::std::os::raw::c_char, pub _IO_backup_base: *mut ::std::os::raw::c_char, pub _IO_save_end: *mut ::std::os::raw::c_char, pub _markers: *mut _IO_marker, pub _chain: *mut _IO_FILE, pub _fileno: ::std::os::raw::c_int, pub _flags2: ::std::os::raw::c_int, pub _old_offset: __off_t, pub _cur_column: ::std::os::raw::c_ushort, pub _vtable_offset: ::std::os::raw::c_schar, pub _shortbuf: [::std::os::raw::c_char; 1usize], pub _lock: *mut _IO_lock_t, pub _offset: __off64_t, pub __pad1: *mut ::std::os::raw::c_void, pub __pad2: *mut ::std::os::raw::c_void, pub __pad3: *mut ::std::os::raw::c_void, pub __pad4: *mut ::std::os::raw::c_void, pub __pad5: usize, pub _mode: ::std::os::raw::c_int, pub _unused2: [::std::os::raw::c_char; 20usize], } #[test] fn bindgen_test_layout__IO_FILE() { assert_eq!( ::std::mem::size_of::<_IO_FILE>(), 216usize, concat!("Size of: ", stringify!(_IO_FILE)) ); assert_eq!( ::std::mem::align_of::<_IO_FILE>(), 8usize, concat!("Alignment of ", stringify!(_IO_FILE)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._flags as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_flags) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_ptr as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_IO_read_ptr) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_end as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_IO_read_end) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_base as *const _ as usize }, 24usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_IO_read_base) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_base as *const _ as usize }, 32usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_IO_write_base) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_ptr as *const _ as usize }, 40usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_IO_write_ptr) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_end as *const _ as usize }, 48usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_IO_write_end) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_buf_base as *const _ as usize }, 56usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_IO_buf_base) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_buf_end as *const _ as usize }, 64usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_IO_buf_end) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_save_base as *const _ as usize }, 72usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_IO_save_base) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_backup_base as *const _ as usize }, 80usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_IO_backup_base) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._IO_save_end as *const _ as usize }, 88usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_IO_save_end) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._markers as *const _ as usize }, 96usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_markers) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._chain as *const _ as usize }, 104usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_chain) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._fileno as *const _ as usize }, 112usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_fileno) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._flags2 as *const _ as usize }, 116usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_flags2) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._old_offset as *const _ as usize }, 120usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_old_offset) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._cur_column as *const _ as usize }, 128usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_cur_column) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._vtable_offset as *const _ as usize }, 130usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_vtable_offset) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._shortbuf as *const _ as usize }, 131usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_shortbuf) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._lock as *const _ as usize }, 136usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_lock) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._offset as *const _ as usize }, 144usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_offset) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad1 as *const _ as usize }, 152usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(__pad1) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad2 as *const _ as usize }, 160usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(__pad2) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad3 as *const _ as usize }, 168usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(__pad3) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad4 as *const _ as usize }, 176usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(__pad4) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad5 as *const _ as usize }, 184usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(__pad5) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._mode as *const _ as usize }, 192usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_mode) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._unused2 as *const _ as usize }, 196usize, concat!( "Offset of field: ", stringify!(_IO_FILE), "::", stringify!(_unused2) ) ); } extern "C" { #[link_name = "\u{1}libsensors_version"] pub static mut libsensors_version: *const ::std::os::raw::c_char; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sensors_bus_id { pub type_: ::std::os::raw::c_short, pub nr: ::std::os::raw::c_short, } #[test] fn bindgen_test_layout_sensors_bus_id() { assert_eq!( ::std::mem::size_of::(), 4usize, concat!("Size of: ", stringify!(sensors_bus_id)) ); assert_eq!( ::std::mem::align_of::(), 2usize, concat!("Alignment of ", stringify!(sensors_bus_id)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(sensors_bus_id), "::", stringify!(type_) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).nr as *const _ as usize }, 2usize, concat!( "Offset of field: ", stringify!(sensors_bus_id), "::", stringify!(nr) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sensors_chip_name { pub prefix: *mut ::std::os::raw::c_char, pub bus: sensors_bus_id, pub addr: ::std::os::raw::c_int, pub path: *mut ::std::os::raw::c_char, } #[test] fn bindgen_test_layout_sensors_chip_name() { assert_eq!( ::std::mem::size_of::(), 24usize, concat!("Size of: ", stringify!(sensors_chip_name)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(sensors_chip_name)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).prefix as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(sensors_chip_name), "::", stringify!(prefix) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).bus as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(sensors_chip_name), "::", stringify!(bus) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).addr as *const _ as usize }, 12usize, concat!( "Offset of field: ", stringify!(sensors_chip_name), "::", stringify!(addr) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).path as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(sensors_chip_name), "::", stringify!(path) ) ); } extern "C" { pub fn sensors_init(input: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { pub fn sensors_cleanup(); } extern "C" { pub fn sensors_parse_chip_name( orig_name: *const ::std::os::raw::c_char, res: *mut sensors_chip_name, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sensors_free_chip_name(chip: *mut sensors_chip_name); } extern "C" { pub fn sensors_snprintf_chip_name( str: *mut ::std::os::raw::c_char, size: usize, chip: *const sensors_chip_name, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sensors_get_adapter_name(bus: *const sensors_bus_id) -> *const ::std::os::raw::c_char; } extern "C" { pub fn sensors_get_label( name: *const sensors_chip_name, feature: *const sensors_feature, ) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn sensors_get_value( name: *const sensors_chip_name, subfeat_nr: ::std::os::raw::c_int, value: *mut f64, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sensors_set_value( name: *const sensors_chip_name, subfeat_nr: ::std::os::raw::c_int, value: f64, ) -> ::std::os::raw::c_int; } extern "C" { pub fn sensors_do_chip_sets(name: *const sensors_chip_name) -> ::std::os::raw::c_int; } extern "C" { pub fn sensors_get_detected_chips( match_: *const sensors_chip_name, nr: *mut ::std::os::raw::c_int, ) -> *const sensors_chip_name; } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum sensors_feature_type { SENSORS_FEATURE_IN = 0, SENSORS_FEATURE_FAN = 1, SENSORS_FEATURE_TEMP = 2, SENSORS_FEATURE_POWER = 3, SENSORS_FEATURE_ENERGY = 4, SENSORS_FEATURE_CURR = 5, SENSORS_FEATURE_HUMIDITY = 6, SENSORS_FEATURE_MAX_MAIN = 7, SENSORS_FEATURE_VID = 16, SENSORS_FEATURE_INTRUSION = 17, SENSORS_FEATURE_MAX_OTHER = 18, SENSORS_FEATURE_BEEP_ENABLE = 24, SENSORS_FEATURE_MAX = 25, SENSORS_FEATURE_UNKNOWN = 2147483647, } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum sensors_subfeature_type { SENSORS_SUBFEATURE_IN_INPUT = 0, SENSORS_SUBFEATURE_IN_MIN = 1, SENSORS_SUBFEATURE_IN_MAX = 2, SENSORS_SUBFEATURE_IN_LCRIT = 3, SENSORS_SUBFEATURE_IN_CRIT = 4, SENSORS_SUBFEATURE_IN_AVERAGE = 5, SENSORS_SUBFEATURE_IN_LOWEST = 6, SENSORS_SUBFEATURE_IN_HIGHEST = 7, SENSORS_SUBFEATURE_IN_ALARM = 128, SENSORS_SUBFEATURE_IN_MIN_ALARM = 129, SENSORS_SUBFEATURE_IN_MAX_ALARM = 130, SENSORS_SUBFEATURE_IN_BEEP = 131, SENSORS_SUBFEATURE_IN_LCRIT_ALARM = 132, SENSORS_SUBFEATURE_IN_CRIT_ALARM = 133, SENSORS_SUBFEATURE_FAN_INPUT = 256, SENSORS_SUBFEATURE_FAN_MIN = 257, SENSORS_SUBFEATURE_FAN_MAX = 258, SENSORS_SUBFEATURE_FAN_ALARM = 384, SENSORS_SUBFEATURE_FAN_FAULT = 385, SENSORS_SUBFEATURE_FAN_DIV = 386, SENSORS_SUBFEATURE_FAN_BEEP = 387, SENSORS_SUBFEATURE_FAN_PULSES = 388, SENSORS_SUBFEATURE_FAN_MIN_ALARM = 389, SENSORS_SUBFEATURE_FAN_MAX_ALARM = 390, SENSORS_SUBFEATURE_TEMP_INPUT = 512, SENSORS_SUBFEATURE_TEMP_MAX = 513, SENSORS_SUBFEATURE_TEMP_MAX_HYST = 514, SENSORS_SUBFEATURE_TEMP_MIN = 515, SENSORS_SUBFEATURE_TEMP_CRIT = 516, SENSORS_SUBFEATURE_TEMP_CRIT_HYST = 517, SENSORS_SUBFEATURE_TEMP_LCRIT = 518, SENSORS_SUBFEATURE_TEMP_EMERGENCY = 519, SENSORS_SUBFEATURE_TEMP_EMERGENCY_HYST = 520, SENSORS_SUBFEATURE_TEMP_LOWEST = 521, SENSORS_SUBFEATURE_TEMP_HIGHEST = 522, SENSORS_SUBFEATURE_TEMP_MIN_HYST = 523, SENSORS_SUBFEATURE_TEMP_LCRIT_HYST = 524, SENSORS_SUBFEATURE_TEMP_ALARM = 640, SENSORS_SUBFEATURE_TEMP_MAX_ALARM = 641, SENSORS_SUBFEATURE_TEMP_MIN_ALARM = 642, SENSORS_SUBFEATURE_TEMP_CRIT_ALARM = 643, SENSORS_SUBFEATURE_TEMP_FAULT = 644, SENSORS_SUBFEATURE_TEMP_TYPE = 645, SENSORS_SUBFEATURE_TEMP_OFFSET = 646, SENSORS_SUBFEATURE_TEMP_BEEP = 647, SENSORS_SUBFEATURE_TEMP_EMERGENCY_ALARM = 648, SENSORS_SUBFEATURE_TEMP_LCRIT_ALARM = 649, SENSORS_SUBFEATURE_POWER_AVERAGE = 768, SENSORS_SUBFEATURE_POWER_AVERAGE_HIGHEST = 769, SENSORS_SUBFEATURE_POWER_AVERAGE_LOWEST = 770, SENSORS_SUBFEATURE_POWER_INPUT = 771, SENSORS_SUBFEATURE_POWER_INPUT_HIGHEST = 772, SENSORS_SUBFEATURE_POWER_INPUT_LOWEST = 773, SENSORS_SUBFEATURE_POWER_CAP = 774, SENSORS_SUBFEATURE_POWER_CAP_HYST = 775, SENSORS_SUBFEATURE_POWER_MAX = 776, SENSORS_SUBFEATURE_POWER_CRIT = 777, SENSORS_SUBFEATURE_POWER_AVERAGE_INTERVAL = 896, SENSORS_SUBFEATURE_POWER_ALARM = 897, SENSORS_SUBFEATURE_POWER_CAP_ALARM = 898, SENSORS_SUBFEATURE_POWER_MAX_ALARM = 899, SENSORS_SUBFEATURE_POWER_CRIT_ALARM = 900, SENSORS_SUBFEATURE_ENERGY_INPUT = 1024, SENSORS_SUBFEATURE_CURR_INPUT = 1280, SENSORS_SUBFEATURE_CURR_MIN = 1281, SENSORS_SUBFEATURE_CURR_MAX = 1282, SENSORS_SUBFEATURE_CURR_LCRIT = 1283, SENSORS_SUBFEATURE_CURR_CRIT = 1284, SENSORS_SUBFEATURE_CURR_AVERAGE = 1285, SENSORS_SUBFEATURE_CURR_LOWEST = 1286, SENSORS_SUBFEATURE_CURR_HIGHEST = 1287, SENSORS_SUBFEATURE_CURR_ALARM = 1408, SENSORS_SUBFEATURE_CURR_MIN_ALARM = 1409, SENSORS_SUBFEATURE_CURR_MAX_ALARM = 1410, SENSORS_SUBFEATURE_CURR_BEEP = 1411, SENSORS_SUBFEATURE_CURR_LCRIT_ALARM = 1412, SENSORS_SUBFEATURE_CURR_CRIT_ALARM = 1413, SENSORS_SUBFEATURE_HUMIDITY_INPUT = 1536, SENSORS_SUBFEATURE_VID = 4096, SENSORS_SUBFEATURE_INTRUSION_ALARM = 4352, SENSORS_SUBFEATURE_INTRUSION_BEEP = 4353, SENSORS_SUBFEATURE_BEEP_ENABLE = 6144, SENSORS_SUBFEATURE_UNKNOWN = 2147483647, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sensors_feature { pub name: *mut ::std::os::raw::c_char, pub number: ::std::os::raw::c_int, pub type_: sensors_feature_type, pub first_subfeature: ::std::os::raw::c_int, pub padding1: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_sensors_feature() { assert_eq!( ::std::mem::size_of::(), 24usize, concat!("Size of: ", stringify!(sensors_feature)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(sensors_feature)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(sensors_feature), "::", stringify!(name) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).number as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(sensors_feature), "::", stringify!(number) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, 12usize, concat!( "Offset of field: ", stringify!(sensors_feature), "::", stringify!(type_) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).first_subfeature as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(sensors_feature), "::", stringify!(first_subfeature) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).padding1 as *const _ as usize }, 20usize, concat!( "Offset of field: ", stringify!(sensors_feature), "::", stringify!(padding1) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sensors_subfeature { pub name: *mut ::std::os::raw::c_char, pub number: ::std::os::raw::c_int, pub type_: sensors_subfeature_type, pub mapping: ::std::os::raw::c_int, pub flags: ::std::os::raw::c_uint, } #[test] fn bindgen_test_layout_sensors_subfeature() { assert_eq!( ::std::mem::size_of::(), 24usize, concat!("Size of: ", stringify!(sensors_subfeature)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(sensors_subfeature)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(sensors_subfeature), "::", stringify!(name) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).number as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(sensors_subfeature), "::", stringify!(number) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, 12usize, concat!( "Offset of field: ", stringify!(sensors_subfeature), "::", stringify!(type_) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).mapping as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(sensors_subfeature), "::", stringify!(mapping) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, 20usize, concat!( "Offset of field: ", stringify!(sensors_subfeature), "::", stringify!(flags) ) ); } extern "C" { pub fn sensors_get_features( name: *const sensors_chip_name, nr: *mut ::std::os::raw::c_int, ) -> *const sensors_feature; } extern "C" { pub fn sensors_get_all_subfeatures( name: *const sensors_chip_name, feature: *const sensors_feature, nr: *mut ::std::os::raw::c_int, ) -> *const sensors_subfeature; } extern "C" { pub fn sensors_get_subfeature( name: *const sensors_chip_name, feature: *const sensors_feature, type_: sensors_subfeature_type, ) -> *const sensors_subfeature; }