zeroc-ice 3.8.1 → 3.8.3
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 +26 -9
- data/dist/IceRuby/Config.h +0 -12
- data/dist/IceRuby/Connection.cpp +18 -9
- data/dist/IceRuby/DefaultSliceLoader.h +1 -1
- data/dist/IceRuby/Endpoint.cpp +21 -8
- data/dist/IceRuby/Operation.cpp +29 -11
- data/dist/IceRuby/Properties.cpp +3 -4
- data/dist/IceRuby/Proxy.cpp +11 -19
- data/dist/IceRuby/RubySliceLoader.cpp +1 -1
- data/dist/IceRuby/RubySliceLoader.h +6 -0
- data/dist/IceRuby/Types.cpp +162 -138
- data/dist/IceRuby/Types.h +68 -28
- data/dist/IceRuby/Util.cpp +14 -78
- data/dist/IceRuby/Util.h +7 -17
- data/dist/ice/cpp/include/Ice/Communicator.h +31 -8
- data/dist/ice/cpp/include/Ice/Config.h +2 -2
- data/dist/ice/cpp/include/Ice/Connection.h +24 -8
- data/dist/ice/cpp/include/Ice/CtrlCHandler.h +1 -1
- data/dist/ice/cpp/include/Ice/Demangle.h +1 -1
- data/dist/ice/cpp/include/Ice/Endpoint.h +4 -4
- data/dist/ice/cpp/include/Ice/Initialize.h +4 -4
- data/dist/ice/cpp/include/Ice/InputStream.h +5 -5
- data/dist/ice/cpp/include/Ice/Instrumentation.h +13 -7
- data/dist/ice/cpp/include/Ice/LocalExceptions.h +26 -5
- data/dist/ice/cpp/include/Ice/Logger.h +7 -0
- data/dist/ice/cpp/include/Ice/LoggerUtil.h +1 -1
- data/dist/ice/cpp/include/Ice/Object.h +10 -8
- data/dist/ice/cpp/include/Ice/ObjectAdapter.h +1 -1
- data/dist/ice/cpp/include/Ice/OutgoingAsync.h +5 -2
- data/dist/ice/cpp/include/Ice/OutgoingResponse.h +2 -1
- data/dist/ice/cpp/include/Ice/OutputStream.h +14 -11
- data/dist/ice/cpp/include/Ice/PluginFactory.h +1 -1
- data/dist/ice/cpp/include/Ice/Properties.h +3 -3
- data/dist/ice/cpp/include/Ice/Proxy.h +192 -50
- data/dist/ice/cpp/include/Ice/SSL/ClientAuthenticationOptions.h +3 -3
- data/dist/ice/cpp/include/Ice/SSL/EndpointInfo.h +1 -1
- data/dist/ice/cpp/include/Ice/SSL/ServerAuthenticationOptions.h +5 -5
- data/dist/ice/cpp/include/Ice/ServantLocator.h +1 -1
- data/dist/ice/cpp/include/Ice/Service.h +2 -5
- data/dist/ice/cpp/include/Ice/SliceLoader.h +1 -1
- data/dist/ice/cpp/include/Ice/SlicedData.h +5 -3
- data/dist/ice/cpp/include/Ice/StreamHelpers.h +1 -1
- data/dist/ice/cpp/include/Ice/StreamableTraits.h +2 -2
- data/dist/ice/cpp/include/Ice/StringConverter.h +2 -3
- data/dist/ice/cpp/include/Ice/StringUtil.h +2 -7
- data/dist/ice/cpp/include/Ice/UUID.h +1 -0
- data/dist/ice/cpp/include/Ice/Value.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/BuiltinSequences.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Context.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/EndpointTypes.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Identity.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Locator.h +57 -23
- data/dist/ice/cpp/include/generated/Ice/LocatorRegistry.h +38 -11
- data/dist/ice/cpp/include/generated/Ice/Metrics.h +99 -44
- data/dist/ice/cpp/include/generated/Ice/OperationMode.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Process.h +34 -8
- data/dist/ice/cpp/include/generated/Ice/PropertiesAdmin.h +42 -11
- data/dist/ice/cpp/include/generated/Ice/PropertyDict.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/RemoteLogger.h +93 -40
- data/dist/ice/cpp/include/generated/Ice/ReplyStatus.h +8 -4
- data/dist/ice/cpp/include/generated/Ice/Router.h +55 -19
- data/dist/ice/cpp/include/generated/Ice/SliceChecksumDict.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Version.h +2 -2
- data/dist/ice/cpp/include/generated/IceDiscovery/Lookup.h +66 -14
- data/dist/ice/cpp/include/generated/IceLocatorDiscovery/Lookup.h +34 -8
- data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_all.cpp +1 -1
- data/dist/ice/cpp/src/Ice/Base64.cpp +47 -137
- data/dist/ice/cpp/src/Ice/Base64.h +2 -2
- data/dist/ice/cpp/src/Ice/BatchRequestQueue.cpp +28 -13
- data/dist/ice/cpp/src/Ice/BatchRequestQueue.h +5 -1
- data/dist/ice/cpp/src/Ice/Buffer.cpp +1 -1
- data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +6 -4
- data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.h +1 -1
- data/dist/ice/cpp/src/Ice/Communicator.cpp +4 -3
- data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp +8 -0
- data/dist/ice/cpp/src/Ice/ConnectRequestHandler.cpp +5 -15
- data/dist/ice/cpp/src/Ice/ConnectRequestHandler.h +1 -1
- data/dist/ice/cpp/src/Ice/ConnectionFactory.cpp +6 -8
- data/dist/ice/cpp/src/Ice/ConnectionFactory.h +0 -3
- data/dist/ice/cpp/src/Ice/ConnectionI.cpp +121 -108
- data/dist/ice/cpp/src/Ice/ConnectionI.h +12 -9
- data/dist/ice/cpp/src/Ice/ConsoleUtil.cpp +1 -1
- data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +10 -14
- data/dist/ice/cpp/src/Ice/EndpointI.h +1 -1
- data/dist/ice/cpp/src/Ice/FileUtil.cpp +15 -79
- data/dist/ice/cpp/src/Ice/FileUtil.h +0 -3
- data/dist/ice/cpp/src/Ice/FixedRequestHandler.cpp +1 -1
- data/dist/ice/cpp/src/Ice/FixedRequestHandler.h +1 -1
- data/dist/ice/cpp/src/Ice/HttpParser.h +0 -2
- data/dist/ice/cpp/src/Ice/IPEndpointI.cpp +4 -0
- data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp +6 -3
- data/dist/ice/cpp/src/Ice/IncomingRequest.cpp +2 -4
- data/dist/ice/cpp/src/Ice/InputStream.cpp +50 -33
- data/dist/ice/cpp/src/Ice/Instance.cpp +73 -50
- data/dist/ice/cpp/src/Ice/Instance.h +1 -6
- data/dist/ice/cpp/src/Ice/LocalExceptions.cpp +7 -1
- data/dist/ice/cpp/src/Ice/LocatorInfo.cpp +2 -2
- data/dist/ice/cpp/src/Ice/LoggerAdminI.cpp +13 -18
- data/dist/ice/cpp/src/Ice/LoggerI.cpp +1 -1
- data/dist/ice/cpp/src/Ice/LoggerI.h +2 -2
- data/dist/ice/cpp/src/Ice/MetricsAdminI.h +6 -1
- data/dist/ice/cpp/src/Ice/MetricsObserverI.h +22 -18
- data/dist/ice/cpp/src/Ice/NativePropertiesAdmin.cpp +5 -2
- data/dist/ice/cpp/src/Ice/Network.cpp +168 -103
- data/dist/ice/cpp/src/Ice/Network.h +12 -7
- data/dist/ice/cpp/src/Ice/NetworkProxy.cpp +17 -6
- data/dist/ice/cpp/src/Ice/NetworkProxy.h +2 -1
- data/dist/ice/cpp/src/Ice/Object.cpp +1 -1
- data/dist/ice/cpp/src/Ice/ObjectAdapterI.cpp +56 -19
- data/dist/ice/cpp/src/Ice/OpaqueEndpointI.cpp +10 -10
- data/dist/ice/cpp/src/Ice/Options.cpp +7 -2
- data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +2 -2
- data/dist/ice/cpp/src/Ice/OutgoingResponse.cpp +127 -127
- data/dist/ice/cpp/src/Ice/OutgoingResponseInternal.h +21 -0
- data/dist/ice/cpp/src/Ice/OutputStream.cpp +50 -65
- data/dist/ice/cpp/src/Ice/PluginManagerI.cpp +7 -1
- data/dist/ice/cpp/src/Ice/Properties.cpp +26 -16
- data/dist/ice/cpp/src/Ice/PropertyNames.cpp +2 -1
- data/dist/ice/cpp/src/Ice/PropertyUtil.cpp +1 -1
- data/dist/ice/cpp/src/Ice/ProtocolInstance.cpp +0 -11
- data/dist/ice/cpp/src/Ice/ProtocolInstance.h +1 -2
- data/dist/ice/cpp/src/Ice/Proxy.cpp +9 -1
- data/dist/ice/cpp/src/Ice/ProxyAsync.cpp +110 -13
- data/dist/ice/cpp/src/Ice/ProxyFunctions.cpp +4 -4
- data/dist/ice/cpp/src/Ice/Random.cpp +68 -7
- data/dist/ice/cpp/src/Ice/Random.h +6 -2
- data/dist/ice/cpp/src/Ice/Reference.cpp +37 -26
- data/dist/ice/cpp/src/Ice/Reference.h +3 -0
- data/dist/ice/cpp/src/Ice/ReferenceFactory.cpp +26 -13
- data/dist/ice/cpp/src/Ice/RequestHandler.h +3 -1
- data/dist/ice/cpp/src/Ice/RequestHandlerCache.cpp +1 -1
- data/dist/ice/cpp/src/Ice/RequestHandlerCache.h +1 -1
- data/dist/ice/cpp/src/Ice/ResourceConfig.h +3 -3
- data/dist/ice/cpp/src/Ice/RetryQueue.cpp +8 -12
- data/dist/ice/cpp/src/Ice/SHA1.cpp +11 -11
- data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.cpp +0 -6
- data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.h +0 -6
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.cpp +27 -12
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.h +1 -2
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +77 -27
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.h +2 -1
- data/dist/ice/cpp/src/Ice/SSL/RFC2253.cpp +2 -2
- data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.cpp +1 -1
- data/dist/ice/cpp/src/Ice/SSL/SSLEngine.h +1 -4
- data/dist/ice/cpp/src/Ice/SSL/SSLUtil.cpp +39 -34
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.cpp +165 -80
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.h +1 -5
- data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +73 -33
- data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.h +0 -1
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.cpp +110 -17
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.h +7 -2
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +9 -3
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.cpp +73 -51
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.h +0 -8
- data/dist/ice/cpp/src/Ice/Selector.cpp +13 -11
- data/dist/ice/cpp/src/Ice/ServantManager.cpp +3 -3
- data/dist/ice/cpp/src/Ice/Service.cpp +33 -115
- data/dist/ice/cpp/src/Ice/StreamSocket.cpp +33 -40
- data/dist/ice/cpp/src/Ice/StreamSocket.h +4 -4
- data/dist/ice/cpp/src/Ice/StringConverter.cpp +1 -1
- data/dist/ice/cpp/src/Ice/StringUtil.cpp +12 -21
- data/dist/ice/cpp/src/Ice/SysLoggerI.cpp +136 -100
- data/dist/ice/cpp/src/Ice/SysLoggerI.h +7 -3
- data/dist/ice/cpp/src/Ice/SystemdJournalI.cpp +1 -1
- data/dist/ice/cpp/src/Ice/TcpAcceptor.cpp +7 -7
- data/dist/ice/cpp/src/Ice/TcpAcceptor.h +2 -1
- data/dist/ice/cpp/src/Ice/TcpBufSize.h +40 -0
- data/dist/ice/cpp/src/Ice/TcpConnector.cpp +5 -2
- data/dist/ice/cpp/src/Ice/TcpConnector.h +2 -0
- data/dist/ice/cpp/src/Ice/TcpEndpointI.cpp +2 -2
- data/dist/ice/cpp/src/Ice/TcpTransceiver.cpp +6 -2
- data/dist/ice/cpp/src/Ice/ThreadPool.cpp +2 -8
- data/dist/ice/cpp/src/Ice/ThreadPool.h +0 -2
- data/dist/ice/cpp/src/Ice/Timer.cpp +7 -3
- data/dist/ice/cpp/src/Ice/UUID.cpp +1 -2
- data/dist/ice/cpp/src/Ice/UdpEndpointI.cpp +6 -3
- data/dist/ice/cpp/src/Ice/UdpTransceiver.cpp +136 -123
- data/dist/ice/cpp/src/Ice/UdpTransceiver.h +3 -4
- data/dist/ice/cpp/src/Ice/WSAcceptor.cpp +8 -3
- data/dist/ice/cpp/src/Ice/WSAcceptor.h +5 -1
- data/dist/ice/cpp/src/Ice/WSEndpoint.cpp +45 -2
- data/dist/ice/cpp/src/Ice/WSTransceiver.cpp +214 -34
- data/dist/ice/cpp/src/Ice/WSTransceiver.h +13 -2
- data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Context.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Identity.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Locator.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/LocatorRegistry.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/OperationMode.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Process.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/PropertyDict.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/ReplyStatus.cpp +4 -2
- data/dist/ice/cpp/src/Ice/generated/Router.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Version.cpp +2 -2
- data/dist/ice/cpp/src/IceDiscovery/LookupI.cpp +47 -9
- data/dist/ice/cpp/src/IceDiscovery/LookupI.h +8 -3
- data/dist/ice/cpp/src/IceDiscovery/generated/Lookup.cpp +2 -2
- data/dist/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +43 -14
- data/dist/ice/cpp/src/IceLocatorDiscovery/generated/Lookup.cpp +2 -2
- data/dist/ice/cpp/src/Slice/DocCommentParser.cpp +32 -26
- data/dist/ice/cpp/src/Slice/DocCommentParser.h +6 -4
- data/dist/ice/cpp/src/Slice/FileTracker.cpp +3 -11
- data/dist/ice/cpp/src/Slice/FileTracker.h +0 -2
- data/dist/ice/cpp/src/Slice/Grammar.cpp +211 -210
- data/dist/ice/cpp/src/Slice/MetadataValidation.cpp +34 -14
- data/dist/ice/cpp/src/Slice/MetadataValidation.h +3 -2
- data/dist/ice/cpp/src/Slice/Parser.cpp +145 -97
- data/dist/ice/cpp/src/Slice/Parser.h +22 -8
- data/dist/ice/cpp/src/Slice/Preprocessor.cpp +77 -29
- data/dist/ice/cpp/src/Slice/Preprocessor.h +0 -3
- data/dist/ice/cpp/src/Slice/Scanner.cpp +3 -3
- data/dist/ice/cpp/src/Slice/SliceUtil.cpp +203 -172
- data/dist/ice/cpp/src/Slice/StringLiteralUtil.cpp +0 -2
- data/dist/ice/cpp/src/Slice/Util.h +21 -12
- data/dist/ice/cpp/src/slice2rb/Ruby.cpp +7 -3
- data/dist/ice/cpp/src/slice2rb/RubyUtil.cpp +26 -20
- data/dist/ice/cpp/src/slice2rb/RubyUtil.h +10 -13
- data/dist/ice/slice/Glacier2/Router.ice +3 -3
- data/dist/ice/slice/Ice/Identity.ice +3 -0
- data/dist/ice/slice/Ice/Locator.ice +6 -5
- data/dist/ice/slice/Ice/LocatorRegistry.ice +3 -0
- data/dist/ice/slice/Ice/Metrics.ice +7 -6
- data/dist/ice/slice/Ice/OperationMode.ice +8 -0
- data/dist/ice/slice/Ice/Process.ice +3 -0
- data/dist/ice/slice/Ice/RemoteLogger.ice +5 -5
- data/dist/ice/slice/Ice/ReplyStatus.ice +13 -0
- data/dist/ice/slice/IceGrid/Admin.ice +9 -9
- data/dist/ice/slice/IceGrid/Descriptor.ice +5 -5
- data/dist/ice/slice/IceStorm/Metrics.ice +1 -1
- data/dist/lib/Glacier2/Metrics.rb +1 -1
- data/dist/lib/Glacier2/PermissionsVerifier.rb +3 -3
- data/dist/lib/Glacier2/Router.rb +9 -9
- data/dist/lib/Glacier2/SSLInfo.rb +1 -1
- data/dist/lib/Glacier2/Session.rb +15 -15
- data/dist/lib/Ice/BuiltinSequences.rb +1 -1
- data/dist/lib/Ice/CompressBatch.rb +1 -2
- data/dist/lib/Ice/Context.rb +1 -1
- data/dist/lib/Ice/EndpointSelectionType.rb +1 -2
- data/dist/lib/Ice/EndpointTypes.rb +1 -1
- data/dist/lib/Ice/Identity.rb +1 -1
- data/dist/lib/Ice/IdentitySpaceship.rb +1 -0
- data/dist/lib/Ice/LocalExceptions.rb +3 -0
- data/dist/lib/Ice/Locator.rb +5 -5
- data/dist/lib/Ice/LocatorRegistry.rb +4 -4
- data/dist/lib/Ice/Metrics.rb +7 -7
- data/dist/lib/Ice/OperationMode.rb +2 -3
- data/dist/lib/Ice/Process.rb +3 -3
- data/dist/lib/Ice/PropertiesAdmin.rb +4 -4
- data/dist/lib/Ice/PropertyDict.rb +1 -1
- data/dist/lib/Ice/ProxyFunctions.rb +8 -4
- data/dist/lib/Ice/RemoteLogger.rb +7 -8
- data/dist/lib/Ice/ReplyStatus.rb +4 -4
- data/dist/lib/Ice/Router.rb +5 -5
- data/dist/lib/Ice/SliceChecksumDict.rb +1 -1
- data/dist/lib/Ice/SliceUtil.rb +2 -2
- data/dist/lib/Ice/Struct.rb +1 -0
- data/dist/lib/Ice/ToStringMode.rb +1 -2
- data/dist/lib/Ice/Value.rb +2 -2
- data/dist/lib/Ice/Version.rb +1 -1
- data/dist/lib/IceBox/ServiceManager.rb +8 -8
- data/dist/lib/IceGrid/Admin.rb +85 -86
- data/dist/lib/IceGrid/Descriptor.rb +1 -1
- data/dist/lib/IceGrid/Exception.rb +1 -1
- data/dist/lib/IceGrid/FileParser.rb +2 -2
- data/dist/lib/IceGrid/Registry.rb +14 -15
- data/dist/lib/IceGrid/Session.rb +7 -7
- data/dist/lib/IceGrid/UserAccountMapper.rb +2 -2
- data/dist/lib/IceStorm/IceStorm.rb +16 -16
- data/dist/lib/IceStorm/Metrics.rb +1 -1
- data/extconf.rb +1 -1
- data/ice.gemspec +3 -3
- metadata +5 -5
- data/dist/ice/cpp/src/Ice/DLLMain.cpp +0 -40
- data/dist/ice/cpp/src/Ice/UndefSysMacros.h +0 -37
|
@@ -87,7 +87,6 @@ namespace Slice
|
|
|
87
87
|
|
|
88
88
|
using StringList = std::list<std::string>;
|
|
89
89
|
using MetadataList = std::list<MetadataPtr>;
|
|
90
|
-
using TypeList = std::list<TypePtr>;
|
|
91
90
|
using ContainedList = std::list<ContainedPtr>;
|
|
92
91
|
using ModuleList = std::list<ModulePtr>;
|
|
93
92
|
using ClassList = std::list<ClassDefPtr>;
|
|
@@ -401,7 +400,7 @@ namespace Slice
|
|
|
401
400
|
/// @remark Equivalent to `mappedScope(separator, leading) + mappedName()`.
|
|
402
401
|
[[nodiscard]] std::string mappedScoped(const std::string& separator, bool leading = false) const;
|
|
403
402
|
|
|
404
|
-
/// Returns the mapped scope
|
|
403
|
+
/// Returns the mapped scope in which this element will be generated in the target language.
|
|
405
404
|
/// @param separator This string will be used to separate scope segments.
|
|
406
405
|
/// @param leading If true, the returned string will have a leading `separator` (defaults to false).
|
|
407
406
|
[[nodiscard]] std::string mappedScope(const std::string& separator, bool leading = false) const;
|
|
@@ -510,7 +509,7 @@ namespace Slice
|
|
|
510
509
|
/// The user should disambiguate by qualifying the type-reference as 'Outer::H'.
|
|
511
510
|
void checkHasChangedMeaning(const std::string& name, ContainedPtr namedThing = nullptr);
|
|
512
511
|
|
|
513
|
-
/// Returns `
|
|
512
|
+
/// Returns `false` if this container is the global scope (i.e. it's of type `Unit`), and `true` otherwise.
|
|
514
513
|
/// If false, we emit an error message. So this function should only be called for types which cannot appear at
|
|
515
514
|
/// global scope... so everything except for `Module`s.
|
|
516
515
|
bool checkForGlobalDefinition(const char* definitionKindPlural);
|
|
@@ -692,8 +691,15 @@ namespace Slice
|
|
|
692
691
|
Idempotent = 2
|
|
693
692
|
};
|
|
694
693
|
|
|
695
|
-
Operation(
|
|
696
|
-
|
|
694
|
+
Operation(
|
|
695
|
+
const ContainerPtr& container,
|
|
696
|
+
const std::string& name,
|
|
697
|
+
TypePtr returnType,
|
|
698
|
+
bool returnIsOptional,
|
|
699
|
+
std::int32_t returnTag,
|
|
700
|
+
Mode mode);
|
|
701
|
+
|
|
702
|
+
[[nodiscard]] InterfaceDefPtr parentInterface() const;
|
|
697
703
|
[[nodiscard]] TypePtr returnType() const;
|
|
698
704
|
[[nodiscard]] bool returnIsOptional() const;
|
|
699
705
|
[[nodiscard]] std::int32_t returnTag() const;
|
|
@@ -726,7 +732,7 @@ namespace Slice
|
|
|
726
732
|
[[nodiscard]] ParameterPtr returnParameter(const std::string& name);
|
|
727
733
|
|
|
728
734
|
/// Returns this operation's out parameters and return type sorted in this order: '(required..., optional...)'.
|
|
729
|
-
/// If
|
|
735
|
+
/// If this operation's return type is non-void and non-optional, it is at the end of the 'required' list.
|
|
730
736
|
/// Otherwise, required parameters are kept in definition order and optional parameters are sorted by tag.
|
|
731
737
|
///
|
|
732
738
|
/// For convenience, non-void return types are represented by a dummy `Parameter` in this list.
|
|
@@ -740,12 +746,19 @@ namespace Slice
|
|
|
740
746
|
|
|
741
747
|
[[nodiscard]] ExceptionList throws() const;
|
|
742
748
|
void setExceptionList(const ExceptionList& exceptions);
|
|
749
|
+
|
|
750
|
+
/// Returns true if this operation uses class types in any of its in parameters.
|
|
743
751
|
[[nodiscard]] bool sendsClasses() const;
|
|
752
|
+
|
|
753
|
+
/// Returns true if this operation uses class types in its return type, or any of its out parameters.
|
|
744
754
|
[[nodiscard]] bool returnsClasses() const;
|
|
755
|
+
|
|
756
|
+
/// Returns true if this operation has any out parameters, a non-void return type, or can throw any exceptions.
|
|
745
757
|
[[nodiscard]] bool returnsData() const;
|
|
746
758
|
|
|
747
759
|
/// Returns true if this operation has any out parameters or a non-void return type.
|
|
748
760
|
[[nodiscard]] bool returnsAnyValues() const;
|
|
761
|
+
|
|
749
762
|
/// Returns true if this operation's output parameters, plus any non-void return type, is greater than 1.
|
|
750
763
|
[[nodiscard]] bool returnsMultipleValues() const;
|
|
751
764
|
|
|
@@ -792,6 +805,7 @@ namespace Slice
|
|
|
792
805
|
[[nodiscard]] InterfaceList allBases() const;
|
|
793
806
|
[[nodiscard]] OperationList operations() const;
|
|
794
807
|
[[nodiscard]] OperationList allOperations() const;
|
|
808
|
+
[[nodiscard]] OperationList allInheritedOperations() const;
|
|
795
809
|
[[nodiscard]] std::string kindOf() const final;
|
|
796
810
|
void visit(ParserVisitor* visitor) final;
|
|
797
811
|
|
|
@@ -1019,7 +1033,7 @@ namespace Slice
|
|
|
1019
1033
|
[[nodiscard]] TypePtr type() const;
|
|
1020
1034
|
[[nodiscard]] bool isOutParam() const;
|
|
1021
1035
|
void setIsOutParam();
|
|
1022
|
-
[[nodiscard]] bool
|
|
1036
|
+
[[nodiscard]] bool isOptional() const;
|
|
1023
1037
|
[[nodiscard]] std::int32_t tag() const;
|
|
1024
1038
|
[[nodiscard]] std::string kindOf() const final;
|
|
1025
1039
|
|
|
@@ -1048,7 +1062,7 @@ namespace Slice
|
|
|
1048
1062
|
SyntaxTreeBasePtr defaultValueType,
|
|
1049
1063
|
std::optional<std::string> defaultValueString);
|
|
1050
1064
|
[[nodiscard]] TypePtr type() const;
|
|
1051
|
-
[[nodiscard]] bool
|
|
1065
|
+
[[nodiscard]] bool isOptional() const;
|
|
1052
1066
|
[[nodiscard]] std::int32_t tag() const;
|
|
1053
1067
|
|
|
1054
1068
|
// defaultValue() and defaultValueType() are either both null (no default value) or both non-null.
|
|
@@ -9,21 +9,80 @@
|
|
|
9
9
|
#include "Util.h"
|
|
10
10
|
#include <algorithm>
|
|
11
11
|
#include <cassert>
|
|
12
|
+
#include <cerrno>
|
|
12
13
|
#include <cstring>
|
|
14
|
+
#include <fcntl.h>
|
|
13
15
|
#include <fstream>
|
|
14
16
|
#include <iterator>
|
|
15
17
|
#include <sys/stat.h>
|
|
16
18
|
#include <sys/types.h>
|
|
17
19
|
#include <vector>
|
|
18
20
|
|
|
19
|
-
#
|
|
21
|
+
#ifdef _WIN32
|
|
22
|
+
# include <io.h>
|
|
23
|
+
# include <share.h>
|
|
24
|
+
#else
|
|
20
25
|
# include <sys/wait.h>
|
|
26
|
+
# include <unistd.h>
|
|
21
27
|
#endif
|
|
22
28
|
|
|
23
29
|
using namespace std;
|
|
24
30
|
using namespace Slice;
|
|
25
31
|
using namespace IceInternal;
|
|
26
32
|
|
|
33
|
+
namespace
|
|
34
|
+
{
|
|
35
|
+
// Atomically create and open a new file for read/write, failing if the file already exists or, on POSIX, if the
|
|
36
|
+
// path resolves to a symlink. This avoids the TOCTOU race that a name-then-open sequence would otherwise expose
|
|
37
|
+
// to a local attacker who could plant a symlink at the generated path.
|
|
38
|
+
#ifdef _WIN32
|
|
39
|
+
FILE* openExclusive(const wchar_t* path)
|
|
40
|
+
{
|
|
41
|
+
int fd = -1;
|
|
42
|
+
// _O_TEMPORARY tells the CRT to delete the file when the last file descriptor is closed -- this avoids the
|
|
43
|
+
// need for a separate, racy unlink-by-name in close().
|
|
44
|
+
if (::_wsopen_s(
|
|
45
|
+
&fd,
|
|
46
|
+
path,
|
|
47
|
+
_O_RDWR | _O_CREAT | _O_EXCL | _O_BINARY | _O_TEMPORARY,
|
|
48
|
+
_SH_DENYRW,
|
|
49
|
+
_S_IREAD | _S_IWRITE) != 0)
|
|
50
|
+
{
|
|
51
|
+
return nullptr;
|
|
52
|
+
}
|
|
53
|
+
FILE* fp = ::_fdopen(fd, "w+");
|
|
54
|
+
if (!fp)
|
|
55
|
+
{
|
|
56
|
+
::_close(fd);
|
|
57
|
+
}
|
|
58
|
+
return fp;
|
|
59
|
+
}
|
|
60
|
+
#else
|
|
61
|
+
FILE* openExclusive(const char* path)
|
|
62
|
+
{
|
|
63
|
+
int fd = ::open(path, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW, S_IRUSR | S_IWUSR);
|
|
64
|
+
if (fd == -1)
|
|
65
|
+
{
|
|
66
|
+
return nullptr;
|
|
67
|
+
}
|
|
68
|
+
// Unlink immediately so the file is anonymous: the inode survives via our descriptor and the kernel
|
|
69
|
+
// releases it on close. ENOENT means another process already removed the entry, leaving us in the same
|
|
70
|
+
// state; any other unlink error is fatal because the caller has no path to retry cleanup.
|
|
71
|
+
if (::unlink(path) != 0 && errno != ENOENT)
|
|
72
|
+
{
|
|
73
|
+
::close(fd);
|
|
74
|
+
return nullptr;
|
|
75
|
+
}
|
|
76
|
+
FILE* fp = ::fdopen(fd, "w+");
|
|
77
|
+
if (!fp)
|
|
78
|
+
{
|
|
79
|
+
::close(fd);
|
|
80
|
+
}
|
|
81
|
+
return fp;
|
|
82
|
+
}
|
|
83
|
+
#endif
|
|
84
|
+
}
|
|
85
|
+
|
|
27
86
|
//
|
|
28
87
|
// mcpp defines
|
|
29
88
|
//
|
|
@@ -51,24 +110,16 @@ Slice::Preprocessor::create(const string& path, const string& fileName, const ve
|
|
|
51
110
|
Slice::Preprocessor::Preprocessor(string path, const string& fileName, const vector<string>& args)
|
|
52
111
|
: _path(std::move(path)),
|
|
53
112
|
_fileName(fullPath(fileName)),
|
|
54
|
-
_shortFileName(fileName),
|
|
55
113
|
_args(args)
|
|
56
114
|
{
|
|
57
115
|
}
|
|
58
116
|
|
|
59
117
|
Slice::Preprocessor::~Preprocessor() { close(); }
|
|
60
118
|
|
|
61
|
-
string
|
|
62
|
-
Slice::Preprocessor::getFileName()
|
|
63
|
-
{
|
|
64
|
-
return _fileName;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
119
|
string
|
|
68
120
|
Slice::Preprocessor::getBaseName()
|
|
69
121
|
{
|
|
70
122
|
string base(_fileName);
|
|
71
|
-
string suffix;
|
|
72
123
|
string::size_type pos = base.rfind('.');
|
|
73
124
|
if (pos != string::npos)
|
|
74
125
|
{
|
|
@@ -197,36 +248,36 @@ Slice::Preprocessor::preprocess(const string& languageArg)
|
|
|
197
248
|
char* buf = mcpp_get_mem_buffer(Out);
|
|
198
249
|
|
|
199
250
|
//
|
|
200
|
-
// First try to open
|
|
251
|
+
// First try to open a temporary file in the 'tmp' directory.
|
|
201
252
|
//
|
|
202
253
|
#ifdef _WIN32
|
|
203
254
|
//
|
|
204
|
-
// We use
|
|
205
|
-
//
|
|
206
|
-
//
|
|
207
|
-
//
|
|
208
|
-
//
|
|
255
|
+
// We use a unique id as the tmp file name prefix to avoid problems with this code being called concurrently
|
|
256
|
+
// from several processes, otherwise there is a chance that two processes call _wtempnam before any of them
|
|
257
|
+
// opens the file and they will end up using the same tmp file. We then open the file with O_EXCL to atomically
|
|
258
|
+
// create it -- this closes the TOCTOU window between _wtempnam returning a name and our opening it. The
|
|
259
|
+
// _O_TEMPORARY flag inside openExclusive causes the file to be deleted automatically when the descriptor is
|
|
260
|
+
// closed, so we don't need to retain the path past this point.
|
|
209
261
|
//
|
|
210
262
|
wchar_t* name = _wtempnam(0, Ice::stringToWstring("slice-" + Ice::generateUUID()).c_str());
|
|
211
263
|
if (name)
|
|
212
264
|
{
|
|
213
|
-
|
|
265
|
+
_cppHandle = openExclusive(name);
|
|
214
266
|
free(name);
|
|
215
|
-
_cppHandle = IceInternal::fopen(_cppFile, "w+");
|
|
216
267
|
}
|
|
217
268
|
#else
|
|
218
269
|
_cppHandle = tmpfile();
|
|
219
270
|
#endif
|
|
220
271
|
|
|
221
|
-
// If that fails try to open file in current directory.
|
|
272
|
+
// If that fails try to open file in current directory. openExclusive immediately unlinks the file on POSIX
|
|
273
|
+
// and sets _O_TEMPORARY on Windows, so the path is only used during the open attempt.
|
|
222
274
|
if (_cppHandle == nullptr)
|
|
223
275
|
{
|
|
224
276
|
#ifdef _WIN32
|
|
225
|
-
|
|
277
|
+
_cppHandle = openExclusive(Ice::stringToWstring("slice-" + Ice::generateUUID()).c_str());
|
|
226
278
|
#else
|
|
227
|
-
|
|
279
|
+
_cppHandle = openExclusive((".slice-" + Ice::generateUUID()).c_str());
|
|
228
280
|
#endif
|
|
229
|
-
_cppHandle = IceInternal::fopen(_cppFile, "w+");
|
|
230
281
|
}
|
|
231
282
|
|
|
232
283
|
if (_cppHandle != nullptr)
|
|
@@ -241,7 +292,7 @@ Slice::Preprocessor::preprocess(const string& languageArg)
|
|
|
241
292
|
{
|
|
242
293
|
// Calling this again causes the memory buffers to be freed.
|
|
243
294
|
mcpp_use_mem_buffers(1);
|
|
244
|
-
throw runtime_error(_path + ": error: could not open temporary file
|
|
295
|
+
throw runtime_error(_path + ": error: could not open temporary file for preprocessor output");
|
|
245
296
|
}
|
|
246
297
|
}
|
|
247
298
|
|
|
@@ -256,14 +307,11 @@ Slice::Preprocessor::close()
|
|
|
256
307
|
{
|
|
257
308
|
if (_cppHandle != nullptr)
|
|
258
309
|
{
|
|
310
|
+
// The temp file deletes itself when the descriptor is closed. On POSIX, tmpfile() returns an
|
|
311
|
+
// already-unlinked file and the CWD fallback unlinks after open; on Windows, openExclusive opens
|
|
312
|
+
// with _O_TEMPORARY. fclose is the only cleanup needed.
|
|
259
313
|
int status = fclose(_cppHandle);
|
|
260
314
|
_cppHandle = nullptr;
|
|
261
|
-
|
|
262
|
-
if (_cppFile.size() != 0)
|
|
263
|
-
{
|
|
264
|
-
IceInternal::unlink(_cppFile);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
315
|
if (status != 0)
|
|
268
316
|
{
|
|
269
317
|
throw runtime_error("failed to close preprocessor file: " + IceInternal::lastErrorToString());
|
|
@@ -283,7 +331,7 @@ Slice::Preprocessor::checkInputFile()
|
|
|
283
331
|
}
|
|
284
332
|
if (suffix != ".ice")
|
|
285
333
|
{
|
|
286
|
-
throw runtime_error(_path + ": error: input files must end with
|
|
334
|
+
throw runtime_error(_path + ": error: input files must end with '.ice'");
|
|
287
335
|
}
|
|
288
336
|
|
|
289
337
|
ifstream test(IceInternal::streamFilename(_fileName).c_str());
|
|
@@ -24,7 +24,6 @@ namespace Slice
|
|
|
24
24
|
FILE* preprocess(const std::string& languageArg = "");
|
|
25
25
|
void close();
|
|
26
26
|
|
|
27
|
-
std::string getFileName();
|
|
28
27
|
std::string getBaseName();
|
|
29
28
|
|
|
30
29
|
static std::string normalizeIncludePath(const std::string& path);
|
|
@@ -34,9 +33,7 @@ namespace Slice
|
|
|
34
33
|
|
|
35
34
|
const std::string _path;
|
|
36
35
|
const std::string _fileName;
|
|
37
|
-
const std::string _shortFileName;
|
|
38
36
|
const std::vector<std::string> _args;
|
|
39
|
-
std::string _cppFile;
|
|
40
37
|
FILE* _cppHandle{nullptr};
|
|
41
38
|
};
|
|
42
39
|
}
|
|
@@ -1829,7 +1829,7 @@ YY_RULE_SETUP
|
|
|
1829
1829
|
}
|
|
1830
1830
|
YY_BREAK
|
|
1831
1831
|
/* Matches the end of a double-quoted string literal, but only while scanning a string literal. Flex always prefers
|
|
1832
|
-
* to match the longest string it can, so quotes
|
|
1832
|
+
* to match the longest string it can, so quotes preceded with a literal '\' will match the rules above this one. */
|
|
1833
1833
|
case 18:
|
|
1834
1834
|
YY_RULE_SETUP
|
|
1835
1835
|
#line 261 "src/Slice/Scanner.l"
|
|
@@ -2233,7 +2233,7 @@ YY_RULE_SETUP
|
|
|
2233
2233
|
return BAD_TOKEN;
|
|
2234
2234
|
}
|
|
2235
2235
|
YY_BREAK
|
|
2236
|
-
/* Matches any valid character (except newlines) not matched by another rule and
|
|
2236
|
+
/* Matches any valid character (except newlines) not matched by another rule and forwards it to the parser.
|
|
2237
2237
|
* This is the lowest priority rule in the scanner, and is only active while not in a sub-scanner. */
|
|
2238
2238
|
case 50:
|
|
2239
2239
|
YY_RULE_SETUP
|
|
@@ -3390,7 +3390,7 @@ namespace
|
|
|
3390
3390
|
keywordMap["Value"] = ICE_VALUE;
|
|
3391
3391
|
}
|
|
3392
3392
|
|
|
3393
|
-
// This function is always called directly after a match has been made, but directly before
|
|
3393
|
+
// This function is always called directly after a match has been made, but directly before its action block is run.
|
|
3394
3394
|
void preAction()
|
|
3395
3395
|
{
|
|
3396
3396
|
yycolno += yyleng;
|