side-huddle 0.1.2

Detect meetings locally and capture audio as WAV
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
    use libc::{c_char, c_uint, c_int};

    extern "C" {
        fn proc_name(pid: c_int, buffer: *mut c_char, buffersize: c_uint) -> c_int;
    }

    pub(crate) fn proc_name_for_pid(pid: u32) -> String {
        let mut buf = vec![0u8; 1024];
        let sz = unsafe { proc_name(pid as c_int, buf.as_mut_ptr() as *mut c_char, buf.len() as c_uint) };
        if sz <= 0 { return String::new(); }
        String::from_utf8_lossy(&buf[..sz as usize]).trim_end_matches('\0').to_string()
    }