#!/usr/bin/perl

# Copyright (c) 2012 Apple Inc.  All Rights Reserved.
#
# This file contains Original Code and/or Modifications of Original Code
# as defined in and that are subject to the Apple Public Source License
# Version 2.0 (the 'License'). You may not use this file except in
# compliance with the License. Please obtain a copy of the License at
# http://www.opensource.apple.com/apsl/ and read it before using this
# file.
# 
# The Original Code and all software distributed under the License are
# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
# Please see the License for the specific language governing rights and
# limitations under the License.
#
# unFlatCarbon - Replace #include of FlatCarbon headers with the corresponding
#                framework header.

use strict;

my %FlatCarbon = (
    'ADSP.h' => '#warning ADSP.h is not available on Mac OS X',
    'AEDataModel.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'AEHelpers.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'AEInteraction.h' => '#include <Carbon/Carbon.h>',
    'AEMach.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'AEObjects.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'AEPackObject.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'AERegistry.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'AEUserTermTypes.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'AIFF.h' => '#include <CoreServices/CoreServices.h>',
    'ASDebugging.h' => '#include <Carbon/Carbon.h>',
    'ASRegistry.h' => '#include <Carbon/Carbon.h>',
    'ATA.h' => '#warning ATA.h is not available on Mac OS X',
    'ATSFont.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'ATSLayoutTypes.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'ATSTypes.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'ATSUnicode.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'AVComponents.h' => '#warning AVComponents.h is not available on Mac OS X',
    'AVComponents.k.h' => '#include <CoreServices/AVComponents.k.h>',
    'AVLTree.h' => '#include <CoreServices/CoreServices.h>',
    'Aliases.h' => '#include <CoreServices/CoreServices.h>',
    'Appearance.h' => '#include <Carbon/Carbon.h>',
    'AppleDiskPartitions.h' => '#include <CoreServices/CoreServices.h>',
    'AppleEvents.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'AppleGuide.h' => '#warning AppleGuide.h is not available on Mac OS X',
    'AppleHelp.h' => '#include <Carbon/Carbon.h>',
    'AppleScript.h' => '#include <Carbon/Carbon.h>',
    'AppleTalk.h' => '#warning AppleTalk.h is not available on Mac OS X',
    'ApplicationServices.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'Balloons.h' => '#include <Carbon/Carbon.h>',
    'CFArray.h' => '#include <CoreServices/CoreServices.h>',
    'CFBag.h' => '#include <CoreServices/CoreServices.h>',
    'CFBase.h' => '#include <CoreServices/CoreServices.h>',
    'CFBundle.h' => '#include <CoreServices/CoreServices.h>',
    'CFCharacterSet.h' => '#include <CoreServices/CoreServices.h>',
    'CFData.h' => '#include <CoreServices/CoreServices.h>',
    'CFDate.h' => '#include <CoreServices/CoreServices.h>',
    'CFDictionary.h' => '#include <CoreServices/CoreServices.h>',
    'CFNumber.h' => '#include <CoreServices/CoreServices.h>',
    'CFPlugIn.h' => '#include <CoreServices/CoreServices.h>',
    'CFPlugInCOM.h' => '#include <CoreServices/CoreServices.h>',
    'CFPreferences.h' => '#include <CoreServices/CoreServices.h>',
    'CFPropertyList.h' => '#include <CoreServices/CoreServices.h>',
    'CFSet.h' => '#include <CoreServices/CoreServices.h>',
    'CFString.h' => '#include <CoreServices/CoreServices.h>',
    'CFStringEncodingExt.h' => '#include <CoreServices/CoreServices.h>',
    'CFTimeZone.h' => '#include <CoreServices/CoreServices.h>',
    'CFTree.h' => '#include <CoreServices/CoreServices.h>',
    'CFURL.h' => '#include <CoreServices/CoreServices.h>',
    'CFURLAccess.h' => '#include <CoreServices/CoreServices.h>',
    'CFUUID.h' => '#include <CoreServices/CoreServices.h>',
    'CFXMLNode.h' => '#include <CoreServices/CoreServices.h>',
    'CFXMLParser.h' => '#include <CoreServices/CoreServices.h>',
    'CGAffineTransform.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGBase.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGBitmapContext.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGColorSpace.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGContext.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGDataConsumer.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGDataProvider.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGDirectDisplay.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGDirectPalette.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGError.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGFont.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGGeometry.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGImage.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGPDFContext.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGPDFDocument.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGPattern.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGRemoteOperation.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CGWindowLevel.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CMAcceleration.h' => '#warning CMAcceleration.h is not available on Mac OS X',
    'CMApplication.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CMCalibrator.h' => '#include <Carbon/Carbon.h>',
    'CMComponent.h' => '#warning CMComponent.h is not available on Mac OS X',
    'CMConversions.h' => '#warning CMConversions.h is not available on Mac OS X',
    'CMDeviceIntegration.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CMICCProfile.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CMMComponent.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CMPRComponent.h' => '#warning CMPRComponent.h is not available on Mac OS X',
    'CMScriptingPlugin.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CMTypes.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'CRMSerialDevices.h' => '#warning Comm Toolbox is not available on Mac OS X',
    'CTBUtilities.h' => '#warning Comm Toolbox is not available on Mac OS X',
    'Carbon.h' => '#include <Carbon/Carbon.h>',
    'CarbonEvents.h' => '#include <Carbon/Carbon.h>',
    'CardServices.h' => '#warning CardServices.h is not available on Mac OS X',
    'CodeFragments.h' => '#include <CoreServices/CoreServices.h>',
    'Collections.h' => '#include <CoreServices/CoreServices.h>',
    'ColorPicker.h' => '#include <Carbon/Carbon.h>',
    'ColorPickerComponents.h' => '#warning ColorPickerComponents.h is not available on Mac OS X',
    'CommResources.h' => '#warning CommResources.h is not available on Mac OS X',
    'Components.h' => '#include <CoreServices/CoreServices.h>',
    'Components.k.h' => '#include <CoreServices/Components.k.h>',
    'ConditionalMacros.h' => '#include <CoreServices/CoreServices.h>',
    'ConnectionTools.h' => '#warning Comm Toolbox is not available on Mac OS X',
    'Connections.h' => '#warning Comm Toolbox is not available on Mac OS X',
    'ControlDefinitions.h' => '#include <Carbon/Carbon.h>',
    'ControlStrip.h' => '#warning ControlStrip.h is not available on Mac OS X',
    'Controls.h' => '#include <Carbon/Carbon.h>',
    'CoreServices.h' => '#include <CoreServices/CoreServices.h>',
    'CryptoMessageSyntax.h' => '#warning CryptoMessageSyntax.h is not available on Mac OS X',
    'CursorDevices.h' => '#warning CursorDevices.h is not available on Mac OS X',
    'DatabaseAccess.h' => '#warning DatabaseAccess.h is not available on Mac OS X',
    'DateTimeUtils.h' => '#include <CoreServices/CoreServices.h>',
    'Debugging.h' => '#include <CoreServices/CoreServices.h>',
    'DeskBus.h' => '#warning DeskBus.h is not available on Mac OS X',
    'DesktopPrinting.h' => '#warning DesktopPrinting.h is not available on Mac OS X',
    'DeviceControl.h' => '#include <DVComponentGlue/DeviceControl.h>',
    'DeviceControl.k.h' => '#warning DeviceControl.k.h is not available on Mac OS X',
    'Devices.h' => '#include <CoreServices/CoreServices.h>',
    'Dialogs.h' => '#include <Carbon/Carbon.h>',
    'Dictionary.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'DiskInit.h' => '#warning DiskInit.h is not available on Mac OS X',
    'Disks.h' => '#warning Disks.h is not available on Mac OS X',
    'Displays.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'Drag.h' => '#include <Carbon/Carbon.h>',
    'DrawSprocket.h' => '#include <DrawSprocket/DrawSprocket.h>',
    'DriverFamilyMatching.h' => '#warning DriverFamilyMatching.h is not available on Mac OS X',
    'DriverGestalt.h' => '#warning DriverGestalt.h is not available on Mac OS X',
    'DriverServices.h' => '#include <CoreServices/CoreServices.h>',
    'DriverSupport.h' => '#warning DriverSupport.h is not available on Mac OS X',
    'DriverSynchronization.h' => '#include <CoreServices/CoreServices.h>',
    'ENET.h' => '#warning ENET.h is not available on Mac OS X',
    'EPPC.h' => '#warning EPPC.h is not available on Mac OS X',
    'Editions.h' => '#warning Editions.h is not available on Mac OS X',
    'Endian.h' => '#include <CoreServices/CoreServices.h>',
    'Errors.h' => '#include <CoreServices/CoreServices.h>',
    'Events.h' => '#include <Carbon/Carbon.h>',
    'FSM.h' => '#warning FSM.h is not available on Mac OS X',
    'FileSigning.h' => '#warning FileSigning.h is not available on Mac OS X',
    'FileTransferTools.h' => '#warning Comm Toolbox is not available on Mac OS X',
    'FileTransfers.h' => '#warning Comm Toolbox is not available on Mac OS X',
    'FileTypesAndCreators.h' => '#warning FileTypesAndCreators.h is not available on Mac OS X',
    'Files.h' => '#include <CoreServices/CoreServices.h>',
    'FindByContent.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'Finder.h' => '#include <CoreServices/CoreServices.h>',
    'FinderRegistry.h' => '#include <Carbon/Carbon.h>',
    'FixMath.h' => '#include <CoreServices/CoreServices.h>',
    'Folders.h' => '#include <CoreServices/CoreServices.h>',
    'FontSync.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'Fonts.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'GXEnvironment.h' => '#warning Quickdraw GX is not available on Mac OS X',
    'GXErrors.h' => '#warning Quickdraw GX is not available on Mac OS X',
    'GXFonts.h' => '#warning Quickdraw GX is not available on Mac OS X',
    'GXGraphics.h' => '#warning Quickdraw GX is not available on Mac OS X',
    'GXLayout.h' => '#warning Quickdraw GX is not available on Mac OS X',
    'GXMath.h' => '#warning Quickdraw GX is not available on Mac OS X',
    'GXMessages.h' => '#warning Quickdraw GX is not available on Mac OS X',
    'GXPrinterDrivers.h' => '#warning Quickdraw GX is not available on Mac OS X',
    'GXPrinting.h' => '#warning Quickdraw GX is not available on Mac OS X',
    'GXTypes.h' => '#warning Quickdraw GX is not available on Mac OS X',
    'Gestalt.h' => '#include <CoreServices/CoreServices.h>',
    'GoggleSprocket.h' => '#warning GoggleSprocket.h is not available on Mac OS X',
    'HFSVolumes.h' => '#include <CoreServices/CoreServices.h>',
    'HID.h' => '#warning HID.h is not available on Mac OS X',
    'HTMLRendering.h' => '#include <Carbon/Carbon.h>',
    'HyperXCmd.h' => '#warning HyperXCmd.h is not available on Mac OS X',
    'IAExtractor.h' => '#warning IAExtractor.h is not available on Mac OS X',
    'IBCarbonRuntime.h' => '#include <Carbon/Carbon.h>',
    'ICAApplication.h' => '#include <Carbon/Carbon.h>',
    'ICACamera.h' => '#include <Carbon/Carbon.h>',
    'ICADevice.h' => '#include <Carbon/Carbon.h>',
    'Icons.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'ImageCodec.h' => '#include <QuickTime/QuickTime.h>',
    'ImageCodec.k.h' => '#include <QuickTime/ImageCodec.k.h>',
    'ImageCompression.h' => '#include <QuickTime/QuickTime.h>',
    'ImageCompression.k.h' => '#include <QuickTime/ImageCompression.k.h>',
    'InputSprocket.h' => '#warning InputSprocket.h is not available on Mac OS X',
    'InternetConfig.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'Interrupts.h' => '#warning Interrupts.h is not available on Mac OS X',
    'IntlResources.h' => '#include <CoreServices/CoreServices.h>',
    'IsochronousDataHandler.h' => '#include <DVComponentGlue/IsochronousDataHandler.h>',
    'IsochronousDataHandler.k.h' => '#warning IsochronousDataHandler.k.h is not available on Mac OS X',
    'JManager.h' => '#warning JManager.h is not available on Mac OS X',
    'Kernel.h' => '#warning Kernel.h is not available on Mac OS X',
    'Keyboards.h' => '#include <Carbon/Carbon.h>',
    'Keychain.h' => '#include <Carbon/Carbon.h>',
    'KeychainCore.h' => '#include <CoreServices/CoreServices.h>',
    'KeychainHI.h' => '#include <Carbon/Carbon.h>',
    'LanguageAnalysis.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'LaunchServices.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'Lists.h' => '#include <Carbon/Carbon.h>',
    'LocationManager.h' => '#warning LocationManager.h is not available on Mac OS X',
    'LocationManager.k.h' => '#warning LocationManager.k.h is not available on Mac OS X',
    'LowMem.h' => '#include <CoreServices/CoreServices.h>',
    'MIDI.h' => '#warning MIDI.h is not available on Mac OS X',
    'MacApplication.h' => '#include <Carbon/Carbon.h>',
    'MacErrors.h' => '#include <CoreServices/CoreServices.h>',
    'MacHelp.h' => '#include <Carbon/Carbon.h>',
    'MacLocales.h' => '#include <CoreServices/CoreServices.h>',
    'MacMemory.h' => '#include <CoreServices/CoreServices.h>',
    'MacTCP.h' => '#warning MacTCP.h is not available on Mac OS X',
    'MacTextEditor.h' => '#include <Carbon/Carbon.h>',
    'MacTypes.h' => '#include <CoreServices/CoreServices.h>',
    'MacWindows.h' => '#include <Carbon/Carbon.h>',
    'MachineExceptions.h' => '#include <CoreServices/CoreServices.h>',
    'Math64.h' => '#include <CoreServices/CoreServices.h>',
    'MediaHandlers.h' => '#include <QuickTime/QuickTime.h>',
    'MediaHandlers.k.h' => '#include <QuickTime/MediaHandlers.k.h>',
    'Memory.h' => '#include <CoreServices/CoreServices.h>',
    'Menus.h' => '#include <Carbon/Carbon.h>',
    'MixedMode.h' => '#include <CoreServices/CoreServices.h>',
    'Movies.h' => '#include <QuickTime/QuickTime.h>',
    'Movies.k.h' => '#include <QuickTime/Movies.k.h>',
    'MoviesFormat.h' => '#include <QuickTime/QuickTime.h>',
    'Multiprocessing.h' => '#include <CoreServices/CoreServices.h>',
    'MultiprocessingInfo.h' => '#include <CoreServices/CoreServices.h>',
    'NSL.h' => '#include <Carbon/Carbon.h>',
    'NSLCore.h' => '#include <CoreServices/CoreServices.h>',
    'NameRegistry.h' => '#include <CoreServices/CoreServices.h>',
    'Navigation.h' => '#include <Carbon/Carbon.h>',
    'NetSprocket.h' => '#warning NetSprocket.h is not available on Mac OS X',
    'NetworkSetup.h' => '#warning NetworkSetup.h is not available on Mac OS X',
    'Notification.h' => '#include <Carbon/Carbon.h>',
    'NumberFormatting.h' => '#include <CoreServices/CoreServices.h>',
    'OSA.h' => '#include <Carbon/Carbon.h>',
    'OSA.k.h' => '#warning OSA.k.h is not available on Mac OS X',
    'OSAComp.h' => '#include <Carbon/Carbon.h>',
    'OSAGeneric.h' => '#include <Carbon/Carbon.h>',
    'OSUtils.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTptAppleTalk.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTptClient.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTptCommon.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTptConfig.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTptDevLinks.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTptGlobalNew.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTptISDN.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTptInternet.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTptLinks.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTptModule.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTptPCISupport.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTptSerial.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTptXTI.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTransport.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTransportKernel.h' => '#warning OpenTransportKernel.h is not available on Mac OS X',
    'OpenTransportProtocol.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTransportProviders.h' => '#include <CoreServices/CoreServices.h>',
    'OpenTransportUNIX.h' => '#warning OpenTransportUNIX.h is not available on Mac OS X',
    'PCCard.h' => '#warning PCCard.h is not available on Mac OS X',
    'PCCardAdapterPlugin.h' => '#warning PCCardAdapterPlugin.h is not available on Mac OS X',
    'PCCardEnablerPlugin.h' => '#warning PCCardEnablerPlugin.h is not available on Mac OS X',
    'PCCardTuples.h' => '#warning PCCardTuples.h is not available on Mac OS X',
    'PCI.h' => '#warning PCI.h is not available on Mac OS X',
    'PEFBinaryFormat.h' => '#include <CoreServices/CoreServices.h>',
    'PLStringFuncs.h' => '#include <CoreServices/CoreServices.h>',
    'PMApplication.h' => '#include <Carbon/Carbon.h>',
    'PMCore.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'PMDefinitions.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'PPCToolbox.h' => '#warning PPCToolbox.h is not available on Mac OS X',
    'Packages.h' => '#warning Packages.h is not available on Mac OS X',
    'Palettes.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'Patches.h' => '#include <CoreServices/CoreServices.h>',
    'PictUtils.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'Power.h' => '#include <CoreServices/CoreServices.h>',
    'Printing.h' => '#warning Printing.h is not available on Mac OS X',
    'Processes.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'QD3D.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DAcceleration.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DCamera.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DController.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DCustomElements.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DDrawContext.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DErrors.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DExtension.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DGeometry.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DGroup.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DIO.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DLight.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DMath.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DPick.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DRenderer.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DSet.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DShader.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DStorage.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DString.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DStyle.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DTransform.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DView.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DViewer.h' => '#warning QD3D is not available on Mac OS X',
    'QD3DWinViewer.h' => '#warning QD3D is not available on Mac OS X',
    'QDOffscreen.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'QTML.h' => '#warning QTML.h is not available on Mac OS X',
    'QTSMovie.h' => '#include <QuickTime/QuickTime.h>',
    'QTSMovie.k.h' => '#include <QuickTime/QTSMovie.k.h>',
    'QTStreamingComponents.h' => '#include <QuickTime/QuickTime.h>',
    'QTStreamingComponents.k.h' => '#include <QuickTime/QTStreamingComponents.k.h>',
    'QuickTime.h' => '#include <QuickTime/QuickTime.h>',
    'QuickTimeComponents.h' => '#include <QuickTime/QuickTime.h>',
    'QuickTimeComponents.k.h' => '#include <QuickTime/QuickTimeComponents.k.h>',
    'QuickTimeMusic.h' => '#include <QuickTime/QuickTime.h>',
    'QuickTimeMusic.k.h' => '#include <QuickTime/QuickTimeMusic.k.h>',
    'QuickTimeStreaming.h' => '#include <QuickTime/QuickTime.h>',
    'QuickTimeVR.h' => '#include <QuickTime/QuickTime.h>',
    'QuickTimeVRFormat.h' => '#include <QuickTime/QuickTime.h>',
    'Quickdraw.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'QuickdrawText.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'RAVE.h' => '#warning QD3D is not available on Mac OS X',
    'RAVESystem.h' => '#warning QD3D is not available on Mac OS X',
    'ROMDefs.h' => '#warning ROMDefs.h is not available on Mac OS X',
    'Resources.h' => '#include <CoreServices/CoreServices.h>',
    'Retrace.h' => '#warning Retrace.h is not available on Mac OS X',
    'SCSI.h' => '#include <CoreServices/CoreServices.h>',
    'SFNTLayoutTypes.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'SFNTTypes.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'ScalerStreamTypes.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'ScalerTypes.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'Scrap.h' => '#include <Carbon/Carbon.h>',
    'Script.h' => '#include <CoreServices/CoreServices.h>',
    'SegLoad.h' => '#warning SegLoad.h is not available on Mac OS X',
    'Serial.h' => '#warning Serial.h is not available on Mac OS X',
    'ShutDown.h' => '#warning ShutDown.h is not available on Mac OS X',
    'Slots.h' => '#warning Slots.h is not available on Mac OS X',
    'SocketServices.h' => '#warning SocketServices.h is not available on Mac OS X',
    'Sound.h' => '#include <Carbon/Carbon.h>',
    'Sound.k.h' => '#include <Carbon/Sound.k.h>',
    'SoundComponents.h' => '#include <Carbon/Carbon.h>',
    'SoundInput.h' => '#include <Carbon/Carbon.h>',
    'SoundSprocket.h' => '#warning SoundSprocket.h is not available on Mac OS X',
    'Speech.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'SpeechRecognition.h' => '#include <Carbon/Carbon.h>',
    'SpeechSynthesis.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'StandardFile.h' => '#warning StandardFile.h is not available on Mac OS X',
    'Start.h' => '#warning Start.h is not available on Mac OS X',
    'StringCompare.h' => '#include <CoreServices/CoreServices.h>',
    'Strings.h' => '#warning Strings.h is not available on Mac OS X',
    'TSMTE.h' => '#include <Carbon/Carbon.h>',
    'Telephones.h' => '#warning Telephones.h is not available on Mac OS X',
    'TerminalTools.h' => '#warning Comm Toolbox is not available on Mac OS X',
    'Terminals.h' => '#warning Comm Toolbox is not available on Mac OS X',
    'TextCommon.h' => '#include <CoreServices/CoreServices.h>',
    'TextEdit.h' => '#include <Carbon/Carbon.h>',
    'TextEncodingConverter.h' => '#include <CoreServices/CoreServices.h>',
    'TextEncodingPlugin.h' => '#include <CoreServices/CoreServices.h>',
    'TextServices.h' => '#include <Carbon/Carbon.h>',
    'TextUtils.h' => '#include <CoreServices/CoreServices.h>',
    'Threads.h' => '#include <CoreServices/CoreServices.h>',
    'Timer.h' => '#include <CoreServices/CoreServices.h>',
    'ToolUtils.h' => '#include <CoreServices/CoreServices.h>',
    'Translation.h' => '#include <Carbon/Carbon.h>',
    'TranslationExtensions.h' => '#include <Carbon/Carbon.h>',
    'Traps.h' => '#warning Traps.h is not available on Mac OS X',
    'TypeSelect.h' => '#include <Carbon/Carbon.h>',
    'Types.h' => '#include <CoreServices/CoreServices.h>',
    'URLAccess.h' => '#include <Carbon/Carbon.h>',
    'USB.h' => '#warning USB.h is not available on Mac OS X',
    'UTCUtils.h' => '#include <CoreServices/CoreServices.h>',
    'Unicode.h' => '#include <CoreServices/CoreServices.h>',
    'UnicodeConverter.h' => '#include <CoreServices/CoreServices.h>',
    'UnicodeUtilities.h' => '#include <CoreServices/CoreServices.h>',
    'Video.h' => '#include <ApplicationServices/ApplicationServices.h>',
    'VideoServices.h' => '#warning VideoServices.h is not available on Mac OS X',
    'Windows.h' => '#include <Carbon/Carbon.h>',
    'WorldScript.h' => '#warning WorldScript.h is not available on Mac OS X',
    'ZoomedVideo.h' => '#warning ZoomedVideo.h is not available on Mac OS X',
    'fp.h' => '#include <CoreServices/CoreServices.h>',
    'vBLAS.h' => '#include <vecLib/vecLib.h>',
    'vBasicOps.h' => '#include <vecLib/vecLib.h>',
    'vBigNum.h' => '#include <vecLib/vecLib.h>',
    'vDSP.h' => '#include <vecLib/vecLib.h>',
    'vectorOps.h' => '#include <vecLib/vecLib.h>',
    'vfp.h' => '#include <vecLib/vecLib.h>',
);

my %seen;
while(<>) {
    if(/^#\s*include\s+<([^>]+)>/) {
	my $t = $FlatCarbon{$1};
	if(defined($t)) {
	    # only emit the #include if we haven't emitted this header before
	    if(!$seen{$t}) {
		print "$t\n";
		$seen{$t} = 1;
	    }
	    next;
	}
    }
    print;
}
