def writeTypeUtil(api, filename):
    QUERY_RESULT_TYPES = set(['VkPhysicalDeviceFeatures', 'VkPhysicalDeviceLimits', 'VkFormatProperties', 'VkImageFormatProperties', 'VkPhysicalDeviceSparseProperties', 'VkQueueFamilyProperties', 'VkMemoryType', 'VkMemoryHeap'])
    COMPOSITE_TYPES = set([t.name for t in api.compositeTypes if (not t.isAlias)])

    def isSimpleStruct(type):

        def hasArrayMember(type):
            for member in type.members:
                if (member.arraySize != ''):
                    return True
            return False

        def hasCompositeMember(type):
            for member in type.members:
                if (member.getType() in COMPOSITE_TYPES):
                    return True
            return False
        return ((type.typeClass == CompositeType.CLASS_STRUCT) and (type.members[0].getType() != 'VkStructureType') and (not (type.name in QUERY_RESULT_TYPES)) and (not hasArrayMember(type)) and (not hasCompositeMember(type)))

    def gen():
        for type in api.compositeTypes:
            if ((not isSimpleStruct(type)) or type.isAlias):
                continue
            (yield '')
            (yield ('inline %s make%s (%s)' % (type.name, type.name[2:], argListToStr(type.members))))
            (yield '{')
            (yield ('\t%s res;' % type.name))
            for line in indentLines([('\tres.%s\t= %s;' % (m.name, m.name)) for m in type.members]):
                (yield line)
            (yield '\treturn res;')
            (yield '}')
    writeInlFile(filename, INL_HEADER, gen())
def writeTypeUtil(api, filename):
    QUERY_RESULT_TYPES = set(['VkPhysicalDeviceFeatures', 'VkPhysicalDeviceLimits', 'VkFormatProperties', 'VkImageFormatProperties', 'VkPhysicalDeviceSparseProperties', 'VkQueueFamilyProperties', 'VkMemoryType', 'VkMemoryHeap'])
    COMPOSITE_TYPES = set([t.name for t in api.compositeTypes if (not t.isAlias)])

    def isSimpleStruct(type):

        def hasArrayMember(type):
            for member in type.members:
                if (member.arraySize != ):
                    return True
            return False

        def hasCompositeMember(type):
            for member in type.members:
                if (member.getType() in COMPOSITE_TYPES):
                    return True
            return False
        return ((type.typeClass == CompositeType.CLASS_STRUCT) and (type.members[0].getType() != 'VkStructureType') and (not (type.name in QUERY_RESULT_TYPES)) and (not hasArrayMember(type)) and (not hasCompositeMember(type)))

    def gen():
        for type in api.compositeTypes:
            if ((not isSimpleStruct(type)) or type.isAlias):
                continue
            (yield )
            (yield ('inline %s make%s (%s)' % (type.name, type.name[2:], argListToStr(type.members))))
            (yield '{')
            (yield ('\t%s res;' % type.name))
            for line in indentLines([('\tres.%s\t= %s;' % (m.name, m.name)) for m in type.members]):
                (yield line)
            (yield '\treturn res;')
            (yield '}')
    writeInlFile(filename, INL_HEADER, gen())