Skip to content

Associate CStr for extensions with their function pointer counterparts #215

Description

@MalekiRe

Right now there's no programmatic way to get the CStr from the extensions function pointer counterpart, one method we could do is the following.

trait FunctionPtr {
       Signature: Type;
       const Name: &'static CStr;
}
struct EnumerateColorSpacesFB;
impl FunctionPtr for EnumerateColorSpacesFB {
    Signature = unsafe extern "system" fn(
        session: Session,
        color_space_capacity_input: u32,
        color_space_count_output: *mut u32,
        color_spaces: *mut ColorSpaceFB,
    ) -> Result;
   Name: &'static CStr = c"xrEnumerateColorSpacesFB"
}

We could switch over the auto-generated functions to generate this. For backwards compatibility reasons maybe we would want to leave the old function type signatures in generated and then add a new section with these traits?

Is this something you would be willing to accept a PR for?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions