mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-20 03:25:47 +00:00
rust: add input module with 1 static function
This commit is contained in:
parent
446d2179d6
commit
cfb2bf0824
27
rust/src/input.rs
Normal file
27
rust/src/input.rs
Normal file
@ -0,0 +1,27 @@
|
||||
// functions already exported by bindgen : 0
|
||||
// -----------------------------------------
|
||||
//
|
||||
// static inline functions total: 1
|
||||
// ------------------------------------------ (done / remaining)
|
||||
// (+) done: 1 / 0
|
||||
// (#) test: 0 / 1
|
||||
// ------------------------------------------
|
||||
//+ ncinput_equal_p
|
||||
|
||||
use crate as nc;
|
||||
use nc::types::Input;
|
||||
|
||||
/// Compare two ncinput structs for data equality by doing a field-by-field
|
||||
/// comparison for equality (excepting seqnum).
|
||||
///
|
||||
/// Returns true if the two are data-equivalent.
|
||||
pub fn ncinput_equal_p(input1: Input, input2: Input) -> bool {
|
||||
if n1.id != n2.id {
|
||||
return false;
|
||||
}
|
||||
if n1.y != n2.y || n1.x != n2.x {
|
||||
return false;
|
||||
}
|
||||
// do not check seqnum
|
||||
true
|
||||
}
|
Loading…
Reference in New Issue
Block a user