zeroc-ice 3.7.10 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/dist/IceRuby/Communicator.cpp +575 -0
- data/dist/IceRuby/Communicator.h +19 -0
- data/dist/IceRuby/Config.h +77 -0
- data/dist/IceRuby/Connection.cpp +428 -0
- data/dist/IceRuby/Connection.h +20 -0
- data/dist/IceRuby/DefaultSliceLoader.cpp +45 -0
- data/dist/IceRuby/DefaultSliceLoader.h +25 -0
- data/dist/IceRuby/Endpoint.cpp +342 -0
- data/dist/IceRuby/Endpoint.h +18 -0
- data/dist/IceRuby/ImplicitContext.cpp +143 -0
- data/dist/IceRuby/ImplicitContext.h +16 -0
- data/dist/IceRuby/Init.cpp +36 -0
- data/dist/IceRuby/Logger.cpp +146 -0
- data/dist/IceRuby/Logger.h +19 -0
- data/dist/IceRuby/Operation.cpp +623 -0
- data/dist/IceRuby/Operation.h +28 -0
- data/dist/IceRuby/Properties.cpp +413 -0
- data/dist/IceRuby/Properties.h +16 -0
- data/dist/IceRuby/Proxy.cpp +926 -0
- data/dist/IceRuby/Proxy.h +21 -0
- data/dist/IceRuby/RubySliceLoader.cpp +39 -0
- data/dist/IceRuby/RubySliceLoader.h +27 -0
- data/dist/IceRuby/Slice.cpp +199 -0
- data/dist/IceRuby/Slice.h +13 -0
- data/dist/IceRuby/Types.cpp +3133 -0
- data/dist/IceRuby/Types.h +533 -0
- data/dist/IceRuby/Util.cpp +553 -0
- data/dist/IceRuby/Util.h +485 -0
- data/dist/ice/cpp/include/Ice/AsyncResponseHandler.h +85 -0
- data/dist/ice/cpp/include/Ice/BatchRequest.h +39 -0
- data/dist/ice/cpp/include/Ice/BatchRequestQueueF.h +14 -0
- data/dist/ice/cpp/include/Ice/Buffer.h +159 -0
- data/dist/ice/cpp/include/Ice/Communicator.h +411 -0
- data/dist/ice/cpp/include/Ice/CommunicatorF.h +16 -0
- data/dist/ice/cpp/include/Ice/Config.h +60 -0
- data/dist/ice/cpp/include/Ice/Connection.h +410 -0
- data/dist/ice/cpp/include/Ice/ConnectionF.h +36 -0
- data/dist/ice/cpp/include/Ice/ConnectionIF.h +16 -0
- data/dist/ice/cpp/include/Ice/CtrlCHandler.h +56 -0
- data/dist/ice/cpp/include/Ice/Current.h +60 -0
- data/dist/ice/cpp/include/Ice/DefaultSliceLoader.h +160 -0
- data/dist/ice/cpp/include/Ice/Demangle.h +17 -0
- data/dist/ice/cpp/include/Ice/Endpoint.h +298 -0
- data/dist/ice/cpp/include/Ice/EndpointF.h +44 -0
- data/dist/ice/cpp/include/Ice/EndpointSelectionType.h +21 -0
- data/dist/ice/cpp/include/Ice/Exception.h +56 -0
- data/dist/ice/cpp/include/Ice/FacetMap.h +16 -0
- data/dist/ice/cpp/include/Ice/Format.h +22 -0
- data/dist/ice/cpp/include/Ice/Ice.h +60 -0
- data/dist/ice/cpp/include/Ice/IconvStringConverter.h +216 -0
- data/dist/ice/cpp/include/Ice/ImplicitContext.h +76 -0
- data/dist/ice/cpp/include/Ice/IncomingRequest.h +75 -0
- data/dist/ice/cpp/include/Ice/Initialize.h +143 -0
- data/dist/ice/cpp/include/Ice/InputStream.h +942 -0
- data/dist/ice/cpp/include/Ice/InstanceF.h +14 -0
- data/dist/ice/cpp/include/Ice/Instrumentation.h +319 -0
- data/dist/ice/cpp/include/Ice/LocalException.h +58 -0
- data/dist/ice/cpp/include/Ice/LocalExceptions.h +870 -0
- data/dist/ice/cpp/include/Ice/Logger.h +62 -0
- data/dist/ice/cpp/include/Ice/LoggerUtil.h +162 -0
- data/dist/ice/cpp/include/Ice/MarshaledResult.h +50 -0
- data/dist/ice/cpp/include/Ice/NativePropertiesAdmin.h +54 -0
- data/dist/ice/cpp/include/Ice/Object.h +168 -0
- data/dist/ice/cpp/include/Ice/ObjectAdapter.h +324 -0
- data/dist/ice/cpp/include/Ice/ObjectAdapterF.h +16 -0
- data/dist/ice/cpp/include/Ice/ObjectF.h +16 -0
- data/dist/ice/cpp/include/Ice/ObserverHelper.h +164 -0
- data/dist/ice/cpp/include/Ice/OutgoingAsync.h +512 -0
- data/dist/ice/cpp/include/Ice/OutgoingResponse.h +129 -0
- data/dist/ice/cpp/include/Ice/OutputStream.h +872 -0
- data/dist/ice/cpp/include/Ice/Plugin.h +73 -0
- data/dist/ice/cpp/include/Ice/PluginFactory.h +77 -0
- data/dist/ice/cpp/include/Ice/PopDisableWarnings.h +16 -0
- data/dist/ice/cpp/include/Ice/Properties.h +307 -0
- data/dist/ice/cpp/include/Ice/PropertiesF.h +19 -0
- data/dist/ice/cpp/include/Ice/Proxy.h +742 -0
- data/dist/ice/cpp/include/Ice/ProxyF.h +11 -0
- data/dist/ice/cpp/include/Ice/ProxyFunctions.h +209 -0
- data/dist/ice/cpp/include/Ice/PushDisableWarnings.h +29 -0
- data/dist/ice/cpp/include/Ice/ReferenceF.h +14 -0
- data/dist/ice/cpp/include/Ice/RequestHandlerF.h +20 -0
- data/dist/ice/cpp/include/Ice/SSL/ClientAuthenticationOptions.h +268 -0
- data/dist/ice/cpp/include/Ice/SSL/Config.h +54 -0
- data/dist/ice/cpp/include/Ice/SSL/ConnectionInfo.h +107 -0
- data/dist/ice/cpp/include/Ice/SSL/ConnectionInfoF.h +39 -0
- data/dist/ice/cpp/include/Ice/SSL/EndpointInfo.h +40 -0
- data/dist/ice/cpp/include/Ice/SSL/SSLException.h +32 -0
- data/dist/ice/cpp/include/Ice/SSL/ServerAuthenticationOptions.h +278 -0
- data/dist/ice/cpp/include/Ice/ServantLocator.h +51 -0
- data/dist/ice/cpp/include/Ice/Service.h +219 -0
- data/dist/ice/cpp/include/Ice/SliceLoader.h +67 -0
- data/dist/ice/cpp/include/Ice/SlicedData.h +125 -0
- data/dist/ice/cpp/include/Ice/SlicedDataF.h +30 -0
- data/dist/ice/cpp/include/Ice/StreamHelpers.h +652 -0
- data/dist/ice/cpp/include/Ice/StreamableTraits.h +291 -0
- data/dist/ice/cpp/include/Ice/StringConverter.h +167 -0
- data/dist/ice/cpp/include/Ice/StringUtil.h +114 -0
- data/dist/ice/cpp/include/Ice/TimerTask.h +24 -0
- data/dist/ice/cpp/include/Ice/TupleCompare.h +103 -0
- data/dist/ice/cpp/include/Ice/UUID.h +16 -0
- data/dist/ice/cpp/include/Ice/UserException.h +46 -0
- data/dist/ice/cpp/include/Ice/UserExceptionFactory.h +15 -0
- data/dist/ice/cpp/include/Ice/Value.h +127 -0
- data/dist/ice/cpp/include/Ice/ValueF.h +16 -0
- data/dist/ice/cpp/include/IceDiscovery/IceDiscovery.h +28 -0
- data/dist/ice/cpp/include/IceLocatorDiscovery/IceLocatorDiscovery.h +28 -0
- data/dist/ice/cpp/include/generated/Ice/BuiltinSequences.h +70 -0
- data/dist/ice/cpp/include/generated/Ice/Context.h +40 -0
- data/dist/ice/cpp/include/generated/Ice/EndpointTypes.h +74 -0
- data/dist/ice/cpp/include/generated/Ice/Identity.h +108 -0
- data/dist/ice/cpp/include/generated/Ice/Locator.h +542 -0
- data/dist/ice/cpp/include/generated/Ice/LocatorRegistry.h +443 -0
- data/dist/ice/cpp/include/generated/Ice/Metrics.h +1103 -0
- data/dist/ice/cpp/include/generated/Ice/OperationMode.h +73 -0
- data/dist/ice/cpp/include/generated/Ice/Process.h +245 -0
- data/dist/ice/cpp/include/generated/Ice/PropertiesAdmin.h +314 -0
- data/dist/ice/cpp/include/generated/Ice/PropertyDict.h +39 -0
- data/dist/ice/cpp/include/generated/Ice/RemoteLogger.h +724 -0
- data/dist/ice/cpp/include/generated/Ice/ReplyStatus.h +94 -0
- data/dist/ice/cpp/include/generated/Ice/Router.h +496 -0
- data/dist/ice/cpp/include/generated/Ice/SliceChecksumDict.h +37 -0
- data/dist/ice/cpp/include/generated/Ice/Version.h +112 -0
- data/dist/ice/cpp/include/generated/IceDiscovery/Lookup.h +498 -0
- data/dist/ice/cpp/include/generated/IceLocatorDiscovery/Lookup.h +387 -0
- data/dist/ice/cpp/src/Ice/Acceptor.h +41 -0
- data/dist/ice/cpp/src/Ice/AcceptorF.h +17 -0
- data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories.h +16 -0
- data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_all.cpp +43 -0
- data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_min.cpp +17 -0
- data/dist/ice/cpp/src/Ice/ArgVector.cpp +58 -0
- data/dist/ice/cpp/src/Ice/ArgVector.h +30 -0
- data/dist/ice/cpp/src/Ice/Base64.cpp +263 -0
- data/dist/ice/cpp/src/Ice/Base64.h +26 -0
- data/dist/ice/cpp/src/Ice/BatchRequestQueue.cpp +199 -0
- data/dist/ice/cpp/src/Ice/BatchRequestQueue.h +49 -0
- data/dist/ice/cpp/src/Ice/Buffer.cpp +187 -0
- data/dist/ice/cpp/src/Ice/CheckIdentity.h +21 -0
- data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +373 -0
- data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.h +65 -0
- data/dist/ice/cpp/src/Ice/Communicator.cpp +399 -0
- data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp +140 -0
- data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.h +39 -0
- data/dist/ice/cpp/src/Ice/ConnectRequestHandler.cpp +227 -0
- data/dist/ice/cpp/src/Ice/ConnectRequestHandler.h +51 -0
- data/dist/ice/cpp/src/Ice/ConnectRequestHandlerF.h +14 -0
- data/dist/ice/cpp/src/Ice/Connection.cpp +44 -0
- data/dist/ice/cpp/src/Ice/ConnectionFactory.cpp +1758 -0
- data/dist/ice/cpp/src/Ice/ConnectionFactory.h +264 -0
- data/dist/ice/cpp/src/Ice/ConnectionFactoryF.h +17 -0
- data/dist/ice/cpp/src/Ice/ConnectionI.cpp +3563 -0
- data/dist/ice/cpp/src/Ice/ConnectionI.h +429 -0
- data/dist/ice/cpp/src/Ice/ConnectionOptions.h +22 -0
- data/dist/ice/cpp/src/Ice/Connector.h +38 -0
- data/dist/ice/cpp/src/Ice/ConnectorF.h +14 -0
- data/dist/ice/cpp/src/Ice/ConsoleUtil.cpp +136 -0
- data/dist/ice/cpp/src/Ice/ConsoleUtil.h +79 -0
- data/dist/ice/cpp/src/Ice/CtrlCHandler.cpp +189 -0
- data/dist/ice/cpp/src/Ice/Current.cpp +29 -0
- data/dist/ice/cpp/src/Ice/DLLMain.cpp +40 -0
- data/dist/ice/cpp/src/Ice/DefaultSliceLoader.cpp +39 -0
- data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +81 -0
- data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.h +38 -0
- data/dist/ice/cpp/src/Ice/DefaultsAndOverridesF.h +14 -0
- data/dist/ice/cpp/src/Ice/Demangle.cpp +25 -0
- data/dist/ice/cpp/src/Ice/DisableWarnings.h +31 -0
- data/dist/ice/cpp/src/Ice/DynamicLibrary.cpp +216 -0
- data/dist/ice/cpp/src/Ice/DynamicLibrary.h +91 -0
- data/dist/ice/cpp/src/Ice/Endian.h +40 -0
- data/dist/ice/cpp/src/Ice/EndpointFactory.cpp +165 -0
- data/dist/ice/cpp/src/Ice/EndpointFactory.h +96 -0
- data/dist/ice/cpp/src/Ice/EndpointFactoryF.h +14 -0
- data/dist/ice/cpp/src/Ice/EndpointFactoryManager.cpp +180 -0
- data/dist/ice/cpp/src/Ice/EndpointFactoryManager.h +42 -0
- data/dist/ice/cpp/src/Ice/EndpointFactoryManagerF.h +14 -0
- data/dist/ice/cpp/src/Ice/EndpointI.cpp +128 -0
- data/dist/ice/cpp/src/Ice/EndpointI.h +150 -0
- data/dist/ice/cpp/src/Ice/EndpointIF.h +21 -0
- data/dist/ice/cpp/src/Ice/EventHandler.cpp +9 -0
- data/dist/ice/cpp/src/Ice/EventHandler.h +71 -0
- data/dist/ice/cpp/src/Ice/EventHandlerF.h +14 -0
- data/dist/ice/cpp/src/Ice/Exception.cpp +5 -0
- data/dist/ice/cpp/src/Ice/FileUtil.cpp +476 -0
- data/dist/ice/cpp/src/Ice/FileUtil.h +152 -0
- data/dist/ice/cpp/src/Ice/FixedRequestHandler.cpp +34 -0
- data/dist/ice/cpp/src/Ice/FixedRequestHandler.h +29 -0
- data/dist/ice/cpp/src/Ice/HashUtil.h +67 -0
- data/dist/ice/cpp/src/Ice/HttpParser.cpp +684 -0
- data/dist/ice/cpp/src/Ice/HttpParser.h +112 -0
- data/dist/ice/cpp/src/Ice/IPEndpointI.cpp +593 -0
- data/dist/ice/cpp/src/Ice/IPEndpointI.h +106 -0
- data/dist/ice/cpp/src/Ice/IPEndpointIF.h +17 -0
- data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp +172 -0
- data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.h +89 -0
- data/dist/ice/cpp/src/Ice/ImplicitContext.cpp +109 -0
- data/dist/ice/cpp/src/Ice/IncomingRequest.cpp +66 -0
- data/dist/ice/cpp/src/Ice/Initialize.cpp +160 -0
- data/dist/ice/cpp/src/Ice/InputStream.cpp +2206 -0
- data/dist/ice/cpp/src/Ice/Instance.cpp +1956 -0
- data/dist/ice/cpp/src/Ice/Instance.h +225 -0
- data/dist/ice/cpp/src/Ice/InstrumentationI.cpp +959 -0
- data/dist/ice/cpp/src/Ice/InstrumentationI.h +235 -0
- data/dist/ice/cpp/src/Ice/LocalException.cpp +518 -0
- data/dist/ice/cpp/src/Ice/LocalExceptions.cpp +577 -0
- data/dist/ice/cpp/src/Ice/LocatorInfo.cpp +851 -0
- data/dist/ice/cpp/src/Ice/LocatorInfo.h +176 -0
- data/dist/ice/cpp/src/Ice/LocatorInfoF.h +20 -0
- data/dist/ice/cpp/src/Ice/LoggerAdminI.cpp +774 -0
- data/dist/ice/cpp/src/Ice/LoggerAdminI.h +31 -0
- data/dist/ice/cpp/src/Ice/LoggerI.cpp +234 -0
- data/dist/ice/cpp/src/Ice/LoggerI.h +47 -0
- data/dist/ice/cpp/src/Ice/LoggerMiddleware.cpp +176 -0
- data/dist/ice/cpp/src/Ice/LoggerMiddleware.h +42 -0
- data/dist/ice/cpp/src/Ice/LoggerUtil.cpp +76 -0
- data/dist/ice/cpp/src/Ice/MarshaledResult.cpp +20 -0
- data/dist/ice/cpp/src/Ice/MetricsAdminI.cpp +608 -0
- data/dist/ice/cpp/src/Ice/MetricsAdminI.h +600 -0
- data/dist/ice/cpp/src/Ice/MetricsFunctional.h +92 -0
- data/dist/ice/cpp/src/Ice/MetricsObserverI.h +587 -0
- data/dist/ice/cpp/src/Ice/NativePropertiesAdmin.cpp +185 -0
- data/dist/ice/cpp/src/Ice/Network.cpp +1927 -0
- data/dist/ice/cpp/src/Ice/Network.h +265 -0
- data/dist/ice/cpp/src/Ice/NetworkF.h +11 -0
- data/dist/ice/cpp/src/Ice/NetworkProxy.cpp +306 -0
- data/dist/ice/cpp/src/Ice/NetworkProxy.h +67 -0
- data/dist/ice/cpp/src/Ice/NetworkProxyF.h +14 -0
- data/dist/ice/cpp/src/Ice/OSLogLoggerI.cpp +55 -0
- data/dist/ice/cpp/src/Ice/OSLogLoggerI.h +35 -0
- data/dist/ice/cpp/src/Ice/Object.cpp +249 -0
- data/dist/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +348 -0
- data/dist/ice/cpp/src/Ice/ObjectAdapterFactory.h +53 -0
- data/dist/ice/cpp/src/Ice/ObjectAdapterFactoryF.h +14 -0
- data/dist/ice/cpp/src/Ice/ObjectAdapterI.cpp +1383 -0
- data/dist/ice/cpp/src/Ice/ObjectAdapterI.h +163 -0
- data/dist/ice/cpp/src/Ice/ObserverHelper.cpp +75 -0
- data/dist/ice/cpp/src/Ice/ObserverMiddleware.cpp +96 -0
- data/dist/ice/cpp/src/Ice/ObserverMiddleware.h +25 -0
- data/dist/ice/cpp/src/Ice/OpaqueEndpointI.cpp +368 -0
- data/dist/ice/cpp/src/Ice/OpaqueEndpointI.h +66 -0
- data/dist/ice/cpp/src/Ice/Options.cpp +980 -0
- data/dist/ice/cpp/src/Ice/Options.h +119 -0
- data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +1106 -0
- data/dist/ice/cpp/src/Ice/OutgoingResponse.cpp +276 -0
- data/dist/ice/cpp/src/Ice/OutputStream.cpp +1454 -0
- data/dist/ice/cpp/src/Ice/OutputUtil.cpp +344 -0
- data/dist/ice/cpp/src/Ice/OutputUtil.h +173 -0
- data/dist/ice/cpp/src/Ice/PluginManagerI.cpp +344 -0
- data/dist/ice/cpp/src/Ice/PluginManagerI.h +54 -0
- data/dist/ice/cpp/src/Ice/Properties.cpp +931 -0
- data/dist/ice/cpp/src/Ice/PropertyNames.cpp +606 -0
- data/dist/ice/cpp/src/Ice/PropertyNames.h +63 -0
- data/dist/ice/cpp/src/Ice/PropertyUtil.cpp +103 -0
- data/dist/ice/cpp/src/Ice/PropertyUtil.h +31 -0
- data/dist/ice/cpp/src/Ice/Protocol.cpp +159 -0
- data/dist/ice/cpp/src/Ice/Protocol.h +116 -0
- data/dist/ice/cpp/src/Ice/ProtocolInstance.cpp +186 -0
- data/dist/ice/cpp/src/Ice/ProtocolInstance.h +74 -0
- data/dist/ice/cpp/src/Ice/ProtocolInstanceF.h +14 -0
- data/dist/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +29 -0
- data/dist/ice/cpp/src/Ice/ProtocolPluginFacade.h +35 -0
- data/dist/ice/cpp/src/Ice/Proxy.cpp +541 -0
- data/dist/ice/cpp/src/Ice/ProxyAsync.cpp +684 -0
- data/dist/ice/cpp/src/Ice/ProxyFunctions.cpp +90 -0
- data/dist/ice/cpp/src/Ice/PushDisableDeprecatedWarnings.h +15 -0
- data/dist/ice/cpp/src/Ice/Random.cpp +29 -0
- data/dist/ice/cpp/src/Ice/Random.h +23 -0
- data/dist/ice/cpp/src/Ice/Reference.cpp +1584 -0
- data/dist/ice/cpp/src/Ice/Reference.h +339 -0
- data/dist/ice/cpp/src/Ice/ReferenceFactory.cpp +830 -0
- data/dist/ice/cpp/src/Ice/ReferenceFactory.h +58 -0
- data/dist/ice/cpp/src/Ice/ReferenceFactoryF.h +14 -0
- data/dist/ice/cpp/src/Ice/RequestHandler.cpp +28 -0
- data/dist/ice/cpp/src/Ice/RequestHandler.h +53 -0
- data/dist/ice/cpp/src/Ice/RequestHandlerCache.cpp +76 -0
- data/dist/ice/cpp/src/Ice/RequestHandlerCache.h +33 -0
- data/dist/ice/cpp/src/Ice/ResourceConfig.h +27 -0
- data/dist/ice/cpp/src/Ice/RetryQueue.cpp +151 -0
- data/dist/ice/cpp/src/Ice/RetryQueue.h +59 -0
- data/dist/ice/cpp/src/Ice/RetryQueueF.h +14 -0
- data/dist/ice/cpp/src/Ice/RouterInfo.cpp +275 -0
- data/dist/ice/cpp/src/Ice/RouterInfo.h +95 -0
- data/dist/ice/cpp/src/Ice/RouterInfoF.h +17 -0
- data/dist/ice/cpp/src/Ice/SHA1.cpp +195 -0
- data/dist/ice/cpp/src/Ice/SHA1.h +35 -0
- data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.cpp +89 -0
- data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.h +87 -0
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.cpp +513 -0
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.h +40 -0
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngineF.h +13 -0
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +635 -0
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.h +80 -0
- data/dist/ice/cpp/src/Ice/SSL/RFC2253.cpp +487 -0
- data/dist/ice/cpp/src/Ice/SSL/RFC2253.h +58 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLAcceptorI.cpp +124 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLAcceptorI.h +52 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLConnectorI.cpp +92 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLConnectorI.h +38 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.cpp +377 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.h +84 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLEngine.cpp +115 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLEngine.h +72 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLEngineF.h +14 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLException.cpp +18 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLInstance.cpp +27 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLInstance.h +26 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLInstanceF.h +19 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLUtil.cpp +654 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLUtil.h +104 -0
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.cpp +1437 -0
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.h +58 -0
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngineF.h +18 -0
- data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +1085 -0
- data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.h +118 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.cpp +822 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.h +44 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngineF.h +18 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +621 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.h +91 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.cpp +1061 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.h +40 -0
- data/dist/ice/cpp/src/Ice/SSL/TrustManager.cpp +222 -0
- data/dist/ice/cpp/src/Ice/SSL/TrustManager.h +42 -0
- data/dist/ice/cpp/src/Ice/SSL/TrustManagerF.h +14 -0
- data/dist/ice/cpp/src/Ice/ScannerConfig.h +35 -0
- data/dist/ice/cpp/src/Ice/Selector.cpp +1270 -0
- data/dist/ice/cpp/src/Ice/Selector.h +235 -0
- data/dist/ice/cpp/src/Ice/ServantManager.cpp +547 -0
- data/dist/ice/cpp/src/Ice/ServantManager.h +66 -0
- data/dist/ice/cpp/src/Ice/ServantManagerF.h +14 -0
- data/dist/ice/cpp/src/Ice/Service.cpp +1790 -0
- data/dist/ice/cpp/src/Ice/SharedContext.h +33 -0
- data/dist/ice/cpp/src/Ice/SliceLoader.cpp +53 -0
- data/dist/ice/cpp/src/Ice/SlicedData.cpp +48 -0
- data/dist/ice/cpp/src/Ice/StreamSocket.cpp +472 -0
- data/dist/ice/cpp/src/Ice/StreamSocket.h +73 -0
- data/dist/ice/cpp/src/Ice/StringConverter.cpp +582 -0
- data/dist/ice/cpp/src/Ice/StringUtil.cpp +1137 -0
- data/dist/ice/cpp/src/Ice/SysLoggerI.cpp +160 -0
- data/dist/ice/cpp/src/Ice/SysLoggerI.h +34 -0
- data/dist/ice/cpp/src/Ice/SystemdJournalI.cpp +65 -0
- data/dist/ice/cpp/src/Ice/SystemdJournalI.h +33 -0
- data/dist/ice/cpp/src/Ice/TargetCompare.h +96 -0
- data/dist/ice/cpp/src/Ice/TcpAcceptor.cpp +213 -0
- data/dist/ice/cpp/src/Ice/TcpAcceptor.h +55 -0
- data/dist/ice/cpp/src/Ice/TcpConnector.cpp +128 -0
- data/dist/ice/cpp/src/Ice/TcpConnector.h +36 -0
- data/dist/ice/cpp/src/Ice/TcpEndpointI.cpp +411 -0
- data/dist/ice/cpp/src/Ice/TcpEndpointI.h +86 -0
- data/dist/ice/cpp/src/Ice/TcpTransceiver.cpp +147 -0
- data/dist/ice/cpp/src/Ice/TcpTransceiver.h +53 -0
- data/dist/ice/cpp/src/Ice/ThreadPool.cpp +1110 -0
- data/dist/ice/cpp/src/Ice/ThreadPool.h +305 -0
- data/dist/ice/cpp/src/Ice/ThreadPoolF.h +14 -0
- data/dist/ice/cpp/src/Ice/TimeUtil.cpp +47 -0
- data/dist/ice/cpp/src/Ice/TimeUtil.h +21 -0
- data/dist/ice/cpp/src/Ice/Timer.cpp +169 -0
- data/dist/ice/cpp/src/Ice/Timer.h +212 -0
- data/dist/ice/cpp/src/Ice/TraceLevels.cpp +20 -0
- data/dist/ice/cpp/src/Ice/TraceLevels.h +39 -0
- data/dist/ice/cpp/src/Ice/TraceLevelsF.h +14 -0
- data/dist/ice/cpp/src/Ice/TraceUtil.cpp +399 -0
- data/dist/ice/cpp/src/Ice/TraceUtil.h +41 -0
- data/dist/ice/cpp/src/Ice/Transceiver.cpp +14 -0
- data/dist/ice/cpp/src/Ice/Transceiver.h +52 -0
- data/dist/ice/cpp/src/Ice/TransceiverF.h +23 -0
- data/dist/ice/cpp/src/Ice/UUID.cpp +79 -0
- data/dist/ice/cpp/src/Ice/UdpConnector.cpp +131 -0
- data/dist/ice/cpp/src/Ice/UdpConnector.h +36 -0
- data/dist/ice/cpp/src/Ice/UdpEndpointI.cpp +480 -0
- data/dist/ice/cpp/src/Ice/UdpEndpointI.h +92 -0
- data/dist/ice/cpp/src/Ice/UdpTransceiver.cpp +786 -0
- data/dist/ice/cpp/src/Ice/UdpTransceiver.h +90 -0
- data/dist/ice/cpp/src/Ice/UndefSysMacros.h +37 -0
- data/dist/ice/cpp/src/Ice/UniqueRef.h +77 -0
- data/dist/ice/cpp/src/Ice/UserException.cpp +58 -0
- data/dist/ice/cpp/src/Ice/Value.cpp +145 -0
- data/dist/ice/cpp/src/Ice/WSAcceptor.cpp +87 -0
- data/dist/ice/cpp/src/Ice/WSAcceptor.h +46 -0
- data/dist/ice/cpp/src/Ice/WSConnector.cpp +87 -0
- data/dist/ice/cpp/src/Ice/WSConnector.h +36 -0
- data/dist/ice/cpp/src/Ice/WSEndpoint.cpp +455 -0
- data/dist/ice/cpp/src/Ice/WSEndpoint.h +82 -0
- data/dist/ice/cpp/src/Ice/WSTransceiver.cpp +1715 -0
- data/dist/ice/cpp/src/Ice/WSTransceiver.h +135 -0
- data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +40 -0
- data/dist/ice/cpp/src/Ice/generated/Context.cpp +40 -0
- data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +40 -0
- data/dist/ice/cpp/src/Ice/generated/Identity.cpp +47 -0
- data/dist/ice/cpp/src/Ice/generated/Locator.cpp +752 -0
- data/dist/ice/cpp/src/Ice/generated/LocatorRegistry.cpp +577 -0
- data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +1205 -0
- data/dist/ice/cpp/src/Ice/generated/OperationMode.cpp +56 -0
- data/dist/ice/cpp/src/Ice/generated/Process.cpp +330 -0
- data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +443 -0
- data/dist/ice/cpp/src/Ice/generated/PropertyDict.cpp +40 -0
- data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +851 -0
- data/dist/ice/cpp/src/Ice/generated/ReplyStatus.cpp +70 -0
- data/dist/ice/cpp/src/Ice/generated/Router.cpp +660 -0
- data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +39 -0
- data/dist/ice/cpp/src/Ice/generated/Version.cpp +54 -0
- data/dist/ice/cpp/src/IceDiscovery/LocatorI.cpp +202 -0
- data/dist/ice/cpp/src/IceDiscovery/LocatorI.h +68 -0
- data/dist/ice/cpp/src/IceDiscovery/LookupI.cpp +494 -0
- data/dist/ice/cpp/src/IceDiscovery/LookupI.h +168 -0
- data/dist/ice/cpp/src/IceDiscovery/PluginI.cpp +155 -0
- data/dist/ice/cpp/src/IceDiscovery/PluginI.h +31 -0
- data/dist/ice/cpp/src/IceDiscovery/generated/Lookup.cpp +638 -0
- data/dist/ice/cpp/src/IceLocatorDiscovery/Plugin.h +24 -0
- data/dist/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +822 -0
- data/dist/ice/cpp/src/IceLocatorDiscovery/generated/Lookup.cpp +468 -0
- data/dist/ice/cpp/src/Slice/DeprecationReporter.cpp +172 -0
- data/dist/ice/cpp/src/Slice/DeprecationReporter.h +14 -0
- data/dist/ice/cpp/src/Slice/DocCommentParser.cpp +736 -0
- data/dist/ice/cpp/src/Slice/DocCommentParser.h +61 -0
- data/dist/ice/cpp/src/Slice/FileTracker.cpp +96 -0
- data/dist/ice/cpp/src/Slice/FileTracker.h +44 -0
- data/dist/ice/cpp/src/Slice/Grammar.cpp +4125 -0
- data/dist/ice/cpp/src/Slice/Grammar.h +138 -0
- data/dist/ice/cpp/src/Slice/GrammarUtil.h +128 -0
- data/dist/ice/cpp/src/Slice/MetadataValidation.cpp +473 -0
- data/dist/ice/cpp/src/Slice/MetadataValidation.h +106 -0
- data/dist/ice/cpp/src/Slice/Parser.cpp +4906 -0
- data/dist/ice/cpp/src/Slice/Parser.h +1175 -0
- data/dist/ice/cpp/src/Slice/Preprocessor.cpp +295 -0
- data/dist/ice/cpp/src/Slice/Preprocessor.h +44 -0
- data/dist/ice/cpp/src/Slice/Scanner.cpp +3445 -0
- data/dist/ice/cpp/src/Slice/SliceUtil.cpp +790 -0
- data/dist/ice/cpp/src/Slice/StringLiteralUtil.cpp +448 -0
- data/dist/ice/cpp/src/Slice/Util.h +134 -0
- data/dist/ice/cpp/src/slice2rb/Main.cpp +33 -0
- data/dist/ice/cpp/src/slice2rb/Ruby.cpp +250 -0
- data/dist/ice/cpp/src/slice2rb/RubyUtil.cpp +1197 -0
- data/dist/ice/cpp/src/slice2rb/RubyUtil.h +56 -0
- data/dist/ice/mcpp/internal.H +530 -0
- data/dist/ice/mcpp/system.c +2741 -0
- data/dist/ice/slice/Glacier2/Metrics.ice +47 -0
- data/dist/ice/slice/Glacier2/PermissionsVerifier.ice +55 -0
- data/dist/ice/slice/Glacier2/Router.ice +93 -0
- data/dist/ice/slice/Glacier2/SSLInfo.ice +42 -0
- data/dist/ice/slice/Glacier2/Session.ice +133 -0
- data/dist/ice/slice/Ice/BuiltinSequences.ice +54 -0
- data/dist/ice/slice/Ice/Context.ice +24 -0
- data/dist/ice/slice/Ice/EndpointTypes.ice +50 -0
- data/dist/ice/slice/Ice/Identity.ice +36 -0
- data/dist/ice/slice/Ice/Locator.ice +74 -0
- data/dist/ice/slice/Ice/LocatorRegistry.ice +77 -0
- data/dist/ice/slice/Ice/Metrics.ice +201 -0
- data/dist/ice/slice/Ice/OperationMode.ice +38 -0
- data/dist/ice/slice/Ice/Process.ice +28 -0
- data/dist/ice/slice/Ice/PropertiesAdmin.ice +37 -0
- data/dist/ice/slice/Ice/PropertyDict.ice +23 -0
- data/dist/ice/slice/Ice/RemoteLogger.ice +126 -0
- data/dist/ice/slice/Ice/ReplyStatus.ice +65 -0
- data/dist/ice/slice/Ice/Router.ice +54 -0
- data/dist/ice/slice/Ice/SliceChecksumDict.ice +18 -0
- data/dist/ice/slice/Ice/Version.ice +43 -0
- data/dist/ice/slice/IceBox/ServiceManager.ice +79 -0
- data/dist/ice/slice/IceGrid/Admin.ice +981 -0
- data/dist/ice/slice/IceGrid/Descriptor.ice +519 -0
- data/dist/ice/slice/IceGrid/Exception.ice +98 -0
- data/dist/ice/slice/IceGrid/FileParser.ice +36 -0
- data/dist/ice/slice/IceGrid/Registry.ice +130 -0
- data/dist/ice/slice/IceGrid/Session.ice +64 -0
- data/dist/ice/slice/IceGrid/UserAccountMapper.ice +34 -0
- data/dist/ice/slice/IceStorm/IceStorm.ice +186 -0
- data/dist/ice/slice/IceStorm/Metrics.ice +41 -0
- data/dist/lib/Glacier2/Metrics.rb +41 -0
- data/dist/lib/Glacier2/PermissionsVerifier.rb +61 -0
- data/dist/lib/Glacier2/Router.rb +73 -0
- data/dist/lib/Glacier2/SSLInfo.rb +64 -0
- data/dist/lib/Glacier2/Session.rb +187 -0
- data/dist/lib/Glacier2.rb +7 -0
- data/dist/lib/Ice/BuiltinSequences.rb +48 -0
- data/dist/lib/Ice/CompressBatch.rb +50 -0
- data/dist/lib/Ice/Context.rb +12 -0
- data/dist/lib/Ice/EndpointSelectionType.rb +49 -0
- data/dist/lib/Ice/EndpointTypes.rb +28 -0
- data/dist/lib/Ice/Exception.rb +20 -0
- data/dist/lib/Ice/Identity.rb +47 -0
- data/dist/lib/Ice/IdentitySpaceship.rb +16 -0
- data/dist/lib/Ice/InitializationData.rb +12 -0
- data/dist/lib/Ice/LocalExceptions.rb +168 -0
- data/dist/lib/Ice/Locator.rb +83 -0
- data/dist/lib/Ice/LocatorRegistry.rb +73 -0
- data/dist/lib/Ice/Metrics.rb +290 -0
- data/dist/lib/Ice/OperationMode.rb +58 -0
- data/dist/lib/Ice/Process.rb +34 -0
- data/dist/lib/Ice/PropertiesAdmin.rb +39 -0
- data/dist/lib/Ice/PropertyDict.rb +12 -0
- data/dist/lib/Ice/Proxy.rb +85 -0
- data/dist/lib/Ice/ProxyFunctions.rb +69 -0
- data/dist/lib/Ice/RemoteLogger.rb +176 -0
- data/dist/lib/Ice/ReplyStatus.rb +65 -0
- data/dist/lib/Ice/Router.rb +59 -0
- data/dist/lib/Ice/SliceChecksumDict.rb +12 -0
- data/dist/lib/Ice/SliceUtil.rb +41 -0
- data/dist/lib/Ice/Struct.rb +11 -0
- data/dist/lib/Ice/ToStringMode.rb +50 -0
- data/dist/lib/Ice/Value.rb +93 -0
- data/dist/lib/Ice/Version.rb +78 -0
- data/dist/lib/Ice.rb +37 -0
- data/dist/lib/IceBox/ServiceManager.rb +104 -0
- data/dist/lib/IceBox.rb +3 -0
- data/dist/lib/IceGrid/Admin.rb +1208 -0
- data/dist/lib/IceGrid/Descriptor.rb +989 -0
- data/dist/lib/IceGrid/Exception.rb +145 -0
- data/dist/lib/IceGrid/FileParser.rb +41 -0
- data/dist/lib/IceGrid/Registry.rb +168 -0
- data/dist/lib/IceGrid/Session.rb +56 -0
- data/dist/lib/IceGrid/UserAccountMapper.rb +38 -0
- data/dist/lib/IceGrid.rb +9 -0
- data/dist/lib/IceStorm/IceStorm.rb +251 -0
- data/dist/lib/IceStorm/Metrics.rb +55 -0
- data/dist/lib/IceStorm.rb +4 -0
- data/extconf.rb +89 -0
- data/ice.gemspec +22 -17
- data/scripts/slice2rb +10 -0
- metadata +536 -712
- data/ICE_LICENSE +0 -48
- data/LICENSE +0 -340
- data/MCPP_LICENSE +0 -29
- data/bin/slice2rb +0 -12
- data/ext/Communicator.cpp +0 -792
- data/ext/Communicator.h +0 -20
- data/ext/Config.h +0 -143
- data/ext/Connection.cpp +0 -532
- data/ext/Connection.h +0 -24
- data/ext/Endpoint.cpp +0 -340
- data/ext/Endpoint.h +0 -22
- data/ext/ImplicitContext.cpp +0 -144
- data/ext/ImplicitContext.h +0 -20
- data/ext/Init.cpp +0 -49
- data/ext/Logger.cpp +0 -147
- data/ext/Logger.h +0 -23
- data/ext/Operation.cpp +0 -661
- data/ext/Operation.h +0 -31
- data/ext/Properties.cpp +0 -365
- data/ext/Properties.h +0 -20
- data/ext/Proxy.cpp +0 -1396
- data/ext/Proxy.h +0 -22
- data/ext/Slice.cpp +0 -205
- data/ext/Slice.h +0 -17
- data/ext/Types.cpp +0 -3325
- data/ext/Types.h +0 -595
- data/ext/Util.cpp +0 -812
- data/ext/Util.h +0 -586
- data/ext/ValueFactoryManager.cpp +0 -441
- data/ext/ValueFactoryManager.h +0 -95
- data/ext/extconf.rb +0 -97
- data/ext/ice/cpp/include/Ice/Application.h +0 -326
- data/ext/ice/cpp/include/Ice/AsyncResult.h +0 -155
- data/ext/ice/cpp/include/Ice/AsyncResultF.h +0 -23
- data/ext/ice/cpp/include/Ice/BatchRequestInterceptor.h +0 -75
- data/ext/ice/cpp/include/Ice/BatchRequestQueueF.h +0 -20
- data/ext/ice/cpp/include/Ice/Buffer.h +0 -154
- data/ext/ice/cpp/include/Ice/CommunicatorAsync.h +0 -154
- data/ext/ice/cpp/include/Ice/Comparable.h +0 -205
- data/ext/ice/cpp/include/Ice/Config.h +0 -76
- data/ext/ice/cpp/include/Ice/ConnectionAsync.h +0 -302
- data/ext/ice/cpp/include/Ice/ConnectionIF.h +0 -38
- data/ext/ice/cpp/include/Ice/ConsoleUtil.h +0 -23
- data/ext/ice/cpp/include/Ice/DefaultValueFactory.h +0 -57
- data/ext/ice/cpp/include/Ice/DispatchInterceptor.h +0 -41
- data/ext/ice/cpp/include/Ice/Dispatcher.h +0 -67
- data/ext/ice/cpp/include/Ice/DynamicLibrary.h +0 -102
- data/ext/ice/cpp/include/Ice/DynamicLibraryF.h +0 -24
- data/ext/ice/cpp/include/Ice/Exception.h +0 -161
- data/ext/ice/cpp/include/Ice/ExceptionHelpers.h +0 -74
- data/ext/ice/cpp/include/Ice/FactoryTable.h +0 -73
- data/ext/ice/cpp/include/Ice/FactoryTableInit.h +0 -84
- data/ext/ice/cpp/include/Ice/Format.h +0 -38
- data/ext/ice/cpp/include/Ice/Functional.h +0 -140
- data/ext/ice/cpp/include/Ice/GCObject.h +0 -76
- data/ext/ice/cpp/include/Ice/Handle.h +0 -182
- data/ext/ice/cpp/include/Ice/Ice.h +0 -55
- data/ext/ice/cpp/include/Ice/IconvStringConverter.h +0 -377
- data/ext/ice/cpp/include/Ice/Incoming.h +0 -225
- data/ext/ice/cpp/include/Ice/IncomingAsync.h +0 -186
- data/ext/ice/cpp/include/Ice/IncomingAsyncF.h +0 -36
- data/ext/ice/cpp/include/Ice/Initialize.h +0 -957
- data/ext/ice/cpp/include/Ice/InputStream.h +0 -1514
- data/ext/ice/cpp/include/Ice/InstanceF.h +0 -20
- data/ext/ice/cpp/include/Ice/InterfaceByValue.h +0 -57
- data/ext/ice/cpp/include/Ice/LocalObject.h +0 -35
- data/ext/ice/cpp/include/Ice/LocalObjectF.h +0 -21
- data/ext/ice/cpp/include/Ice/LoggerUtil.h +0 -185
- data/ext/ice/cpp/include/Ice/MetricsAdminI.h +0 -715
- data/ext/ice/cpp/include/Ice/MetricsFunctional.h +0 -159
- data/ext/ice/cpp/include/Ice/MetricsObserverI.h +0 -669
- data/ext/ice/cpp/include/Ice/NativePropertiesAdmin.h +0 -86
- data/ext/ice/cpp/include/Ice/Object.h +0 -507
- data/ext/ice/cpp/include/Ice/ObjectF.h +0 -30
- data/ext/ice/cpp/include/Ice/ObserverHelper.h +0 -182
- data/ext/ice/cpp/include/Ice/Optional.h +0 -1114
- data/ext/ice/cpp/include/Ice/OutgoingAsync.h +0 -856
- data/ext/ice/cpp/include/Ice/OutgoingAsyncF.h +0 -39
- data/ext/ice/cpp/include/Ice/OutputStream.h +0 -1092
- data/ext/ice/cpp/include/Ice/Protocol.h +0 -274
- data/ext/ice/cpp/include/Ice/Proxy.h +0 -5154
- data/ext/ice/cpp/include/Ice/ProxyF.h +0 -53
- data/ext/ice/cpp/include/Ice/ProxyFactoryF.h +0 -21
- data/ext/ice/cpp/include/Ice/ProxyHandle.h +0 -318
- data/ext/ice/cpp/include/Ice/ReferenceF.h +0 -29
- data/ext/ice/cpp/include/Ice/RegisterPlugins.h +0 -127
- data/ext/ice/cpp/include/Ice/RequestHandlerF.h +0 -30
- data/ext/ice/cpp/include/Ice/ResponseHandlerF.h +0 -25
- data/ext/ice/cpp/include/Ice/SHA1.h +0 -40
- data/ext/ice/cpp/include/Ice/ServantManagerF.h +0 -21
- data/ext/ice/cpp/include/Ice/Service.h +0 -379
- data/ext/ice/cpp/include/Ice/SliceChecksums.h +0 -33
- data/ext/ice/cpp/include/Ice/SlicedData.h +0 -172
- data/ext/ice/cpp/include/Ice/SlicedDataF.h +0 -40
- data/ext/ice/cpp/include/Ice/StreamHelpers.h +0 -1190
- data/ext/ice/cpp/include/Ice/StringConverter.h +0 -78
- data/ext/ice/cpp/include/Ice/ThreadPoolF.h +0 -23
- data/ext/ice/cpp/include/Ice/UUID.h +0 -19
- data/ext/ice/cpp/include/Ice/UniquePtr.h +0 -95
- data/ext/ice/cpp/include/Ice/UniqueRef.h +0 -97
- data/ext/ice/cpp/include/Ice/UserExceptionFactory.h +0 -88
- data/ext/ice/cpp/include/Ice/Value.h +0 -139
- data/ext/ice/cpp/include/Ice/ValueF.h +0 -21
- data/ext/ice/cpp/include/IceSSL/Config.h +0 -21
- data/ext/ice/cpp/include/IceSSL/IceSSL.h +0 -24
- data/ext/ice/cpp/include/IceSSL/OpenSSL.h +0 -147
- data/ext/ice/cpp/include/IceSSL/Plugin.h +0 -712
- data/ext/ice/cpp/include/IceSSL/SChannel.h +0 -72
- data/ext/ice/cpp/include/IceSSL/SecureTransport.h +0 -72
- data/ext/ice/cpp/include/IceSSL/UWP.h +0 -62
- data/ext/ice/cpp/include/IceUtil/Atomic.h +0 -179
- data/ext/ice/cpp/include/IceUtil/Cond.h +0 -317
- data/ext/ice/cpp/include/IceUtil/Config.h +0 -392
- data/ext/ice/cpp/include/IceUtil/ConsoleUtil.h +0 -92
- data/ext/ice/cpp/include/IceUtil/CountDownLatch.h +0 -45
- data/ext/ice/cpp/include/IceUtil/CtrlCHandler.h +0 -92
- data/ext/ice/cpp/include/IceUtil/DisableWarnings.h +0 -44
- data/ext/ice/cpp/include/IceUtil/Exception.h +0 -394
- data/ext/ice/cpp/include/IceUtil/FileUtil.h +0 -140
- data/ext/ice/cpp/include/IceUtil/Functional.h +0 -389
- data/ext/ice/cpp/include/IceUtil/Handle.h +0 -261
- data/ext/ice/cpp/include/IceUtil/IceUtil.h +0 -40
- data/ext/ice/cpp/include/IceUtil/InputUtil.h +0 -42
- data/ext/ice/cpp/include/IceUtil/Iterator.h +0 -31
- data/ext/ice/cpp/include/IceUtil/Lock.h +0 -128
- data/ext/ice/cpp/include/IceUtil/Monitor.h +0 -243
- data/ext/ice/cpp/include/IceUtil/Mutex.h +0 -349
- data/ext/ice/cpp/include/IceUtil/MutexProtocol.h +0 -23
- data/ext/ice/cpp/include/IceUtil/MutexPtrLock.h +0 -78
- data/ext/ice/cpp/include/IceUtil/MutexPtrTryLock.h +0 -77
- data/ext/ice/cpp/include/IceUtil/Optional.h +0 -433
- data/ext/ice/cpp/include/IceUtil/Options.h +0 -135
- data/ext/ice/cpp/include/IceUtil/OutputUtil.h +0 -383
- data/ext/ice/cpp/include/IceUtil/PopDisableWarnings.h +0 -14
- data/ext/ice/cpp/include/IceUtil/PushDisableWarnings.h +0 -33
- data/ext/ice/cpp/include/IceUtil/Random.h +0 -55
- data/ext/ice/cpp/include/IceUtil/RecMutex.h +0 -107
- data/ext/ice/cpp/include/IceUtil/ResourceConfig.h +0 -37
- data/ext/ice/cpp/include/IceUtil/ScannerConfig.h +0 -40
- data/ext/ice/cpp/include/IceUtil/ScopedArray.h +0 -98
- data/ext/ice/cpp/include/IceUtil/Shared.h +0 -127
- data/ext/ice/cpp/include/IceUtil/StopWatch.h +0 -49
- data/ext/ice/cpp/include/IceUtil/StringConverter.h +0 -195
- data/ext/ice/cpp/include/IceUtil/StringUtil.h +0 -97
- data/ext/ice/cpp/include/IceUtil/Thread.h +0 -160
- data/ext/ice/cpp/include/IceUtil/ThreadException.h +0 -94
- data/ext/ice/cpp/include/IceUtil/Time.h +0 -205
- data/ext/ice/cpp/include/IceUtil/Timer.h +0 -144
- data/ext/ice/cpp/include/IceUtil/UUID.h +0 -21
- data/ext/ice/cpp/include/IceUtil/UndefSysMacros.h +0 -37
- data/ext/ice/cpp/include/generated/Ice/BuiltinSequences.h +0 -170
- data/ext/ice/cpp/include/generated/Ice/Communicator.h +0 -1162
- data/ext/ice/cpp/include/generated/Ice/CommunicatorF.h +0 -101
- data/ext/ice/cpp/include/generated/Ice/Connection.h +0 -1703
- data/ext/ice/cpp/include/generated/Ice/ConnectionF.h +0 -119
- data/ext/ice/cpp/include/generated/Ice/Current.h +0 -322
- data/ext/ice/cpp/include/generated/Ice/Endpoint.h +0 -979
- data/ext/ice/cpp/include/generated/Ice/EndpointF.h +0 -166
- data/ext/ice/cpp/include/generated/Ice/EndpointTypes.h +0 -118
- data/ext/ice/cpp/include/generated/Ice/FacetMap.h +0 -80
- data/ext/ice/cpp/include/generated/Ice/Identity.h +0 -264
- data/ext/ice/cpp/include/generated/Ice/ImplicitContext.h +0 -284
- data/ext/ice/cpp/include/generated/Ice/ImplicitContextF.h +0 -101
- data/ext/ice/cpp/include/generated/Ice/Instrumentation.h +0 -1203
- data/ext/ice/cpp/include/generated/Ice/InstrumentationF.h +0 -128
- data/ext/ice/cpp/include/generated/Ice/LocalException.h +0 -7437
- data/ext/ice/cpp/include/generated/Ice/Locator.h +0 -3898
- data/ext/ice/cpp/include/generated/Ice/LocatorF.h +0 -147
- data/ext/ice/cpp/include/generated/Ice/Logger.h +0 -237
- data/ext/ice/cpp/include/generated/Ice/LoggerF.h +0 -101
- data/ext/ice/cpp/include/generated/Ice/Metrics.h +0 -4769
- data/ext/ice/cpp/include/generated/Ice/ObjectAdapter.h +0 -1181
- data/ext/ice/cpp/include/generated/Ice/ObjectAdapterF.h +0 -101
- data/ext/ice/cpp/include/generated/Ice/ObjectFactory.h +0 -203
- data/ext/ice/cpp/include/generated/Ice/Plugin.h +0 -318
- data/ext/ice/cpp/include/generated/Ice/PluginF.h +0 -110
- data/ext/ice/cpp/include/generated/Ice/Process.h +0 -977
- data/ext/ice/cpp/include/generated/Ice/ProcessF.h +0 -125
- data/ext/ice/cpp/include/generated/Ice/Properties.h +0 -452
- data/ext/ice/cpp/include/generated/Ice/PropertiesAdmin.h +0 -1366
- data/ext/ice/cpp/include/generated/Ice/PropertiesF.h +0 -134
- data/ext/ice/cpp/include/generated/Ice/RemoteLogger.h +0 -2707
- data/ext/ice/cpp/include/generated/Ice/Router.h +0 -1850
- data/ext/ice/cpp/include/generated/Ice/RouterF.h +0 -125
- data/ext/ice/cpp/include/generated/Ice/ServantLocator.h +0 -305
- data/ext/ice/cpp/include/generated/Ice/ServantLocatorF.h +0 -101
- data/ext/ice/cpp/include/generated/Ice/SliceChecksumDict.h +0 -84
- data/ext/ice/cpp/include/generated/Ice/ValueFactory.h +0 -330
- data/ext/ice/cpp/include/generated/Ice/Version.h +0 -357
- data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfo.h +0 -228
- data/ext/ice/cpp/include/generated/IceSSL/ConnectionInfoF.h +0 -101
- data/ext/ice/cpp/include/generated/IceSSL/EndpointInfo.h +0 -186
- data/ext/ice/cpp/src/Ice/ACM.cpp +0 -380
- data/ext/ice/cpp/src/Ice/ACM.h +0 -119
- data/ext/ice/cpp/src/Ice/ACMF.h +0 -30
- data/ext/ice/cpp/src/Ice/Acceptor.cpp +0 -16
- data/ext/ice/cpp/src/Ice/Acceptor.h +0 -37
- data/ext/ice/cpp/src/Ice/AcceptorF.h +0 -25
- data/ext/ice/cpp/src/Ice/ArgVector.cpp +0 -59
- data/ext/ice/cpp/src/Ice/ArgVector.h +0 -36
- data/ext/ice/cpp/src/Ice/AsyncResult.cpp +0 -70
- data/ext/ice/cpp/src/Ice/Base64.cpp +0 -263
- data/ext/ice/cpp/src/Ice/Base64.h +0 -31
- data/ext/ice/cpp/src/Ice/BatchRequestQueue.cpp +0 -250
- data/ext/ice/cpp/src/Ice/BatchRequestQueue.h +0 -59
- data/ext/ice/cpp/src/Ice/Buffer.cpp +0 -155
- data/ext/ice/cpp/src/Ice/BuiltinSequences.cpp +0 -49
- data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +0 -407
- data/ext/ice/cpp/src/Ice/CollocatedRequestHandler.h +0 -87
- data/ext/ice/cpp/src/Ice/Communicator.cpp +0 -79
- data/ext/ice/cpp/src/Ice/CommunicatorF.cpp +0 -61
- data/ext/ice/cpp/src/Ice/CommunicatorI.cpp +0 -586
- data/ext/ice/cpp/src/Ice/CommunicatorI.h +0 -167
- data/ext/ice/cpp/src/Ice/Cond.cpp +0 -381
- data/ext/ice/cpp/src/Ice/ConnectRequestHandler.cpp +0 -348
- data/ext/ice/cpp/src/Ice/ConnectRequestHandler.h +0 -72
- data/ext/ice/cpp/src/Ice/ConnectRequestHandlerF.h +0 -24
- data/ext/ice/cpp/src/Ice/Connection.cpp +0 -155
- data/ext/ice/cpp/src/Ice/ConnectionF.cpp +0 -61
- data/ext/ice/cpp/src/Ice/ConnectionFactory.cpp +0 -1972
- data/ext/ice/cpp/src/Ice/ConnectionFactory.h +0 -264
- data/ext/ice/cpp/src/Ice/ConnectionFactoryF.h +0 -30
- data/ext/ice/cpp/src/Ice/ConnectionI.cpp +0 -3670
- data/ext/ice/cpp/src/Ice/ConnectionI.h +0 -389
- data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.cpp +0 -73
- data/ext/ice/cpp/src/Ice/ConnectionRequestHandler.h +0 -41
- data/ext/ice/cpp/src/Ice/Connector.cpp +0 -16
- data/ext/ice/cpp/src/Ice/Connector.h +0 -32
- data/ext/ice/cpp/src/Ice/ConnectorF.h +0 -21
- data/ext/ice/cpp/src/Ice/CountDownLatch.cpp +0 -171
- data/ext/ice/cpp/src/Ice/Current.cpp +0 -62
- data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +0 -159
- data/ext/ice/cpp/src/Ice/DefaultsAndOverrides.h +0 -52
- data/ext/ice/cpp/src/Ice/DefaultsAndOverridesF.h +0 -21
- data/ext/ice/cpp/src/Ice/DispatchInterceptor.cpp +0 -37
- data/ext/ice/cpp/src/Ice/DynamicLibrary.cpp +0 -284
- data/ext/ice/cpp/src/Ice/Endpoint.cpp +0 -147
- data/ext/ice/cpp/src/Ice/EndpointF.cpp +0 -61
- data/ext/ice/cpp/src/Ice/EndpointFactory.cpp +0 -189
- data/ext/ice/cpp/src/Ice/EndpointFactory.h +0 -117
- data/ext/ice/cpp/src/Ice/EndpointFactoryF.h +0 -21
- data/ext/ice/cpp/src/Ice/EndpointFactoryManager.cpp +0 -213
- data/ext/ice/cpp/src/Ice/EndpointFactoryManager.h +0 -47
- data/ext/ice/cpp/src/Ice/EndpointFactoryManagerF.h +0 -21
- data/ext/ice/cpp/src/Ice/EndpointI.cpp +0 -98
- data/ext/ice/cpp/src/Ice/EndpointI.h +0 -218
- data/ext/ice/cpp/src/Ice/EndpointIF.h +0 -49
- data/ext/ice/cpp/src/Ice/EndpointTypes.cpp +0 -51
- data/ext/ice/cpp/src/Ice/EventHandler.cpp +0 -32
- data/ext/ice/cpp/src/Ice/EventHandler.h +0 -81
- data/ext/ice/cpp/src/Ice/EventHandlerF.h +0 -24
- data/ext/ice/cpp/src/Ice/Exception.cpp +0 -818
- data/ext/ice/cpp/src/Ice/FacetMap.cpp +0 -49
- data/ext/ice/cpp/src/Ice/FactoryTable.cpp +0 -162
- data/ext/ice/cpp/src/Ice/FactoryTableInit.cpp +0 -88
- data/ext/ice/cpp/src/Ice/GCObject.cpp +0 -442
- data/ext/ice/cpp/src/Ice/HashUtil.h +0 -53
- data/ext/ice/cpp/src/Ice/HttpParser.cpp +0 -684
- data/ext/ice/cpp/src/Ice/HttpParser.h +0 -117
- data/ext/ice/cpp/src/Ice/IPEndpointI.cpp +0 -710
- data/ext/ice/cpp/src/Ice/IPEndpointI.h +0 -152
- data/ext/ice/cpp/src/Ice/IPEndpointIF.h +0 -28
- data/ext/ice/cpp/src/Ice/IconvStringConverter.cpp +0 -51
- data/ext/ice/cpp/src/Ice/Identity.cpp +0 -57
- data/ext/ice/cpp/src/Ice/ImplicitContext.cpp +0 -75
- data/ext/ice/cpp/src/Ice/ImplicitContextF.cpp +0 -61
- data/ext/ice/cpp/src/Ice/ImplicitContextI.cpp +0 -655
- data/ext/ice/cpp/src/Ice/ImplicitContextI.h +0 -48
- data/ext/ice/cpp/src/Ice/Incoming.cpp +0 -795
- data/ext/ice/cpp/src/Ice/IncomingAsync.cpp +0 -230
- data/ext/ice/cpp/src/Ice/IncomingRequest.h +0 -33
- data/ext/ice/cpp/src/Ice/Initialize.cpp +0 -654
- data/ext/ice/cpp/src/Ice/InputStream.cpp +0 -2741
- data/ext/ice/cpp/src/Ice/Instance.cpp +0 -1967
- data/ext/ice/cpp/src/Ice/Instance.h +0 -235
- data/ext/ice/cpp/src/Ice/Instrumentation.cpp +0 -188
- data/ext/ice/cpp/src/Ice/InstrumentationF.cpp +0 -66
- data/ext/ice/cpp/src/Ice/InstrumentationI.cpp +0 -1094
- data/ext/ice/cpp/src/Ice/InstrumentationI.h +0 -256
- data/ext/ice/cpp/src/Ice/LocalException.cpp +0 -3262
- data/ext/ice/cpp/src/Ice/LocalObject.cpp +0 -23
- data/ext/ice/cpp/src/Ice/Locator.cpp +0 -2042
- data/ext/ice/cpp/src/Ice/LocatorF.cpp +0 -63
- data/ext/ice/cpp/src/Ice/LocatorInfo.cpp +0 -889
- data/ext/ice/cpp/src/Ice/LocatorInfo.h +0 -189
- data/ext/ice/cpp/src/Ice/LocatorInfoF.h +0 -29
- data/ext/ice/cpp/src/Ice/Logger.cpp +0 -73
- data/ext/ice/cpp/src/Ice/LoggerAdminI.cpp +0 -956
- data/ext/ice/cpp/src/Ice/LoggerAdminI.h +0 -41
- data/ext/ice/cpp/src/Ice/LoggerF.cpp +0 -61
- data/ext/ice/cpp/src/Ice/LoggerI.cpp +0 -259
- data/ext/ice/cpp/src/Ice/LoggerI.h +0 -52
- data/ext/ice/cpp/src/Ice/LoggerUtil.cpp +0 -100
- data/ext/ice/cpp/src/Ice/Metrics.cpp +0 -2352
- data/ext/ice/cpp/src/Ice/MetricsAdminI.cpp +0 -694
- data/ext/ice/cpp/src/Ice/MetricsObserverI.cpp +0 -8
- data/ext/ice/cpp/src/Ice/Network.cpp +0 -2249
- data/ext/ice/cpp/src/Ice/Network.h +0 -289
- data/ext/ice/cpp/src/Ice/NetworkF.h +0 -19
- data/ext/ice/cpp/src/Ice/NetworkProxy.cpp +0 -311
- data/ext/ice/cpp/src/Ice/NetworkProxy.h +0 -72
- data/ext/ice/cpp/src/Ice/NetworkProxyF.h +0 -21
- data/ext/ice/cpp/src/Ice/OSLogLoggerI.cpp +0 -57
- data/ext/ice/cpp/src/Ice/OSLogLoggerI.h +0 -40
- data/ext/ice/cpp/src/Ice/Object.cpp +0 -435
- data/ext/ice/cpp/src/Ice/ObjectAdapter.cpp +0 -79
- data/ext/ice/cpp/src/Ice/ObjectAdapterF.cpp +0 -61
- data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +0 -291
- data/ext/ice/cpp/src/Ice/ObjectAdapterFactory.h +0 -53
- data/ext/ice/cpp/src/Ice/ObjectAdapterFactoryF.h +0 -25
- data/ext/ice/cpp/src/Ice/ObjectAdapterI.cpp +0 -1530
- data/ext/ice/cpp/src/Ice/ObjectAdapterI.h +0 -159
- data/ext/ice/cpp/src/Ice/ObjectFactory.cpp +0 -75
- data/ext/ice/cpp/src/Ice/ObserverHelper.cpp +0 -56
- data/ext/ice/cpp/src/Ice/OpaqueEndpointI.cpp +0 -408
- data/ext/ice/cpp/src/Ice/OpaqueEndpointI.h +0 -74
- data/ext/ice/cpp/src/Ice/OutgoingAsync.cpp +0 -1322
- data/ext/ice/cpp/src/Ice/OutputStream.cpp +0 -1367
- data/ext/ice/cpp/src/Ice/Plugin.cpp +0 -87
- data/ext/ice/cpp/src/Ice/PluginF.cpp +0 -61
- data/ext/ice/cpp/src/Ice/PluginManagerI.cpp +0 -503
- data/ext/ice/cpp/src/Ice/PluginManagerI.h +0 -61
- data/ext/ice/cpp/src/Ice/Process.cpp +0 -471
- data/ext/ice/cpp/src/Ice/ProcessF.cpp +0 -63
- data/ext/ice/cpp/src/Ice/Properties.cpp +0 -78
- data/ext/ice/cpp/src/Ice/PropertiesAdmin.cpp +0 -603
- data/ext/ice/cpp/src/Ice/PropertiesAdminI.cpp +0 -265
- data/ext/ice/cpp/src/Ice/PropertiesAdminI.h +0 -64
- data/ext/ice/cpp/src/Ice/PropertiesF.cpp +0 -63
- data/ext/ice/cpp/src/Ice/PropertiesI.cpp +0 -739
- data/ext/ice/cpp/src/Ice/PropertiesI.h +0 -70
- data/ext/ice/cpp/src/Ice/PropertyNames.cpp +0 -1429
- data/ext/ice/cpp/src/Ice/PropertyNames.h +0 -78
- data/ext/ice/cpp/src/Ice/Protocol.cpp +0 -124
- data/ext/ice/cpp/src/Ice/ProtocolInstance.cpp +0 -131
- data/ext/ice/cpp/src/Ice/ProtocolInstance.h +0 -93
- data/ext/ice/cpp/src/Ice/ProtocolInstanceF.h +0 -21
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +0 -51
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacade.h +0 -64
- data/ext/ice/cpp/src/Ice/ProtocolPluginFacadeF.h +0 -21
- data/ext/ice/cpp/src/Ice/Proxy.cpp +0 -1601
- data/ext/ice/cpp/src/Ice/ProxyFactory.cpp +0 -300
- data/ext/ice/cpp/src/Ice/ProxyFactory.h +0 -57
- data/ext/ice/cpp/src/Ice/Reference.cpp +0 -2046
- data/ext/ice/cpp/src/Ice/Reference.h +0 -323
- data/ext/ice/cpp/src/Ice/ReferenceFactory.cpp +0 -888
- data/ext/ice/cpp/src/Ice/ReferenceFactory.h +0 -76
- data/ext/ice/cpp/src/Ice/ReferenceFactoryF.h +0 -19
- data/ext/ice/cpp/src/Ice/RegisterPluginsInit.cpp +0 -38
- data/ext/ice/cpp/src/Ice/RegisterPluginsInit.h +0 -20
- data/ext/ice/cpp/src/Ice/RemoteLogger.cpp +0 -1171
- data/ext/ice/cpp/src/Ice/ReplyStatus.h +0 -24
- data/ext/ice/cpp/src/Ice/RequestHandler.cpp +0 -37
- data/ext/ice/cpp/src/Ice/RequestHandler.h +0 -78
- data/ext/ice/cpp/src/Ice/RequestHandlerFactory.cpp +0 -77
- data/ext/ice/cpp/src/Ice/RequestHandlerFactory.h +0 -37
- data/ext/ice/cpp/src/Ice/ResponseHandler.cpp +0 -12
- data/ext/ice/cpp/src/Ice/ResponseHandler.h +0 -43
- data/ext/ice/cpp/src/Ice/RetryQueue.cpp +0 -157
- data/ext/ice/cpp/src/Ice/RetryQueue.h +0 -66
- data/ext/ice/cpp/src/Ice/RetryQueueF.h +0 -19
- data/ext/ice/cpp/src/Ice/Router.cpp +0 -977
- data/ext/ice/cpp/src/Ice/RouterF.cpp +0 -63
- data/ext/ice/cpp/src/Ice/RouterInfo.cpp +0 -379
- data/ext/ice/cpp/src/Ice/RouterInfo.h +0 -152
- data/ext/ice/cpp/src/Ice/RouterInfoF.h +0 -25
- data/ext/ice/cpp/src/Ice/SHA1.cpp +0 -169
- data/ext/ice/cpp/src/Ice/Selector.cpp +0 -1525
- data/ext/ice/cpp/src/Ice/Selector.h +0 -292
- data/ext/ice/cpp/src/Ice/ServantLocator.cpp +0 -75
- data/ext/ice/cpp/src/Ice/ServantLocatorF.cpp +0 -61
- data/ext/ice/cpp/src/Ice/ServantManager.cpp +0 -480
- data/ext/ice/cpp/src/Ice/ServantManager.h +0 -69
- data/ext/ice/cpp/src/Ice/SharedContext.h +0 -46
- data/ext/ice/cpp/src/Ice/SliceChecksumDict.cpp +0 -49
- data/ext/ice/cpp/src/Ice/SliceChecksums.cpp +0 -75
- data/ext/ice/cpp/src/Ice/SlicedData.cpp +0 -127
- data/ext/ice/cpp/src/Ice/StreamSocket.cpp +0 -519
- data/ext/ice/cpp/src/Ice/StreamSocket.h +0 -85
- data/ext/ice/cpp/src/Ice/StringConverterPlugin.cpp +0 -192
- data/ext/ice/cpp/src/Ice/StringUtil.h +0 -30
- data/ext/ice/cpp/src/Ice/SysLoggerI.cpp +0 -166
- data/ext/ice/cpp/src/Ice/SysLoggerI.h +0 -37
- data/ext/ice/cpp/src/Ice/SystemdJournalI.cpp +0 -66
- data/ext/ice/cpp/src/Ice/SystemdJournalI.h +0 -39
- data/ext/ice/cpp/src/Ice/TcpAcceptor.cpp +0 -234
- data/ext/ice/cpp/src/Ice/TcpAcceptor.h +0 -61
- data/ext/ice/cpp/src/Ice/TcpConnector.cpp +0 -127
- data/ext/ice/cpp/src/Ice/TcpConnector.h +0 -45
- data/ext/ice/cpp/src/Ice/TcpEndpointI.cpp +0 -385
- data/ext/ice/cpp/src/Ice/TcpEndpointI.h +0 -90
- data/ext/ice/cpp/src/Ice/TcpTransceiver.cpp +0 -135
- data/ext/ice/cpp/src/Ice/TcpTransceiver.h +0 -58
- data/ext/ice/cpp/src/Ice/Thread.cpp +0 -569
- data/ext/ice/cpp/src/Ice/ThreadPool.cpp +0 -1292
- data/ext/ice/cpp/src/Ice/ThreadPool.h +0 -393
- data/ext/ice/cpp/src/Ice/Timer.cpp +0 -263
- data/ext/ice/cpp/src/Ice/TraceLevels.cpp +0 -38
- data/ext/ice/cpp/src/Ice/TraceLevels.h +0 -45
- data/ext/ice/cpp/src/Ice/TraceLevelsF.h +0 -21
- data/ext/ice/cpp/src/Ice/TraceUtil.cpp +0 -478
- data/ext/ice/cpp/src/Ice/TraceUtil.h +0 -30
- data/ext/ice/cpp/src/Ice/Transceiver.cpp +0 -18
- data/ext/ice/cpp/src/Ice/Transceiver.h +0 -49
- data/ext/ice/cpp/src/Ice/TransceiverF.h +0 -33
- data/ext/ice/cpp/src/Ice/UdpConnector.cpp +0 -131
- data/ext/ice/cpp/src/Ice/UdpConnector.h +0 -45
- data/ext/ice/cpp/src/Ice/UdpEndpointI.cpp +0 -515
- data/ext/ice/cpp/src/Ice/UdpEndpointI.h +0 -95
- data/ext/ice/cpp/src/Ice/UdpTransceiver.cpp +0 -806
- data/ext/ice/cpp/src/Ice/UdpTransceiver.h +0 -96
- data/ext/ice/cpp/src/Ice/Value.cpp +0 -76
- data/ext/ice/cpp/src/Ice/ValueFactory.cpp +0 -83
- data/ext/ice/cpp/src/Ice/ValueFactoryManagerI.cpp +0 -61
- data/ext/ice/cpp/src/Ice/ValueFactoryManagerI.h +0 -37
- data/ext/ice/cpp/src/Ice/Version.cpp +0 -57
- data/ext/ice/cpp/src/Ice/VirtualShared.h +0 -38
- data/ext/ice/cpp/src/Ice/WSAcceptor.cpp +0 -92
- data/ext/ice/cpp/src/Ice/WSAcceptor.h +0 -52
- data/ext/ice/cpp/src/Ice/WSConnector.cpp +0 -102
- data/ext/ice/cpp/src/Ice/WSConnector.h +0 -43
- data/ext/ice/cpp/src/Ice/WSEndpoint.cpp +0 -508
- data/ext/ice/cpp/src/Ice/WSEndpoint.h +0 -93
- data/ext/ice/cpp/src/Ice/WSTransceiver.cpp +0 -1704
- data/ext/ice/cpp/src/Ice/WSTransceiver.h +0 -141
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.cpp +0 -915
- data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.h +0 -1889
- data/ext/ice/cpp/src/IceDiscovery/LocatorI.cpp +0 -265
- data/ext/ice/cpp/src/IceDiscovery/LocatorI.h +0 -109
- data/ext/ice/cpp/src/IceDiscovery/LookupI.cpp +0 -608
- data/ext/ice/cpp/src/IceDiscovery/LookupI.h +0 -228
- data/ext/ice/cpp/src/IceDiscovery/PluginI.cpp +0 -176
- data/ext/ice/cpp/src/IceDiscovery/PluginI.h +0 -36
- data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.cpp +0 -730
- data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.h +0 -1197
- data/ext/ice/cpp/src/IceLocatorDiscovery/Plugin.h +0 -47
- data/ext/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +0 -1048
- data/ext/ice/cpp/src/IceSSL/AcceptorI.cpp +0 -105
- data/ext/ice/cpp/src/IceSSL/AcceptorI.h +0 -52
- data/ext/ice/cpp/src/IceSSL/CertificateI.cpp +0 -301
- data/ext/ice/cpp/src/IceSSL/CertificateI.h +0 -64
- data/ext/ice/cpp/src/IceSSL/ConnectionInfo.cpp +0 -75
- data/ext/ice/cpp/src/IceSSL/ConnectionInfoF.cpp +0 -61
- data/ext/ice/cpp/src/IceSSL/ConnectorI.cpp +0 -102
- data/ext/ice/cpp/src/IceSSL/ConnectorI.h +0 -44
- data/ext/ice/cpp/src/IceSSL/EndpointI.cpp +0 -372
- data/ext/ice/cpp/src/IceSSL/EndpointI.h +0 -100
- data/ext/ice/cpp/src/IceSSL/EndpointInfo.cpp +0 -75
- data/ext/ice/cpp/src/IceSSL/Instance.cpp +0 -28
- data/ext/ice/cpp/src/IceSSL/Instance.h +0 -37
- data/ext/ice/cpp/src/IceSSL/InstanceF.h +0 -33
- data/ext/ice/cpp/src/IceSSL/OpenSSLCertificateI.cpp +0 -688
- data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.cpp +0 -1147
- data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.h +0 -59
- data/ext/ice/cpp/src/IceSSL/OpenSSLEngineF.h +0 -27
- data/ext/ice/cpp/src/IceSSL/OpenSSLPluginI.cpp +0 -127
- data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +0 -1092
- data/ext/ice/cpp/src/IceSSL/OpenSSLTransceiverI.h +0 -90
- data/ext/ice/cpp/src/IceSSL/OpenSSLUtil.cpp +0 -288
- data/ext/ice/cpp/src/IceSSL/OpenSSLUtil.h +0 -58
- data/ext/ice/cpp/src/IceSSL/PluginI.cpp +0 -246
- data/ext/ice/cpp/src/IceSSL/PluginI.h +0 -67
- data/ext/ice/cpp/src/IceSSL/RFC2253.cpp +0 -490
- data/ext/ice/cpp/src/IceSSL/RFC2253.h +0 -62
- data/ext/ice/cpp/src/IceSSL/SChannelCertificateI.cpp +0 -721
- data/ext/ice/cpp/src/IceSSL/SChannelEngine.cpp +0 -1283
- data/ext/ice/cpp/src/IceSSL/SChannelEngine.h +0 -123
- data/ext/ice/cpp/src/IceSSL/SChannelEngineF.h +0 -31
- data/ext/ice/cpp/src/IceSSL/SChannelPluginI.cpp +0 -73
- data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.cpp +0 -1174
- data/ext/ice/cpp/src/IceSSL/SChannelTransceiverI.h +0 -133
- data/ext/ice/cpp/src/IceSSL/SSLEngine.cpp +0 -313
- data/ext/ice/cpp/src/IceSSL/SSLEngine.h +0 -100
- data/ext/ice/cpp/src/IceSSL/SSLEngineF.h +0 -21
- data/ext/ice/cpp/src/IceSSL/SecureTransportCertificateI.cpp +0 -999
- data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.cpp +0 -1308
- data/ext/ice/cpp/src/IceSSL/SecureTransportEngine.h +0 -59
- data/ext/ice/cpp/src/IceSSL/SecureTransportEngineF.h +0 -29
- data/ext/ice/cpp/src/IceSSL/SecureTransportPluginI.cpp +0 -75
- data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +0 -719
- data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.h +0 -92
- data/ext/ice/cpp/src/IceSSL/SecureTransportUtil.cpp +0 -868
- data/ext/ice/cpp/src/IceSSL/SecureTransportUtil.h +0 -45
- data/ext/ice/cpp/src/IceSSL/TrustManager.cpp +0 -236
- data/ext/ice/cpp/src/IceSSL/TrustManager.h +0 -46
- data/ext/ice/cpp/src/IceSSL/TrustManagerF.h +0 -21
- data/ext/ice/cpp/src/IceSSL/UWPCertificateI.cpp +0 -266
- data/ext/ice/cpp/src/IceSSL/UWPEngine.cpp +0 -338
- data/ext/ice/cpp/src/IceSSL/UWPEngine.h +0 -41
- data/ext/ice/cpp/src/IceSSL/UWPEngineF.h +0 -26
- data/ext/ice/cpp/src/IceSSL/UWPPluginI.cpp +0 -89
- data/ext/ice/cpp/src/IceSSL/UWPTransceiverI.cpp +0 -383
- data/ext/ice/cpp/src/IceSSL/UWPTransceiverI.h +0 -71
- data/ext/ice/cpp/src/IceSSL/Util.cpp +0 -192
- data/ext/ice/cpp/src/IceSSL/Util.h +0 -99
- data/ext/ice/cpp/src/IceUtil/ConsoleUtil.cpp +0 -157
- data/ext/ice/cpp/src/IceUtil/ConvertUTF.cpp +0 -472
- data/ext/ice/cpp/src/IceUtil/ConvertUTF.h +0 -147
- data/ext/ice/cpp/src/IceUtil/CtrlCHandler.cpp +0 -259
- data/ext/ice/cpp/src/IceUtil/FileUtil.cpp +0 -471
- data/ext/ice/cpp/src/IceUtil/InputUtil.cpp +0 -36
- data/ext/ice/cpp/src/IceUtil/MutexProtocol.cpp +0 -19
- data/ext/ice/cpp/src/IceUtil/Options.cpp +0 -1051
- data/ext/ice/cpp/src/IceUtil/OutputUtil.cpp +0 -609
- data/ext/ice/cpp/src/IceUtil/Random.cpp +0 -180
- data/ext/ice/cpp/src/IceUtil/RecMutex.cpp +0 -238
- data/ext/ice/cpp/src/IceUtil/Shared.cpp +0 -71
- data/ext/ice/cpp/src/IceUtil/StringConverter.cpp +0 -690
- data/ext/ice/cpp/src/IceUtil/StringUtil.cpp +0 -1135
- data/ext/ice/cpp/src/IceUtil/ThreadException.cpp +0 -130
- data/ext/ice/cpp/src/IceUtil/Time.cpp +0 -307
- data/ext/ice/cpp/src/IceUtil/UUID.cpp +0 -165
- data/ext/ice/cpp/src/IceUtil/Unicode.cpp +0 -183
- data/ext/ice/cpp/src/IceUtil/Unicode.h +0 -43
- data/ext/ice/cpp/src/IceUtil/UtilException.cpp +0 -839
- data/ext/ice/cpp/src/Slice/CPlusPlusUtil.cpp +0 -1810
- data/ext/ice/cpp/src/Slice/CPlusPlusUtil.h +0 -72
- data/ext/ice/cpp/src/Slice/Checksum.cpp +0 -447
- data/ext/ice/cpp/src/Slice/Checksum.h +0 -21
- data/ext/ice/cpp/src/Slice/FileTracker.cpp +0 -146
- data/ext/ice/cpp/src/Slice/FileTracker.h +0 -66
- data/ext/ice/cpp/src/Slice/Grammar.cpp +0 -4793
- data/ext/ice/cpp/src/Slice/Grammar.h +0 -118
- data/ext/ice/cpp/src/Slice/GrammarUtil.h +0 -228
- data/ext/ice/cpp/src/Slice/JavaUtil.cpp +0 -5176
- data/ext/ice/cpp/src/Slice/JavaUtil.h +0 -407
- data/ext/ice/cpp/src/Slice/MD5.cpp +0 -52
- data/ext/ice/cpp/src/Slice/MD5.h +0 -39
- data/ext/ice/cpp/src/Slice/MD5I.cpp +0 -393
- data/ext/ice/cpp/src/Slice/MD5I.h +0 -91
- data/ext/ice/cpp/src/Slice/PHPUtil.cpp +0 -157
- data/ext/ice/cpp/src/Slice/PHPUtil.h +0 -36
- data/ext/ice/cpp/src/Slice/Parser.cpp +0 -7058
- data/ext/ice/cpp/src/Slice/Parser.h +0 -1174
- data/ext/ice/cpp/src/Slice/Preprocessor.cpp +0 -797
- data/ext/ice/cpp/src/Slice/Preprocessor.h +0 -60
- data/ext/ice/cpp/src/Slice/Python.cpp +0 -830
- data/ext/ice/cpp/src/Slice/PythonUtil.cpp +0 -3439
- data/ext/ice/cpp/src/Slice/PythonUtil.h +0 -70
- data/ext/ice/cpp/src/Slice/Ruby.cpp +0 -350
- data/ext/ice/cpp/src/Slice/RubyUtil.cpp +0 -1571
- data/ext/ice/cpp/src/Slice/RubyUtil.h +0 -49
- data/ext/ice/cpp/src/Slice/Scanner.cpp +0 -2807
- data/ext/ice/cpp/src/Slice/SliceUtil.cpp +0 -424
- data/ext/ice/cpp/src/Slice/StringLiteralUtil.cpp +0 -456
- data/ext/ice/cpp/src/Slice/Util.h +0 -50
- data/ext/ice/mcpp/CMakeLists.txt +0 -80
- data/ext/ice/mcpp/LICENSE +0 -29
- data/ext/ice/mcpp/Makefile +0 -63
- data/ext/ice/mcpp/README.md +0 -32
- data/ext/ice/mcpp/internal.H +0 -530
- data/ext/ice/mcpp/mcpp.gyp +0 -88
- data/ext/ice/mcpp/system.c +0 -2737
- data/lib/Glacier2/Metrics.rb +0 -56
- data/lib/Glacier2/PermissionsVerifier.rb +0 -93
- data/lib/Glacier2/PermissionsVerifierF.rb +0 -30
- data/lib/Glacier2/Router.rb +0 -95
- data/lib/Glacier2/RouterF.rb +0 -25
- data/lib/Glacier2/SSLInfo.rb +0 -72
- data/lib/Glacier2/Session.rb +0 -247
- data/lib/Glacier2.rb +0 -7
- data/lib/Ice/BuiltinSequences.rb +0 -60
- data/lib/Ice/Communicator.rb +0 -87
- data/lib/Ice/CommunicatorF.rb +0 -24
- data/lib/Ice/Connection.rb +0 -413
- data/lib/Ice/ConnectionF.rb +0 -32
- data/lib/Ice/Current.rb +0 -141
- data/lib/Ice/Endpoint.rb +0 -187
- data/lib/Ice/EndpointF.rb +0 -48
- data/lib/Ice/EndpointTypes.rb +0 -69
- data/lib/Ice/FacetMap.rb +0 -24
- data/lib/Ice/Identity.rb +0 -63
- data/lib/Ice/ImplicitContext.rb +0 -26
- data/lib/Ice/ImplicitContextF.rb +0 -24
- data/lib/Ice/Instrumentation.rb +0 -169
- data/lib/Ice/InstrumentationF.rb +0 -31
- data/lib/Ice/LocalException.rb +0 -1031
- data/lib/Ice/Locator.rb +0 -196
- data/lib/Ice/LocatorF.rb +0 -30
- data/lib/Ice/Logger.rb +0 -24
- data/lib/Ice/LoggerF.rb +0 -24
- data/lib/Ice/Metrics.rb +0 -337
- data/lib/Ice/ObjectAdapter.rb +0 -29
- data/lib/Ice/ObjectAdapterF.rb +0 -24
- data/lib/Ice/ObjectFactory.rb +0 -24
- data/lib/Ice/Plugin.rb +0 -30
- data/lib/Ice/PluginF.rb +0 -28
- data/lib/Ice/Process.rb +0 -53
- data/lib/Ice/ProcessF.rb +0 -25
- data/lib/Ice/Properties.rb +0 -25
- data/lib/Ice/PropertiesAdmin.rb +0 -63
- data/lib/Ice/PropertiesF.rb +0 -29
- data/lib/Ice/RemoteLogger.rb +0 -207
- data/lib/Ice/Router.rb +0 -87
- data/lib/Ice/RouterF.rb +0 -25
- data/lib/Ice/ServantLocator.rb +0 -26
- data/lib/Ice/ServantLocatorF.rb +0 -24
- data/lib/Ice/SliceChecksumDict.rb +0 -24
- data/lib/Ice/ValueFactory.rb +0 -28
- data/lib/Ice/Version.rb +0 -90
- data/lib/Ice.rb +0 -673
- data/lib/IceBox/IceBox.rb +0 -164
- data/lib/IceBox.rb +0 -5
- data/lib/IceGrid/Admin.rb +0 -1196
- data/lib/IceGrid/Descriptor.rb +0 -1034
- data/lib/IceGrid/Exception.rb +0 -376
- data/lib/IceGrid/FileParser.rb +0 -65
- data/lib/IceGrid/PluginFacade.rb +0 -35
- data/lib/IceGrid/Registry.rb +0 -209
- data/lib/IceGrid/Session.rb +0 -71
- data/lib/IceGrid/UserAccountMapper.rb +0 -61
- data/lib/IceGrid.rb +0 -9
- data/lib/IcePatch2/FileInfo.rb +0 -115
- data/lib/IcePatch2/FileServer.rb +0 -123
- data/lib/IcePatch2.rb +0 -5
- data/lib/IceStorm/IceStorm.rb +0 -332
- data/lib/IceStorm/Metrics.rb +0 -73
- data/lib/IceStorm.rb +0 -6
- data/slice/Glacier2/Metrics.ice +0 -88
- data/slice/Glacier2/PermissionsVerifier.ice +0 -111
- data/slice/Glacier2/PermissionsVerifierF.ice +0 -30
- data/slice/Glacier2/Router.ice +0 -186
- data/slice/Glacier2/RouterF.ice +0 -29
- data/slice/Glacier2/SSLInfo.ice +0 -59
- data/slice/Glacier2/Session.ice +0 -274
- data/slice/Ice/BuiltinSequences.ice +0 -59
- data/slice/Ice/Communicator.ice +0 -676
- data/slice/Ice/CommunicatorF.ice +0 -31
- data/slice/Ice/Connection.ice +0 -516
- data/slice/Ice/ConnectionF.ice +0 -33
- data/slice/Ice/Current.ice +0 -170
- data/slice/Ice/Endpoint.ice +0 -291
- data/slice/Ice/EndpointF.ice +0 -43
- data/slice/Ice/EndpointTypes.ice +0 -48
- data/slice/Ice/FacetMap.ice +0 -36
- data/slice/Ice/Identity.ice +0 -75
- data/slice/Ice/ImplicitContext.ice +0 -119
- data/slice/Ice/ImplicitContextF.ice +0 -30
- data/slice/Ice/Instrumentation.ice +0 -509
- data/slice/Ice/InstrumentationF.ice +0 -38
- data/slice/Ice/LocalException.ice +0 -1040
- data/slice/Ice/Locator.ice +0 -239
- data/slice/Ice/LocatorF.ice +0 -32
- data/slice/Ice/Logger.ice +0 -99
- data/slice/Ice/LoggerF.ice +0 -31
- data/slice/Ice/Metrics.ice +0 -436
- data/slice/Ice/ObjectAdapter.ice +0 -710
- data/slice/Ice/ObjectAdapterF.ice +0 -31
- data/slice/Ice/ObjectFactory.ice +0 -71
- data/slice/Ice/Plugin.ice +0 -131
- data/slice/Ice/PluginF.ice +0 -36
- data/slice/Ice/Process.ice +0 -64
- data/slice/Ice/ProcessF.ice +0 -31
- data/slice/Ice/Properties.ice +0 -244
- data/slice/Ice/PropertiesAdmin.ice +0 -87
- data/slice/Ice/PropertiesF.ice +0 -32
- data/slice/Ice/RemoteLogger.ice +0 -226
- data/slice/Ice/Router.ice +0 -103
- data/slice/Ice/RouterF.ice +0 -31
- data/slice/Ice/ServantLocator.ice +0 -136
- data/slice/Ice/ServantLocatorF.ice +0 -31
- data/slice/Ice/SliceChecksumDict.ice +0 -36
- data/slice/Ice/ValueFactory.ice +0 -133
- data/slice/Ice/Version.ice +0 -51
- data/slice/IceBT/ConnectionInfo.ice +0 -59
- data/slice/IceBT/EndpointInfo.ice +0 -57
- data/slice/IceBT/Types.ice +0 -45
- data/slice/IceBox/IceBox.ice +0 -216
- data/slice/IceDiscovery/IceDiscovery.ice +0 -98
- data/slice/IceGrid/Admin.ice +0 -1957
- data/slice/IceGrid/Descriptor.ice +0 -1094
- data/slice/IceGrid/Exception.ice +0 -396
- data/slice/IceGrid/FileParser.ice +0 -72
- data/slice/IceGrid/PluginFacade.ice +0 -329
- data/slice/IceGrid/Registry.ice +0 -269
- data/slice/IceGrid/Session.ice +0 -128
- data/slice/IceGrid/UserAccountMapper.ice +0 -69
- data/slice/IceIAP/ConnectionInfo.ice +0 -74
- data/slice/IceIAP/EndpointInfo.ice +0 -68
- data/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice +0 -83
- data/slice/IcePatch2/FileInfo.ice +0 -85
- data/slice/IcePatch2/FileServer.ice +0 -191
- data/slice/IceSSL/ConnectionInfo.ice +0 -54
- data/slice/IceSSL/ConnectionInfoF.ice +0 -31
- data/slice/IceSSL/EndpointInfo.ice +0 -45
- data/slice/IceStorm/IceStorm.ice +0 -414
- data/slice/IceStorm/Metrics.ice +0 -83
- /data/{ext → dist}/ice/mcpp/config.h +0 -0
- /data/{ext → dist}/ice/mcpp/configed.H +0 -0
- /data/{ext → dist}/ice/mcpp/directive.c +0 -0
- /data/{ext → dist}/ice/mcpp/eval.c +0 -0
- /data/{ext → dist}/ice/mcpp/expand.c +0 -0
- /data/{ext → dist}/ice/mcpp/mbchar.c +0 -0
- /data/{ext → dist}/ice/mcpp/mcpp_lib.h +0 -0
- /data/{ext/ice/mcpp/main.c → dist/ice/mcpp/mcpp_main.c} +0 -0
- /data/{ext → dist}/ice/mcpp/mcpp_out.h +0 -0
- /data/{ext → dist}/ice/mcpp/support.c +0 -0
- /data/{ext → dist}/ice/mcpp/system.H +0 -0
|
@@ -0,0 +1,2741 @@
|
|
|
1
|
+
/*-
|
|
2
|
+
* Copyright (c) 1998, 2002-2008 Kiyoshi Matsui <kmatsui@t3.rim.or.jp>
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Some parts of this code are derived from the public domain software
|
|
6
|
+
* DECUS cpp (1984,1985) written by Martin Minow.
|
|
7
|
+
*
|
|
8
|
+
* Redistribution and use in source and binary forms, with or without
|
|
9
|
+
* modification, are permitted provided that the following conditions
|
|
10
|
+
* are met:
|
|
11
|
+
* 1. Redistributions of source code must retain the above copyright
|
|
12
|
+
* notice, this list of conditions and the following disclaimer.
|
|
13
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
|
14
|
+
* notice, this list of conditions and the following disclaimer in the
|
|
15
|
+
* documentation and/or other materials provided with the distribution.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
|
|
18
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
20
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
|
|
21
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
23
|
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
24
|
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
25
|
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
26
|
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
27
|
+
* SUCH DAMAGE.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/*
|
|
31
|
+
* S Y S T E M . C
|
|
32
|
+
* S y s t e m D e p e n d e n t R o u t i n e s
|
|
33
|
+
*
|
|
34
|
+
* Routines dependent on O.S., compiler or compiler-driver.
|
|
35
|
+
* To port MCPP for the systems not yet ported, you must
|
|
36
|
+
* 1. specify the constants in "configed.H" or "noconfig.H",
|
|
37
|
+
* 2. append the system-dependent routines in this file.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
#ifndef _MSC_VER
|
|
41
|
+
# include <unistd.h> // For readlink()
|
|
42
|
+
#endif
|
|
43
|
+
|
|
44
|
+
#include "system.H"
|
|
45
|
+
#include "internal.H"
|
|
46
|
+
|
|
47
|
+
#if HOST_SYS_FAMILY == SYS_UNIX
|
|
48
|
+
#include "unistd.h" /* For getcwd(), readlink() */
|
|
49
|
+
#elif HOST_COMPILER == MSC || HOST_COMPILER == LCC
|
|
50
|
+
#include "direct.h"
|
|
51
|
+
#define getcwd( buf, size) _getcwd( buf, size)
|
|
52
|
+
#elif HOST_COMPILER == BORLANDC
|
|
53
|
+
#include "dir.h"
|
|
54
|
+
#endif
|
|
55
|
+
|
|
56
|
+
#include "sys/types.h"
|
|
57
|
+
#include "sys/stat.h" /* For stat() */
|
|
58
|
+
#if ! defined( S_ISREG)
|
|
59
|
+
#define S_ISREG( mode) (mode & S_IFREG)
|
|
60
|
+
#define S_ISDIR( mode) (mode & S_IFDIR)
|
|
61
|
+
#endif
|
|
62
|
+
#if HOST_COMPILER == MSC
|
|
63
|
+
#define S_IFREG _S_IFREG
|
|
64
|
+
#define S_IFDIR _S_IFDIR
|
|
65
|
+
#define stat( path, stbuf) _stat( path, stbuf)
|
|
66
|
+
#endif
|
|
67
|
+
|
|
68
|
+
/* Function to compare path-list */
|
|
69
|
+
#if FNAME_FOLD
|
|
70
|
+
#if HOST_COMPILER == GNUC /* CYGWIN, MINGW, MAC */
|
|
71
|
+
#include <strings.h> /* POSIX 1, 2001 */
|
|
72
|
+
#define str_case_eq( str1, str2) (strcasecmp( str1, str2) == 0)
|
|
73
|
+
#else /* MSC, BORLANDC, LCC */
|
|
74
|
+
#if HOST_COMPILER == MSC
|
|
75
|
+
#define stricmp( str1, str2) _stricmp( str1, str2)
|
|
76
|
+
#endif
|
|
77
|
+
#define str_case_eq( str1, str2) (stricmp( str1, str2) == 0)
|
|
78
|
+
#endif
|
|
79
|
+
#else /* ! FNAME_FOLD */
|
|
80
|
+
#define str_case_eq( str1, str2) (strcmp( str1, str2) == 0)
|
|
81
|
+
#endif
|
|
82
|
+
|
|
83
|
+
/*
|
|
84
|
+
* PATH_DELIM is defined for the O.S. which has single byte path-delimiter.
|
|
85
|
+
* Note: '\\' or any other character identical to second byte of MBCHAR should
|
|
86
|
+
* not be used for PATH_DELIM for convenience of path-list parsing.
|
|
87
|
+
*/
|
|
88
|
+
#if SYS_FAMILY == SYS_UNIX || SYS_FAMILY == SYS_WIN || SYSTEM == SYS_UNKNOWN
|
|
89
|
+
#define PATH_DELIM '/'
|
|
90
|
+
#define SPECIAL_PATH_DELIM FALSE
|
|
91
|
+
#else /* Any other path-delimiter, define PATH_DELIM by yourself */
|
|
92
|
+
#define SPECIAL_PATH_DELIM TRUE /* Any path-delimiter other than '/' */
|
|
93
|
+
#endif
|
|
94
|
+
|
|
95
|
+
/*
|
|
96
|
+
* OBJEXT is the suffix to denote "object" file.
|
|
97
|
+
*/
|
|
98
|
+
#ifndef OBJEXT
|
|
99
|
+
#if SYS_FAMILY == SYS_UNIX || HOST_COMPILER == GNUC
|
|
100
|
+
#define OBJEXT "o"
|
|
101
|
+
#elif SYS_FAMILY == SYS_WIN
|
|
102
|
+
#define OBJEXT "obj"
|
|
103
|
+
#elif 1
|
|
104
|
+
/* Add here appropriate definitions for other systems. */
|
|
105
|
+
#endif
|
|
106
|
+
#endif
|
|
107
|
+
|
|
108
|
+
static void version( void);
|
|
109
|
+
/* Print version message */
|
|
110
|
+
static void usage( int opt);
|
|
111
|
+
/* Putout usage of MCPP */
|
|
112
|
+
static void set_opt_list( char * optlist);
|
|
113
|
+
/* Set list of legal option chars */
|
|
114
|
+
static void def_a_macro( int opt, char * def);
|
|
115
|
+
/* Do a -D option */
|
|
116
|
+
static void chk_opts( int sflag, int trad);
|
|
117
|
+
/* Check consistency of options */
|
|
118
|
+
static void init_predefines( void);
|
|
119
|
+
/* Set and unset predefined macros */
|
|
120
|
+
static void init_std_defines( void);
|
|
121
|
+
/* Predefine Standard macros */
|
|
122
|
+
static void set_limit( void);
|
|
123
|
+
/* Set minimum translation limits */
|
|
124
|
+
|
|
125
|
+
static void put_info( FILEINFO * sharp_file);
|
|
126
|
+
/* Print compiler-specific-inf */
|
|
127
|
+
static char * set_files( int argc, char ** argv, char ** in_pp
|
|
128
|
+
, char ** out_pp);
|
|
129
|
+
/* Set input, output, diagnostic */
|
|
130
|
+
static void set_sys_dirs( int set_cplus_dir);
|
|
131
|
+
/* Set system-specific include dirs */
|
|
132
|
+
static void set_env_dirs( void);
|
|
133
|
+
/* Set user-defined include dirs */
|
|
134
|
+
static void parse_env( const char * env);
|
|
135
|
+
/* Parse environment variables */
|
|
136
|
+
static void set_a_dir( const char * dirname);
|
|
137
|
+
/* Append an include directory */
|
|
138
|
+
static char * norm_dir( const char * dirname, int framework);
|
|
139
|
+
/* Normalize include directory path */
|
|
140
|
+
static char * norm_path( const char * dir, const char * fname, int inf
|
|
141
|
+
, int hmap); /* Normalize pathname to compare */
|
|
142
|
+
#if SYS_FAMILY == SYS_UNIX
|
|
143
|
+
static void deref_syml( char * slbuf1, char * slbuf2, char * chk_start);
|
|
144
|
+
/* Dereference symbolic linked directory and file */
|
|
145
|
+
#endif
|
|
146
|
+
static void def_macros( void);
|
|
147
|
+
/* Define macros specified by -D */
|
|
148
|
+
static void undef_macros( void);
|
|
149
|
+
/* Undefine macros specified by -U */
|
|
150
|
+
static char * md_init( const char * filename, char * output);
|
|
151
|
+
/* Initialize makefile dependency */
|
|
152
|
+
static char * md_quote( char * output);
|
|
153
|
+
/* 'Quote' special characters */
|
|
154
|
+
static int open_include( char * filename, int searchlocal, int next);
|
|
155
|
+
/* Open the file to include */
|
|
156
|
+
static int has_directory( const char * source, char * directory);
|
|
157
|
+
/* Get directory part of fname */
|
|
158
|
+
static int is_full_path( const char * path);
|
|
159
|
+
/* The path is absolute path list ? */
|
|
160
|
+
static int search_dir( char * filename, int searchlocal, int next);
|
|
161
|
+
/* Search the include directories */
|
|
162
|
+
static int open_file( const char ** dirp, const char * src_dir
|
|
163
|
+
, const char * filename, int local, int include_opt, int sys_frame);
|
|
164
|
+
/* Open a source file */
|
|
165
|
+
static const char * set_fname( const char * filename);
|
|
166
|
+
/* Remember the source filename */
|
|
167
|
+
#if 0 /* This function is only for debugging use */
|
|
168
|
+
static int chk_dirp( const char ** dirp);
|
|
169
|
+
/* Check validity of dirp arg for open_file() */
|
|
170
|
+
#endif
|
|
171
|
+
static void cur_file( FILEINFO * file, FILEINFO * sharp_file, int marker);
|
|
172
|
+
/* Output current source file name */
|
|
173
|
+
#if SYS_FAMILY == SYS_WIN
|
|
174
|
+
static char * bsl2sl( char * filename);
|
|
175
|
+
/* Convert \ to / in path-list */
|
|
176
|
+
#endif
|
|
177
|
+
static int is_junk( void);
|
|
178
|
+
/* The directive has trailing junk? */
|
|
179
|
+
static void do_once( const char * fullname);
|
|
180
|
+
/* Process #pragma once */
|
|
181
|
+
static int included( const char * fullname);
|
|
182
|
+
/* The file has been once included? */
|
|
183
|
+
static void push_or_pop( int direction);
|
|
184
|
+
/* Push or pop a macro definition */
|
|
185
|
+
static void do_preprocessed( void);
|
|
186
|
+
/* Process preprocessed file */
|
|
187
|
+
static int do_debug( int set);
|
|
188
|
+
/* #pragma MCPP debug, #debug */
|
|
189
|
+
static void dump_path( void);
|
|
190
|
+
/* Print include search path */
|
|
191
|
+
static int mcpp_getopt( int argc, char * const * argv, const char * opts);
|
|
192
|
+
/* getopt() to prevent linking of glibc getopt */
|
|
193
|
+
|
|
194
|
+
/* for mcpp_getopt() */
|
|
195
|
+
static int mcpp_optind = 1;
|
|
196
|
+
static int mcpp_opterr = 1;
|
|
197
|
+
static int mcpp_optopt;
|
|
198
|
+
static char * mcpp_optarg;
|
|
199
|
+
|
|
200
|
+
static int mb_changed = FALSE; /* Flag of -e option */
|
|
201
|
+
static char cur_work_dir[ PATHMAX + 1]; /* Current working directory*/
|
|
202
|
+
|
|
203
|
+
/*
|
|
204
|
+
* incdir[] stores the -I directories (and the system-specific #include <...>
|
|
205
|
+
* directories). This is set by set_a_dir(). A trailing PATH_DELIM is
|
|
206
|
+
* appended if absent.
|
|
207
|
+
*/
|
|
208
|
+
static const char ** incdir; /* Include directories */
|
|
209
|
+
static const char ** incend; /* -> active end of incdir */
|
|
210
|
+
static int max_inc; /* Number of incdir[] */
|
|
211
|
+
|
|
212
|
+
typedef struct inc_list { /* List of directories or files */
|
|
213
|
+
char *name; /* Filename or directory-name */
|
|
214
|
+
size_t len; /* Length of 'name' */
|
|
215
|
+
} INC_LIST;
|
|
216
|
+
|
|
217
|
+
/*
|
|
218
|
+
* fnamelist[] stores the souce file names opened by #include directive for
|
|
219
|
+
* debugging information.
|
|
220
|
+
*/
|
|
221
|
+
static INC_LIST * fnamelist; /* Source file names */
|
|
222
|
+
static INC_LIST * fname_end; /* -> active end of fnamelist */
|
|
223
|
+
static int max_fnamelist; /* Number of fnamelist[] */
|
|
224
|
+
|
|
225
|
+
/* once_list[] stores the #pragma once file names. */
|
|
226
|
+
static INC_LIST * once_list; /* Once opened file */
|
|
227
|
+
static INC_LIST * once_end; /* -> active end of once_list */
|
|
228
|
+
static int max_once; /* Number of once_list[] */
|
|
229
|
+
|
|
230
|
+
#define INIT_NUM_INCLUDE 32 /* Initial number of incdir[] */
|
|
231
|
+
#define INIT_NUM_FNAMELIST 256 /* Initial number of fnamelist[] */
|
|
232
|
+
#define INIT_NUM_ONCE 64 /* Initial number of once_list[] */
|
|
233
|
+
|
|
234
|
+
/*
|
|
235
|
+
* 'search_rule' holds searching rule of #include "header.h" to search first
|
|
236
|
+
* before searching user specified or system-specific include directories.
|
|
237
|
+
* 'search_rule' is initialized to SEARCH_INIT. It can be changed by -I1, -I2
|
|
238
|
+
* or -I3 option. -I1 specifies CURRENT, -I2 SOURCE and -I3 both.
|
|
239
|
+
*/
|
|
240
|
+
|
|
241
|
+
static int search_rule = SEARCH_INIT; /* Rule to search include file */
|
|
242
|
+
|
|
243
|
+
static int nflag = FALSE; /* Flag of -N (-undef) option */
|
|
244
|
+
static long std_val = -1L; /* Value of __STDC_VERSION__ or __cplusplus */
|
|
245
|
+
|
|
246
|
+
#define MAX_DEF 256
|
|
247
|
+
#define MAX_UNDEF (MAX_DEF/4)
|
|
248
|
+
static char * def_list[ MAX_DEF]; /* Macros to be defined */
|
|
249
|
+
static char * undef_list[ MAX_UNDEF]; /* Macros to be undefined */
|
|
250
|
+
static int def_cnt; /* Count of def_list */
|
|
251
|
+
static int undef_cnt; /* Count of undef_list */
|
|
252
|
+
|
|
253
|
+
/* Values of mkdep. */
|
|
254
|
+
#define MD_MKDEP 1 /* Output source file dependency line */
|
|
255
|
+
#define MD_SYSHEADER 2 /* Print also system-header names */
|
|
256
|
+
#define MD_FILE 4 /* Output to the file named *.d */
|
|
257
|
+
#define MD_PHONY 8 /* Print also phony targets for each header */
|
|
258
|
+
#define MD_QUOTE 16 /* 'Quote' $ and space in target name */
|
|
259
|
+
|
|
260
|
+
static FILE * mkdep_fp; /* For -Mx option */
|
|
261
|
+
static char * mkdep_target;
|
|
262
|
+
/* For -MT TARGET option and for GCC's queer environment variables. */
|
|
263
|
+
static char * mkdep_mf; /* Argument of -MF option */
|
|
264
|
+
static char * mkdep_md; /* Argument of -MD option */
|
|
265
|
+
static char * mkdep_mq; /* Argument of -MQ option */
|
|
266
|
+
static char * mkdep_mt; /* Argument of -MT option */
|
|
267
|
+
|
|
268
|
+
/* sharp_filename is filename for #line line, used only in cur_file() */
|
|
269
|
+
static char * sharp_filename = NULL;
|
|
270
|
+
static char * argv0; /* argv[ 0] for usage() and version() */
|
|
271
|
+
static int compat_mode;
|
|
272
|
+
/* "Compatible" mode of recursive macro expansion */
|
|
273
|
+
|
|
274
|
+
#if SYSTEM == SYS_CYGWIN
|
|
275
|
+
static int no_cygwin = FALSE; /* -mno-cygwin */
|
|
276
|
+
|
|
277
|
+
#endif
|
|
278
|
+
|
|
279
|
+
#define NO_DIR FALSE
|
|
280
|
+
#if NO_DIR
|
|
281
|
+
/* Unofficial feature to strip directory part of include file */
|
|
282
|
+
static int no_dir;
|
|
283
|
+
#endif
|
|
284
|
+
|
|
285
|
+
void init_system( void)
|
|
286
|
+
/* Initialize static variables */
|
|
287
|
+
{
|
|
288
|
+
if (sharp_filename)
|
|
289
|
+
free( sharp_filename);
|
|
290
|
+
sharp_filename = NULL;
|
|
291
|
+
incend = incdir = NULL;
|
|
292
|
+
fnamelist = once_list = NULL;
|
|
293
|
+
search_rule = SEARCH_INIT;
|
|
294
|
+
mb_changed = nflag = compat_mode = FALSE;
|
|
295
|
+
mkdep_fp = NULL;
|
|
296
|
+
mkdep_target = mkdep_mf = mkdep_md = mkdep_mq = mkdep_mt = NULL;
|
|
297
|
+
std_val = -1L;
|
|
298
|
+
def_cnt = undef_cnt = 0;
|
|
299
|
+
mcpp_optind = mcpp_opterr = 1;
|
|
300
|
+
#if SYSTEM == SYS_CYGWIN
|
|
301
|
+
no_cygwin = FALSE;
|
|
302
|
+
#endif
|
|
303
|
+
#if NO_DIR
|
|
304
|
+
no_dir = FALSE;
|
|
305
|
+
#endif
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
#define OPTLISTLEN 80
|
|
310
|
+
|
|
311
|
+
void do_options(
|
|
312
|
+
int argc,
|
|
313
|
+
char ** argv,
|
|
314
|
+
char ** in_pp, /* Input file name */
|
|
315
|
+
char ** out_pp /* Output file name */
|
|
316
|
+
)
|
|
317
|
+
/*
|
|
318
|
+
* Process command line arguments, called only at MCPP startup.
|
|
319
|
+
*/
|
|
320
|
+
{
|
|
321
|
+
char optlist[ OPTLISTLEN]; /* List of option letter*/
|
|
322
|
+
int opt;
|
|
323
|
+
int unset_sys_dirs;
|
|
324
|
+
/* Unset system-specific and site-specific include directories ? */
|
|
325
|
+
int set_cplus_dir; /* Set C++ include directory ? (for GCC)*/
|
|
326
|
+
int show_path; /* Show include directory list */
|
|
327
|
+
int sflag; /* -S option or similar */
|
|
328
|
+
int trad; /* -traditional */
|
|
329
|
+
int i;
|
|
330
|
+
|
|
331
|
+
argv0 = argv[ 0];
|
|
332
|
+
nflag = unset_sys_dirs = show_path = sflag = trad = FALSE;
|
|
333
|
+
set_cplus_dir = TRUE;
|
|
334
|
+
|
|
335
|
+
/* Get current directory for -I option and #pragma once */
|
|
336
|
+
getcwd( cur_work_dir, PATHMAX);
|
|
337
|
+
#if SYS_FAMILY == SYS_WIN
|
|
338
|
+
bsl2sl( cur_work_dir);
|
|
339
|
+
#endif
|
|
340
|
+
sprintf( cur_work_dir + strlen( cur_work_dir), "%c%c", PATH_DELIM, EOS);
|
|
341
|
+
/* Append trailing path-delimiter */
|
|
342
|
+
|
|
343
|
+
set_opt_list( optlist);
|
|
344
|
+
|
|
345
|
+
opt_search: ;
|
|
346
|
+
while (mcpp_optind < argc
|
|
347
|
+
&& (opt = mcpp_getopt( argc, argv, optlist)) != EOF) {
|
|
348
|
+
|
|
349
|
+
switch (opt) { /* Command line option character */
|
|
350
|
+
|
|
351
|
+
case 'C': /* Keep comments */
|
|
352
|
+
option_flags.c = TRUE;
|
|
353
|
+
break;
|
|
354
|
+
|
|
355
|
+
case 'D': /* Define symbol */
|
|
356
|
+
if (def_cnt >= MAX_DEF) {
|
|
357
|
+
mcpp_fputs( "Too many -D options.\n", ERR);
|
|
358
|
+
longjmp( error_exit, -1);
|
|
359
|
+
}
|
|
360
|
+
def_list[ def_cnt++] = mcpp_optarg;
|
|
361
|
+
break;
|
|
362
|
+
|
|
363
|
+
case 'e':
|
|
364
|
+
// We support this option, but it does nothing.
|
|
365
|
+
break;
|
|
366
|
+
|
|
367
|
+
case 'I': /* Include directory */
|
|
368
|
+
if (str_eq( mcpp_optarg, "-")) { /* -I- */
|
|
369
|
+
unset_sys_dirs = TRUE;
|
|
370
|
+
/* Unset pre-specified include directories */
|
|
371
|
+
} else if (*(mcpp_optarg + 1) == EOS && isdigit( *mcpp_optarg)
|
|
372
|
+
&& (i = *mcpp_optarg - '0') != 0
|
|
373
|
+
&& (i & ~(CURRENT | SOURCE)) == 0) {
|
|
374
|
+
search_rule = i; /* -I1, -I2 or -I3 */
|
|
375
|
+
} else { /* Not '-' nor a digit */
|
|
376
|
+
set_a_dir( mcpp_optarg); /* User-defined dir */
|
|
377
|
+
}
|
|
378
|
+
break;
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
case 'M': /* Output source file dependency line */
|
|
382
|
+
if (argv[ mcpp_optind - 1] == mcpp_optarg) { /* -M */
|
|
383
|
+
mkdep |= MD_SYSHEADER;
|
|
384
|
+
mcpp_optind--;
|
|
385
|
+
} else {
|
|
386
|
+
usage( opt);
|
|
387
|
+
}
|
|
388
|
+
mkdep |= MD_MKDEP;
|
|
389
|
+
break;
|
|
390
|
+
|
|
391
|
+
case 'U': /* Undefine macro */
|
|
392
|
+
if (undef_cnt >= MAX_UNDEF) {
|
|
393
|
+
mcpp_fputs( "Too many -U options.\n", ERR);
|
|
394
|
+
longjmp( error_exit, -1);
|
|
395
|
+
}
|
|
396
|
+
undef_list[ undef_cnt++] = mcpp_optarg;
|
|
397
|
+
break;
|
|
398
|
+
|
|
399
|
+
default: /* What is this one? */
|
|
400
|
+
usage( opt);
|
|
401
|
+
break;
|
|
402
|
+
} /* Switch on all options */
|
|
403
|
+
|
|
404
|
+
} /* For all arguments */
|
|
405
|
+
|
|
406
|
+
if (mcpp_optind < argc && set_files( argc, argv, in_pp, out_pp) != NULL)
|
|
407
|
+
goto opt_search; /* More options after the filename */
|
|
408
|
+
|
|
409
|
+
/* Check consistency of specified options, set some variables */
|
|
410
|
+
chk_opts( sflag, trad);
|
|
411
|
+
|
|
412
|
+
if (warn_level == -1) /* No -W option */
|
|
413
|
+
warn_level = 1; /* Default warning level */
|
|
414
|
+
else if (warn_level == 0xFF)
|
|
415
|
+
warn_level = 0; /* -W0 has high precedence */
|
|
416
|
+
|
|
417
|
+
set_env_dirs();
|
|
418
|
+
if (! unset_sys_dirs)
|
|
419
|
+
set_sys_dirs( set_cplus_dir);
|
|
420
|
+
|
|
421
|
+
if (mkdep_mf) { /* -MF overrides -MD */
|
|
422
|
+
mkdep_fp = mcpp_fopen( mkdep_mf, "w");
|
|
423
|
+
} else if (mkdep_md) {
|
|
424
|
+
mkdep_fp = mcpp_fopen( mkdep_md, "w");
|
|
425
|
+
}
|
|
426
|
+
if (mkdep_mq) /* -MQ overrides -MT */
|
|
427
|
+
mkdep_target = mkdep_mq;
|
|
428
|
+
else if (mkdep_mt)
|
|
429
|
+
mkdep_target = mkdep_mt;
|
|
430
|
+
|
|
431
|
+
/* Normalize the path-list */
|
|
432
|
+
if (*in_pp && ! str_eq( *in_pp, "-")) {
|
|
433
|
+
char * tmp = norm_path( null, *in_pp, FALSE, FALSE);
|
|
434
|
+
if (tmp) /* The file exists */
|
|
435
|
+
*in_pp = tmp;
|
|
436
|
+
/* Else mcpp_main() will diagnose *in_pp and exit */
|
|
437
|
+
}
|
|
438
|
+
if (! (mcpp_debug & MACRO_CALL)) {
|
|
439
|
+
if (show_path) {
|
|
440
|
+
fp_debug = stderr;
|
|
441
|
+
dump_path();
|
|
442
|
+
fp_debug = stdout;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
static void version( void)
|
|
448
|
+
/*
|
|
449
|
+
* Print version message.
|
|
450
|
+
*/
|
|
451
|
+
{
|
|
452
|
+
const char * mes[] = {
|
|
453
|
+
/* Write messages here, for example, "MySomeTool with ". */
|
|
454
|
+
"MCPP V.2.7.2 (2008/11)"
|
|
455
|
+
, "https://github.com/zeroc-ice/mcpp"
|
|
456
|
+
, "compiler-independent-build "
|
|
457
|
+
, NULL
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
const char ** mpp = mes;
|
|
461
|
+
while (*mpp)
|
|
462
|
+
mcpp_fputs( *mpp++, ERR);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
static void usage(
|
|
466
|
+
int opt
|
|
467
|
+
)
|
|
468
|
+
/*
|
|
469
|
+
* Print usage.
|
|
470
|
+
*/
|
|
471
|
+
{
|
|
472
|
+
const char * mes[] = {
|
|
473
|
+
|
|
474
|
+
"Usage: ",
|
|
475
|
+
"mcpp",
|
|
476
|
+
" [-<opts> [-<opts>]] [<infile> [-<opts>] [<outfile>] [-<opts>]]\n",
|
|
477
|
+
" <infile> defaults to stdin and <outfile> defaults to stdout.\n",
|
|
478
|
+
|
|
479
|
+
"\nCommonly used options:\n",
|
|
480
|
+
|
|
481
|
+
"-C Output also comments.\n",
|
|
482
|
+
"-D <macro>[=<value>] Define <macro> as <value> (default:1).\n",
|
|
483
|
+
"-D <macro(args)>[=<replace>] Define <macro(args)> as <replace>.\n",
|
|
484
|
+
"-e <encoding> Change the default multi-byte character encoding to one of:\n",
|
|
485
|
+
" euc_jp, gb2312, ksc5601, big5, sjis, iso2022_jp, utf8.\n",
|
|
486
|
+
|
|
487
|
+
"-I <directory> Add <directory> to the #include search list.\n",
|
|
488
|
+
|
|
489
|
+
"-I- Unset system or site specific include directories.\n",
|
|
490
|
+
|
|
491
|
+
"-M file\n",
|
|
492
|
+
" Output source file dependency line for makefile.\n",
|
|
493
|
+
"-U <macro> Undefine <macro>.\n",
|
|
494
|
+
|
|
495
|
+
"\nFor further details see mcpp-manual.html.\n",
|
|
496
|
+
NULL,
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
const char * illegopt = "Incorrect option -%c%s\n";
|
|
500
|
+
const char * const * mpp = mes;
|
|
501
|
+
|
|
502
|
+
if (opt != '?')
|
|
503
|
+
mcpp_fprintf( ERR, illegopt, opt, mcpp_optarg ? mcpp_optarg : null);
|
|
504
|
+
version();
|
|
505
|
+
mes[ 1] = argv0;
|
|
506
|
+
while (*mpp)
|
|
507
|
+
mcpp_fputs( *mpp++, ERR);
|
|
508
|
+
longjmp( error_exit, -1);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
static void set_opt_list(
|
|
512
|
+
char * optlist
|
|
513
|
+
)
|
|
514
|
+
/*
|
|
515
|
+
* Set list of legal option characters.
|
|
516
|
+
*/
|
|
517
|
+
{
|
|
518
|
+
const char * list[] = {
|
|
519
|
+
|
|
520
|
+
#if ! STD_LINE_PREFIX
|
|
521
|
+
"b",
|
|
522
|
+
#endif
|
|
523
|
+
|
|
524
|
+
#if SYS_FAMILY == SYS_UNIX
|
|
525
|
+
"m:",
|
|
526
|
+
#endif
|
|
527
|
+
|
|
528
|
+
"a",
|
|
529
|
+
|
|
530
|
+
NULL
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
const char * const * lp = & list[ 0];
|
|
534
|
+
|
|
535
|
+
strcpy( optlist, "e:CD:I:M:U:");
|
|
536
|
+
/* Default options */
|
|
537
|
+
while (*lp)
|
|
538
|
+
strcat( optlist, *lp++);
|
|
539
|
+
if (strlen( optlist) >= OPTLISTLEN)
|
|
540
|
+
cfatal( "Bug: Too long option list", NULL, 0L, NULL); /* _F_ */
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
static void def_a_macro(
|
|
544
|
+
int opt, /* 'D' */
|
|
545
|
+
char * def /* Argument of -D option */
|
|
546
|
+
)
|
|
547
|
+
/*
|
|
548
|
+
* Define a macro specified by -D option.
|
|
549
|
+
* The macro maybe either object-like or function-like (with parameter).
|
|
550
|
+
*/
|
|
551
|
+
{
|
|
552
|
+
DEFBUF * defp;
|
|
553
|
+
char * definition; /* Argument of -D option */
|
|
554
|
+
char * cp;
|
|
555
|
+
int i;
|
|
556
|
+
|
|
557
|
+
definition = xmalloc( strlen( def) + 4);
|
|
558
|
+
strcpy( definition, def);
|
|
559
|
+
if ((cp = strchr( definition, '=')) != NULL) {
|
|
560
|
+
*cp = ' '; /* Remove the '=' */
|
|
561
|
+
cp = "\n"; /* Append <newline> */
|
|
562
|
+
} else {
|
|
563
|
+
cp = " 1\n"; /* With definition "1" */
|
|
564
|
+
}
|
|
565
|
+
strcat( definition, cp);
|
|
566
|
+
cp = definition;
|
|
567
|
+
while ((char_type[ *cp & UCHARMAX] & SPA) == 0)
|
|
568
|
+
cp++;
|
|
569
|
+
i = *cp;
|
|
570
|
+
*cp = EOS;
|
|
571
|
+
if ((defp = look_id( definition)) != NULL) /* Pre-defined */
|
|
572
|
+
undefine( definition);
|
|
573
|
+
*cp = i;
|
|
574
|
+
/* Now, save the definition. */
|
|
575
|
+
unget_string( definition, NULL);
|
|
576
|
+
if (do_define( FALSE, 0) == NULL) /* Define a macro */
|
|
577
|
+
usage( opt);
|
|
578
|
+
*cp = EOS;
|
|
579
|
+
if (str_eq( definition, "__STDC__")) {
|
|
580
|
+
defp = look_id( definition);
|
|
581
|
+
defp->nargs = DEF_NOARGS_STANDARD;
|
|
582
|
+
/* Restore Standard-predefinedness */
|
|
583
|
+
}
|
|
584
|
+
free( definition);
|
|
585
|
+
skip_nl(); /* Clear the appended <newline> */
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
static void chk_opts(
|
|
589
|
+
int sflag, /* Flag of Standard or post-Standard mode */
|
|
590
|
+
int trad /* -traditional (GCC only) */
|
|
591
|
+
)
|
|
592
|
+
/*
|
|
593
|
+
* Check consistency between the specified options.
|
|
594
|
+
* Set default value of some variables for each 'mcpp_mode'.
|
|
595
|
+
*/
|
|
596
|
+
{
|
|
597
|
+
int incompat = FALSE;
|
|
598
|
+
|
|
599
|
+
if (trad)
|
|
600
|
+
incompat = TRUE;
|
|
601
|
+
if (! stdc_val)
|
|
602
|
+
stdc_val = STDC;
|
|
603
|
+
|
|
604
|
+
if (compat_mode)
|
|
605
|
+
incompat = TRUE;
|
|
606
|
+
if ((mcpp_debug & MACRO_CALL)
|
|
607
|
+
&& option_flags.c) {
|
|
608
|
+
mcpp_fputs( "Disabled -K option.\n", ERR);
|
|
609
|
+
mcpp_debug &= ~MACRO_CALL;
|
|
610
|
+
/* -a and -C options do not co-exist with -K */
|
|
611
|
+
}
|
|
612
|
+
if (incompat) {
|
|
613
|
+
mcpp_fputs( "Incompatible options are specified.\n", ERR);
|
|
614
|
+
usage( '?');
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
expand_init( compat_mode);
|
|
618
|
+
/* Set function pointer to macro expansion routine */
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
static void init_predefines( void)
|
|
622
|
+
/*
|
|
623
|
+
* Set or unset predefined macros.
|
|
624
|
+
*/
|
|
625
|
+
{
|
|
626
|
+
char tmp[ 16];
|
|
627
|
+
|
|
628
|
+
stdc_ver = stdc_val ? STDC_VERSION : 0L;
|
|
629
|
+
|
|
630
|
+
if (nflag) {
|
|
631
|
+
un_predefine( TRUE);
|
|
632
|
+
} else if (stdc_val) {
|
|
633
|
+
un_predefine( FALSE); /* Undefine "unix" or so */
|
|
634
|
+
}
|
|
635
|
+
sprintf( tmp, "%ldL", stdc_ver);
|
|
636
|
+
if (stdc_ver)
|
|
637
|
+
look_and_install( "__STDC_VERSION__", DEF_NOARGS_STANDARD, null
|
|
638
|
+
, tmp);
|
|
639
|
+
#ifdef COMPILER_CPLUS
|
|
640
|
+
if (! nflag) /* Undefine pre-defined macro for C++ */
|
|
641
|
+
undefine( COMPILER_CPLUS);
|
|
642
|
+
#endif
|
|
643
|
+
set_limit();
|
|
644
|
+
init_std_defines();
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
static void init_std_defines( void)
|
|
648
|
+
/*
|
|
649
|
+
* For STD and POST_STD modes.
|
|
650
|
+
* The magic pre-defines are initialized with magic argument counts.
|
|
651
|
+
* expand_macro() notices this and calls the appropriate routine.
|
|
652
|
+
* DEF_NOARGS is one greater than the first "magic" definition.
|
|
653
|
+
* 'DEF_NOARGS - n' are reserved for pre-defined macros.
|
|
654
|
+
* __STDC_VERSION__ and __cplusplus are defined by chk_opts() and set_cplus().
|
|
655
|
+
*/
|
|
656
|
+
{
|
|
657
|
+
char tmp[ 16];
|
|
658
|
+
char timestr[ 14];
|
|
659
|
+
time_t tvec;
|
|
660
|
+
char * tstring;
|
|
661
|
+
|
|
662
|
+
look_and_install( "__LINE__", DEF_NOARGS_DYNAMIC - 1, null, "-1234567890");
|
|
663
|
+
/* Room for 11 chars (10 for long and 1 for '-' in case of wrap round. */
|
|
664
|
+
look_and_install( "__FILE__", DEF_NOARGS_DYNAMIC - 2, null, null);
|
|
665
|
+
/* Should be stuffed */
|
|
666
|
+
|
|
667
|
+
/* Define __DATE__, __TIME__ as present date and time. */
|
|
668
|
+
time( &tvec);
|
|
669
|
+
tstring = ctime( &tvec);
|
|
670
|
+
sprintf( timestr, "\"%.3s %c%c %.4s\"",
|
|
671
|
+
tstring + 4,
|
|
672
|
+
*(tstring + 8) == '0' ? ' ' : *(tstring + 8),
|
|
673
|
+
*(tstring + 9),
|
|
674
|
+
tstring + 20);
|
|
675
|
+
look_and_install( "__DATE__", DEF_NOARGS_DYNAMIC, null, timestr);
|
|
676
|
+
sprintf( timestr, "\"%.8s\"", tstring + 11);
|
|
677
|
+
look_and_install( "__TIME__", DEF_NOARGS_DYNAMIC, null, timestr);
|
|
678
|
+
|
|
679
|
+
if (! look_id( "__STDC_HOSTED__")) {
|
|
680
|
+
/*
|
|
681
|
+
* Some compilers, e.g. GCC older than 3.3, define this macro by
|
|
682
|
+
* -D option.
|
|
683
|
+
*/
|
|
684
|
+
sprintf( tmp, "%d", STDC_HOSTED);
|
|
685
|
+
look_and_install( "__STDC_HOSTED__", DEF_NOARGS_PREDEF, null, tmp);
|
|
686
|
+
}
|
|
687
|
+
/* Define __STDC__ as 1 or such for Standard conforming compiler. */
|
|
688
|
+
if (! look_id( "__STDC__")) {
|
|
689
|
+
sprintf( tmp, "%d", stdc_val);
|
|
690
|
+
look_and_install( "__STDC__", DEF_NOARGS_STANDARD, null, tmp);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
#define LINE90LIMIT 32767
|
|
695
|
+
#define LINE_CPLUS_LIMIT 32767
|
|
696
|
+
|
|
697
|
+
static void set_limit( void)
|
|
698
|
+
/*
|
|
699
|
+
* Set the minimum translation limits specified by the Standards.
|
|
700
|
+
*/
|
|
701
|
+
{
|
|
702
|
+
/* Specified by C 1990 Standard */
|
|
703
|
+
std_limits.str_len = SLEN90MIN;
|
|
704
|
+
std_limits.id_len = IDLEN90MIN;
|
|
705
|
+
std_limits.n_mac_pars = NMACPARS90MIN;
|
|
706
|
+
std_limits.exp_nest = EXP_NEST90MIN;
|
|
707
|
+
std_limits.blk_nest = BLK_NEST90MIN;
|
|
708
|
+
std_limits.inc_nest = INCLUDE_NEST90MIN;
|
|
709
|
+
std_limits.n_macro = NMACRO90MIN;
|
|
710
|
+
std_limits.line_num = LINE90LIMIT;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
void init_sys_macro( void)
|
|
715
|
+
/*
|
|
716
|
+
* Define system-specific macros and some Standard required macros
|
|
717
|
+
* and undefine macros specified by -U options.
|
|
718
|
+
*/
|
|
719
|
+
{
|
|
720
|
+
/* This order is important. */
|
|
721
|
+
def_macros(); /* Define macros specified by -D */
|
|
722
|
+
init_predefines(); /* Define predefined macros */
|
|
723
|
+
undef_macros(); /* Undefine macros specified by -U */
|
|
724
|
+
if (mcpp_debug & MACRO_CALL)
|
|
725
|
+
dump_def( FALSE, TRUE); /* Finally putout current macro names */
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
void at_start( void)
|
|
729
|
+
/*
|
|
730
|
+
* Do the commands prior to processing main source file after do_options().
|
|
731
|
+
*/
|
|
732
|
+
{
|
|
733
|
+
FILEINFO * file_saved = infile;
|
|
734
|
+
|
|
735
|
+
// We don't support changing the encodings.
|
|
736
|
+
|
|
737
|
+
put_info( file_saved);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
static void put_info(
|
|
741
|
+
FILEINFO * sharp_file
|
|
742
|
+
)
|
|
743
|
+
/*
|
|
744
|
+
* Putout compiler-specific information.
|
|
745
|
+
*/
|
|
746
|
+
{
|
|
747
|
+
if (no_output)
|
|
748
|
+
return;
|
|
749
|
+
sharp_file->line++;
|
|
750
|
+
sharp( sharp_file, 0);
|
|
751
|
+
sharp_file->line--;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
static char * set_files(
|
|
755
|
+
int argc,
|
|
756
|
+
char ** argv,
|
|
757
|
+
char ** in_pp,
|
|
758
|
+
char ** out_pp
|
|
759
|
+
)
|
|
760
|
+
/*
|
|
761
|
+
* Set input and/or output files.
|
|
762
|
+
*/
|
|
763
|
+
{
|
|
764
|
+
char * cp;
|
|
765
|
+
|
|
766
|
+
if (*in_pp == NULL) { /* Input file */
|
|
767
|
+
cp = argv[ mcpp_optind++];
|
|
768
|
+
#if SYS_FAMILY == SYS_WIN
|
|
769
|
+
cp = bsl2sl( cp);
|
|
770
|
+
#endif
|
|
771
|
+
*in_pp = cp;
|
|
772
|
+
}
|
|
773
|
+
if (mcpp_optind < argc && argv[ mcpp_optind][ 0] != '-'
|
|
774
|
+
&& *out_pp == NULL) {
|
|
775
|
+
cp = argv[ mcpp_optind++];
|
|
776
|
+
#if SYS_FAMILY == SYS_WIN
|
|
777
|
+
cp = bsl2sl( cp);
|
|
778
|
+
#endif
|
|
779
|
+
*out_pp = cp; /* Output file */
|
|
780
|
+
}
|
|
781
|
+
if (mcpp_optind >= argc)
|
|
782
|
+
return NULL; /* Exhausted command line arguments */
|
|
783
|
+
if (argv[ mcpp_optind][ 0] == '-')
|
|
784
|
+
return argv[ mcpp_optind]; /* More options */
|
|
785
|
+
cfatal( "Excessive file argument \"%s\"", argv[ mcpp_optind], 0L , NULL);
|
|
786
|
+
return NULL;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
static void set_env_dirs( void)
|
|
790
|
+
/*
|
|
791
|
+
* Add to include path those specified by environment variables.
|
|
792
|
+
*/
|
|
793
|
+
{
|
|
794
|
+
const char * env;
|
|
795
|
+
|
|
796
|
+
if ((env = getenv( ENV_C_INCLUDE_DIR)) != NULL)
|
|
797
|
+
parse_env( env);
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
static void parse_env(
|
|
801
|
+
const char * env
|
|
802
|
+
)
|
|
803
|
+
/*
|
|
804
|
+
* Parse environmental variable and append the path to include-dir-list.
|
|
805
|
+
*/
|
|
806
|
+
{
|
|
807
|
+
char * save;
|
|
808
|
+
char * save_start;
|
|
809
|
+
char * p;
|
|
810
|
+
int sep;
|
|
811
|
+
|
|
812
|
+
save = save_start = save_string( env);
|
|
813
|
+
while (*save) {
|
|
814
|
+
p = save;
|
|
815
|
+
while (*p && *p != ENV_SEP)
|
|
816
|
+
p++;
|
|
817
|
+
if (p != save) { /* Variable separator */
|
|
818
|
+
sep = *p;
|
|
819
|
+
*p = EOS;
|
|
820
|
+
set_a_dir( save);
|
|
821
|
+
if (sep == EOS)
|
|
822
|
+
break;
|
|
823
|
+
save = ++p;
|
|
824
|
+
}
|
|
825
|
+
while (*save == ENV_SEP)
|
|
826
|
+
++save;
|
|
827
|
+
}
|
|
828
|
+
free( save_start);
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
static void set_sys_dirs(
|
|
832
|
+
int set_cplus_dir /* Set C++ include-directory too */
|
|
833
|
+
)
|
|
834
|
+
/*
|
|
835
|
+
* Set site-specific and system-specific directories to the include directory
|
|
836
|
+
* list.
|
|
837
|
+
*/
|
|
838
|
+
{
|
|
839
|
+
#if SYS_FAMILY == SYS_UNIX
|
|
840
|
+
set_a_dir( "/usr/local/include");
|
|
841
|
+
#endif
|
|
842
|
+
|
|
843
|
+
#ifdef C_INCLUDE_DIR1
|
|
844
|
+
set_a_dir( C_INCLUDE_DIR1);
|
|
845
|
+
#endif
|
|
846
|
+
#ifdef C_INCLUDE_DIR2
|
|
847
|
+
set_a_dir( C_INCLUDE_DIR2);
|
|
848
|
+
#endif
|
|
849
|
+
|
|
850
|
+
#if SYS_FAMILY == SYS_UNIX
|
|
851
|
+
#if SYSTEM == SYS_CYGWIN
|
|
852
|
+
if (no_cygwin) /* -mno-cygwin */
|
|
853
|
+
set_a_dir( "/usr/include/mingw");
|
|
854
|
+
else
|
|
855
|
+
set_a_dir( "/usr/include");
|
|
856
|
+
#else
|
|
857
|
+
set_a_dir( "/usr/include"); /* Should be placed after C_INCLUDE_DIR? */
|
|
858
|
+
#endif
|
|
859
|
+
#endif
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
static void set_a_dir(
|
|
863
|
+
const char * dirname /* The path-name */
|
|
864
|
+
)
|
|
865
|
+
/*
|
|
866
|
+
* Append an include directory.
|
|
867
|
+
* This routine is called from the following routines (in this order).
|
|
868
|
+
* 1. do_options() by -I option.
|
|
869
|
+
* 2. do_options() by -isystem option (for GNUC).
|
|
870
|
+
* 3. set_env_dirs() by environment variables.
|
|
871
|
+
* 4. set_sys_dirs() by CPLUS_INCLUDE_DIR?, C_INCLUDE_DIR? and system-
|
|
872
|
+
* specifics (unless -I- or -nostdinc option is specified).
|
|
873
|
+
* Ignore non-existent directory.
|
|
874
|
+
* Note that this routine should be called only in initializing steps,
|
|
875
|
+
* because increase of include dirs causes reallocation of incdir[].
|
|
876
|
+
* Note: a trailing PATH-DELIM is appended by norm_path().
|
|
877
|
+
*/
|
|
878
|
+
{
|
|
879
|
+
char * norm_name;
|
|
880
|
+
const char ** ip;
|
|
881
|
+
|
|
882
|
+
if (incdir == NULL) { /* Should be initialized */
|
|
883
|
+
max_inc = INIT_NUM_INCLUDE;
|
|
884
|
+
incdir = (const char **) xmalloc( sizeof (char *) * max_inc);
|
|
885
|
+
incend = &incdir[ 0];
|
|
886
|
+
} else if (incend - incdir >= max_inc) { /* Buffer full */
|
|
887
|
+
incdir = (const char **) xrealloc( (void *) incdir
|
|
888
|
+
, sizeof (char *) * max_inc * 2);
|
|
889
|
+
incend = &incdir[ max_inc];
|
|
890
|
+
max_inc *= 2;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
if (dirname == NULL)
|
|
894
|
+
return; /* Only to initialize incdir[] */
|
|
895
|
+
norm_name = norm_dir( dirname, FALSE);
|
|
896
|
+
if (! norm_name) /* Non-existent */
|
|
897
|
+
return;
|
|
898
|
+
for (ip = incdir; ip < incend; ip++) {
|
|
899
|
+
if (str_case_eq( *ip, norm_name)) {
|
|
900
|
+
free( norm_name); /* Already registered */
|
|
901
|
+
return;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
/* Register new directory */
|
|
905
|
+
*incend++ = norm_name;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
static char * norm_dir(
|
|
909
|
+
const char * dirname, /* Directory path to normalize */
|
|
910
|
+
int framework /* Setting a framework directory*/
|
|
911
|
+
)
|
|
912
|
+
/*
|
|
913
|
+
* Normalize include directory path.
|
|
914
|
+
* Handle -isysroot option for GCC, including framework directory for SYS_MAC.
|
|
915
|
+
*/
|
|
916
|
+
{
|
|
917
|
+
char * norm_name;
|
|
918
|
+
|
|
919
|
+
{
|
|
920
|
+
norm_name = norm_path( dirname, NULL, FALSE, FALSE);
|
|
921
|
+
/* Normalize the pathname to compare */
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
return norm_name;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
static char * norm_path(
|
|
928
|
+
const char * dir, /* Include directory (maybe "", never NULL) */
|
|
929
|
+
const char * fname,
|
|
930
|
+
/* Filename (possibly has directory part, or maybe NULL) */
|
|
931
|
+
int inf, /* If TRUE, output some infs when (mcpp_debug & PATH) */
|
|
932
|
+
int hmap /* "header map" file of Apple-GCC */
|
|
933
|
+
)
|
|
934
|
+
/*
|
|
935
|
+
* Normalize the pathname removing redundant components such as
|
|
936
|
+
* "foo/../", "./" and trailing "/.".
|
|
937
|
+
* Append trailing "/" if 'fname' is NULL.
|
|
938
|
+
* Change relative path to absolute path.
|
|
939
|
+
* Dereference a symbolic linked file (or directory) to a real directory/file.
|
|
940
|
+
* Return a malloc'ed buffer, if the directory/file exists.
|
|
941
|
+
* Return NULL, if the specified directory/file does not exist or 'dir' is
|
|
942
|
+
* not a directory or 'fname' is not a regular file.
|
|
943
|
+
* This routine is called from set_a_dir(), init_gcc_macro(), do_once() and
|
|
944
|
+
* open_file().
|
|
945
|
+
*/
|
|
946
|
+
{
|
|
947
|
+
char * norm_name; /* The path-list converted */
|
|
948
|
+
char * start;
|
|
949
|
+
char * cp1;
|
|
950
|
+
char * cp2;
|
|
951
|
+
char * abs_path;
|
|
952
|
+
int len; /* Should not be size_t */
|
|
953
|
+
size_t start_pos = 0;
|
|
954
|
+
char slbuf1[ PATHMAX+1]; /* Working buffer */
|
|
955
|
+
#if SYS_FAMILY == SYS_UNIX
|
|
956
|
+
char slbuf2[ PATHMAX+1]; /* Working buffer for dereferencing */
|
|
957
|
+
#endif
|
|
958
|
+
#if SYSTEM == SYS_CYGWIN || SYSTEM == SYS_MINGW
|
|
959
|
+
static char * root_dir;
|
|
960
|
+
/* System's root directory in Windows file system */
|
|
961
|
+
static size_t root_dir_len;
|
|
962
|
+
#if SYSTEM == SYS_CYGWIN
|
|
963
|
+
static char * cygdrive = "/cygdrive/"; /* Prefix for drive letter */
|
|
964
|
+
#else
|
|
965
|
+
static char * mingw_dir; /* "/mingw" dir in Windows */
|
|
966
|
+
static size_t mingw_dir_len;
|
|
967
|
+
#endif
|
|
968
|
+
#endif
|
|
969
|
+
#if HOST_COMPILER == MSC
|
|
970
|
+
struct _stat st_buf;
|
|
971
|
+
#else
|
|
972
|
+
struct stat st_buf;
|
|
973
|
+
#endif
|
|
974
|
+
|
|
975
|
+
if (! dir || (*dir && is_full_path( fname)))
|
|
976
|
+
cfatal( "Bug: Wrong argument to norm_path()" /* _F_ */
|
|
977
|
+
, NULL, 0L, NULL);
|
|
978
|
+
inf = inf && (mcpp_debug & PATH); /* Output information */
|
|
979
|
+
|
|
980
|
+
strcpy( slbuf1, dir); /* Include directory */
|
|
981
|
+
len = strlen( slbuf1);
|
|
982
|
+
if (fname && len && slbuf1[ len - 1] != PATH_DELIM) {
|
|
983
|
+
slbuf1[ len] = PATH_DELIM; /* Append PATH_DELIM */
|
|
984
|
+
slbuf1[ ++len] = EOS;
|
|
985
|
+
} else if (! fname && len && slbuf1[ len - 1] == PATH_DELIM) {
|
|
986
|
+
/* stat() of some systems do not like trailing '/' */
|
|
987
|
+
slbuf1[ --len] = EOS;
|
|
988
|
+
}
|
|
989
|
+
if (fname)
|
|
990
|
+
strcat( slbuf1, fname);
|
|
991
|
+
if (stat( slbuf1, & st_buf) != 0 /* Non-existent */
|
|
992
|
+
|| (! fname && ! S_ISDIR( st_buf.st_mode))
|
|
993
|
+
/* Not a directory though 'fname' is not specified */
|
|
994
|
+
|| (fname && ! S_ISREG( st_buf.st_mode)))
|
|
995
|
+
/* Not a regular file though 'fname' is specified */
|
|
996
|
+
return NULL;
|
|
997
|
+
if (! fname) {
|
|
998
|
+
slbuf1[ len] = PATH_DELIM; /* Append PATH_DELIM */
|
|
999
|
+
slbuf1[ ++len] = EOS;
|
|
1000
|
+
}
|
|
1001
|
+
#if SYS_FAMILY == SYS_UNIX
|
|
1002
|
+
/* Dereference symbolic linked directory or file, if any */
|
|
1003
|
+
slbuf1[ len] = EOS; /* Truncate PATH_DELIM and 'fname' part, if any */
|
|
1004
|
+
slbuf2[ 0] = EOS;
|
|
1005
|
+
if (*dir && ! fname) { /* Registering include directory */
|
|
1006
|
+
/* Symbolic link check of directories are required */
|
|
1007
|
+
deref_syml( slbuf1, slbuf2, slbuf1);
|
|
1008
|
+
} else if (fname) { /* Regular file */
|
|
1009
|
+
len = strlen( slbuf1);
|
|
1010
|
+
strcat( slbuf1, fname);
|
|
1011
|
+
deref_syml( slbuf1, slbuf2, slbuf1 + len);
|
|
1012
|
+
/* Symbolic link check of directory */
|
|
1013
|
+
if ((len = readlink( slbuf1, slbuf2, PATHMAX)) > 0) {
|
|
1014
|
+
/* Dereference symbolic linked file (not directory) */
|
|
1015
|
+
*(slbuf2 + len) = EOS;
|
|
1016
|
+
cp1 = slbuf1;
|
|
1017
|
+
if (slbuf2[ 0] != PATH_DELIM) { /* Relative path */
|
|
1018
|
+
cp2 = strrchr( slbuf1, PATH_DELIM);
|
|
1019
|
+
if (cp2) /* Append to the source directory */
|
|
1020
|
+
cp1 = cp2 + 1;
|
|
1021
|
+
}
|
|
1022
|
+
strcpy( cp1, slbuf2);
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
if (inf) {
|
|
1026
|
+
if (slbuf2[ 0])
|
|
1027
|
+
mcpp_fprintf( DBG, "Dereferenced \"%s%s\" to \"%s\"\n"
|
|
1028
|
+
, dir, fname ? fname : null, slbuf1);
|
|
1029
|
+
}
|
|
1030
|
+
#endif
|
|
1031
|
+
len = strlen( slbuf1);
|
|
1032
|
+
start = norm_name = xmalloc( len + 1); /* Need a new buffer */
|
|
1033
|
+
strcpy( norm_name, slbuf1);
|
|
1034
|
+
#if SYS_FAMILY == SYS_WIN
|
|
1035
|
+
bsl2sl( norm_name);
|
|
1036
|
+
#endif
|
|
1037
|
+
#if SPECIAL_PATH_DELIM /* ':' ? */
|
|
1038
|
+
for (cp1 = norm_name; *cp1 != EOS; cp1++) {
|
|
1039
|
+
if (*cp1 == PATH_DELIM)
|
|
1040
|
+
*cp1 = '/';
|
|
1041
|
+
}
|
|
1042
|
+
#endif
|
|
1043
|
+
cp1 = norm_name;
|
|
1044
|
+
|
|
1045
|
+
#if SYSTEM == SYS_CYGWIN
|
|
1046
|
+
/* Convert to "/cygdirve/x/dir" style of absolute path-list */
|
|
1047
|
+
if (len >= 8 && (memcmp( cp1, "/usr/bin", 8) == 0
|
|
1048
|
+
|| memcmp( cp1, "/usr/lib", 8) == 0)) {
|
|
1049
|
+
memmove( cp1, cp1 + 4, len - 4 + 1); /* Remove "/usr" */
|
|
1050
|
+
len -= 4;
|
|
1051
|
+
}
|
|
1052
|
+
if (*cp1 == '/' && (len < 10 || memcmp( cp1, cygdrive, 10) != 0)) {
|
|
1053
|
+
/* /dir, not /cygdrive/ */
|
|
1054
|
+
if (! root_dir_len) { /* Should be initialized */
|
|
1055
|
+
/* Convert "X:\DIR-list" to "/cygdrive/x/dir-list" */
|
|
1056
|
+
root_dir = xmalloc( strlen( CYGWIN_ROOT_DIRECTORY) + 1);
|
|
1057
|
+
strcpy( root_dir, CYGWIN_ROOT_DIRECTORY);
|
|
1058
|
+
*(root_dir + 1) = *root_dir; /* "x:/" to " x/" */
|
|
1059
|
+
cp1 = xmalloc( strlen( cygdrive) + strlen( root_dir));
|
|
1060
|
+
strcpy( cp1, cygdrive);
|
|
1061
|
+
strcat( cp1, root_dir + 1);
|
|
1062
|
+
free( root_dir);
|
|
1063
|
+
root_dir = cp1;
|
|
1064
|
+
root_dir_len = strlen( root_dir);
|
|
1065
|
+
}
|
|
1066
|
+
cp1 = xmalloc( root_dir_len + len + 1);
|
|
1067
|
+
strcpy( cp1, root_dir);
|
|
1068
|
+
strcat( cp1, norm_name); /* Convert to absolute path */
|
|
1069
|
+
free( norm_name);
|
|
1070
|
+
norm_name = start = cp1;
|
|
1071
|
+
len += root_dir_len;
|
|
1072
|
+
}
|
|
1073
|
+
#endif
|
|
1074
|
+
|
|
1075
|
+
#if SYSTEM == SYS_MINGW
|
|
1076
|
+
/* Handle the mess of MinGW's path-list */
|
|
1077
|
+
/* Convert to "x:/dir" style of absolute path-list */
|
|
1078
|
+
if (*cp1 == PATH_DELIM && isalpha( *(cp1 + 1))
|
|
1079
|
+
&& *(cp1 + 2) == PATH_DELIM) { /* /c/, /d/, etc*/
|
|
1080
|
+
*cp1 = *(cp1 + 1);
|
|
1081
|
+
*(cp1 + 1) = ':'; /* Convert to c:/, d:/, etc */
|
|
1082
|
+
} else if (memcmp( cp1, "/mingw", 6) == 0) {
|
|
1083
|
+
if (! mingw_dir_len) { /* Should be initialized */
|
|
1084
|
+
mingw_dir_len = strlen( MINGW_DIRECTORY);
|
|
1085
|
+
mingw_dir = xmalloc( mingw_dir_len + 1);
|
|
1086
|
+
strcpy( mingw_dir, MINGW_DIRECTORY);
|
|
1087
|
+
}
|
|
1088
|
+
cp1 = xmalloc( mingw_dir_len + len + 1);
|
|
1089
|
+
strcpy( cp1, mingw_dir);
|
|
1090
|
+
strcat( cp1, norm_name + 6); /* Convert to absolute path */
|
|
1091
|
+
free( norm_name);
|
|
1092
|
+
norm_name = start = cp1;
|
|
1093
|
+
len += mingw_dir_len;
|
|
1094
|
+
} else if (memcmp( cp1, "/usr", 4) == 0) {
|
|
1095
|
+
memmove( cp1, cp1 + 4, len - 4 + 1); /* Remove "/usr" */
|
|
1096
|
+
len -= 4;
|
|
1097
|
+
}
|
|
1098
|
+
if (*cp1 == '/') { /* /dir or / */
|
|
1099
|
+
if (! root_dir_len) { /* Should be initialized */
|
|
1100
|
+
root_dir_len = strlen( MSYS_ROOT_DIRECTORY);
|
|
1101
|
+
root_dir = xmalloc( root_dir_len + 1);
|
|
1102
|
+
strcpy( root_dir, MSYS_ROOT_DIRECTORY);
|
|
1103
|
+
}
|
|
1104
|
+
cp1 = xmalloc( root_dir_len + len + 1);
|
|
1105
|
+
strcpy( cp1, root_dir);
|
|
1106
|
+
strcat( cp1, norm_name); /* Convert to absolute path */
|
|
1107
|
+
free( norm_name);
|
|
1108
|
+
norm_name = start = cp1;
|
|
1109
|
+
len += root_dir_len;
|
|
1110
|
+
}
|
|
1111
|
+
#endif
|
|
1112
|
+
|
|
1113
|
+
#if SYS_FAMILY == SYS_WIN
|
|
1114
|
+
if (*(cp1 + 1) == ':')
|
|
1115
|
+
start = cp1 += 2; /* Next to the drive letter */
|
|
1116
|
+
start_pos = 2;
|
|
1117
|
+
#endif
|
|
1118
|
+
if (len == 1 && *norm_name == '/') /* Only "/" */
|
|
1119
|
+
return norm_name;
|
|
1120
|
+
|
|
1121
|
+
if (strncmp( cp1, "./", 2) == 0) /* Remove beginning "./" */
|
|
1122
|
+
memmove( cp1, cp1 + 2, strlen( cp1 + 2) + 1); /* +1 for EOS */
|
|
1123
|
+
if (*start != '/') { /* Relative path to current directory */
|
|
1124
|
+
/* Make absolute path */
|
|
1125
|
+
abs_path = xmalloc( len + strlen( cur_work_dir) + 1);
|
|
1126
|
+
cp1 = stpcpy( abs_path, cur_work_dir);
|
|
1127
|
+
strcpy( cp1, start);
|
|
1128
|
+
free( norm_name);
|
|
1129
|
+
norm_name = abs_path;
|
|
1130
|
+
start = cp1 = norm_name + start_pos;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
while ((cp1 = strstr( cp1, "/./")) != NULL)
|
|
1134
|
+
memmove( cp1, cp1 + 2, strlen( cp1 + 2) + 1);
|
|
1135
|
+
/* Remove "/." of "/./" */
|
|
1136
|
+
cp1 = start;
|
|
1137
|
+
/* Remove redundant "foo/../" */
|
|
1138
|
+
while ((cp1 = strstr( cp1, "/../")) != NULL) {
|
|
1139
|
+
*cp1 = EOS;
|
|
1140
|
+
if ((cp2 = strrchr( start, '/')) != NULL) {
|
|
1141
|
+
if (*(cp1 - 1) != '.') {
|
|
1142
|
+
memmove( cp2 + 1, cp1 + 4, strlen( cp1 + 4) + 1);
|
|
1143
|
+
/* Remove "foo/../" */
|
|
1144
|
+
cp1 = cp2;
|
|
1145
|
+
} else { /* Impossible */
|
|
1146
|
+
break;
|
|
1147
|
+
}
|
|
1148
|
+
} else { /* Impossible */
|
|
1149
|
+
break;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
#if SPECIAL_PATH_DELIM
|
|
1154
|
+
for (cp1 = start; *cp1 != EOS; cp1++) {
|
|
1155
|
+
if (*cp1 == '/')
|
|
1156
|
+
*cp1 = PATH_DELIM;
|
|
1157
|
+
}
|
|
1158
|
+
#endif
|
|
1159
|
+
if (inf) {
|
|
1160
|
+
char debug_buf[ PATHMAX+1];
|
|
1161
|
+
strcpy( debug_buf, dir);
|
|
1162
|
+
strcat( debug_buf, fname ? fname : null);
|
|
1163
|
+
#if SYS_FAMILY == SYS_WIN
|
|
1164
|
+
bsl2sl( debug_buf);
|
|
1165
|
+
#endif
|
|
1166
|
+
if (! str_eq( debug_buf, norm_name))
|
|
1167
|
+
mcpp_fprintf( DBG, "Normalized the path \"%s\" to \"%s\"\n"
|
|
1168
|
+
, debug_buf, norm_name);
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
return norm_name;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
#if SYS_FAMILY == SYS_UNIX
|
|
1175
|
+
|
|
1176
|
+
static void deref_syml(
|
|
1177
|
+
char * slbuf1, /* Original path-list */
|
|
1178
|
+
char * slbuf2, /* Working buffer */
|
|
1179
|
+
char * chk_start /* Pointer into slbuf1 */
|
|
1180
|
+
)
|
|
1181
|
+
/* Dereference symbolic linked directory */
|
|
1182
|
+
{
|
|
1183
|
+
char * cp2;
|
|
1184
|
+
int len; /* Should be int, not size_t */
|
|
1185
|
+
|
|
1186
|
+
while ((chk_start = strchr( chk_start, PATH_DELIM)) != NULL) {
|
|
1187
|
+
*chk_start = EOS;
|
|
1188
|
+
if ((len = readlink( slbuf1, slbuf2, PATHMAX)) > 0) {
|
|
1189
|
+
/* Dereference symbolic linked directory */
|
|
1190
|
+
cp2 = strrchr( slbuf1, PATH_DELIM); /* Previous delimiter */
|
|
1191
|
+
*chk_start = PATH_DELIM;
|
|
1192
|
+
strcpy( slbuf2 + len, chk_start);
|
|
1193
|
+
if (slbuf2[ 0] == PATH_DELIM) { /* Absolute path */
|
|
1194
|
+
strcpy( slbuf1, slbuf2);
|
|
1195
|
+
chk_start = slbuf1 + len + 1;
|
|
1196
|
+
} else {
|
|
1197
|
+
if (cp2)
|
|
1198
|
+
chk_start = cp2 + 1;
|
|
1199
|
+
else
|
|
1200
|
+
chk_start = slbuf1;
|
|
1201
|
+
strcpy( chk_start, slbuf2); /* Rewrite the path */
|
|
1202
|
+
chk_start += len;
|
|
1203
|
+
}
|
|
1204
|
+
} else {
|
|
1205
|
+
*chk_start++ = PATH_DELIM;
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
#endif
|
|
1210
|
+
|
|
1211
|
+
static void def_macros( void)
|
|
1212
|
+
/*
|
|
1213
|
+
* Define macros specified by -D option.
|
|
1214
|
+
* This routine should be called before undef_macros().
|
|
1215
|
+
*/
|
|
1216
|
+
{
|
|
1217
|
+
int i;
|
|
1218
|
+
|
|
1219
|
+
for (i = 0; i < def_cnt; i++)
|
|
1220
|
+
def_a_macro( 'D', def_list[ i]);
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
static void undef_macros( void)
|
|
1224
|
+
/*
|
|
1225
|
+
* Undefine macros specified by -U option.
|
|
1226
|
+
* This routine should be called after init_predefine().
|
|
1227
|
+
*/
|
|
1228
|
+
{
|
|
1229
|
+
char * name;
|
|
1230
|
+
int i;
|
|
1231
|
+
|
|
1232
|
+
for (i = 0; i < undef_cnt; i++) {
|
|
1233
|
+
name = undef_list[ i];
|
|
1234
|
+
if (look_id( name) != NULL)
|
|
1235
|
+
undefine( name);
|
|
1236
|
+
else if (warn_level & 8)
|
|
1237
|
+
mcpp_fprintf( ERR, "\"%s\" wasn't defined\n", name);
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
void put_depend(
|
|
1242
|
+
const char * filename
|
|
1243
|
+
)
|
|
1244
|
+
/*
|
|
1245
|
+
* Append a header name to the source file dependency line.
|
|
1246
|
+
*/
|
|
1247
|
+
{
|
|
1248
|
+
#define MAX_OUT_LEN 76 /* Maximum length of output line */
|
|
1249
|
+
#define MKDEP_INITLEN (MKDEP_INIT * 0x100)
|
|
1250
|
+
#define MKDEP_MAX (MKDEP_INIT * 0x10)
|
|
1251
|
+
#define MKDEP_MAXLEN (MKDEP_INITLEN * 0x10)
|
|
1252
|
+
|
|
1253
|
+
static char * output = NULL; /* File names */
|
|
1254
|
+
static size_t * pos = NULL; /* Offset to filenames */
|
|
1255
|
+
static int pos_num; /* Index of pos[] */
|
|
1256
|
+
static char * out_p; /* Pointer to output[] */
|
|
1257
|
+
static size_t mkdep_len; /* Size of output[] */
|
|
1258
|
+
static size_t pos_max; /* Size of pos[] */
|
|
1259
|
+
static FILE * fp; /* Path to output dependency line */
|
|
1260
|
+
static size_t llen; /* Length of current physical output line */
|
|
1261
|
+
size_t * pos_p; /* Index into pos[] */
|
|
1262
|
+
size_t fnamlen; /* Length of filename */
|
|
1263
|
+
|
|
1264
|
+
if (fp == NULL) { /* Main source file. Have to initialize. */
|
|
1265
|
+
if (output != NULL) {
|
|
1266
|
+
free( output);
|
|
1267
|
+
free( pos);
|
|
1268
|
+
}
|
|
1269
|
+
output = xmalloc( mkdep_len = MKDEP_INITLEN);
|
|
1270
|
+
pos = (size_t *) xmalloc( (pos_max = MKDEP_INIT) * sizeof (size_t));
|
|
1271
|
+
out_p = md_init( filename, output);
|
|
1272
|
+
fp = mkdep_fp;
|
|
1273
|
+
llen = strlen( output);
|
|
1274
|
+
pos_num = 0; /* Initialize for MCPP_LIB build */
|
|
1275
|
+
} else if (filename == NULL) { /* End of input */
|
|
1276
|
+
out_p = stpcpy( out_p, "\n\n");
|
|
1277
|
+
if (mkdep & MD_PHONY) {
|
|
1278
|
+
/* Output the phony target line for each recorded header files. */
|
|
1279
|
+
char * cp;
|
|
1280
|
+
int c;
|
|
1281
|
+
|
|
1282
|
+
if (strlen( output) * 2 + (pos_num * 2) >= MKDEP_MAXLEN) {
|
|
1283
|
+
cerror( "Too long dependency line" /* _E_ */
|
|
1284
|
+
, NULL, 0L, NULL);
|
|
1285
|
+
if (fp == fp_out)
|
|
1286
|
+
mcpp_fputs( output, OUT);
|
|
1287
|
+
else
|
|
1288
|
+
fputs( output, fp);
|
|
1289
|
+
return;
|
|
1290
|
+
} else if (strlen( output) * 2 + (pos_num * 2) >= mkdep_len) {
|
|
1291
|
+
/* Enlarge the buffer */
|
|
1292
|
+
size_t len = out_p - output;
|
|
1293
|
+
output = xrealloc( output, mkdep_len *= 2);
|
|
1294
|
+
out_p = output + len;
|
|
1295
|
+
}
|
|
1296
|
+
pos_num--;
|
|
1297
|
+
for (pos_p = &pos[ 0]; pos_p <= &pos[ pos_num]; pos_p++) {
|
|
1298
|
+
if (pos_p == &pos[ pos_num]) { /* End of output */
|
|
1299
|
+
for (cp = output + *pos_p; *cp != '\n'; cp++)
|
|
1300
|
+
;
|
|
1301
|
+
c = '\n'; /* Append newline */
|
|
1302
|
+
} else {
|
|
1303
|
+
cp = output + *(pos_p + 1) - 1;
|
|
1304
|
+
while( *cp == ' ' || *cp == '\\' || *cp == '\n')
|
|
1305
|
+
cp--; /* Remove trailing spaces */
|
|
1306
|
+
c = *(++cp);
|
|
1307
|
+
}
|
|
1308
|
+
*cp = EOS;
|
|
1309
|
+
out_p = stpcpy( out_p, output + *pos_p);
|
|
1310
|
+
out_p = stpcpy( out_p, ":\n\n");
|
|
1311
|
+
*cp = c;
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
if (fp == fp_out) { /* To the same path with normal preprocessing */
|
|
1315
|
+
mcpp_fputs( output, OUT);
|
|
1316
|
+
} else { /* To the file specified by -MF, -MD, -MMD options */
|
|
1317
|
+
fputs( output, fp);
|
|
1318
|
+
fclose( fp);
|
|
1319
|
+
}
|
|
1320
|
+
fp = NULL; /* Clear for the next call in MCPP_LIB build */
|
|
1321
|
+
return;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
fnamlen = strlen( filename);
|
|
1325
|
+
/* Check the recorded filename */
|
|
1326
|
+
for (pos_p = pos; pos_p < &pos[ pos_num]; pos_p++) {
|
|
1327
|
+
if (memcmp( output + *pos_p, filename, fnamlen) == 0)
|
|
1328
|
+
return; /* Already recorded filename */
|
|
1329
|
+
}
|
|
1330
|
+
/* Any new header. Append its name to output. */
|
|
1331
|
+
if (llen + fnamlen > MAX_OUT_LEN) { /* Line is long */
|
|
1332
|
+
out_p = stpcpy( out_p, " \\\n "); /* Fold it */
|
|
1333
|
+
llen = 1;
|
|
1334
|
+
}
|
|
1335
|
+
llen += fnamlen + 1;
|
|
1336
|
+
if (pos_num >= MKDEP_MAX
|
|
1337
|
+
|| out_p + fnamlen + 1 >= output + MKDEP_MAXLEN)
|
|
1338
|
+
cfatal( "Too long dependency line: %s", output, 0L, NULL);
|
|
1339
|
+
/* Need to enlarge the buffer */
|
|
1340
|
+
if (pos_num >= pos_max) {
|
|
1341
|
+
pos = (size_t *) xrealloc( (char *) pos
|
|
1342
|
+
, (pos_max *= 2) * sizeof (size_t *));
|
|
1343
|
+
}
|
|
1344
|
+
if (output + mkdep_len <= out_p + fnamlen + 1) {
|
|
1345
|
+
size_t len = out_p - output;
|
|
1346
|
+
output = xrealloc( output, mkdep_len *= 2);
|
|
1347
|
+
out_p = output + len;
|
|
1348
|
+
}
|
|
1349
|
+
*out_p++ = ' ';
|
|
1350
|
+
pos[ pos_num++] = out_p - output; /* Remember the offset */
|
|
1351
|
+
/* Don't use pointer, since 'output' may be reallocated later. */
|
|
1352
|
+
out_p = stpcpy( out_p, filename);
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
static char * md_init(
|
|
1356
|
+
const char * filename, /* The source file name */
|
|
1357
|
+
char * output /* Output to dependency file */
|
|
1358
|
+
)
|
|
1359
|
+
/*
|
|
1360
|
+
* Initialize output file and target.
|
|
1361
|
+
*/
|
|
1362
|
+
{
|
|
1363
|
+
char prefix[ PATHMAX];
|
|
1364
|
+
char * cp = NULL;
|
|
1365
|
+
size_t len;
|
|
1366
|
+
char * out_p;
|
|
1367
|
+
const char * target = filename;
|
|
1368
|
+
const char * cp0;
|
|
1369
|
+
|
|
1370
|
+
if (! mkdep_target || ! mkdep_fp) { /* Make target name */
|
|
1371
|
+
#ifdef PATH_DELIM
|
|
1372
|
+
if ((cp0 = strrchr( target, PATH_DELIM)) != NULL)
|
|
1373
|
+
target = cp0 + 1;
|
|
1374
|
+
#endif
|
|
1375
|
+
if ((cp0 = strrchr( target, '.')) == NULL)
|
|
1376
|
+
len = strlen( target);
|
|
1377
|
+
else
|
|
1378
|
+
len = (size_t) (cp0 - target);
|
|
1379
|
+
memcpy( prefix, target, len);
|
|
1380
|
+
cp = prefix + len;
|
|
1381
|
+
*cp++ = '.';
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
if (! mkdep_fp) { /* Unless already opened by -MF, -MD, -MMD options */
|
|
1385
|
+
if (mkdep & MD_FILE) {
|
|
1386
|
+
strcpy( cp, "d");
|
|
1387
|
+
mkdep_fp = mcpp_fopen(prefix, "w");
|
|
1388
|
+
} else {
|
|
1389
|
+
mkdep_fp = fp_out; /* Output dependency line to normal output */
|
|
1390
|
+
no_output++; /* Without normal output */
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
if (mkdep_target) { /* -MT or -MQ option is specified */
|
|
1395
|
+
if (mkdep & MD_QUOTE) { /* 'Quote' $, \t and space */
|
|
1396
|
+
out_p = md_quote( output);
|
|
1397
|
+
} else {
|
|
1398
|
+
out_p = stpcpy( output, mkdep_target);
|
|
1399
|
+
}
|
|
1400
|
+
} else {
|
|
1401
|
+
strcpy( cp, OBJEXT);
|
|
1402
|
+
out_p = stpcpy( output, prefix);
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
*out_p++ = ':';
|
|
1406
|
+
*out_p = EOS;
|
|
1407
|
+
return out_p;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
static char * md_quote(
|
|
1411
|
+
char * output
|
|
1412
|
+
)
|
|
1413
|
+
/*
|
|
1414
|
+
* 'Quote' $, tab and space.
|
|
1415
|
+
* This function was written referring to GCC V.3.2 source.
|
|
1416
|
+
*/
|
|
1417
|
+
{
|
|
1418
|
+
char * p;
|
|
1419
|
+
char * q;
|
|
1420
|
+
|
|
1421
|
+
for (p = mkdep_target; *p; p++, output++) {
|
|
1422
|
+
switch (*p) {
|
|
1423
|
+
case ' ':
|
|
1424
|
+
case '\t':
|
|
1425
|
+
/* GNU-make treats backslash-space sequence peculiarly */
|
|
1426
|
+
for (q = p - 1; mkdep_target <= q && *q == '\\'; q--)
|
|
1427
|
+
*output++ = '\\';
|
|
1428
|
+
*output++ = '\\';
|
|
1429
|
+
break;
|
|
1430
|
+
case '$':
|
|
1431
|
+
*output++ = '$';
|
|
1432
|
+
break;
|
|
1433
|
+
default:
|
|
1434
|
+
break;
|
|
1435
|
+
}
|
|
1436
|
+
*output = *p;
|
|
1437
|
+
}
|
|
1438
|
+
*output = EOS;
|
|
1439
|
+
return output;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
static const char * toolong_fname =
|
|
1443
|
+
"Too long header name \"%s%.0ld%s\""; /* _F_ */
|
|
1444
|
+
static const char * excess_token =
|
|
1445
|
+
"Excessive token sequence \"%s\""; /* _E_, _W1_ */
|
|
1446
|
+
|
|
1447
|
+
int do_include(
|
|
1448
|
+
int next /* TRUE if the directive is #include_next */
|
|
1449
|
+
)
|
|
1450
|
+
/*
|
|
1451
|
+
* Process the #include line.
|
|
1452
|
+
* There are three variations:
|
|
1453
|
+
* #include "file" search somewhere relative to the
|
|
1454
|
+
* current (or source) directory, if not
|
|
1455
|
+
* found, treat as #include <file>.
|
|
1456
|
+
* #include <file> Search in an implementation-dependent
|
|
1457
|
+
* list of places.
|
|
1458
|
+
* #include macro-call Expand the macro call, it must be one of
|
|
1459
|
+
* "file" or <file>, process as such.
|
|
1460
|
+
* On success : return TRUE;
|
|
1461
|
+
* On failure of syntax : return FALSE;
|
|
1462
|
+
* On failure of file opening : return FALSE.
|
|
1463
|
+
* do_include() always absorbs the line (including the <newline>).
|
|
1464
|
+
*/
|
|
1465
|
+
{
|
|
1466
|
+
const char * const no_name = "No header name"; /* _E_ */
|
|
1467
|
+
char header[ PATHMAX + 16];
|
|
1468
|
+
int token_type;
|
|
1469
|
+
char * fname;
|
|
1470
|
+
char * filename;
|
|
1471
|
+
int delim; /* " or <, > */
|
|
1472
|
+
|
|
1473
|
+
if ((delim = skip_ws()) == '\n') { /* No argument */
|
|
1474
|
+
cerror( no_name, NULL, 0L, NULL);
|
|
1475
|
+
return FALSE;
|
|
1476
|
+
}
|
|
1477
|
+
fname = infile->bptr - 1; /* Current token for diagnosis */
|
|
1478
|
+
|
|
1479
|
+
if ((char_type[ delim] & LET)) { /* Maybe macro */
|
|
1480
|
+
int c;
|
|
1481
|
+
char *hp;
|
|
1482
|
+
|
|
1483
|
+
hp = header;
|
|
1484
|
+
*hp = EOS;
|
|
1485
|
+
c = delim;
|
|
1486
|
+
while (get_unexpandable( c, FALSE) != NO_TOKEN) {
|
|
1487
|
+
/* Expand any macros in the line */
|
|
1488
|
+
if (header + PATHMAX < hp + (int) (workp - work_buf))
|
|
1489
|
+
cfatal( toolong_fname, header, 0L, work_buf);
|
|
1490
|
+
hp = stpcpy( hp, work_buf);
|
|
1491
|
+
while (char_type[ c = get_ch()] & HSP)
|
|
1492
|
+
*hp++ = c;
|
|
1493
|
+
}
|
|
1494
|
+
*hp = EOS; /* Ensure to terminate */
|
|
1495
|
+
if (macro_line == MACRO_ERROR) /* Unterminated macro */
|
|
1496
|
+
return FALSE; /* already diagnosed. */
|
|
1497
|
+
unget_string( header, NULL); /* To re-read */
|
|
1498
|
+
delim = skip_ws();
|
|
1499
|
+
if (delim == '\n') {
|
|
1500
|
+
cerror( no_name, NULL, 0L, NULL); /* Expanded to */
|
|
1501
|
+
return FALSE; /* 0 token. */
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
token_type = scan_token( delim, (workp = work_buf, &workp)
|
|
1506
|
+
, work_buf + PATHMAX);
|
|
1507
|
+
if (token_type == STR) /* String literal form */
|
|
1508
|
+
goto found_name;
|
|
1509
|
+
else if (token_type == OPE && openum == OP_LT) /* '<' */
|
|
1510
|
+
workp = scan_quote( delim, work_buf, work_buf + PATHMAX, TRUE);
|
|
1511
|
+
/* Re-construct or diagnose */
|
|
1512
|
+
else /* Any other token in- */
|
|
1513
|
+
goto not_header; /* cluding <=, <<, <% */
|
|
1514
|
+
|
|
1515
|
+
if (workp == NULL) /* Missing closing '>' */
|
|
1516
|
+
goto syntax_error;
|
|
1517
|
+
|
|
1518
|
+
found_name:
|
|
1519
|
+
*--workp = EOS; /* Remove the closing and */
|
|
1520
|
+
fname = save_string( &work_buf[ 1]); /* the starting delimiter. */
|
|
1521
|
+
|
|
1522
|
+
if (skip_ws() != '\n') {
|
|
1523
|
+
cerror( excess_token, infile->bptr-1, 0L, NULL);
|
|
1524
|
+
skip_nl();
|
|
1525
|
+
goto error;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
#if SYS_FAMILY == SYS_WIN
|
|
1529
|
+
bsl2sl( fname);
|
|
1530
|
+
#endif
|
|
1531
|
+
filename = fname;
|
|
1532
|
+
#if NO_DIR /* Unofficial feature */
|
|
1533
|
+
if (no_dir) { /* Strip directory components */
|
|
1534
|
+
char src_dir[ PATHMAX] = { EOS, };
|
|
1535
|
+
if (has_directory( fname, src_dir))
|
|
1536
|
+
filename = fname + strlen( src_dir);
|
|
1537
|
+
delim = '"'; /* Even a system header is handled as a local one */
|
|
1538
|
+
}
|
|
1539
|
+
#endif
|
|
1540
|
+
if (open_include( filename, (delim == '"'), next)) {
|
|
1541
|
+
/* 'fname' should not be free()ed, it is used as file-> */
|
|
1542
|
+
/* real_fname and has been registered into fnamelist[] */
|
|
1543
|
+
return TRUE;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
cerror( "Can't open include file \"%s\"", filename, 0L, NULL); /* _E_ */
|
|
1547
|
+
error:
|
|
1548
|
+
free( fname);
|
|
1549
|
+
return FALSE;
|
|
1550
|
+
|
|
1551
|
+
not_header:
|
|
1552
|
+
cerror( "Not a header name \"%s\"", fname, 0L, NULL); /* _E_ */
|
|
1553
|
+
syntax_error:
|
|
1554
|
+
skip_nl();
|
|
1555
|
+
return FALSE;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
static int open_include(
|
|
1559
|
+
char * filename, /* File name to include */
|
|
1560
|
+
int searchlocal, /* TRUE if #include "file" */
|
|
1561
|
+
int next /* TRUE if #include_next */
|
|
1562
|
+
)
|
|
1563
|
+
/*
|
|
1564
|
+
* Open an include file. This routine is only called from do_include() above.
|
|
1565
|
+
* It searches the list of directories via search_dir() and opens the file
|
|
1566
|
+
* via open_file(), linking it into the list of active files.
|
|
1567
|
+
* Returns TRUE if the file was opened, FALSE if it fails.
|
|
1568
|
+
*/
|
|
1569
|
+
{
|
|
1570
|
+
char src_dir[ PATHMAX] = { EOS, }; /* Directory part of includer */
|
|
1571
|
+
int full_path; /* Filename is full-path-list */
|
|
1572
|
+
int has_dir = FALSE; /* Includer has directory part */
|
|
1573
|
+
int has_dir_src = FALSE;
|
|
1574
|
+
int has_dir_fname = FALSE;
|
|
1575
|
+
|
|
1576
|
+
full_path = is_full_path( filename);
|
|
1577
|
+
|
|
1578
|
+
if (!full_path && searchlocal && (search_rule & SOURCE)) {
|
|
1579
|
+
has_dir_src = has_directory( infile->src_dir, src_dir);
|
|
1580
|
+
has_dir_fname = has_directory( infile->real_fname
|
|
1581
|
+
, src_dir + strlen( src_dir));
|
|
1582
|
+
/* Get directory part of the parent file of the file to include.*/
|
|
1583
|
+
/* Note that infile->dirp of main input file is set to "" and */
|
|
1584
|
+
/* remains the same even if -include options are processed. */
|
|
1585
|
+
has_dir = has_dir_src || has_dir_fname
|
|
1586
|
+
|| (**(infile->dirp) != EOS);
|
|
1587
|
+
}
|
|
1588
|
+
if (mcpp_debug & PATH)
|
|
1589
|
+
mcpp_fprintf( DBG, "filename: %s\n", filename);
|
|
1590
|
+
|
|
1591
|
+
if ((searchlocal && ((search_rule & CURRENT) || !has_dir)) || full_path) {
|
|
1592
|
+
/*
|
|
1593
|
+
* Look in local directory first.
|
|
1594
|
+
* Try to open filename relative to the "current directory".
|
|
1595
|
+
*/
|
|
1596
|
+
if (open_file( &null, NULL, filename, searchlocal && !full_path
|
|
1597
|
+
, FALSE, FALSE))
|
|
1598
|
+
return TRUE;
|
|
1599
|
+
if (full_path)
|
|
1600
|
+
return FALSE;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
if (searchlocal && (search_rule & SOURCE) && has_dir) {
|
|
1604
|
+
/*
|
|
1605
|
+
* Look in local directory of source file.
|
|
1606
|
+
* Try to open filename relative to the "source directory".
|
|
1607
|
+
*/
|
|
1608
|
+
if (open_file( infile->dirp, src_dir, filename, TRUE, FALSE, FALSE))
|
|
1609
|
+
return TRUE;
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
/* Search the include directories */
|
|
1613
|
+
if (search_dir( filename, searchlocal, next))
|
|
1614
|
+
return TRUE;
|
|
1615
|
+
|
|
1616
|
+
return FALSE;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
static int has_directory(
|
|
1620
|
+
const char * source, /* Filename to examine */
|
|
1621
|
+
char * directory /* Put directory stuff here */
|
|
1622
|
+
)
|
|
1623
|
+
/*
|
|
1624
|
+
* If a directory is found in the 'source' filename string (i.e. "includer"),
|
|
1625
|
+
* the directory part of the string is copied to 'directory' and
|
|
1626
|
+
* has_directory() returns TRUE.
|
|
1627
|
+
* Else, nothing is copied and it returns FALSE.
|
|
1628
|
+
*/
|
|
1629
|
+
{
|
|
1630
|
+
const char * sp;
|
|
1631
|
+
size_t len;
|
|
1632
|
+
|
|
1633
|
+
if (! source)
|
|
1634
|
+
return FALSE;
|
|
1635
|
+
if ((sp = strrchr( source, PATH_DELIM)) == NULL) {
|
|
1636
|
+
return FALSE;
|
|
1637
|
+
} else {
|
|
1638
|
+
len = (size_t)(sp - source) + 1; /* With path-delimiter */
|
|
1639
|
+
memcpy( directory, source, len);
|
|
1640
|
+
directory[ len] = EOS;
|
|
1641
|
+
return TRUE;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
static int is_full_path(
|
|
1646
|
+
const char * path
|
|
1647
|
+
)
|
|
1648
|
+
/*
|
|
1649
|
+
* Check whether the path is a full (absolute) path list or not.
|
|
1650
|
+
*/
|
|
1651
|
+
{
|
|
1652
|
+
if (! path)
|
|
1653
|
+
return FALSE;
|
|
1654
|
+
#if SYS_FAMILY == SYS_UNIX
|
|
1655
|
+
if (path[0] == PATH_DELIM)
|
|
1656
|
+
#elif SYS_FAMILY == SYS_WIN
|
|
1657
|
+
if ((path[1] == ':' && path[2] == PATH_DELIM) /* "C:/path" */
|
|
1658
|
+
|| path[0] == PATH_DELIM) /* Root dir of current drive */
|
|
1659
|
+
#elif 1
|
|
1660
|
+
/* For other systems you should write code here. */
|
|
1661
|
+
if (path[0] == PATH_DELIM)
|
|
1662
|
+
#endif
|
|
1663
|
+
return TRUE;
|
|
1664
|
+
else
|
|
1665
|
+
return FALSE;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
static int search_dir(
|
|
1669
|
+
char * filename, /* File name to include */
|
|
1670
|
+
int searchlocal, /* #include "header.h" */
|
|
1671
|
+
int next /* TRUE if #include_next */
|
|
1672
|
+
)
|
|
1673
|
+
/*
|
|
1674
|
+
* Look in any directories specified by -I command line arguments,
|
|
1675
|
+
* specified by environment variable, then in the builtin search list.
|
|
1676
|
+
*/
|
|
1677
|
+
{
|
|
1678
|
+
const char ** incptr; /* -> inlcude directory */
|
|
1679
|
+
|
|
1680
|
+
incptr = incdir;
|
|
1681
|
+
|
|
1682
|
+
for ( ; incptr < incend; incptr++) {
|
|
1683
|
+
if (strlen( *incptr) + strlen( filename) >= PATHMAX)
|
|
1684
|
+
cfatal( toolong_fname, *incptr, 0L, filename); /* _F_ */
|
|
1685
|
+
if (open_file( incptr, NULL, filename, FALSE, FALSE, FALSE))
|
|
1686
|
+
/* Now infile has been renewed */
|
|
1687
|
+
return TRUE;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
return FALSE;
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
static int open_file(
|
|
1694
|
+
const char ** dirp, /* Pointer to include directory */
|
|
1695
|
+
const char * src_dir, /* Source directory of includer */
|
|
1696
|
+
const char * filename, /* Filename (possibly has directory) */
|
|
1697
|
+
int local, /* #include "file" */
|
|
1698
|
+
int include_opt, /* Specified by -include option */
|
|
1699
|
+
int sys_frame /* System framework header (for SYS_MAC)*/
|
|
1700
|
+
)
|
|
1701
|
+
/*
|
|
1702
|
+
* Open a file, add it to the linked list of open files, close the includer
|
|
1703
|
+
* if nessesary and truncate the includer's buffer.
|
|
1704
|
+
* This is called from open_include() and at_start().
|
|
1705
|
+
*/
|
|
1706
|
+
{
|
|
1707
|
+
char dir_fname[ PATHMAX] = { EOS, };
|
|
1708
|
+
#if HOST_COMPILER == BORLANDC
|
|
1709
|
+
/* Borland's fopen() does not set errno. */
|
|
1710
|
+
static int max_open = FOPEN_MAX - 5;
|
|
1711
|
+
#else
|
|
1712
|
+
static int max_open;
|
|
1713
|
+
#endif
|
|
1714
|
+
int len;
|
|
1715
|
+
FILEINFO * file = infile;
|
|
1716
|
+
FILE * fp;
|
|
1717
|
+
char * fullname;
|
|
1718
|
+
const char * fname;
|
|
1719
|
+
|
|
1720
|
+
errno = 0; /* Clear errno possibly set by path searching */
|
|
1721
|
+
{
|
|
1722
|
+
if (mcpp_debug & PATH)
|
|
1723
|
+
mcpp_fprintf( DBG, "Searching %s%s%s\n", *dirp
|
|
1724
|
+
, src_dir ? src_dir : null, filename);
|
|
1725
|
+
}
|
|
1726
|
+
/* src_dir is usually NULL. This is specified to */
|
|
1727
|
+
/* search the source directory of the includer. */
|
|
1728
|
+
if (src_dir && *src_dir != EOS) {
|
|
1729
|
+
strcpy( dir_fname, src_dir);
|
|
1730
|
+
strcat( dir_fname, filename);
|
|
1731
|
+
fname = dir_fname;
|
|
1732
|
+
} else {
|
|
1733
|
+
fname = filename;
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
fullname = norm_path( *dirp, fname, TRUE, FALSE);
|
|
1737
|
+
/* Convert to absolute path */
|
|
1738
|
+
if (! fullname) /* Non-existent or directory */
|
|
1739
|
+
return FALSE;
|
|
1740
|
+
if (included( fullname)) /* Once included */
|
|
1741
|
+
goto true;
|
|
1742
|
+
|
|
1743
|
+
if ((max_open != 0 && max_open <= include_nest)
|
|
1744
|
+
/* Exceed the known limit of open files */
|
|
1745
|
+
|| ((fp = mcpp_fopen( fullname, "r")) == NULL && errno == EMFILE)) {
|
|
1746
|
+
/* Reached the limit for the first time */
|
|
1747
|
+
if (mcpp_debug & PATH) {
|
|
1748
|
+
#if HOST_COMPILER == BORLANDC
|
|
1749
|
+
if (include_nest == FOPEN_MAX - 5)
|
|
1750
|
+
#else
|
|
1751
|
+
if (max_open == 0)
|
|
1752
|
+
#endif
|
|
1753
|
+
mcpp_fprintf( DBG,
|
|
1754
|
+
"#include nest reached at the maximum of system: %d, returned errno: %d\n"
|
|
1755
|
+
, include_nest, errno);
|
|
1756
|
+
}
|
|
1757
|
+
/*
|
|
1758
|
+
* Table of open files is full.
|
|
1759
|
+
* Remember the file position and close the includer.
|
|
1760
|
+
* The state will be restored by get_line() on end of the included.
|
|
1761
|
+
*/
|
|
1762
|
+
file->pos = ftell( file->fp);
|
|
1763
|
+
fclose( file->fp);
|
|
1764
|
+
/* In case of failure, re-open the includer */
|
|
1765
|
+
if ((fp = mcpp_fopen( fullname, "r")) == NULL) {
|
|
1766
|
+
file->fp = mcpp_fopen( cur_fullname, "r");
|
|
1767
|
+
fseek( file->fp, file->pos, SEEK_SET);
|
|
1768
|
+
goto false;
|
|
1769
|
+
}
|
|
1770
|
+
if (max_open == 0) /* Remember the limit of the system */
|
|
1771
|
+
max_open = include_nest;
|
|
1772
|
+
} else if (fp == NULL) /* No read permission */
|
|
1773
|
+
goto false;
|
|
1774
|
+
/* Truncate buffer of the includer to save memory */
|
|
1775
|
+
len = (int) (file->bptr - file->buffer);
|
|
1776
|
+
if (len) {
|
|
1777
|
+
file->buffer = xrealloc( file->buffer, len + 1);
|
|
1778
|
+
file->bptr = file->buffer + len;
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
if (! include_opt)
|
|
1782
|
+
sharp( NULL, 0); /* Print includer's line num and fname */
|
|
1783
|
+
add_file( fp, src_dir, filename, fullname, include_opt);
|
|
1784
|
+
/* Add file-info to the linked list. 'infile' has been just renewed */
|
|
1785
|
+
/*
|
|
1786
|
+
* Remember the directory for #include_next.
|
|
1787
|
+
* Note: inc_dirp is restored to the parent includer's directory
|
|
1788
|
+
* by get_ch() when the current includer is finished.
|
|
1789
|
+
*/
|
|
1790
|
+
infile->dirp = inc_dirp = dirp;
|
|
1791
|
+
#if 0 /* This part is only for debugging */
|
|
1792
|
+
chk_dirp( dirp);
|
|
1793
|
+
#endif
|
|
1794
|
+
cur_fullname = fullname;
|
|
1795
|
+
|
|
1796
|
+
if (! include_opt) { /* Do not sharp() on -include */
|
|
1797
|
+
src_line = 1; /* Working on line 1 now */
|
|
1798
|
+
sharp( NULL, 1); /* Print out the included file name */
|
|
1799
|
+
}
|
|
1800
|
+
src_line = 0; /* To read the first line */
|
|
1801
|
+
|
|
1802
|
+
if (mkdep && ((mkdep & MD_SYSHEADER) || ! infile->sys_header))
|
|
1803
|
+
put_depend( fullname); /* Output dependency line */
|
|
1804
|
+
|
|
1805
|
+
true:
|
|
1806
|
+
return TRUE;
|
|
1807
|
+
false:
|
|
1808
|
+
free( fullname);
|
|
1809
|
+
return FALSE;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
void add_file(
|
|
1813
|
+
FILE * fp, /* Open file pointer */
|
|
1814
|
+
const char * src_dir, /* Directory of source */
|
|
1815
|
+
const char * filename, /* Name of the file */
|
|
1816
|
+
const char * fullname, /* Full path list */
|
|
1817
|
+
int include_opt /* File specified by -include option */
|
|
1818
|
+
)
|
|
1819
|
+
/*
|
|
1820
|
+
* Initialize tables for this open file. This is called from open_file()
|
|
1821
|
+
* (for #include files), and from the entry to MCPP to open the main input
|
|
1822
|
+
* file. It calls a common routine get_file() to build the FILEINFO
|
|
1823
|
+
* structure which is used to read characters.
|
|
1824
|
+
*/
|
|
1825
|
+
{
|
|
1826
|
+
FILEINFO * file;
|
|
1827
|
+
const char * too_many_include_nest =
|
|
1828
|
+
"More than %.0s%ld nesting of #include"; /* _F_ _W4_ */
|
|
1829
|
+
|
|
1830
|
+
//
|
|
1831
|
+
// When encoding is UTF-8, skip BOM if present.
|
|
1832
|
+
//
|
|
1833
|
+
if(fp != NULL && ftell(fp) == 0)
|
|
1834
|
+
{
|
|
1835
|
+
const unsigned char UTF8_BOM[3] = {0xEF, 0xBB, 0xBF};
|
|
1836
|
+
unsigned char FILE_HEAD[3] = {0, 0, 0};
|
|
1837
|
+
int i;
|
|
1838
|
+
for(i = 0; i < 3; ++i)
|
|
1839
|
+
{
|
|
1840
|
+
FILE_HEAD[i] = getc(fp);
|
|
1841
|
+
if(FILE_HEAD[i] != UTF8_BOM[i])
|
|
1842
|
+
{
|
|
1843
|
+
if(FILE_HEAD[i] == (unsigned char)EOF)
|
|
1844
|
+
{
|
|
1845
|
+
i--;
|
|
1846
|
+
}
|
|
1847
|
+
for(; i >= 0; --i)
|
|
1848
|
+
{
|
|
1849
|
+
ungetc(FILE_HEAD[i], fp);
|
|
1850
|
+
}
|
|
1851
|
+
break;
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
filename = set_fname( filename); /* Search or append to fnamelist[] */
|
|
1857
|
+
fullname = set_fname( fullname); /* Search or append to fnamelist[] */
|
|
1858
|
+
file = get_file( filename, src_dir, fullname, (size_t) NBUFF, include_opt);
|
|
1859
|
+
/* file == infile */
|
|
1860
|
+
file->fp = fp; /* Better remember FILE * */
|
|
1861
|
+
cur_fname = filename;
|
|
1862
|
+
|
|
1863
|
+
if (include_nest >= INCLUDE_NEST) /* Probably recursive #include */
|
|
1864
|
+
cfatal( too_many_include_nest, NULL, (long) INCLUDE_NEST, NULL);
|
|
1865
|
+
if ((warn_level & 4)
|
|
1866
|
+
&& include_nest == std_limits.inc_nest + 1)
|
|
1867
|
+
cwarn( too_many_include_nest, NULL, (long) std_limits.inc_nest, NULL);
|
|
1868
|
+
include_nest++;
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
static const char * set_fname(
|
|
1872
|
+
const char * filename
|
|
1873
|
+
)
|
|
1874
|
+
/*
|
|
1875
|
+
* Register the source filename to fnamelist[].
|
|
1876
|
+
* Search fnamelist[] for filename or append filename to fnamelist[].
|
|
1877
|
+
* Returns the pointer.
|
|
1878
|
+
* file->real_fname and file->full_fname points into fnamelist[].
|
|
1879
|
+
*/
|
|
1880
|
+
{
|
|
1881
|
+
INC_LIST * fnamep;
|
|
1882
|
+
size_t fnamelen;
|
|
1883
|
+
|
|
1884
|
+
if (fnamelist == NULL) { /* Should be initialized */
|
|
1885
|
+
max_fnamelist = INIT_NUM_FNAMELIST;
|
|
1886
|
+
fnamelist = (INC_LIST *) xmalloc( sizeof (INC_LIST) * max_fnamelist);
|
|
1887
|
+
fname_end = &fnamelist[ 0];
|
|
1888
|
+
} else if (fname_end - fnamelist >= max_fnamelist) {
|
|
1889
|
+
/* Buffer full: double the elements */
|
|
1890
|
+
fnamelist = (INC_LIST *) xrealloc( (void *) fnamelist
|
|
1891
|
+
, sizeof (INC_LIST) * max_fnamelist * 2);
|
|
1892
|
+
fname_end = &fnamelist[ max_fnamelist];
|
|
1893
|
+
max_fnamelist *= 2;
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
/* Register the filename in fnamelist[] */
|
|
1897
|
+
fnamelen = strlen( filename);
|
|
1898
|
+
for (fnamep = fnamelist; fnamep < fname_end; fnamep++) {
|
|
1899
|
+
if (fnamep->len == fnamelen && str_case_eq( fnamep->name, filename))
|
|
1900
|
+
return filename; /* Already registered */
|
|
1901
|
+
}
|
|
1902
|
+
fname_end->name = xmalloc( fnamelen + 1);
|
|
1903
|
+
filename = strcpy( fname_end->name, filename);
|
|
1904
|
+
/* Global pointer for get_file() */
|
|
1905
|
+
fname_end->len = fnamelen;
|
|
1906
|
+
fname_end++;
|
|
1907
|
+
|
|
1908
|
+
return filename;
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
#if 0 /* This part is only for debugging */
|
|
1912
|
+
static int chk_dirp(
|
|
1913
|
+
const char ** dirp
|
|
1914
|
+
)
|
|
1915
|
+
/*
|
|
1916
|
+
* Check the validity of include directory specified for open_file().
|
|
1917
|
+
* Called only from open_file().
|
|
1918
|
+
*/
|
|
1919
|
+
{
|
|
1920
|
+
const char ** ip;
|
|
1921
|
+
|
|
1922
|
+
if (dirp == &null)
|
|
1923
|
+
return TRUE;
|
|
1924
|
+
|
|
1925
|
+
for (ip = incdir; ip < incend; ip++)
|
|
1926
|
+
if (dirp == ip)
|
|
1927
|
+
break;
|
|
1928
|
+
if (ip == incend) {
|
|
1929
|
+
#if COMPILER == MSC
|
|
1930
|
+
FILEINFO * pfile = infile->parent;
|
|
1931
|
+
if (pfile) {
|
|
1932
|
+
while ((pfile = pfile->parent) != NULL) {
|
|
1933
|
+
/* Search each parent includer's directory */
|
|
1934
|
+
if (dirp == pfile->dirp)
|
|
1935
|
+
break;
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
if (! pfile)
|
|
1939
|
+
#endif
|
|
1940
|
+
#if COMPILER == GNUC
|
|
1941
|
+
const char ** qdir;
|
|
1942
|
+
for (qdir = quote_dir; qdir < quote_dir_end; qdir++) {
|
|
1943
|
+
if (dirp == qdir)
|
|
1944
|
+
break;
|
|
1945
|
+
}
|
|
1946
|
+
if (qdir == quote_dir_end)
|
|
1947
|
+
#endif
|
|
1948
|
+
{
|
|
1949
|
+
cfatal( "Bug: *dirp:%s is invalid", *dirp, 0L, NULL);
|
|
1950
|
+
return FALSE;
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
return TRUE;
|
|
1954
|
+
}
|
|
1955
|
+
#endif
|
|
1956
|
+
|
|
1957
|
+
FILEINFO* sh_file;
|
|
1958
|
+
int sh_line;
|
|
1959
|
+
|
|
1960
|
+
void sharp(
|
|
1961
|
+
FILEINFO * sharp_file,
|
|
1962
|
+
int flag /* Flag to append to the line for GCC */
|
|
1963
|
+
)
|
|
1964
|
+
/*
|
|
1965
|
+
* Output a line number line.
|
|
1966
|
+
* 'file' is 'sharp_file' if specified,
|
|
1967
|
+
* else (i.e. 'sharp_file' is NULL) 'infile'.
|
|
1968
|
+
*/
|
|
1969
|
+
{
|
|
1970
|
+
FILEINFO * file;
|
|
1971
|
+
int line;
|
|
1972
|
+
|
|
1973
|
+
file = sharp_file ? sharp_file : infile;
|
|
1974
|
+
if (! file)
|
|
1975
|
+
return;
|
|
1976
|
+
while (! file->fp)
|
|
1977
|
+
file = file->parent;
|
|
1978
|
+
line = sharp_file ? sharp_file->line : src_line;
|
|
1979
|
+
if (no_output || file == NULL
|
|
1980
|
+
|| (file == sh_file && line == sh_line))
|
|
1981
|
+
goto sharp_exit;
|
|
1982
|
+
sh_file = file;
|
|
1983
|
+
sh_line = line;
|
|
1984
|
+
if (keep_comments)
|
|
1985
|
+
mcpp_fputc( '\n', OUT); /* Ensure to be on line top */
|
|
1986
|
+
if (std_line_prefix)
|
|
1987
|
+
mcpp_fprintf( OUT, "#line %ld", line);
|
|
1988
|
+
else
|
|
1989
|
+
mcpp_fprintf( OUT, "%s%ld", LINE_PREFIX, line);
|
|
1990
|
+
cur_file( file, sharp_file, flag);
|
|
1991
|
+
mcpp_fputc( '\n', OUT);
|
|
1992
|
+
sharp_exit:
|
|
1993
|
+
wrong_line = FALSE;
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
static void cur_file(
|
|
1997
|
+
FILEINFO * file, /* infile or sharp_file */
|
|
1998
|
+
FILEINFO * sharp_file, /* The 'file' or NULL */
|
|
1999
|
+
int flag /* Flag to append for GCC */
|
|
2000
|
+
)
|
|
2001
|
+
/*
|
|
2002
|
+
* Output current source file name and line number.
|
|
2003
|
+
* Called only from sharp() above.
|
|
2004
|
+
*/
|
|
2005
|
+
{
|
|
2006
|
+
const char * name;
|
|
2007
|
+
|
|
2008
|
+
if (mcpp_debug & MACRO_CALL) { /* In macro notification mode */
|
|
2009
|
+
if (sharp_file) /* Main input file */
|
|
2010
|
+
name = file->filename;
|
|
2011
|
+
else /* Output full-path-list, normalized */
|
|
2012
|
+
name = cur_fullname;
|
|
2013
|
+
} else { /* Usually, the path not "normalized" */
|
|
2014
|
+
if (sharp_file) { /* Main input file */
|
|
2015
|
+
name = file->filename;
|
|
2016
|
+
} else if (str_eq( file->filename, file->real_fname)) {
|
|
2017
|
+
sprintf( work_buf, "%s%s", *(file->dirp), cur_fname);
|
|
2018
|
+
name = work_buf;
|
|
2019
|
+
} else { /* Changed by '#line fname' directive */
|
|
2020
|
+
name = file->filename;
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
if (sharp_filename == NULL || ! str_eq( name, sharp_filename)) {
|
|
2024
|
+
if (sharp_filename != NULL)
|
|
2025
|
+
free( sharp_filename);
|
|
2026
|
+
sharp_filename = save_string( name);
|
|
2027
|
+
}
|
|
2028
|
+
mcpp_fprintf( OUT, " \"%s\"", name);
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
#if SYS_FAMILY == SYS_WIN
|
|
2032
|
+
|
|
2033
|
+
static char * bsl2sl(
|
|
2034
|
+
char * filename
|
|
2035
|
+
)
|
|
2036
|
+
/*
|
|
2037
|
+
* Convert '\\' in the path-list to '/'.
|
|
2038
|
+
*/
|
|
2039
|
+
{
|
|
2040
|
+
static int diagnosed = FALSE;
|
|
2041
|
+
char * cp;
|
|
2042
|
+
|
|
2043
|
+
cp = filename;
|
|
2044
|
+
|
|
2045
|
+
while (*cp) {
|
|
2046
|
+
if (*cp == '\\') {
|
|
2047
|
+
*cp++ = PATH_DELIM;
|
|
2048
|
+
if (!diagnosed && (warn_level & 2) && (warn_level != -1)) {
|
|
2049
|
+
/* Backslash in source program */
|
|
2050
|
+
cwarn( "Converted \\ to %s", "/", 0L, NULL); /* _W2_ */
|
|
2051
|
+
diagnosed = TRUE; /* Diagnose only once */
|
|
2052
|
+
}
|
|
2053
|
+
} else {
|
|
2054
|
+
cp++;
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
return filename;
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
#endif /* SYS_FAMILY == SYS_WIN */
|
|
2062
|
+
|
|
2063
|
+
static const char * const unknown_arg =
|
|
2064
|
+
"Unknown argument \"%s\""; /*_W1_*/
|
|
2065
|
+
static const char * const not_ident =
|
|
2066
|
+
"Not an identifier \"%s\""; /*_W1_*/
|
|
2067
|
+
|
|
2068
|
+
static int is_junk( void)
|
|
2069
|
+
/*
|
|
2070
|
+
* Check the trailing junk in a directive line.
|
|
2071
|
+
* This routine is never called in OLD_PREP mode.
|
|
2072
|
+
*/
|
|
2073
|
+
{
|
|
2074
|
+
int c;
|
|
2075
|
+
|
|
2076
|
+
c = skip_ws();
|
|
2077
|
+
unget_ch();
|
|
2078
|
+
if (c != '\n') { /* Trailing junk */
|
|
2079
|
+
if (warn_level & 1)
|
|
2080
|
+
cwarn( unknown_arg, infile->bptr, 0L, NULL);
|
|
2081
|
+
return TRUE;
|
|
2082
|
+
} else {
|
|
2083
|
+
return FALSE;
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
#define PUSH 1
|
|
2088
|
+
#define POP -1
|
|
2089
|
+
|
|
2090
|
+
#define __SETLOCALE 1 /* #pragma __setlocale( "encoding") */
|
|
2091
|
+
#define SETLOCALE 2 /* #pragma setlocale( "encoding") */
|
|
2092
|
+
|
|
2093
|
+
void do_pragma( void)
|
|
2094
|
+
/*
|
|
2095
|
+
* Process the #pragma lines.
|
|
2096
|
+
* 1. Process the sub-directive for MCPP.
|
|
2097
|
+
* 2. Pass the line to the compiler-proper.
|
|
2098
|
+
* #pragma MCPP put_defines, #pragma MCPP preprocess,
|
|
2099
|
+
* #pragma MCPP preprocessed and #pragma once are, however, not put
|
|
2100
|
+
* out so as not to duplicate output when re-preprocessed.
|
|
2101
|
+
* When EXPAND_PRAGMA == TRUE and (__STDC_VERSION__ >= 199901L or
|
|
2102
|
+
* __cplusplus >= 199901L), the line is subject to macro expansion unless
|
|
2103
|
+
* the next to 'pragma' token is one of 'STDC', 'GCC' or 'MCPP'.
|
|
2104
|
+
*/
|
|
2105
|
+
{
|
|
2106
|
+
int c;
|
|
2107
|
+
int warn = FALSE; /* Necessity of warning */
|
|
2108
|
+
int token_type;
|
|
2109
|
+
char * bp; /* Pointer to argument */
|
|
2110
|
+
char * tp;
|
|
2111
|
+
FILEINFO * file;
|
|
2112
|
+
|
|
2113
|
+
wrong_line = TRUE; /* In case of error */
|
|
2114
|
+
c = skip_ws();
|
|
2115
|
+
bp = infile->bptr - 1; /* Remember token to pass to compiler */
|
|
2116
|
+
if (c == '\n') {
|
|
2117
|
+
if (warn_level & 1)
|
|
2118
|
+
cwarn( "No sub-directive", NULL, 0L, NULL); /* _W1_ */
|
|
2119
|
+
unget_ch();
|
|
2120
|
+
return;
|
|
2121
|
+
}
|
|
2122
|
+
token_type = scan_token( c, (tp = work_buf, &tp), work_end);
|
|
2123
|
+
#if EXPAND_PRAGMA
|
|
2124
|
+
if (stdc3 && token_type == NAM
|
|
2125
|
+
&& !str_eq( identifier, "STDC") && !str_eq( identifier, "MCPP")) {
|
|
2126
|
+
DEFBUF * defp;
|
|
2127
|
+
char * mp;
|
|
2128
|
+
char * mp_end;
|
|
2129
|
+
LINE_COL line_col = { 0L, 0};
|
|
2130
|
+
|
|
2131
|
+
bp = mp = xmalloc( (size_t)(NMACWORK + IDMAX));
|
|
2132
|
+
/* Buffer for macro expansion */
|
|
2133
|
+
mp_end = mp + NMACWORK;
|
|
2134
|
+
tp = stpcpy( mp, identifier);
|
|
2135
|
+
do { /* Expand all the macros in the line */
|
|
2136
|
+
int has_pragma;
|
|
2137
|
+
if (token_type == NAM && (defp = is_macro( &tp)) != NULL) {
|
|
2138
|
+
tp = expand_macro( defp, bp, mp_end, line_col, & has_pragma);
|
|
2139
|
+
if (has_pragma)
|
|
2140
|
+
cerror( "_Pragma operator found in #pragma line" /* _E_ */
|
|
2141
|
+
, NULL, 0L, NULL);
|
|
2142
|
+
if (! stdc3 && (warn_level & 2))
|
|
2143
|
+
cwarn(
|
|
2144
|
+
"\"%s\" is macro expanded in other than C99 mode" /* _W2_ */
|
|
2145
|
+
, identifier, 0L, NULL);
|
|
2146
|
+
}
|
|
2147
|
+
token_type = scan_token( c = get_ch(), (bp = tp, &tp), mp_end);
|
|
2148
|
+
} while (c != '\n');
|
|
2149
|
+
unget_string( mp, NULL); /* To re-read */
|
|
2150
|
+
free( mp);
|
|
2151
|
+
c = skip_ws();
|
|
2152
|
+
bp = infile->bptr - 1;
|
|
2153
|
+
token_type = scan_token( c, (tp = work_buf, &tp), work_end);
|
|
2154
|
+
}
|
|
2155
|
+
#endif
|
|
2156
|
+
if (token_type != NAM) {
|
|
2157
|
+
if (warn_level & 1)
|
|
2158
|
+
cwarn( not_ident, work_buf, 0L, NULL);
|
|
2159
|
+
goto skip_nl;
|
|
2160
|
+
} else if (str_eq( identifier, "once")) { /* #pragma once */
|
|
2161
|
+
if (! is_junk()) {
|
|
2162
|
+
file = infile;
|
|
2163
|
+
while (file->fp == NULL)
|
|
2164
|
+
file = file->parent;
|
|
2165
|
+
do_once( file->full_fname);
|
|
2166
|
+
goto skip_nl;
|
|
2167
|
+
}
|
|
2168
|
+
} else if (str_eq( identifier, "MCPP")) {
|
|
2169
|
+
if (scan_token( skip_ws(), (tp = work_buf, &tp), work_end) != NAM) {
|
|
2170
|
+
if (warn_level & 1)
|
|
2171
|
+
cwarn( not_ident, work_buf, 0L, NULL);
|
|
2172
|
+
}
|
|
2173
|
+
if (str_eq( identifier, "put_defines")) {
|
|
2174
|
+
if (! is_junk())
|
|
2175
|
+
dump_def( TRUE, FALSE); /* #pragma MCPP put_defines */
|
|
2176
|
+
} else if (str_eq( identifier, "preprocess")) {
|
|
2177
|
+
if (! is_junk()) /* #pragma MCPP preprocess */
|
|
2178
|
+
mcpp_fputs( "#pragma MCPP preprocessed\n", OUT);
|
|
2179
|
+
/* Just putout the directive */
|
|
2180
|
+
} else if (str_eq( identifier, "preprocessed")) {
|
|
2181
|
+
if (! is_junk()) { /* #pragma MCPP preprocessed*/
|
|
2182
|
+
skip_nl();
|
|
2183
|
+
do_preprocessed();
|
|
2184
|
+
return;
|
|
2185
|
+
}
|
|
2186
|
+
} else if (str_eq( identifier, "warning")) {
|
|
2187
|
+
/* #pragma MCPP warning */
|
|
2188
|
+
cwarn( infile->buffer, NULL, 0L, NULL);
|
|
2189
|
+
} else if (str_eq( identifier, "push_macro")) {
|
|
2190
|
+
push_or_pop( PUSH); /* #pragma MCPP push_macro */
|
|
2191
|
+
} else if (str_eq( identifier, "pop_macro")) {
|
|
2192
|
+
push_or_pop( POP); /* #pragma MCPP pop_macro */
|
|
2193
|
+
} else if (str_eq( identifier, "debug")) {
|
|
2194
|
+
do_debug( TRUE); /* #pragma MCPP debug */
|
|
2195
|
+
} else if (str_eq( identifier, "end_debug")) {
|
|
2196
|
+
do_debug( FALSE); /* #pragma MCPP end_debug */
|
|
2197
|
+
} else {
|
|
2198
|
+
warn = TRUE;
|
|
2199
|
+
}
|
|
2200
|
+
if (warn && (warn_level & 1))
|
|
2201
|
+
cwarn( unknown_arg, identifier, 0L, NULL);
|
|
2202
|
+
goto skip_nl; /* Do not putout the line */
|
|
2203
|
+
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
if (warn) {
|
|
2207
|
+
if (warn_level & 1)
|
|
2208
|
+
cwarn( unknown_arg, identifier, 0L, NULL);
|
|
2209
|
+
goto skip_nl; /* Do not putout the line */
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
sharp( NULL, 0); /* Synchronize line number before output */
|
|
2213
|
+
if (! no_output) {
|
|
2214
|
+
mcpp_fputs( "#pragma ", OUT);
|
|
2215
|
+
mcpp_fputs( bp, OUT); /* Line is put out */
|
|
2216
|
+
}
|
|
2217
|
+
skip_nl: /* Don't use skip_nl() which skips to the newline in source file */
|
|
2218
|
+
while (get_ch() != '\n')
|
|
2219
|
+
;
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
static void do_once(
|
|
2223
|
+
const char * fullname /* Full-path-list of the header */
|
|
2224
|
+
)
|
|
2225
|
+
/*
|
|
2226
|
+
* Process #pragma once so as not to re-include the file later.
|
|
2227
|
+
* This directive has been imported from GCC V.1.* / cpp as an extension.
|
|
2228
|
+
*/
|
|
2229
|
+
{
|
|
2230
|
+
if (once_list == NULL) { /* Should initialize */
|
|
2231
|
+
max_once = INIT_NUM_ONCE;
|
|
2232
|
+
once_list = (INC_LIST *) xmalloc( sizeof (INC_LIST) * max_once);
|
|
2233
|
+
once_end = &once_list[ 0];
|
|
2234
|
+
} else if (once_end - once_list >= max_once) {
|
|
2235
|
+
/* Double the elements */
|
|
2236
|
+
once_list = (INC_LIST *) xrealloc( (void *) once_list
|
|
2237
|
+
, sizeof (INC_LIST) * max_once * 2);
|
|
2238
|
+
once_end = &once_list[ max_once];
|
|
2239
|
+
max_once *= 2;
|
|
2240
|
+
}
|
|
2241
|
+
once_end->name = (char*)fullname;
|
|
2242
|
+
once_end->len = strlen( fullname);
|
|
2243
|
+
once_end++;
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
static int included(
|
|
2247
|
+
const char * fullname
|
|
2248
|
+
)
|
|
2249
|
+
/*
|
|
2250
|
+
* Has the file been once included ?
|
|
2251
|
+
* This routine is only called from open_file().
|
|
2252
|
+
*/
|
|
2253
|
+
{
|
|
2254
|
+
INC_LIST * inc;
|
|
2255
|
+
size_t fnamelen;
|
|
2256
|
+
|
|
2257
|
+
if (once_list == NULL) /* No once file registered */
|
|
2258
|
+
return FALSE;
|
|
2259
|
+
fnamelen = strlen( fullname);
|
|
2260
|
+
for (inc = once_list; inc < once_end; inc++) {
|
|
2261
|
+
if (inc->len == fnamelen && str_case_eq( inc->name, fullname)) {
|
|
2262
|
+
/* Already included */
|
|
2263
|
+
if (mcpp_debug & PATH)
|
|
2264
|
+
mcpp_fprintf( DBG, "Once included \"%s\"\n", fullname);
|
|
2265
|
+
return TRUE;
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
return FALSE; /* Not yet included */
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
static void push_or_pop(
|
|
2272
|
+
int direction
|
|
2273
|
+
)
|
|
2274
|
+
/* Process #pragma MCPP push_macro( "MACRO"),
|
|
2275
|
+
* #pragma MCPP pop_macro( "MACRO") for other compilers than Visual C,
|
|
2276
|
+
* and #pragma push_macro( "MACRO"), #pragma pop_macro( "MACRO") for Visual C.
|
|
2277
|
+
* Note:1. "push" count is set in defp->push.
|
|
2278
|
+
* 2. pushed definitions are inserted immediatly after the current
|
|
2279
|
+
* definition of the same name.
|
|
2280
|
+
* 3. the definitions of a same name macro can be pushed multiple times.
|
|
2281
|
+
*/
|
|
2282
|
+
{
|
|
2283
|
+
char * tp;
|
|
2284
|
+
DEFBUF ** prevp;
|
|
2285
|
+
DEFBUF * defp;
|
|
2286
|
+
DEFBUF * dp;
|
|
2287
|
+
int cmp;
|
|
2288
|
+
size_t s_name, s_def;
|
|
2289
|
+
|
|
2290
|
+
if (skip_ws() == '('
|
|
2291
|
+
&& scan_token( skip_ws(), (tp = work_buf, &tp), work_end) == STR
|
|
2292
|
+
&& skip_ws() == ')') { /* Correct syntax */
|
|
2293
|
+
|
|
2294
|
+
if (is_junk())
|
|
2295
|
+
return;
|
|
2296
|
+
s_name = strlen( work_buf) - 2;
|
|
2297
|
+
*(work_buf + s_name + 1) = '\0';
|
|
2298
|
+
memcpy( identifier, work_buf + 1, s_name + 1);
|
|
2299
|
+
/* Remove enclosing '"' */
|
|
2300
|
+
prevp = look_prev( identifier, &cmp);
|
|
2301
|
+
if (cmp == 0) { /* Current definition or pushed definition exists */
|
|
2302
|
+
defp = *prevp;
|
|
2303
|
+
if (direction == PUSH) {/* #pragma push_macro( "MACRO") */
|
|
2304
|
+
if (defp->push) { /* No current definition*/
|
|
2305
|
+
if (warn_level & 1)
|
|
2306
|
+
cwarn( "\"%s\" is already pushed" /* _W1_ */
|
|
2307
|
+
, identifier, 0L, NULL);
|
|
2308
|
+
return;
|
|
2309
|
+
}
|
|
2310
|
+
/* Else the current definition exists. Push it */
|
|
2311
|
+
s_def = sizeof (DEFBUF) + 3 + s_name
|
|
2312
|
+
+ strlen( defp->repl) + strlen( defp->fname);
|
|
2313
|
+
s_def += strlen( defp->parmnames);
|
|
2314
|
+
dp = (DEFBUF *) xmalloc( s_def);
|
|
2315
|
+
memcpy( dp, defp, s_def); /* Copy the definition */
|
|
2316
|
+
dp->link = *prevp; /* Insert to linked-list*/
|
|
2317
|
+
*prevp = dp; /* the pushed def */
|
|
2318
|
+
prevp = &dp->link; /* Next link to search */
|
|
2319
|
+
} else { /* #pragma pop_macro( "MACRO") */
|
|
2320
|
+
if (defp->push == 0) { /* Current definition */
|
|
2321
|
+
if (defp->link == NULL
|
|
2322
|
+
|| ! str_eq( identifier, defp->link->name)) {
|
|
2323
|
+
if (warn_level & 1)
|
|
2324
|
+
cwarn( "\"%s\" has not been pushed" /* _W1_ */
|
|
2325
|
+
, identifier, 0L, NULL);
|
|
2326
|
+
return;
|
|
2327
|
+
} else {
|
|
2328
|
+
*prevp = defp->link;
|
|
2329
|
+
/* Link the previous and the next */
|
|
2330
|
+
free( defp);
|
|
2331
|
+
/* Delete the definition to enable popped def */
|
|
2332
|
+
}
|
|
2333
|
+
} /* Else no current definition exists */
|
|
2334
|
+
}
|
|
2335
|
+
while ((defp = *prevp) != NULL) {
|
|
2336
|
+
/* Increment or decrement "push" count of all pushed defs */
|
|
2337
|
+
if ((cmp = memcmp( defp->name, identifier, s_name)) > 0)
|
|
2338
|
+
break;
|
|
2339
|
+
defp->push += direction; /* Increment or decrement */
|
|
2340
|
+
prevp = &defp->link;
|
|
2341
|
+
}
|
|
2342
|
+
} else { /* No current definition nor pushed definition */
|
|
2343
|
+
if (warn_level & 1)
|
|
2344
|
+
cwarn( "\"%s\" has not been defined" /* _W1_ */
|
|
2345
|
+
, identifier, 0L, NULL);
|
|
2346
|
+
}
|
|
2347
|
+
} else { /* Wrong syntax */
|
|
2348
|
+
if (warn_level & 1)
|
|
2349
|
+
cwarn( "Bad %s syntax", direction == PUSH /* _W1_ */
|
|
2350
|
+
? "push_macro" : "pop_macro", 0L, NULL);
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
|
|
2355
|
+
void do_old( void)
|
|
2356
|
+
/*
|
|
2357
|
+
* Process the out-of-standard directives.
|
|
2358
|
+
* GCC permits #include_next and #warning even in STANDARD mode.
|
|
2359
|
+
*/
|
|
2360
|
+
{
|
|
2361
|
+
static const char * const unknown
|
|
2362
|
+
= "Unknown #directive \"%s\"%.0ld%s"; /* _E_ _W8_ */
|
|
2363
|
+
|
|
2364
|
+
if (compiling) {
|
|
2365
|
+
cerror( unknown, identifier, 0L, NULL);
|
|
2366
|
+
} else if (warn_level & 8) {
|
|
2367
|
+
cwarn( unknown, identifier, 0L, " (in skipped block)");
|
|
2368
|
+
}
|
|
2369
|
+
skip_nl();
|
|
2370
|
+
unget_ch();
|
|
2371
|
+
return;
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2374
|
+
static void do_preprocessed( void)
|
|
2375
|
+
/*
|
|
2376
|
+
* The source file has been already preprocessed.
|
|
2377
|
+
* Copy the lines to output.
|
|
2378
|
+
* Install macros according the #define directives.
|
|
2379
|
+
*/
|
|
2380
|
+
{
|
|
2381
|
+
const char * corrupted =
|
|
2382
|
+
"This preprocessed file is corrupted"; /* _F_ */
|
|
2383
|
+
FILEINFO * file;
|
|
2384
|
+
char * lbuf;
|
|
2385
|
+
char * cp;
|
|
2386
|
+
const char ** incptr;
|
|
2387
|
+
char * comment = NULL;
|
|
2388
|
+
char * colon = NULL;
|
|
2389
|
+
const char * dir;
|
|
2390
|
+
#if STD_LINE_PREFIX == FALSE
|
|
2391
|
+
char conv[ NBUFF];
|
|
2392
|
+
char * arg;
|
|
2393
|
+
|
|
2394
|
+
/*
|
|
2395
|
+
* Compiler cannot accept C source style #line.
|
|
2396
|
+
* Convert it to the compiler-specific format.
|
|
2397
|
+
*/
|
|
2398
|
+
strcpy( conv, LINE_PREFIX);
|
|
2399
|
+
arg = conv + strlen( conv);
|
|
2400
|
+
#endif
|
|
2401
|
+
file = infile;
|
|
2402
|
+
lbuf = file->bptr = file->buffer; /* Reset file->bptr */
|
|
2403
|
+
|
|
2404
|
+
/* Copy the input to output until a comment line appears. */
|
|
2405
|
+
while (fgets( lbuf, NBUFF, file->fp) != NULL
|
|
2406
|
+
&& memcmp( lbuf, "/*", 2) != 0) {
|
|
2407
|
+
#if STD_LINE_PREFIX == FALSE
|
|
2408
|
+
if (memcmp( lbuf, "#line ", 6) == 0) {
|
|
2409
|
+
strcpy( arg, lbuf + 6);
|
|
2410
|
+
mcpp_fputs( conv, OUT);
|
|
2411
|
+
} else
|
|
2412
|
+
#endif
|
|
2413
|
+
{
|
|
2414
|
+
mcpp_fputs( lbuf, OUT);
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
if (! str_eq( lbuf, "/* Currently defined macros. */\n"))
|
|
2418
|
+
cfatal( "This is not a preprocessed source" /* _F_ */
|
|
2419
|
+
, NULL, 0L, NULL);
|
|
2420
|
+
|
|
2421
|
+
/* Define macros according to the #define lines. */
|
|
2422
|
+
while (fgets( lbuf, NWORK, file->fp) != NULL) {
|
|
2423
|
+
if (memcmp( lbuf, "/*", 2) == 0) {
|
|
2424
|
+
/* Standard predefined macro */
|
|
2425
|
+
continue;
|
|
2426
|
+
}
|
|
2427
|
+
if (memcmp( lbuf, "#define ", 8) != 0) {
|
|
2428
|
+
if (memcmp( lbuf, "#line", 5) == 0)
|
|
2429
|
+
continue;
|
|
2430
|
+
else
|
|
2431
|
+
cfatal( corrupted, NULL, 0L, NULL);
|
|
2432
|
+
}
|
|
2433
|
+
/* Filename and line-number information in comment as: */
|
|
2434
|
+
/* dir/fname:1234\t*/
|
|
2435
|
+
cp = lbuf + strlen( lbuf);
|
|
2436
|
+
if ((memcmp( cp - 4, "\t*/\n", 4) != 0)
|
|
2437
|
+
|| (*(cp - 4) = EOS
|
|
2438
|
+
, (comment = strrchr( lbuf, '*')) == NULL)
|
|
2439
|
+
|| (memcmp( --comment, "/* ", 3) != 0)
|
|
2440
|
+
|| ((colon = strrchr( comment, ':')) == NULL))
|
|
2441
|
+
cfatal( corrupted, NULL, 0L, NULL);
|
|
2442
|
+
src_line = atol( colon + 1); /* Pseudo line number */
|
|
2443
|
+
*colon = EOS;
|
|
2444
|
+
dir = comment + 3;
|
|
2445
|
+
inc_dirp = &null;
|
|
2446
|
+
/* Search the include directory list */
|
|
2447
|
+
for (incptr = incdir ; incptr < incend; incptr++) {
|
|
2448
|
+
if (memcmp( *incptr, dir, strlen( *incptr)) == 0) {
|
|
2449
|
+
inc_dirp = incptr;
|
|
2450
|
+
break;
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
/* Register the filename to fnamelist[] */
|
|
2454
|
+
/* inc_dirp may be NULL, and cur_fname may be "(predefined)" */
|
|
2455
|
+
cur_fname = set_fname( dir + strlen( *inc_dirp));
|
|
2456
|
+
strcpy( comment - 2, "\n"); /* Remove the comment */
|
|
2457
|
+
unget_string( lbuf + 8, NULL);
|
|
2458
|
+
do_define( FALSE, 0);
|
|
2459
|
+
get_ch(); /* '\n' */
|
|
2460
|
+
get_ch(); /* Clear the "file" */
|
|
2461
|
+
unget_ch(); /* infile == file */
|
|
2462
|
+
}
|
|
2463
|
+
file->bptr = file->buffer + strlen( file->buffer);
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
static int do_debug(
|
|
2467
|
+
int set /* TRUE to set debugging */
|
|
2468
|
+
)
|
|
2469
|
+
/*
|
|
2470
|
+
* #pragma MCPP debug, #pragma MCPP end_debug, #debug, #end_debug
|
|
2471
|
+
* Return TRUE when diagnostic is issued else return FALSE.
|
|
2472
|
+
*/
|
|
2473
|
+
{
|
|
2474
|
+
struct Debug_arg {
|
|
2475
|
+
const char * arg_name; /* Name of option */
|
|
2476
|
+
int arg_num; /* Value of 'debug' */
|
|
2477
|
+
};
|
|
2478
|
+
static struct Debug_arg debug_args[] = {
|
|
2479
|
+
{ "path", PATH },
|
|
2480
|
+
{ "token", TOKEN },
|
|
2481
|
+
{ "expand", EXPAND },
|
|
2482
|
+
{ "macro_call", MACRO_CALL }, /* Implemented only in STD mode */
|
|
2483
|
+
{ "if", IF },
|
|
2484
|
+
{ "expression", EXPRESSION },
|
|
2485
|
+
{ "getc", GETC },
|
|
2486
|
+
{ "memory", MEMORY },
|
|
2487
|
+
{ NULL, 0 },
|
|
2488
|
+
};
|
|
2489
|
+
struct Debug_arg *argp;
|
|
2490
|
+
int num;
|
|
2491
|
+
int c;
|
|
2492
|
+
|
|
2493
|
+
c = skip_ws();
|
|
2494
|
+
if (c == '\n') {
|
|
2495
|
+
unget_ch();
|
|
2496
|
+
if (set) {
|
|
2497
|
+
if (warn_level & 1)
|
|
2498
|
+
cwarn( "No argument", NULL, 0L, NULL); /* _W1_ */
|
|
2499
|
+
return TRUE;
|
|
2500
|
+
} else {
|
|
2501
|
+
mcpp_debug = 0; /* Clear all the flags */
|
|
2502
|
+
return FALSE;
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
while (scan_token( c, (workp = work_buf, &workp), work_end) == NAM) {
|
|
2506
|
+
argp = debug_args;
|
|
2507
|
+
while (argp->arg_name) {
|
|
2508
|
+
if (str_eq( argp->arg_name, work_buf))
|
|
2509
|
+
break;
|
|
2510
|
+
argp++;
|
|
2511
|
+
}
|
|
2512
|
+
if (argp->arg_name == NULL) {
|
|
2513
|
+
if (warn_level & 1)
|
|
2514
|
+
cwarn( unknown_arg, work_buf, 0L, NULL);
|
|
2515
|
+
goto diagnosed;
|
|
2516
|
+
} else {
|
|
2517
|
+
num = argp->arg_num;
|
|
2518
|
+
if (set) {
|
|
2519
|
+
mcpp_debug |= num;
|
|
2520
|
+
if (num == PATH)
|
|
2521
|
+
dump_path();
|
|
2522
|
+
else if (num == MEMORY)
|
|
2523
|
+
print_heap();
|
|
2524
|
+
else if (num == MACRO_CALL)
|
|
2525
|
+
// option_flags.k = TRUE; /* This pragma needs this mode */
|
|
2526
|
+
;
|
|
2527
|
+
} else {
|
|
2528
|
+
mcpp_debug &= ~num;
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
c = skip_ws();
|
|
2532
|
+
}
|
|
2533
|
+
if (c != '\n') {
|
|
2534
|
+
if (warn_level & 1) {
|
|
2535
|
+
if (c != '\n') {
|
|
2536
|
+
cwarn( not_ident, work_buf, 0L, NULL);
|
|
2537
|
+
} else {
|
|
2538
|
+
cwarn( unknown_arg, work_buf, 0L, NULL);
|
|
2539
|
+
mcpp_debug &= ~num; /* Disable */
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
skip_nl();
|
|
2543
|
+
unget_ch();
|
|
2544
|
+
goto diagnosed;
|
|
2545
|
+
}
|
|
2546
|
+
unget_ch();
|
|
2547
|
+
return FALSE;
|
|
2548
|
+
diagnosed:
|
|
2549
|
+
return TRUE;
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
static void dump_path( void)
|
|
2553
|
+
/*
|
|
2554
|
+
* Show the include directories.
|
|
2555
|
+
*/
|
|
2556
|
+
{
|
|
2557
|
+
const char ** incptr;
|
|
2558
|
+
const char * inc_dir;
|
|
2559
|
+
const char * dir = "./";
|
|
2560
|
+
|
|
2561
|
+
mcpp_fputs( "Include paths are as follows --\n", DBG);
|
|
2562
|
+
for (incptr = incdir; incptr < incend; incptr++) {
|
|
2563
|
+
inc_dir = *incptr;
|
|
2564
|
+
if (*inc_dir == '\0')
|
|
2565
|
+
inc_dir = dir;
|
|
2566
|
+
mcpp_fprintf( DBG, " %s\n", inc_dir);
|
|
2567
|
+
}
|
|
2568
|
+
mcpp_fputs( "End of include path list.\n", DBG);
|
|
2569
|
+
}
|
|
2570
|
+
|
|
2571
|
+
/*
|
|
2572
|
+
* Note: The getopt() of glibc should not be used since the specification
|
|
2573
|
+
* differs from the standard one.
|
|
2574
|
+
* Use this mcpp_getopt() for mcpp.
|
|
2575
|
+
*/
|
|
2576
|
+
|
|
2577
|
+
/* Based on the public-domain-software released by AT&T in 1985. */
|
|
2578
|
+
|
|
2579
|
+
#define OPTERR( s, c) if (mcpp_opterr) { \
|
|
2580
|
+
mcpp_fputs( argv[0], ERR); \
|
|
2581
|
+
mcpp_fputs( s, ERR); \
|
|
2582
|
+
mcpp_fputc( c, ERR); \
|
|
2583
|
+
mcpp_fputc( '\n', ERR); \
|
|
2584
|
+
}
|
|
2585
|
+
|
|
2586
|
+
static int mcpp_getopt(
|
|
2587
|
+
int argc,
|
|
2588
|
+
char * const * argv,
|
|
2589
|
+
const char * opts
|
|
2590
|
+
)
|
|
2591
|
+
/*
|
|
2592
|
+
* Get the next option (and it's argument) from the command line.
|
|
2593
|
+
*/
|
|
2594
|
+
{
|
|
2595
|
+
const char * const error1 = ": option requires an argument --";
|
|
2596
|
+
const char * const error2 = ": illegal option --";
|
|
2597
|
+
static int sp = 1;
|
|
2598
|
+
int c;
|
|
2599
|
+
const char * cp;
|
|
2600
|
+
|
|
2601
|
+
if (sp == 1) {
|
|
2602
|
+
if (argc <= mcpp_optind ||
|
|
2603
|
+
argv[ mcpp_optind][ 0] != '-'
|
|
2604
|
+
|| argv[ mcpp_optind][ 1] == '\0') {
|
|
2605
|
+
return EOF;
|
|
2606
|
+
} else if (strcmp( argv[ mcpp_optind], "--") == 0) {
|
|
2607
|
+
mcpp_optind++;
|
|
2608
|
+
return EOF;
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
/* mcpp_optopt = c = (unsigned char) argv[ mcpp_optind][ sp]; */
|
|
2612
|
+
mcpp_optopt = c = argv[ mcpp_optind][ sp] & UCHARMAX;
|
|
2613
|
+
if (c == ':' || (cp = strchr( opts, c)) == NULL) {
|
|
2614
|
+
OPTERR( error2, c)
|
|
2615
|
+
if (argv[ mcpp_optind][ ++sp] == '\0') {
|
|
2616
|
+
mcpp_optind++;
|
|
2617
|
+
sp = 1;
|
|
2618
|
+
}
|
|
2619
|
+
return '?';
|
|
2620
|
+
}
|
|
2621
|
+
if (*++cp == ':') {
|
|
2622
|
+
if (argv[ mcpp_optind][ sp+1] != '\0') {
|
|
2623
|
+
mcpp_optarg = &argv[ mcpp_optind++][ sp+1];
|
|
2624
|
+
} else if (argc <= ++mcpp_optind) {
|
|
2625
|
+
OPTERR( error1, c)
|
|
2626
|
+
sp = 1;
|
|
2627
|
+
return '?';
|
|
2628
|
+
} else {
|
|
2629
|
+
mcpp_optarg = argv[ mcpp_optind++];
|
|
2630
|
+
}
|
|
2631
|
+
sp = 1;
|
|
2632
|
+
} else {
|
|
2633
|
+
if (argv[ mcpp_optind][ ++sp] == '\0') {
|
|
2634
|
+
sp = 1;
|
|
2635
|
+
mcpp_optind++;
|
|
2636
|
+
}
|
|
2637
|
+
mcpp_optarg = NULL;
|
|
2638
|
+
}
|
|
2639
|
+
return c;
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
#if ! HOST_HAVE_STPCPY
|
|
2643
|
+
char * stpcpy(
|
|
2644
|
+
char * dest,
|
|
2645
|
+
const char * src
|
|
2646
|
+
)
|
|
2647
|
+
/*
|
|
2648
|
+
* Copy the string and return the advanced pointer.
|
|
2649
|
+
*/
|
|
2650
|
+
{
|
|
2651
|
+
const char * s;
|
|
2652
|
+
char * d;
|
|
2653
|
+
|
|
2654
|
+
for (s = src, d = dest; (*d++ = *s++) != '\0'; )
|
|
2655
|
+
;
|
|
2656
|
+
return d - 1;
|
|
2657
|
+
}
|
|
2658
|
+
#endif
|
|
2659
|
+
|
|
2660
|
+
/*
|
|
2661
|
+
* list_heap() is a function to print out information of heap-memory.
|
|
2662
|
+
* See "kmmalloc-2.5.3.zip" by kmatsui.
|
|
2663
|
+
*/
|
|
2664
|
+
#if KMMALLOC
|
|
2665
|
+
int list_heap( int);
|
|
2666
|
+
#elif BSD_MALLOC
|
|
2667
|
+
int list_heap( char *);
|
|
2668
|
+
#elif DB_MALLOC || DMALLOC
|
|
2669
|
+
int list_heap( FILE *);
|
|
2670
|
+
#endif
|
|
2671
|
+
|
|
2672
|
+
void print_heap( void)
|
|
2673
|
+
{
|
|
2674
|
+
#if KMMALLOC
|
|
2675
|
+
list_heap( 1);
|
|
2676
|
+
#elif BSD_MALLOC
|
|
2677
|
+
list_heap( ":cpp");
|
|
2678
|
+
#elif DB_MALLOC || DMALLOC || PHK_MALLOC || DLMALLOC
|
|
2679
|
+
list_heap( fp_debug);
|
|
2680
|
+
#endif
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2683
|
+
void at_end( void)
|
|
2684
|
+
/*
|
|
2685
|
+
* Handle the commands to be executed at the end of processing.
|
|
2686
|
+
*/
|
|
2687
|
+
{
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
void clear_filelist( void)
|
|
2691
|
+
/*
|
|
2692
|
+
* Free malloced memory for filename-list and directory-list.
|
|
2693
|
+
*/
|
|
2694
|
+
{
|
|
2695
|
+
const char ** incp;
|
|
2696
|
+
INC_LIST * namep;
|
|
2697
|
+
|
|
2698
|
+
for (incp = incdir; incp < incend; incp++)
|
|
2699
|
+
free( (void *) *incp);
|
|
2700
|
+
free( (void *) incdir);
|
|
2701
|
+
for (namep = fnamelist; namep < fname_end; namep++)
|
|
2702
|
+
free( (void *) namep->name);
|
|
2703
|
+
free( (void *) fnamelist);
|
|
2704
|
+
free( (void *) once_list);
|
|
2705
|
+
}
|
|
2706
|
+
|
|
2707
|
+
#ifdef _WIN32
|
|
2708
|
+
# include <Windows.h>
|
|
2709
|
+
#endif
|
|
2710
|
+
|
|
2711
|
+
FILE* mcpp_fopen(const char* filename, const char* mode)
|
|
2712
|
+
{
|
|
2713
|
+
#ifdef _WIN32
|
|
2714
|
+
FILE* f = 0;
|
|
2715
|
+
if(filename && mode)
|
|
2716
|
+
{
|
|
2717
|
+
int wfilenameLength = strlen(filename) + 1;
|
|
2718
|
+
wchar_t* wfilename = malloc(wfilenameLength * sizeof(wchar_t));
|
|
2719
|
+
if(wfilename)
|
|
2720
|
+
{
|
|
2721
|
+
if(MultiByteToWideChar(CP_UTF8, 0, filename, -1, wfilename, wfilenameLength))
|
|
2722
|
+
{
|
|
2723
|
+
int wmodeLength = strlen(mode) + 1;
|
|
2724
|
+
wchar_t* wmode = malloc(wmodeLength * sizeof(wchar_t));
|
|
2725
|
+
if(wmode)
|
|
2726
|
+
{
|
|
2727
|
+
if(MultiByteToWideChar(CP_UTF8, 0, mode, -1, wmode, wmodeLength))
|
|
2728
|
+
{
|
|
2729
|
+
_wfopen_s(&f, wfilename, wmode);
|
|
2730
|
+
}
|
|
2731
|
+
free(wmode);
|
|
2732
|
+
}
|
|
2733
|
+
}
|
|
2734
|
+
free(wfilename);
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
return f;
|
|
2738
|
+
#else
|
|
2739
|
+
return fopen(filename, mode);
|
|
2740
|
+
#endif
|
|
2741
|
+
}
|