def METHOD_NAME(root, name):
    global inst_commands, dev_commands, processed_commands
    inst = ""
    dev = ""
    for req in root.findall('require'):
        for cmd in req.findall('command'):
            function = cmd.attrib['name']
            if function in processed_commands:
                continue
            processed_commands.append(function)
            if function not in commands:
                raise ValueError('command {} referenced by {} is unknown'.format(function, name))
            table = commands[function]
            if table == INSTANCE_CMD:
                inst += '\n  PFN_{} {};'.format(function, function[2:])
            elif table == DEVICE_CMD:
                dev += '\n  PFN_{} {};'.format(function, function[2:])
            else:
                raise ValueError('command {} has unknown table type {}'.format(function, table))
    if 'platform' in root.attrib:
        if inst != "":
            inst = '\n#ifdef {plat}{inst}\n#endif // {plat}'.format(plat = platform_defines[root.attrib['platform']], inst = inst)
        if dev != "":
            dev = '\n#ifdef {plat}{dev}\n#endif // {plat}'.format(plat = platform_defines[root.attrib['platform']], dev = dev)
    if inst != "":
        inst_commands += "  // {name}{inst}\n\n".format(**locals())
    if dev != "":
        dev_commands += "  // {name}{dev}\n\n".format(**locals())