Skip to main content

module_loop

Function module_loop 

Source
pub extern "C" fn module_loop() -> c_int
Expand description

Called after init confirmed

This should invoke module_process to process SSIP commands from stdin.

Your module implementation must export it’s own version of this function, unless your build system builds and links with its own version of module-utils.c from the speech-dispatcher distribution.

#[unsafe(no_mangle)]
unsafe extern "C" fn module_loop() -> raw::c_int {
    // Minimal implementation
    if modapi::module_process(io::stdin().as_fd(), 1) != 0 {
        eprintln!("Standard input is end-of-stream");
    }

    0
}