let cast_to_c_proto_dispatch (klass, ret, args, uid, _) =
    let types = List.map (fun t -> "struct " ^ t ^ "*") (klass::args) in
    let proto rtype = Format.sprintf "struct %s*%s(%s);" rtype uid (String.concat ", " types) in
    match ret with
        | None -> proto "void"
        | Some(t) -> proto t