forked from mirror/vulkan-zig
Funcpointer parsing
This commit is contained in:
@@ -70,6 +70,8 @@ fn parseTypes(allocator: *Allocator, out: []registry.Declaration, types_elem: *x
|
||||
break :blk try parseContainer(allocator, ty, false);
|
||||
} else if (mem.eql(u8, category, "union")) {
|
||||
break :blk try parseContainer(allocator, ty, true);
|
||||
} else if (mem.eql(u8, category, "funcpointer")) {
|
||||
break :blk try parseFuncPointer(allocator, ty);
|
||||
}
|
||||
|
||||
continue;
|
||||
@@ -184,6 +186,11 @@ fn parseContainer(allocator: *Allocator, ty: *xml.Element, is_union: bool) !regi
|
||||
};
|
||||
}
|
||||
|
||||
fn parseFuncPointer(allocator: *Allocator, ty: *xml.Element) !registry.Declaration {
|
||||
var xctok = xmlc.XmlCTokenizer.init(ty);
|
||||
return try xmlc.parseTypedef(allocator, &xctok);
|
||||
}
|
||||
|
||||
fn lenToPointerSize(len: []const u8) registry.Pointer.PointerSize {
|
||||
if (mem.eql(u8, len, "null-terminated")) {
|
||||
return .zero_terminated;
|
||||
|
||||
Reference in New Issue
Block a user