You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: flags_bsd.rs
    path of file: ./repos/eza/src/output/render
    
    the code of the file until where you have to start completion: use ansiterm::Style;
use std::ffi::CStr;

#[cfg(target_os = "netbsd")]
use std::ffi::CString;

use crate::fs::fields as f;
use crate::output::cell::TextCell;
use crate::output::table::FlagsFormat;

#[cfg(not(target_os = "netbsd"))]
extern "C" {
    fn fflagstostr(flags: libc::c_ulong) -> *const libc::c_char;
}

#[cfg(target_os
    
fn wrapper_flags_to_string(flags: f::flag_t) -> String {
    #[cfg(target_os = "netbsd")]
    let empty_string = CString::new("").expect("This string is always valid");

    // SAFETY: Calling external "C" function
    #[cfg(not(target_os = "netbsd"))]
    let flags_c_str = unsafe { fflagstostr(libc::c_ulong::from(flags)) };

    // SAFETY: Calling external "C" function
    #[cfg(target_os = "netbsd")]
    let flags_c_str = unsafe { flags_to_string(libc::c_ulong::from(flags), empty_string.as_ptr()) };

    if flags_c_str.is_null() {
        "-".to_string()
    } else {
        let flags_str = unsafe { CStr::from_ptr(flags_c_str) };
        let flags = flags_str
            .to_str()
            .map_or("-", |s| if s.is_empty() { "-" } else { s })
            .to_string();

        // SAFETY: Calling external "C" function to free memory allocated by fflagstostr
        unsafe {
            libc::free(flags_c_str.cast_mut().cast());
        }

        flags
    }
}