fn to_voodoo_type(orig_type: &str) -> String {
    match orig_type {
        "float" => "f32".to_string(),
        "int32_t" => "i32".to_string(),
        "uint32_t" => "u32".to_string(),
        "char" => "i8".to_string(),
        "uint8_t" => "u8".to_string(),
        "void" => "c_void".to_string(),
        "size_t" => "usize".to_string(),
        "uint64_t" => "u64".to_string(),
        "int" => "i32".to_string(),
        "VkFlags" => "u32".to_string(),
        "VkBool32" => "bool".to_string(),
        "VkDeviceSize" => "u64".to_string(),
        "VkSampleMask" => "u32".to_string(),
        "VkResult" => "CallResult".to_string(),
        // "VkSurfaceKHR" => "Surface".to_string(),
        // "VkSwapchainKHR" => "Swapchain".to_string(),
        // "VkDisplayKHR" => "Display".to_string(),
        // "VkDisplayModeKHR" => "DisplayMode".to_string(),
        "VkDescriptorUpdateTemplateKHR" => "DescriptorUpdateTemplate".to_string(),
        // "Window" => "u64".to_string(),
        other @ _ => {
            if other.len() > 2 && other.split_at(2).0 == "Vk" {
                let mut out_str = replace_suffix(other.split_at(2).1);
                if out_str.contains("IOSSurface") { out_str = out_str.replace("IOSSurface", "IosSurface"); }
                if out_str.contains("OSSurface") { out_str = out_str.replace("OSSurface", "OsSurface"); }
                if out_str.contains("FlagBits") { out_str = out_str.replace("FlagBits", "Flags"); }
                // if out_str.contains("Flags") { out_str = out_str.replace("Flags", ""); }
                out_str
            } else if other.len() > 4 && other.split_at(4).0 == "PFN_" {
                String::from(other)
            } else if !other.contains("ANativeWindow") &&
                    !other.contains("MirConnection") &&
                    !other.contains("MirSurface") &&
                    !other.contains("wl_display") &&
                    !other.contains("wl_surface") &&
                    !other.contains("HINSTANCE") &&
                    !other.contains("HWND") &&
                    !other.contains("Display") &&
                    !other.contains("Window") &&
                    !other.contains("xcb_connection_t") &&
                    !other.contains("xcb_window_t") &&
                    !other.contains("HANDLE") &&
                    !other.contains("SECURITY_ATTRIBUTES") &&
                    !other.contains("DWORD") &&
                    !other.contains("LPCWSTR") {
                panic!("unknown type: \"{}\"", other);
            } else {
                String::from(other)
            }
        }
    }
}
/// Converts C/Vulkan names into Rust/Voodoo conventions.
Converts C/Vulkan names into Rust/Voodoo conventions.
Converts C / Vulkan names into Rust / Voodoo conventions .
fn to_voodoo_type(orig_type: &str) -> String {
    match orig_type {
        "float" => "f32".to_string(),
        "int32_t" => "i32".to_string(),
        "uint32_t" => "u32".to_string(),
        "char" => "i8".to_string(),
        "uint8_t" => "u8".to_string(),
        "void" => "c_void".to_string(),
        "size_t" => "usize".to_string(),
        "uint64_t" => "u64".to_string(),
        "int" => "i32".to_string(),
        "VkFlags" => "u32".to_string(),
        "VkBool32" => "bool".to_string(),
        "VkDeviceSize" => "u64".to_string(),
        "VkSampleMask" => "u32".to_string(),
        "VkResult" => "CallResult".to_string(),
        // "VkSurfaceKHR" => "Surface".to_string(),
        // "VkSwapchainKHR" => "Swapchain".to_string(),
        // "VkDisplayKHR" => "Display".to_string(),
        // "VkDisplayModeKHR" => "DisplayMode".to_string(),
        "VkDescriptorUpdateTemplateKHR" => "DescriptorUpdateTemplate".to_string(),
        // "Window" => "u64".to_string(),
        other @ _ => {
            if other.len() > 2 && other.split_at(2).0 == "Vk" {
                let mut out_str = replace_suffix(other.split_at(2).1);
                if out_str.contains("IOSSurface") { out_str = out_str.replace("IOSSurface", "IosSurface"); }
                if out_str.contains("OSSurface") { out_str = out_str.replace("OSSurface", "OsSurface"); }
                if out_str.contains("FlagBits") { out_str = out_str.replace("FlagBits", "Flags"); }
                // if out_str.contains("Flags") { out_str = out_str.replace("Flags", ""); }
                out_str
            } else if other.len() > 4 && other.split_at(4).0 == "PFN_" {
                String::from(other)
            } else if !other.contains("ANativeWindow") &&
                    !other.contains("MirConnection") &&
                    !other.contains("MirSurface") &&
                    !other.contains("wl_display") &&
                    !other.contains("wl_surface") &&
                    !other.contains("HINSTANCE") &&
                    !other.contains("HWND") &&
                    !other.contains("Display") &&
                    !other.contains("Window") &&
                    !other.contains("xcb_connection_t") &&
                    !other.contains("xcb_window_t") &&
                    !other.contains("HANDLE") &&
                    !other.contains("SECURITY_ATTRIBUTES") &&
                    !other.contains("DWORD") &&
                    !other.contains("LPCWSTR") {
                panic!("unknown type: \"{}\"", other);
            } else {
                String::from(other)
            }
        }
    }
}
fn to_voodoo_type ( orig_type : & str ) -> String { match orig_type { " " => " " . to_string ( ) , " " => " " . to_string ( ) , " " => " " . to_string ( ) , " " => " " . to_string ( ) , " " => " " . to_string ( ) , " " => " " . to_string ( ) , " " => " " . to_string ( ) , " " => " " . to_string ( ) , " " => " " . to_string ( ) , " " => " " . to_string ( ) , " " => " " . to_string ( ) , " " => " " . to_string ( ) , " " => " " . to_string ( ) , " " => " " . to_string ( ) , // "VkSurfaceKHR" => "Surface".to_string(), // "VkSwapchainKHR" => "Swapchain".to_string(), // "VkDisplayKHR" => "Display".to_string(), // "VkDisplayModeKHR" => "DisplayMode".to_string(), " " => " " . to_string ( ) , // "Window" => "u64".to_string(), other @ _ => { if other . len ( ) > 2 && other . split_at ( 2 ) . 0 == " " { let mut out_str = replace_suffix ( other . split_at ( 2 ) . 1 ) ; if out_str . contains ( " " ) { out_str = out_str . replace ( " " , " " ) ; } if out_str . contains ( " " ) { out_str = out_str . replace ( " " , " " ) ; } if out_str . contains ( " " ) { out_str = out_str . replace ( " " , " " ) ; } // if out_str.contains("Flags") { out_str = out_str.replace("Flags", ""); } out_str } else if other . len ( ) > 4 && other . split_at ( 4 ) . 0 == " " { String :: from ( other ) } else if ! other . contains ( " " ) && ! other . contains ( " " ) && ! other . contains ( " " ) && ! other . contains ( " " ) && ! other . contains ( " " ) && ! other . contains ( " " ) && ! other . contains ( " " ) && ! other . contains ( " " ) && ! other . contains ( " " ) && ! other . contains ( " " ) && ! other . contains ( " " ) && ! other . contains ( " " ) && ! other . contains ( " " ) && ! other . contains ( " " ) && ! other . contains ( " " ) { panic ! ( " \" \" " other ) ; } else { String :: from ( other ) } } } }
Converts C/Vulkan names into Rust/Voodoo conventions.
Converts C / Vulkan names into Rust / Voodoo conventions .
orig_type
&str
orig_type
&str