def writeSupportedExtenions(api, filename):

    def writeExtensionsForVersions(map):
        result = []
        for version in map:
            result.append((('\tif (coreVersion >= ' + str(version)) + ')'))
            result.append('\t{')
            for extension in map[version]:
                result.append((('\t\tdst.push_back("' + extension.name) + '");'))
            result.append('\t}')
        return result
    instanceMap = {}
    deviceMap = {}
    versionSet = set()
    for ext in api.extensions:
        if (ext.versionInCore != None):
            if (ext.versionInCore[0] == 'INSTANCE'):
                list = instanceMap.get(Version(ext.versionInCore[1:]))
                instanceMap[Version(ext.versionInCore[1:])] = ((list + [ext]) if list else [ext])
            else:
                list = deviceMap.get(Version(ext.versionInCore[1:]))
                deviceMap[Version(ext.versionInCore[1:])] = ((list + [ext]) if list else [ext])
            versionSet.add(Version(ext.versionInCore[1:]))
    lines = ((((((addVersionDefines(versionSet) + ['', ('void getCoreDeviceExtensionsImpl (deUint32 coreVersion, ::std::vector<const char*>&%s)' % (' dst' if (len(deviceMap) != 0) else '')), '{']) + writeExtensionsForVersions(deviceMap)) + ['}', '', ('void getCoreInstanceExtensionsImpl (deUint32 coreVersion, ::std::vector<const char*>&%s)' % (' dst' if (len(instanceMap) != 0) else '')), '{']) + writeExtensionsForVersions(instanceMap)) + ['}', '']) + removeVersionDefines(versionSet))
    writeInlFile(filename, INL_HEADER, lines)
def writeSupportedExtenions(api, filename):

    def writeExtensionsForVersions(map):
        result = []
        for version in map:
            result.append((('\tif (coreVersion >= ' + str(version)) + ')'))
            result.append('\t{')
            for extension in map[version]:
                result.append((('\t\tdst.push_back("' + extension.name) + '");'))
            result.append('\t}')
        return result
    instanceMap = {}
    deviceMap = {}
    versionSet = set()
    for ext in api.extensions:
        if (ext.versionInCore != None):
            if (ext.versionInCore[0] == 'INSTANCE'):
                list = instanceMap.get(Version(ext.versionInCore[1:]))
                instanceMap[Version(ext.versionInCore[1:])] = ((list + [ext]) if list else [ext])
            else:
                list = deviceMap.get(Version(ext.versionInCore[1:]))
                deviceMap[Version(ext.versionInCore[1:])] = ((list + [ext]) if list else [ext])
            versionSet.add(Version(ext.versionInCore[1:]))
    lines = ((((((addVersionDefines(versionSet) + [, ('void getCoreDeviceExtensionsImpl (deUint32 coreVersion, ::std::vector<const char*>&%s)' % (' dst' if (len(deviceMap) != 0) else )), '{']) + writeExtensionsForVersions(deviceMap)) + ['}', , ('void getCoreInstanceExtensionsImpl (deUint32 coreVersion, ::std::vector<const char*>&%s)' % (' dst' if (len(instanceMap) != 0) else )), '{']) + writeExtensionsForVersions(instanceMap)) + ['}', ]) + removeVersionDefines(versionSet))
    writeInlFile(filename, INL_HEADER, lines)