Skip to content

Commit

Permalink
build cir library on macos (not binaries yet)
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Young <[email protected]>
  • Loading branch information
seanyoung committed Mar 24, 2024
1 parent b4f751e commit 8ec8e8f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
pub mod keymap;
#[cfg(target_os = "linux")]
pub mod lirc;
pub mod lircd_conf;
pub mod rc_maps;
#[cfg(target_os = "linux")]
pub mod rcdev;
8 changes: 0 additions & 8 deletions src/rc_maps.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Parse /etc/rc_maps.cfg for Linux. This file configures the default keymap
//! to load on Linux.
use crate::rcdev::Rcdev;
use std::fs::File;
use std::io::{BufRead, BufReader, Error, ErrorKind};
use std::path::Path;
Expand Down Expand Up @@ -59,13 +58,6 @@ pub fn parse_rc_maps_file(path: &Path) -> Result<Vec<KeymapTable>, Error> {
Ok(res)
}

impl KeymapTable {
pub fn matches(&self, rcdev: &Rcdev) -> bool {
(self.driver == "*" || self.driver == rcdev.driver)
&& (self.table == "*" || self.table == rcdev.default_keymap)
}
}

#[test]
fn parse_bad() {
use std::path::PathBuf;
Expand Down
8 changes: 8 additions & 0 deletions src/rcdev.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Get a list of remote controller devices from sysfs on linux. A remote
//! controller is either an infrared receiver/transmitter or a cec interface.
use crate::rc_maps::KeymapTable;
use std::path::Path;
use std::{fs, io};

Expand Down Expand Up @@ -127,3 +128,10 @@ fn read_uevent(path: &Path) -> io::Result<UEvent> {
dev_name,
})
}

impl KeymapTable {
pub fn matches(&self, rcdev: &Rcdev) -> bool {
(self.driver == "*" || self.driver == rcdev.driver)
&& (self.table == "*" || self.table == rcdev.default_keymap)
}
}

0 comments on commit 8ec8e8f

Please sign in to comment.