diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 0000000..27aa80b --- /dev/null +++ b/src/config.rs @@ -0,0 +1,15 @@ +//! Configuration file API +//! +//! For now, just contains two functions regarding the global configuration +//! stored as a cache inside alsa-lib. Calling `update_free_global` might help +//! against valgrind reporting memory leaks. +use crate::{alsa}; +use super::error::*; + +pub fn update() -> Result<()> { + acheck!(snd_config_update()).map(|_| ()) +} + +pub fn update_free_global() -> Result<()> { + acheck!(snd_config_update_free_global()).map(|_| ()) +} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 7bcfcdc..cd45b3a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -110,6 +110,8 @@ pub use crate::hctl::HCtl as HCtl; pub mod pcm; pub use crate::pcm::PCM as PCM; +pub mod config; + pub mod rawmidi; pub use crate::rawmidi::Rawmidi as Rawmidi; diff --git a/src/pcm.rs b/src/pcm.rs index 6c600b9..b3ced88 100644 --- a/src/pcm.rs +++ b/src/pcm.rs @@ -239,9 +239,9 @@ impl PCM { self.verify_format(S::FORMAT).map(|_| IO::new(self)) } - /// Creates IO without checking [`S`] is valid type. + /// Creates IO without checking `S` is valid type. /// - /// SAFETY: Caller must guarantee [`S`] is valid type for this PCM stream + /// SAFETY: Caller must guarantee `S` is valid type for this PCM stream /// and that no other IO objects exist at the same time for the same stream /// (or in some other way guarantee mmap safety) pub unsafe fn io_unchecked(&self) -> IO {