/// Get list of all home names in hub
///
/// # Safety
///
/// handle gets from smart_home_new()
///
/// # Warning
///
/// This function returns borrowed pointer, use copy name before next call
///
/// * `handle`: smart hub handle
Get list of all home names in hub
Get list of all home names in hub
pub unsafe extern "C" fn smart_home_get_home_next(iter: *mut HandleIter) -> *const c_char {
    let iter = &mut *iter;
    let handle = &mut *iter.handle;
    let home = match handle.controller.iter().nth(iter.cursor) {
        Some(home) => home,
        None => return std::ptr::null(),
    };
    iter.cursor += 1;
    handle.home_name_buffer = Some(CString::new(home.name()).unwrap());
    handle.home_name_buffer.as_ref().unwrap().as_ptr()
}
pub unsafe extern " " fn smart_home_get_home_next ( iter : * mut HandleIter ) -> * const c_char { let iter = & mut * iter ; let handle = & mut * iter . handle ; let home = match handle . controller . iter ( ) . nth ( iter . cursor ) { Some ( home ) => home , None => return std :: ptr :: null ( ) , } ; iter . cursor += 1 ; handle . home_name_buffer = Some ( CString :: new ( home . name ( ) ) . unwrap ( ) ) ; handle . home_name_buffer . as_ref ( ) . unwrap ( ) . as_ptr ( ) }
Get list of all home names in hub
Get list of all home names in hub
iter
*mut HandleIter
safety
handle gets from smart_home_new()
handle gets from smart_home_new ()
warning
This function returns borrowed pointer, use copy name before next call

`handle`: smart hub handle
This function returns borrowed pointer use copy name before next call ` handle ` : smart hub handle