pub unsafe extern "C" fn smart_home_add_room(handle: *mut Home, name: *const c_char) -> *mut Room {
    let home = &mut *handle;
    let room_name = CStr::from_ptr(name).to_str().unwrap();

    match home.add_room(Room::new(room_name)) {
        Ok(room) => room as *mut Room,
        Err(_) => std::ptr::null_mut(),
    }
}
/// Adds a new room to home
///
/// # Safety
///
/// Home gets from smart_home_get_home()
///
/// * `handle`: home handle
/// * `name`: room name to add
Adds a new room to home
Adds a new room to home
pub unsafe extern "C" fn smart_home_add_room(handle: *mut Home, name: *const c_char) -> *mut Room {
    let home = &mut *handle;
    let room_name = CStr::from_ptr(name).to_str().unwrap();
    match home.add_room(Room::new(room_name)) {
        Ok(room) => room as *mut Room,
        Err(_) => std::ptr::null_mut(),
    }
}
pub unsafe extern " " fn smart_home_add_room ( handle : * mut Home , name : * const c_char ) -> * mut Room { let home = & mut * handle ; let room_name = CStr :: from_ptr ( name ) . to_str ( ) . unwrap ( ) ; match home . add_room ( Room :: new ( room_name ) ) { Ok ( room ) => room as * mut Room , Err ( _ ) => std :: ptr :: null_mut ( ) , } }
Adds a new room to home
Adds a new room to home
handle
*mut Home
name
*const c_char
handle
*mut Home
name
*const c_char
safety
Home gets from smart_home_get_home()

`handle`: home handle
`name`: room name to add
Home gets from smart_home_get_home () ` handle ` : home handle ` name ` : room name to add